Skip to content

Commit

Permalink
Fixed method chaining Type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-deluna committed Sep 30, 2020
1 parent a6c8475 commit 1a1f768
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion src/Query/Sql/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function inheritFromParent(BaseQuery $parent)
* $h->table('db_mydatabase.posts')
*
* @param string|\Closure $table
* @return self
* @return static
*/
public function table($table, $alias = null)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Query/Sql/Insert.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Insert extends Base
* ->ignore(true)
*
* @param bool $ignore
* @return self The current query builder.
* @return static The current query builder.
*/
public function ignore($ignore = true)
{
Expand All @@ -50,7 +50,7 @@ public function ignore($ignore = true)
* ])
*
* @param array $values The data you want to insert.
* @return self The current query builder.
* @return static The current query builder.
*/
public function values(array $values = array())
{
Expand Down Expand Up @@ -84,7 +84,7 @@ public function values(array $values = array())
/**
* Resets the current insert values of the query.
*
* @return self The current query builder.
* @return static The current query builder.
*/
public function resetValues()
{
Expand Down
36 changes: 18 additions & 18 deletions src/Query/Sql/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function copyTo(Select $query)
* Distinct select setter
*
* @param bool $distinct
* @return self The current query builder.
* @return static The current query builder.
*/
public function distinct($distinct = true)
{
Expand All @@ -116,7 +116,7 @@ public function distinct($distinct = true)
* ->fields('id, name, created_at as created')
*
* @param string|array|object $fields The fields that should be selected.
* @return self The current query builder.
* @return static The current query builder.
*/
public function fields($fields)
{
Expand Down Expand Up @@ -159,7 +159,7 @@ public function fields($fields)
*
* @param string|object $field
* @param string $alias
* @return self The current query builder.
* @return static The current query builder.
*/
public function addField($field, $alias = null)
{
Expand All @@ -173,7 +173,7 @@ public function addField($field, $alias = null)
*
* @param string $field
* @param string $alias
* @return self The current query builder.
* @return static The current query builder.
*/
public function addFieldCount($field, $alias = null)
{
Expand All @@ -187,7 +187,7 @@ public function addFieldCount($field, $alias = null)
*
* @param string $field
* @param string $alias
* @return self The current query builder.
* @return static The current query builder.
*/
public function addFieldMax($field, $alias = null)
{
Expand All @@ -201,7 +201,7 @@ public function addFieldMax($field, $alias = null)
*
* @param string $field
* @param string $alias
* @return self The current query builder.
* @return static The current query builder.
*/
public function addFieldMin($field, $alias = null)
{
Expand All @@ -215,7 +215,7 @@ public function addFieldMin($field, $alias = null)
*
* @param string $field
* @param string $alias
* @return self The current query builder.
* @return static The current query builder.
*/
public function addFieldSum($field, $alias = null)
{
Expand All @@ -229,7 +229,7 @@ public function addFieldSum($field, $alias = null)
*
* @param string $field
* @param string $alias
* @return self The current query builder.
* @return static The current query builder.
*/
public function addFieldAvg($field, $alias = null)
{
Expand All @@ -243,7 +243,7 @@ public function addFieldAvg($field, $alias = null)
*
* @param string $field
* @param string $alias
* @return self The current query builder.
* @return static The current query builder.
*/
public function addFieldRound($field, $decimals = 0, $alias = null)
{
Expand All @@ -264,7 +264,7 @@ public function addFieldRound($field, $decimals = 0, $alias = null)
*
* @param array|string|Expression $columns The column or colums to order by.
* @param string $direction The sort direction (asc, desc...).
* @return self The current query builder.
* @return static The current query builder.
*/
public function orderBy($columns, $direction = 'asc')
{
Expand Down Expand Up @@ -302,7 +302,7 @@ public function orderBy($columns, $direction = 'asc')
* ->gorupBy(['category', 'price'])
*
* @param array|string $groupKeys The keys on which the data should be grouped on.
* @return self The current query builder.
* @return static The current query builder.
*/
public function groupBy($groupKeys)
{
Expand Down Expand Up @@ -330,7 +330,7 @@ public function groupBy($groupKeys)
* @param string $referenceKey
* @param string $type The join type (inner, left, right, outer)
*
* @return self The current query builder.
* @return static The current query builder.
*/
public function join($table, $localKey, $operator = null, $referenceKey = null, $type = 'left')
{
Expand Down Expand Up @@ -365,7 +365,7 @@ public function join($table, $localKey, $operator = null, $referenceKey = null,
* @param string $operator The operator (=, !=, <, > etc.)
* @param string $referenceKey
*
* @return self The current query builder.
* @return static The current query builder.
*/
public function leftJoin($table, $localKey, $operator = null, $referenceKey = null)
{
Expand All @@ -380,7 +380,7 @@ public function leftJoin($table, $localKey, $operator = null, $referenceKey = nu
* @param string $operator The operator (=, !=, <, > etc.)
* @param string $referenceKey
*
* @return self The current query builder.
* @return static The current query builder.
*/
public function rightJoin($table, $localKey, $operator = null, $referenceKey = null)
{
Expand All @@ -395,7 +395,7 @@ public function rightJoin($table, $localKey, $operator = null, $referenceKey = n
* @param string $operator The operator (=, !=, <, > etc.)
* @param string $referenceKey
*
* @return self The current query builder.
* @return static The current query builder.
*/
public function innerJoin($table, $localKey, $operator = null, $referenceKey = null)
{
Expand All @@ -410,7 +410,7 @@ public function innerJoin($table, $localKey, $operator = null, $referenceKey = n
* @param string $operator The operator (=, !=, <, > etc.)
* @param string $referenceKey
*
* @return self The current query builder.
* @return static The current query builder.
*/
public function outerJoin($table, $localKey, $operator = null, $referenceKey = null)
{
Expand All @@ -421,7 +421,7 @@ public function outerJoin($table, $localKey, $operator = null, $referenceKey = n
* Forward a result value as array key
*
* @param string|bool $key
* @return self The current query builder.
* @return static The current query builder.
*/
public function forwardKey($key = true)
{
Expand Down Expand Up @@ -453,7 +453,7 @@ public function forwardKey($key = true)
* ),
*
* @param string|bool $key
* @return self The current query builder.
* @return static The current query builder.
*/
public function groupResults($key)
{
Expand Down
30 changes: 15 additions & 15 deletions src/Query/Sql/SelectBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected function stringArgumentToArray($argument)
/**
* Will reset the current selects where conditions
*
* @return self The current query builder.
* @return static The current query builder.
*/
public function resetWheres()
{
Expand All @@ -64,7 +64,7 @@ public function resetWheres()
/**
* Will reset the current selects limit
*
* @return self The current query builder.
* @return static The current query builder.
*/
public function resetLimit()
{
Expand All @@ -74,7 +74,7 @@ public function resetLimit()
/**
* Will reset the current selects offset
*
* @return self The current query builder.
* @return static The current query builder.
*/
public function resetOffset()
{
Expand All @@ -93,7 +93,7 @@ public function resetOffset()
* @param mixed $param2 The value if $param1 is an opartor.
* @param string $type the where type ( and, or )
*
* @return self The current query builder.
* @return static The current query builder.
*/
public function where($column, $param1 = null, $param2 = null, $type = 'and')
{
Expand Down Expand Up @@ -169,7 +169,7 @@ public function where($column, $param1 = null, $param2 = null, $type = 'and')
* @param mixed $param1
* @param mixed $param2
*
* @return self The current query builder.
* @return static The current query builder.
*/
public function orWhere($column, $param1 = null, $param2 = null)
{
Expand All @@ -185,7 +185,7 @@ public function orWhere($column, $param1 = null, $param2 = null)
* @param mixed $param1
* @param mixed $param2
*
* @return self The current query builder.
* @return static The current query builder.
*/
public function andWhere($column, $param1 = null, $param2 = null)
{
Expand All @@ -199,7 +199,7 @@ public function andWhere($column, $param1 = null, $param2 = null)
*
* @param string $column
* @param array $options
* @return self The current query builder.
* @return static The current query builder.
*/
public function whereIn($column, array $options = array())
{
Expand All @@ -219,7 +219,7 @@ public function whereIn($column, array $options = array())
*
* @param string $column
* @param array $options
* @return self The current query builder.
* @return static The current query builder.
*/
public function whereNotIn($column, array $options = array())
{
Expand All @@ -238,7 +238,7 @@ public function whereNotIn($column, array $options = array())
* ->whereNull('modified_at')
*
* @param string $column
* @return self The current query builder.
* @return static The current query builder.
*/
public function whereNull($column)
{
Expand All @@ -251,7 +251,7 @@ public function whereNull($column)
* ->whereNotNull('created_at')
*
* @param string $column
* @return self The current query builder.
* @return static The current query builder.
*/
public function whereNotNull($column)
{
Expand All @@ -264,7 +264,7 @@ public function whereNotNull($column)
* ->orWhereNull('modified_at')
*
* @param string $column
* @return self The current query builder.
* @return static The current query builder.
*/
public function orWhereNull($column)
{
Expand All @@ -277,7 +277,7 @@ public function orWhereNull($column)
* ->orWhereNotNull('modified_at')
*
* @param string $column
* @return self The current query builder.
* @return static The current query builder.
*/
public function orWhereNotNull($column)
{
Expand All @@ -295,7 +295,7 @@ public function orWhereNotNull($column)
*
* @param int $limit
* @param int $limit2
* @return self The current query builder.
* @return static The current query builder.
*/
public function limit($limit, $limit2 = null)
{
Expand All @@ -314,7 +314,7 @@ public function limit($limit, $limit2 = null)
* Set the queries current offset
*
* @param int $offset
* @return self The current query builder.
* @return static The current query builder.
*/
public function offset($offset)
{
Expand All @@ -326,7 +326,7 @@ public function offset($offset)
*
* @param int $page
* @param int $size
* @return self The current query builder.
* @return static The current query builder.
*/
public function page($page, $size = 25)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Query/Sql/SelectJoin.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class SelectJoin extends SelectBase
* @param string $operator
* @param string $referenceKey
*
* @return self
* @return static
*/
public function on($localKey, $operator, $referenceKey, $type = 'and')
{
Expand All @@ -48,7 +48,7 @@ public function on($localKey, $operator, $referenceKey, $type = 'and')
* @param string $operator
* @param string $referenceKey
*
* @return self
* @return static
*/
public function orOn($localKey, $operator, $referenceKey)
{
Expand All @@ -62,7 +62,7 @@ public function orOn($localKey, $operator, $referenceKey)
* @param string $operator
* @param string $referenceKey
*
* @return self
* @return static
*/
public function andOn($localKey, $operator, $referenceKey)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Query/Sql/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Update extends SelectBase
*
* @param string|array $param1
* @param mixed $param2
* @return self
* @return static
*/
public function set($param1, $param2 = null)
{
Expand Down

0 comments on commit 1a1f768

Please sign in to comment.