Skip to content

Commit

Permalink
use $this in return declarations according to PSR-5
Browse files Browse the repository at this point in the history
  • Loading branch information
tflori committed Oct 31, 2020
1 parent 9d0ddbd commit a66da2c
Show file tree
Hide file tree
Showing 15 changed files with 365 additions and 365 deletions.
620 changes: 310 additions & 310 deletions docs/reference.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/BulkInsert.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function getLimit()
* Limit the amount of entities inserted at once.
*
* @param int $limit
* @return static
* @return $this
* @codeCoverageIgnore trivial
*/
public function limit($limit)
Expand All @@ -127,7 +127,7 @@ public function limit($limit)
*
* **Caution**: Your db access layer (DBAL) may not support this feature.
*
* @return static
* @return $this
* @codeCoverageIgnore trivial
*/
public function useAutoincrement()
Expand All @@ -141,7 +141,7 @@ public function useAutoincrement()
*
* **Caution**: If this is disabled updating could cause a IncompletePrimaryKey exception.
*
* @return static
* @return $this
* @codeCoverageIgnore trivial
*/
public function noAutoIncrement()
Expand All @@ -156,7 +156,7 @@ public function noAutoIncrement()
* Provides an array of the just inserted entities in first argument.
*
* @param callable $callback
* @return static
* @return $this
* @codeCoverageIgnore trivial
*/
public function onSync(callable $callback = null)
Expand All @@ -168,7 +168,7 @@ public function onSync(callable $callback = null)
/**
* Disable updating entities after insert
*
* @return static
* @return $this
* @codeCoverageIgnore trivial
*/
public function noUpdates()
Expand All @@ -183,7 +183,7 @@ public function noUpdates()
* **Caution**: This option will need to update the primary key by autoincrement which maybe is not supported
* by your db access layer (DBAL).
*
* @return static
* @return $this
* @codeCoverageIgnore trivial
*/
public function updateEntities()
Expand Down
2 changes: 1 addition & 1 deletion src/Dbal/Dbal.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct(EntityManager $entityManager, array $options = [])
*
* @param string $option
* @param mixed $value
* @return static
* @return $this
*/
public function setOption($option, $value)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public static function isAutoIncremented()

/**
* @param EM $entityManager
* @return static
* @return $this
*/
public function setEntityManager(EM $entityManager)
{
Expand Down Expand Up @@ -275,7 +275,7 @@ public function __set($attribute, $value)
*
* @param string $attribute The variable to change
* @param mixed $value The value to store
* @return static
* @return $this
* @link https://tflori.github.io/orm/entities.html Working with entities
* @throws Error
*/
Expand Down
6 changes: 3 additions & 3 deletions src/EntityFetcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ public function __construct(EntityManager $entityManager, $class)
$this->modifier = [ 'DISTINCT' ];
}

/** @return static
/** @return $this
* @internal
*/
public function columns(array $columns = null)
{
return $this;
}

