Skip to content

Commit

Permalink
Fix code in docblocks for apigen
Browse files Browse the repository at this point in the history
  • Loading branch information
bcrowe committed Jan 14, 2016
1 parent f2c84bc commit 427f544
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/Cache/Cache.php
Expand Up @@ -571,7 +571,7 @@ public static function remember($key, $callable, $config = 'default')
*
* ```
* Cache::add('cached_data', $data);
* ````
* ```
*
* Writing to a specific cache config:
*
Expand Down
8 changes: 4 additions & 4 deletions src/Database/Expression/FunctionExpression.php
Expand Up @@ -45,13 +45,13 @@ class FunctionExpression extends QueryExpression
*
* ### Examples:
*
* ``$f = new FunctionExpression('CONCAT', ['CakePHP', ' rules']);``
* `$f = new FunctionExpression('CONCAT', ['CakePHP', ' rules']);`
*
* Previous line will generate ``CONCAT('CakePHP', ' rules')``
* Previous line will generate `CONCAT('CakePHP', ' rules')`
*
* ``$f = new FunctionExpression('CONCAT', ['name' => 'literal', ' rules']);``
* `$f = new FunctionExpression('CONCAT', ['name' => 'literal', ' rules']);`
*
* Will produce ``CONCAT(name, ' rules')``
* Will produce `CONCAT(name, ' rules')`
*
* @param string $name the name of the function to be constructed
* @param array $params list of arguments to be passed to the function
Expand Down
41 changes: 20 additions & 21 deletions src/Database/Query.php
Expand Up @@ -427,10 +427,10 @@ public function from($tables = [], $overwrite = false)
* to be joined, unless the third argument is set to true.
*
* When no join type is specified an INNER JOIN is used by default:
* ``$query->join(['authors'])`` Will produce ``INNER JOIN authors ON 1 = 1``
* `$query->join(['authors'])` will produce `INNER JOIN authors ON 1 = 1`
*
* It is also possible to alias joins using the array key:
* ``$query->join(['a' => 'authors'])`` Will produce ``INNER JOIN authors a ON 1 = 1``
* `$query->join(['a' => 'authors'])`` will produce `INNER JOIN authors a ON 1 = 1`
*
* A join can be fully described and aliased using the array notation:
*
Expand Down Expand Up @@ -694,7 +694,7 @@ protected function _makeJoin($table, $conditions, $type)
*
* The previous example produces:
*
* ``WHERE posted >= 2012-01-27 AND title LIKE 'Hello W%' AND author_id = 1``
* `WHERE posted >= 2012-01-27 AND title LIKE 'Hello W%' AND author_id = 1`
*
* Second parameter is used to specify what type is expected for each passed
* key. Valid types can be used from the mapped with Database\Type class.
Expand All @@ -711,13 +711,13 @@ protected function _makeJoin($table, $conditions, $type)
*
* The previous example produces:
*
* ``WHERE author_id = 1 AND (published = 1 OR posted < '2012-02-01') AND NOT (title = 'Hello')``
* `WHERE author_id = 1 AND (published = 1 OR posted < '2012-02-01') AND NOT (title = 'Hello')`
*
* You can nest conditions using conjunctions as much as you like. Sometimes, you
* may want to define 2 different options for the same key, in that case, you can
* wrap each condition inside a new array:
*
* ``$query->where(['OR' => [['published' => false], ['published' => true]])``
* `$query->where(['OR' => [['published' => false], ['published' => true]])`
*
* Keep in mind that every time you call where() with the third param set to false
* (default), it will join the passed conditions to the previous stored list using
Expand All @@ -733,7 +733,7 @@ protected function _makeJoin($table, $conditions, $type)
*
* The previous example produces:
*
* ``WHERE (id != 100 OR author_id != 1) AND published = 1``
* `WHERE (id != 100 OR author_id != 1) AND published = 1`
*
* Other Query objects that be used as conditions for any field.
*
Expand All @@ -756,7 +756,7 @@ protected function _makeJoin($table, $conditions, $type)
*
* * The previous example produces:
*
* ``WHERE title != 'Hello World' AND (id = 1 OR (id > 2 AND id < 10))``
* `WHERE title != 'Hello World' AND (id = 1 OR (id > 2 AND id < 10))`
*
* ### Conditions as strings:
*
Expand All @@ -766,7 +766,7 @@ protected function _makeJoin($table, $conditions, $type)
*
* The previous example produces:
*
* ``WHERE articles.author_id = authors.id AND modified IS NULL``
* `WHERE articles.author_id = authors.id AND modified IS NULL`
*
* Please note that when using the array notation or the expression objects, all
* values will be correctly quoted and transformed to the correspondent database
Expand Down Expand Up @@ -824,7 +824,7 @@ public function where($conditions = null, $types = [], $overwrite = false)
*
* Produces:
*
* ``WHERE (published = 0 OR published IS NULL) AND author_id = 1 AND comments_count > 10``
* `WHERE (published = 0 OR published IS NULL) AND author_id = 1 AND comments_count > 10`
*
* ```
* $query
Expand All @@ -838,7 +838,7 @@ public function where($conditions = null, $types = [], $overwrite = false)
*
* Generates the following conditions:
*
* ``WHERE (title = 'Foo') AND (author_id = 1 OR author_id = 2)``
* `WHERE (title = 'Foo') AND (author_id = 1 OR author_id = 2)`
*
* @param string|array|ExpressionInterface|callback $conditions The conditions to add with AND.
* @param array $types associative array of type names used to bind values to query
Expand Down Expand Up @@ -876,7 +876,7 @@ public function andWhere($conditions, $types = [])
*
* Will produce:
*
* ``WHERE title = 'Hello World' OR title = 'Foo'``
* `WHERE title = 'Hello World' OR title = 'Foo'`
*
* ```
* $query
Expand All @@ -886,7 +886,7 @@ public function andWhere($conditions, $types = [])
*
* Produces:
*
* ``WHERE (published = 0 OR published IS NULL) OR (author_id = 1 AND comments_count > 10)``
* `WHERE (published = 0 OR published IS NULL) OR (author_id = 1 AND comments_count > 10)`
*
* ```
* $query
Expand All @@ -900,7 +900,7 @@ public function andWhere($conditions, $types = [])
*
* Generates the following conditions:
*
* ``WHERE (title = 'Foo') OR (author_id = 1 OR author_id = 2)``
* `WHERE (title = 'Foo') OR (author_id = 1 OR author_id = 2)`
*
* @param string|array|ExpressionInterface|callback $conditions The conditions to add with OR.
* @param array $types associative array of type names used to bind values to query
Expand Down Expand Up @@ -935,15 +935,15 @@ public function orWhere($conditions, $types = [])
*
* Produces:
*
* ``ORDER BY title DESC, author_id ASC``
* `ORDER BY title DESC, author_id ASC`
*
* ```
* $query->order(['title' => 'DESC NULLS FIRST'])->order('author_id');
* ```
*
* Will generate:
*
* ``ORDER BY title DESC NULLS FIRST, author_id``
* `ORDER BY title DESC NULLS FIRST, author_id`
*
* ```
* $expression = $query->newExpr()->add(['id % 2 = 0']);
Expand All @@ -952,7 +952,7 @@ public function orWhere($conditions, $types = [])
*
* Will become:
*
* ``ORDER BY (id %2 = 0), title ASC``
* `ORDER BY (id %2 = 0), title ASC`
*
* If you need to set complex expressions as order conditions, you
* should use `orderAsc()` or `orderDesc()`.
Expand Down Expand Up @@ -1091,7 +1091,7 @@ public function having($conditions = null, $types = [], $overwrite = false)
/**
* Connects any previously defined set of conditions to the provided list
* using the AND operator in the HAVING clause. This method operates in exactly
* the same way as the method ``andWhere()`` does. Please refer to its
* the same way as the method `andWhere()` does. Please refer to its
* documentation for an insight on how to using each parameter.
*
* @param string|array|ExpressionInterface|callback $conditions The AND conditions for HAVING.
Expand All @@ -1108,7 +1108,7 @@ public function andHaving($conditions, $types = [])
/**
* Connects any previously defined set of conditions to the provided list
* using the OR operator in the HAVING clause. This method operates in exactly
* the same way as the method ``orWhere()`` does. Please refer to its
* the same way as the method `orWhere()` does. Please refer to its
* documentation for an insight on how to using each parameter.
*
* @param string|array|ExpressionInterface|callback $conditions The OR conditions for HAVING.
Expand Down Expand Up @@ -1226,7 +1226,7 @@ public function offset($num)
*
* Will produce:
*
* ``SELECT id, name FROM things d UNION SELECT id, title FROM articles a``
* `SELECT id, name FROM things d UNION SELECT id, title FROM articles a`
*
* @param string|Query $query full SQL query to be used in UNION operator
* @param bool $overwrite whether to reset the list of queries to be operated or not
Expand Down Expand Up @@ -1260,7 +1260,7 @@ public function union($query, $overwrite = false)
*
* Will produce:
*
* ``SELECT id, name FROM things d UNION ALL SELECT id, title FROM articles a``
* `SELECT id, name FROM things d UNION ALL SELECT id, title FROM articles a`
*
* @param string|Query $query full SQL query to be used in UNION operator
* @param bool $overwrite whether to reset the list of queries to be operated or not
Expand Down Expand Up @@ -1463,7 +1463,6 @@ public function type()
* any format accepted by \Cake\Database\Expression\QueryExpression:
*
* ```
*
* $expression = $query->newExpr(); // Returns an empty expression object
* $expression = $query->newExpr('Table.column = Table2.column'); // Return a raw SQL expression
* ```
Expand Down
18 changes: 9 additions & 9 deletions src/Datasource/QueryInterface.php
Expand Up @@ -199,15 +199,15 @@ public function offset($num);
*
* Produces:
*
* ``ORDER BY title DESC, author_id ASC``
* `ORDER BY title DESC, author_id ASC`
*
* ```
* $query->order(['title' => 'DESC NULLS FIRST'])->order('author_id');
* ```
*
* Will generate:
*
* ``ORDER BY title DESC NULLS FIRST, author_id``
* `ORDER BY title DESC NULLS FIRST, author_id`
*
* ```
* $expression = $query->newExpr()->add(['id % 2 = 0']);
Expand All @@ -216,7 +216,7 @@ public function offset($num);
*
* Will become:
*
* ``ORDER BY (id %2 = 0), title ASC``
* `ORDER BY (id %2 = 0), title ASC`
*
* If you need to set complex expressions as order conditions, you
* should use `orderAsc()` or `orderDesc()`.
Expand Down Expand Up @@ -286,7 +286,7 @@ public function repository(RepositoryInterface $repository = null);
*
* The previous example produces:
*
* ``WHERE posted >= 2012-01-27 AND title LIKE 'Hello W%' AND author_id = 1``
* `WHERE posted >= 2012-01-27 AND title LIKE 'Hello W%' AND author_id = 1`
*
* Second parameter is used to specify what type is expected for each passed
* key. Valid types can be used from the mapped with Database\Type class.
Expand All @@ -303,13 +303,13 @@ public function repository(RepositoryInterface $repository = null);
*
* The previous example produces:
*
* ``WHERE author_id = 1 AND (published = 1 OR posted < '2012-02-01') AND NOT (title = 'Hello')``
* `WHERE author_id = 1 AND (published = 1 OR posted < '2012-02-01') AND NOT (title = 'Hello')`
*
* You can nest conditions using conjunctions as much as you like. Sometimes, you
* may want to define 2 different options for the same key, in that case, you can
* wrap each condition inside a new array:
*
* ``$query->where(['OR' => [['published' => false], ['published' => true]])``
* `$query->where(['OR' => [['published' => false], ['published' => true]])`
*
* Keep in mind that every time you call where() with the third param set to false
* (default), it will join the passed conditions to the previous stored list using
Expand All @@ -325,7 +325,7 @@ public function repository(RepositoryInterface $repository = null);
*
* The previous example produces:
*
* ``WHERE (id != 100 OR author_id != 1) AND published = 1``
* `WHERE (id != 100 OR author_id != 1) AND published = 1`
*
* Other Query objects that be used as conditions for any field.
*
Expand All @@ -348,7 +348,7 @@ public function repository(RepositoryInterface $repository = null);
*
* * The previous example produces:
*
* ``WHERE title != 'Hello World' AND (id = 1 OR (id > 2 AND id < 10))``
* `WHERE title != 'Hello World' AND (id = 1 OR (id > 2 AND id < 10))`
*
* ### Conditions as strings:
*
Expand All @@ -358,7 +358,7 @@ public function repository(RepositoryInterface $repository = null);
*
* The previous example produces:
*
* ``WHERE articles.author_id = authors.id AND modified IS NULL``
* `WHERE articles.author_id = authors.id AND modified IS NULL`
*
* Please note that when using the array notation or the expression objects, all
* values will be correctly quoted and transformed to the correspondent database
Expand Down

0 comments on commit 427f544

Please sign in to comment.