Browse Source

Merge pull request #13225 from cakephp/4.x-cleanup-collection

Docblock fixes for collection.
Mark Story 7 years ago
parent
commit
aedd4577c7
2 changed files with 14 additions and 5 deletions
  1. 3 3
      src/Core/PluginCollection.php
  2. 11 2
      tests/test_app/TestApp/Model/Table/TestTable.php

+ 3 - 3
src/Core/PluginCollection.php

@@ -37,14 +37,14 @@ class PluginCollection implements Iterator, Countable
     /**
      * Plugin list
      *
-     * @var array
+     * @var \Cake\Core\PluginInterface[]
      */
     protected $plugins = [];
 
     /**
      * Names of plugins
      *
-     * @var array
+     * @var string[]
      */
     protected $names = [];
 
@@ -58,7 +58,7 @@ class PluginCollection implements Iterator, Countable
     /**
      * Constructor
      *
-     * @param array $plugins The map of plugins to add to the collection.
+     * @param \Cake\Core\PluginInterface[] $plugins The map of plugins to add to the collection.
      */
     public function __construct(array $plugins = [])
     {

+ 11 - 2
tests/test_app/TestApp/Model/Table/TestTable.php

@@ -3,6 +3,7 @@ declare(strict_types=1);
 
 namespace TestApp\Model\Table;
 
+use Cake\Datasource\QueryInterface;
 use Cake\ORM\Table;
 
 /**
@@ -10,12 +11,20 @@ use Cake\ORM\Table;
  */
 class TestTable extends Table
 {
-    public function initialize(array $config = []): void
+    /**
+     * @param array $config
+     * @return void
+     */
+    public function initialize(array $config): void
     {
         $this->setSchema(['id' => ['type' => 'integer']]);
     }
 
-    public function findPublished($query)
+    /**
+     * @param \Cake\Datasource\QueryInterface $query
+     * @return \Cake\Datasource\QueryInterface
+     */
+    public function findPublished(QueryInterface $query)
     {
         return $query->applyOptions(['this' => 'worked']);
     }