/** @return static
/** @return $this
* @internal
*/
public function column($column, $args = [], $alias = '')
Expand Down Expand Up @@ -217,7 +217,7 @@ public function getQuery()
*
* @param string|QueryBuilderInterface $query Raw query string or a QueryBuilderInterface
* @param array $args The arguments for placeholders
* @return static
* @return $this
*/
public function setQuery($query, $args = null)
{
Expand Down
6 changes: 3 additions & 3 deletions src/EntityFetcher/MakesJoins.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function fullJoin($class, $expression = '', $alias = '', $args = [])
*
* @param $join
* @param $relation
* @return static
* @return $this
*/
public function createRelatedJoin($join, $relation)
{
Expand All @@ -57,7 +57,7 @@ public function createRelatedJoin($join, $relation)
* Join $relation
*
* @param $relation
* @return static
* @return $this
*/
public function joinRelated($relation)
{
Expand All @@ -68,7 +68,7 @@ public function joinRelated($relation)
* Left outer join $relation
*
* @param $relation
* @return static
* @return $this
*/
public function leftJoinRelated($relation)
{
Expand Down
6 changes: 3 additions & 3 deletions src/EntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private static function getInstanceByParent($class)
* Define $this EntityManager as the default EntityManager for $nameSpace
*
* @param $nameSpace
* @return static
* @return $this
*/
public function defineForNamespace($nameSpace)
{
Expand All @@ -210,7 +210,7 @@ public function defineForNamespace($nameSpace)
* Define $this EntityManager as the default EntityManager for subClasses of $class
*
* @param $class
* @return static
* @return $this
*/
public function defineForParent($class)
{
Expand All @@ -223,7 +223,7 @@ public function defineForParent($class)
*
* @param string $option One of OPT_* constants
* @param mixed $value
* @return static
* @return $this
*/
public function setOption($option, $value)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Namer.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function __construct($options = [])
*
* @param string $option
* @param mixed $value
* @return static
* @return $this
*/
public function setOption($option, $value)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Observer/CallbackObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CallbackObserver extends AbstractObserver
*
* @param $event
* @param callable $listener
* @return static
* @return $this
*/
public function on($event, callable $listener)
{
Expand All @@ -29,7 +29,7 @@ public function on($event, callable $listener)
* Remove all listeners for $event
*
* @param $event
* @return static
* @return $this
*/
public function off($event)
{
Expand Down
14 changes: 7 additions & 7 deletions src/QueryBuilder/HasWhereConditions.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ trait HasWhereConditions
* @param string $column Column or expression with placeholders
* @param mixed $operator Operator, value or array of values
* @param mixed $value Value (required when used with operator)
* @return static
* @return $this
*/
public function where($column, $operator = null, $value = null)
{
Expand Down Expand Up @@ -60,7 +60,7 @@ public function where($column, $operator = null, $value = null)
* @param string $column Column or expression with placeholders
* @param string|array $operator Operator, value or array of values
* @param string $value Value (required when used with operator)
* @return static
* @return $this
*/
public function andWhere($column, $operator = null, $value = null)
{
Expand Down Expand Up @@ -90,7 +90,7 @@ public function andWhere($column, $operator = null, $value = null)
* @param string $column Column or expression with placeholders
* @param string|array $operator Operator, value or array of values
* @param string $value Value (required when used with operator)
* @return static
* @return $this
*/
public function orWhere($column, $operator = null, $value = null)
{
Expand All @@ -110,7 +110,7 @@ public function orWhere($column, $operator = null, $value = null)
*
* @param string|array $column
* @param array $values
* @return static
* @return $this
*/
public function whereIn($column, array $values)
{
Expand All @@ -130,7 +130,7 @@ public function whereIn($column, array $values)
*
* @param string|array $column
* @param array $values
* @return static
* @return $this
*/
public function orWhereIn($column, array $values)
{
Expand All @@ -150,7 +150,7 @@ public function orWhereIn($column, array $values)
*
* @param string|array $column
* @param array $values
* @return static
* @return $this
*/
public function whereNotIn($column, array $values)
{
Expand All @@ -170,7 +170,7 @@ public function whereNotIn($column, array $values)
*
* @param string|array $column
* @param array $values
* @return static
* @return $this
*/
public function orWhereNotIn($column, array $values)
{
Expand Down
8 changes: 4 additions & 4 deletions src/QueryBuilder/MakesJoins.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function (ParenthesisInterface $parenthesis) use ($joinClause) {
* @param string|boolean $expression Expression, single column name or boolean to create an empty join
* @param string $alias Alias for the table
* @param array $args Arguments for expression
* @return static|ParenthesisInterface
* @return $this|ParenthesisInterface
*/
public function join($tableName, $expression = '', $alias = '', $args = [])
{
Expand All @@ -78,7 +78,7 @@ public function join($tableName, $expression = '', $alias = '', $args = [])
* @param string|boolean $expression Expression, single column name or boolean to create an empty join
* @param string $alias Alias for the table
* @param array $args Arguments for expression
* @return static|ParenthesisInterface
* @return $this|ParenthesisInterface
*/
public function leftJoin($tableName, $expression = '', $alias = '', $args = [])
{
Expand All @@ -98,7 +98,7 @@ public function leftJoin($tableName, $expression = '', $alias = '', $args = [])
* @param string|boolean $expression Expression, single column name or boolean to create an empty join
* @param string $alias Alias for the table
* @param array $args Arguments for expression
* @return static|ParenthesisInterface
* @return $this|ParenthesisInterface
*/
public function rightJoin($tableName, $expression = '', $alias = '', $args = [])
{
Expand All @@ -119,7 +119,7 @@ public function rightJoin($tableName, $expression = '', $alias = '', $args = [])
* @param string|boolean $expression Expression, single column name or boolean to create an empty join
* @param string $alias Alias for the table
* @param array $args Arguments for expression
* @return static|ParenthesisInterface
* @return $this|ParenthesisInterface
*/
public function fullJoin($tableName, $expression = '', $alias = '', $args = [])
{
Expand Down
20 changes: 10 additions & 10 deletions src/QueryBuilder/ParenthesisInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface ParenthesisInterface
* @param string $column Column or expression with placeholders
* @param mixed $operator Operator, value or array of values
* @param mixed $value Value (required when used with operator)
* @return static
* @return $this
*/
public function where($column, $operator = '', $value = '');

Expand All @@ -59,7 +59,7 @@ public function where($column, $operator = '', $value = '');
* @param string $column Column or expression with placeholders
* @param string|array $operator Operator, value or array of values
* @param string $value Value (required when used with operator)
* @return static
* @return $this
*/
public function andWhere($column, $operator = '', $value = '');

Expand All @@ -85,7 +85,7 @@ public function andWhere($column, $operator = '', $value = '');
* @param string $column Column or expression with placeholders
* @param string|array $operator Operator, value or array of values
* @param string $value Value (required when used with operator)
* @return static
* @return $this
*/
public function orWhere($column, $operator = '', $value = '');

Expand All @@ -101,7 +101,7 @@ public function orWhere($column, $operator = '', $value = '');
*
* @param string|array $column
* @param array $values
* @return static
* @return $this
*/
public function whereIn($column, array $values);

Expand All @@ -117,7 +117,7 @@ public function whereIn($column, array $values);
*
* @param string|array $column
* @param array $values
* @return static
* @return $this
*/
public function orWhereIn($column, array $values);

Expand All @@ -133,7 +133,7 @@ public function orWhereIn($column, array $values);
*
* @param string|array $column
* @param array $values
* @return static
* @return $this
*/
public function whereNotIn($column, array $values);

Expand All @@ -149,29 +149,29 @@ public function whereNotIn($column, array $values);
*
* @param string|array $column
* @param array $values
* @return static
* @return $this
*/
public function orWhereNotIn($column, array $values);

/**
* Alias for andParenthesis
*
* @see ParenthesisInterface::andWhere()
* @return static
* @return $this
*/
public function parenthesis();

/**
* Add a parenthesis with AND
*
* @return static
* @return $this
*/
public function andParenthesis();

/**
* Add a parenthesis with OR
*
* @return static
* @return $this
*/
public function orParenthesis();

Expand Down
2 changes: 1 addition & 1 deletion src/QueryBuilder/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public function column($column, $args = [], $alias = '')

/**
* @internal
* @return static
* @return $this
*/
public function close()
{
Expand Down
Loading

0 comments on commit a66da2c

Please sign in to comment.