Skip to content

Commit

Permalink
Merge pull request #14091 from cakephp/fix-deprecated-types
Browse files Browse the repository at this point in the history
Fixed missing types in api docs
  • Loading branch information
dereuromark committed Dec 29, 2019
2 parents 9b250ca + 53064af commit dd208b2
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Collection/CollectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public function extract($matcher): CollectionInterface;
* @param callable|string $callback the callback or column name to use for sorting
* @param int $type the type of comparison to perform, either SORT_STRING
* SORT_NUMERIC or SORT_NATURAL
* @see \Cake\Collection\CollectionIterface::sortBy()
* @see \Cake\Collection\CollectionInterface::sortBy()
* @return mixed The value of the top element in the collection
*/
public function max($callback, int $type = \SORT_NUMERIC);
Expand Down
3 changes: 2 additions & 1 deletion src/Console/CommandCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public function add(string $name, $command)
if (!is_subclass_of($command, Shell::class) && !is_subclass_of($command, CommandInterface::class)) {
$class = is_string($command) ? $command : get_class($command);
throw new InvalidArgumentException(sprintf(
"Cannot use '%s' for command '%s' it is not a subclass of Cake\Console\Shell or Cake\Console\Command.",
"Cannot use '%s' for command '%s'. " .
"It is not a subclass of Cake\Console\Shell or Cake\Command\CommandInterface.",
$class,
$name
));
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Exception/StopException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @see \Cake\Console\Shell::_stop()
* @see \Cake\Console\Shell::error()
* @see \Cake\Console\Command::abort()
* @see \Cake\Command\BaseCommand::abort()
*/
class StopException extends ConsoleException
{
Expand Down
6 changes: 3 additions & 3 deletions src/Database/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ public function from($tables = [], $overwrite = false)
* @param array|string $tables list of tables to be joined in the query
* @param array $types associative array of type names used to bind values to query
* @param bool $overwrite whether to reset joins with passed list or not
* @see \Cake\Database\Type
* @see \Cake\Database\TypeFactory
* @return $this
*/
public function join($tables, $types = [], $overwrite = false)
Expand Down Expand Up @@ -925,7 +925,7 @@ protected function _makeJoin($table, $conditions, $type): array
* @param string|array|\Cake\Database\ExpressionInterface|\Closure|null $conditions The conditions to filter on.
* @param array $types associative array of type names used to bind values to query
* @param bool $overwrite whether to reset conditions with passed list or not
* @see \Cake\Database\Type
* @see \Cake\Database\TypeFactory
* @see \Cake\Database\Expression\QueryExpression
* @return $this
*/
Expand Down Expand Up @@ -1095,7 +1095,7 @@ public function whereNotInList(string $field, array $values, array $options = []
* @param string|array|\Cake\Database\ExpressionInterface|\Closure $conditions The conditions to add with AND.
* @param array $types associative array of type names used to bind values to query
* @see \Cake\Database\Query::where()
* @see \Cake\Database\Type
* @see \Cake\Database\TypeFactory
* @return $this
*/
public function andWhere($conditions, array $types = [])
Expand Down
2 changes: 1 addition & 1 deletion src/View/Form/ArrayContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ public function fieldNames(): array
*
* @param string $field A dot separated path to get a schema type for.
* @return string|null An abstract data type or null.
* @see \Cake\Database\Type
* @see \Cake\Database\TypeFactory
*/
public function type(string $field): ?string
{
Expand Down
2 changes: 1 addition & 1 deletion src/View/Form/ContextInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function fieldNames(): array;
*
* @param string $field A dot separated path to get a schema type for.
* @return string|null An abstract data type or null.
* @see \Cake\Database\Type
* @see \Cake\Database\TypeFactory
*/
public function type(string $field): ?string;

Expand Down
2 changes: 1 addition & 1 deletion src/View/Form/EntityContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ protected function _getTable($parts, $fallback = true): ?Table
*
* @param string $field A dot separated path to get a schema type for.
* @return string|null An abstract data type or null.
* @see \Cake\Database\Type
* @see \Cake\Database\TypeFactory
*/
public function type(string $field): ?string
{
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase/Console/CommandCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testConstructor()
public function testConstructorInvalidClass()
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Cannot use \'stdClass\' for command \'nope\' it is not a subclass of Cake\Console\Shell');
$this->expectExceptionMessage('Cannot use \'stdClass\' for command \'nope\'. It is not a subclass of Cake\Console\Shell');
new CommandCollection([
'sample' => SampleShell::class,
'nope' => stdClass::class,
Expand Down Expand Up @@ -133,7 +133,7 @@ public function testAddInstance()
public function testAddInvalidInstance()
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Cannot use \'stdClass\' for command \'routes\' it is not a subclass of Cake\Console\Shell');
$this->expectExceptionMessage('Cannot use \'stdClass\' for command \'routes\'. It is not a subclass of Cake\Console\Shell');
$collection = new CommandCollection();
$shell = new stdClass();
$collection->add('routes', $shell);
Expand Down Expand Up @@ -179,7 +179,7 @@ public function testAddCommandInvalidName($name)
public function testInvalidShellClassName()
{
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Cannot use \'stdClass\' for command \'routes\' it is not a subclass of Cake\Console\Shell');
$this->expectExceptionMessage('Cannot use \'stdClass\' for command \'routes\'. It is not a subclass of Cake\Console\Shell');
$collection = new CommandCollection();
$collection->add('routes', stdClass::class);
}
Expand Down

0 comments on commit dd208b2

Please sign in to comment.