Skip to content

[5.0] More Specific DocBlocks #8309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from Apr 7, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@ public function count($columns = '*')
* Retrieve the minimum value of a given column.
*
* @param string $column
* @return mixed
* @return float|int
*/
public function min($column)
{
Expand All @@ -1589,7 +1589,7 @@ public function min($column)
* Retrieve the maximum value of a given column.
*
* @param string $column
* @return mixed
* @return float|int
*/
public function max($column)
{
Expand All @@ -1600,7 +1600,7 @@ public function max($column)
* Retrieve the sum of the values of a given column.
*
* @param string $column
* @return mixed
* @return float|int
*/
public function sum($column)
{
Expand All @@ -1613,7 +1613,7 @@ public function sum($column)
* Retrieve the average of the values of a given column.
*
* @param string $column
* @return mixed
* @return float|int
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this just be float in all cases?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't think so? Not sure?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense for an average? I'd even say you can do "float" for all of them. Even though PHP may or may not turn some of the values into integers, I don't see a reason why we cannot simply treat them as floats.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point is that this method, MIGHT return int, though will return float in most cases.

*/
public function avg($column)
{
Expand All @@ -1625,7 +1625,7 @@ public function avg($column)
*
* @param string $function
* @param array $columns
* @return mixed
* @return float|int
*/
public function aggregate($function, $columns = array('*'))
{
Expand Down