Browse Source

Merge branch 'master' into 3.next

Mark Story 7 years ago
parent
commit
7b442f81ba

+ 1 - 1
README.md

@@ -38,7 +38,7 @@ recommend using the [app skeleton](https://github.com/cakephp/app) as
 a starting point. For existing applications you can run the following:
 
 ``` bash
-$ composer require cakephp/cakephp:"~3.6"
+$ composer require cakephp/cakephp
 ```
 
 ## Running Tests

+ 1 - 1
src/Console/ConsoleOptionParser.php

@@ -949,7 +949,7 @@ class ConsoleOptionParser
      * algorithm.
      *
      * @param string $needle Unknown item (either a subcommand name or an option for instance) trying to be used.
-     * @param array $haystack List of items available for the type $needle belongs to.
+     * @param string[] $haystack List of items available for the type $needle belongs to.
      * @return string|null The closest name to the item submitted by the user.
      */
     protected function findClosestItem($needle, $haystack)

+ 1 - 1
src/Core/ObjectRegistry.php

@@ -184,7 +184,7 @@ abstract class ObjectRegistry implements Countable, IteratorAggregate
     /**
      * Get the list of loaded objects.
      *
-     * @return array List of object names.
+     * @return string[] List of object names.
      */
     public function loaded()
     {

+ 1 - 1
src/Core/StaticConfigTrait.php

@@ -205,7 +205,7 @@ trait StaticConfigTrait
     /**
      * Returns an array containing the named configurations
      *
-     * @return array Array of configurations.
+     * @return string[] Array of configurations.
      */
     public static function configured()
     {

+ 1 - 1
src/Database/Query.php

@@ -299,7 +299,7 @@ class Query implements ExpressionInterface, IteratorAggregate
      * ```
      *
      * @param callable $visitor A function or callable to be executed for each part
-     * @param array $parts The query clauses to traverse
+     * @param string[] $parts The query clauses to traverse
      * @return $this
      */
     public function traverse(callable $visitor, array $parts = [])

+ 2 - 2
src/Database/Schema/TableSchemaInterface.php

@@ -201,7 +201,7 @@ interface TableSchemaInterface extends SchemaInterface
     /**
      * Get the names of all the indexes in the table.
      *
-     * @return array
+     * @return string[]
      */
     public function indexes();
 
@@ -246,7 +246,7 @@ interface TableSchemaInterface extends SchemaInterface
     /**
      * Get the names of all the constraints in the table.
      *
-     * @return array
+     * @return string[]
      */
     public function constraints();
 }

+ 1 - 1
src/Datasource/EntityTrait.php

@@ -840,7 +840,7 @@ trait EntityTrait
     /**
      * Gets the dirty properties.
      *
-     * @return array
+     * @return string[]
      */
     public function getDirty()
     {

+ 2 - 2
src/Datasource/SchemaInterface.php

@@ -52,7 +52,7 @@ interface SchemaInterface
      * - `comment` The comment for the column.
      *
      * @param string $name The name of the column
-     * @param array $attrs The attributes for the column.
+     * @param array|string $attrs The attributes for the column.
      * @return $this
      */
     public function addColumn($name, $attrs);
@@ -86,7 +86,7 @@ interface SchemaInterface
     /**
      * Get the column names in the table.
      *
-     * @return array
+     * @return string[]
      */
     public function columns();
 

+ 1 - 1
src/Form/Schema.php

@@ -89,7 +89,7 @@ class Schema
     /**
      * Get the list of fields in the schema.
      *
-     * @return array The list of field names.
+     * @return string[] The list of field names.
      */
     public function fields()
     {

+ 6 - 0
src/Mailer/Email.php

@@ -1288,6 +1288,7 @@ class Email implements JsonSerializable, Serializable
      *
      * @param string|null $layout Layout name or null to not use
      * @return $this
+     * @deprecated 3.7.0 Use $email->viewBuilder()->setLayout() instead.
      */
     public function setLayout($layout)
     {
@@ -1303,6 +1304,7 @@ class Email implements JsonSerializable, Serializable
     /**
      * Gets layout.
      *
+     * @deprecated 3.7.0 Use $email->viewBuilder()->getLayout() instead.
      * @return string
      */
     public function getLayout()
@@ -1432,6 +1434,7 @@ class Email implements JsonSerializable, Serializable
      *
      * @param string $theme Theme name.
      * @return $this
+     * @deprecated 3.7.0 Use $email->viewBuilder()->setTheme() instead.
      */
     public function setTheme($theme)
     {
@@ -1448,6 +1451,7 @@ class Email implements JsonSerializable, Serializable
      * Gets theme to use when rendering.
      *
      * @return string
+     * @deprecated 3.7.0 Use $email->viewBuilder()->getTheme() instead.
      */
     public function getTheme()
     {
@@ -1483,6 +1487,7 @@ class Email implements JsonSerializable, Serializable
      *
      * @param array $helpers Helpers list.
      * @return $this
+     * @deprecated 3.7.0 Use $email->viewBuilder()->setHelpers() instead.
      */
     public function setHelpers(array $helpers)
     {
@@ -1499,6 +1504,7 @@ class Email implements JsonSerializable, Serializable
      * Gets helpers to be used when rendering.
      *
      * @return array
+     * @deprecated 3.7.0 Use $email->viewBuilder()->getHelpers() instead.
      */
     public function getHelpers()
     {

+ 1 - 1
src/ORM/AssociationCollection.php

@@ -143,7 +143,7 @@ class AssociationCollection implements IteratorAggregate
     /**
      * Get the names of all the associations in the collection.
      *
-     * @return array
+     * @return string[]
      */
     public function keys()
     {

+ 5 - 3
src/ORM/LazyEagerLoader.php

@@ -110,7 +110,7 @@ class LazyEagerLoader
      * in the top level entities.
      *
      * @param \Cake\ORM\Table $source The table having the top level associations
-     * @param array $associations The name of the top level associations
+     * @param string[] $associations The name of the top level associations
      * @return array
      */
     protected function _getPropertyMap($source, $associations)
@@ -128,9 +128,9 @@ class LazyEagerLoader
      * Injects the results of the eager loader query into the original list of
      * entities.
      *
-     * @param array|\Traversable $objects The original list of entities
+     * @param \Cake\Datasource\EntityInterface[]|\Traversable $objects The original list of entities
      * @param \Cake\Collection\CollectionInterface|\Cake\Database\Query $results The loaded results
-     * @param array $associations The top level associations that were loaded
+     * @param string[] $associations The top level associations that were loaded
      * @param \Cake\ORM\Table $source The table where the entities came from
      * @return array
      */
@@ -141,6 +141,7 @@ class LazyEagerLoader
         $primaryKey = (array)$source->getPrimaryKey();
         $results = $results
             ->indexBy(function ($e) use ($primaryKey) {
+                /** @var \Cake\Datasource\EntityInterface $e */
                 return implode(';', $e->extract($primaryKey));
             })
             ->toArray();
@@ -152,6 +153,7 @@ class LazyEagerLoader
                 continue;
             }
 
+            /** @var \Cake\Datasource\EntityInterface $loaded */
             $loaded = $results[$key];
             foreach ($associations as $assoc) {
                 $property = $properties[$assoc];

+ 1 - 1
src/Shell/Task/CommandTask.php

@@ -163,7 +163,7 @@ class CommandTask extends Shell
      * Return a list of subcommands for a given command
      *
      * @param string $commandName The command you want subcommands from.
-     * @return array
+     * @return string[]
      * @throws \ReflectionException
      */
     public function subCommands($commandName)

+ 2 - 2
src/Validation/Validator.php

@@ -306,7 +306,7 @@ class Validator implements ArrayAccess, IteratorAggregate, Countable
     /**
      * Get the list of default providers.
      *
-     * @return array
+     * @return string[]
      */
     public static function getDefaultProviders()
     {
@@ -343,7 +343,7 @@ class Validator implements ArrayAccess, IteratorAggregate, Countable
     /**
      * Get the list of providers in this validator.
      *
-     * @return array
+     * @return string[]
      */
     public function providers()
     {

+ 1 - 1
src/View/Form/ContextInterface.php

@@ -76,7 +76,7 @@ interface ContextInterface
     /**
      * Get the fieldnames of the top level object in this context.
      *
-     * @return array A list of the field names in the context.
+     * @return string[] A list of the field names in the context.
      */
     public function fieldNames();
 

+ 1 - 1
src/View/View.php

@@ -934,7 +934,7 @@ class View implements EventDispatcherInterface
     /**
      * Returns a list of variables available in the current View context
      *
-     * @return array Array of the set view variable names.
+     * @return string[] Array of the set view variable names.
      */
     public function getVars()
     {

+ 1 - 1
src/View/ViewBlock.php

@@ -197,7 +197,7 @@ class ViewBlock
     /**
      * Get the names of all the existing blocks.
      *
-     * @return array An array containing the blocks.
+     * @return string[] An array containing the blocks.
      */
     public function keys()
     {

+ 3 - 2
src/View/ViewBuilder.php

@@ -637,9 +637,10 @@ class ViewBuilder implements JsonSerializable, Serializable
      * Sets the view classname.
      *
      * Accepts either a short name (Ajax) a plugin name (MyPlugin.Ajax)
-     * or a fully namespaced name (App\View\AppView).
+     * or a fully namespaced name (App\View\AppView) or null to use the
+     * View class provided by CakePHP.
      *
-     * @param string $name The class name for the view.
+     * @param string|null $name The class name for the view.
      * @return $this
      */
     public function setClassName($name)