Browse Source

Merge pull request #13310 from cakephp/4.x-array-doc

Fix up string[] doc blocks and annotations.
Mark Story 6 years ago
parent
commit
7dca886d77
3 changed files with 14 additions and 29 deletions
  1. 0 15
      psalm-baseline.xml
  2. 4 4
      src/Database/Query.php
  3. 10 10
      src/Database/TypeMap.php

+ 0 - 15
psalm-baseline.xml

@@ -1448,15 +1448,9 @@
     </PropertyNotSetInConstructor>
   </file>
   <file src="src/Log/Engine/ConsoleLog.php">
-    <InvalidArgument occurrences="1">
-      <code>$this-&gt;_output</code>
-    </InvalidArgument>
     <MoreSpecificImplementedParamType occurrences="1">
       <code>$level</code>
     </MoreSpecificImplementedParamType>
-    <UninitializedProperty occurrences="1">
-      <code>$this-&gt;_output</code>
-    </UninitializedProperty>
   </file>
   <file src="src/Log/Engine/FileLog.php">
     <MoreSpecificImplementedParamType occurrences="1">
@@ -1928,15 +1922,6 @@
       <code>PluginShell</code>
     </PropertyNotSetInConstructor>
   </file>
-  <file src="src/Shell/SchemaCacheShell.php">
-    <DeprecatedClass occurrences="2">
-      <code>Shell</code>
-      <code>parent::getOptionParser()</code>
-    </DeprecatedClass>
-    <PropertyNotSetInConstructor occurrences="1">
-      <code>SchemaCacheShell</code>
-    </PropertyNotSetInConstructor>
-  </file>
   <file src="src/Shell/ServerShell.php">
     <DeprecatedClass occurrences="3">
       <code>Shell</code>

+ 4 - 4
src/Database/Query.php

@@ -708,7 +708,7 @@ class Query implements ExpressionInterface, IteratorAggregate
      *
      * See `join()` for further details on conditions and types.
      *
-     * @param string|array $table The table to join with
+     * @param string|string[] $table The table to join with
      * @param string|array|\Cake\Database\ExpressionInterface $conditions The conditions
      * to use for joining.
      * @param array $types a list of types associated to the conditions used for converting
@@ -730,7 +730,7 @@ class Query implements ExpressionInterface, IteratorAggregate
      * The arguments of this method are identical to the `leftJoin()` shorthand, please refer
      * to that methods description for further details.
      *
-     * @param string|array $table The table to join with
+     * @param string|string[] $table The table to join with
      * @param string|array|\Cake\Database\ExpressionInterface $conditions The conditions
      * to use for joining.
      * @param array $types a list of types associated to the conditions used for converting
@@ -769,7 +769,7 @@ class Query implements ExpressionInterface, IteratorAggregate
     /**
      * Returns an array that can be passed to the join method describing a single join clause
      *
-     * @param string|array $table The table to join with
+     * @param string|string[] $table The table to join with
      * @param string|array|\Cake\Database\ExpressionInterface $conditions The conditions
      * to use for joining.
      * @param string $type the join type to use
@@ -1487,7 +1487,7 @@ class Query implements ExpressionInterface, IteratorAggregate
      * with Query::values().
      *
      * @param array $columns The columns to insert into.
-     * @param array $types A map between columns & their datatypes.
+     * @param string[] $types A map between columns & their datatypes.
      * @return $this
      * @throws \RuntimeException When there are 0 columns.
      */

+ 10 - 10
src/Database/TypeMap.php

@@ -27,7 +27,7 @@ class TypeMap
      * Used to avoid repetition when calling multiple functions inside this class that
      * may require a custom type for a specific field.
      *
-     * @var array
+     * @var string[]
      */
     protected $_defaults;
 
@@ -37,14 +37,14 @@ class TypeMap
      * Used to avoid repetition when calling multiple functions inside this class that
      * may require a custom type for a specific field.
      *
-     * @var array
+     * @var string[]
      */
     protected $_types = [];
 
     /**
      * Creates an instance with the given defaults
      *
-     * @param array $defaults The defaults to use.
+     * @param string[] $defaults The defaults to use.
      */
     public function __construct(array $defaults = [])
     {
@@ -69,7 +69,7 @@ class TypeMap
      * This method will replace all the existing default mappings with the ones provided.
      * To add into the mappings use `addDefaults()`.
      *
-     * @param array $defaults Associative array where keys are field names and values
+     * @param string[] $defaults Associative array where keys are field names and values
      * are the correspondent type.
      * @return $this
      */
@@ -83,7 +83,7 @@ class TypeMap
     /**
      * Returns the currently configured types.
      *
-     * @return array
+     * @return string[]
      */
     public function getDefaults(): array
     {
@@ -95,7 +95,7 @@ class TypeMap
      *
      * If a key already exists it will not be overwritten.
      *
-     * @param array $types The additional types to add.
+     * @param string[] $types The additional types to add.
      * @return void
      */
     public function addDefaults(array $types): void
@@ -114,7 +114,7 @@ class TypeMap
      *
      * This method will replace all the existing type maps with the ones provided.
      *
-     * @param array $types Associative array where keys are field names and values
+     * @param string[] $types Associative array where keys are field names and values
      * are the correspondent type.
      * @return $this
      */
@@ -128,7 +128,7 @@ class TypeMap
     /**
      * Gets a map of fields and their associated types for single-use.
      *
-     * @return array
+     * @return string[]
      */
     public function getTypes(): array
     {
@@ -141,7 +141,7 @@ class TypeMap
      * null will be returned.
      *
      * @param string|int $column The type for a given column
-     * @return null|string
+     * @return string|null
      */
     public function type($column): ?string
     {
@@ -158,7 +158,7 @@ class TypeMap
     /**
      * Returns an array of all types mapped types
      *
-     * @return array
+     * @return string[]
      */
     public function toArray(): array
     {