Browse Source

Make components projected on core level.

mscherer 5 years ago
parent
commit
a5dc68d5f9

+ 1 - 1
src/Controller/Component.php

@@ -75,7 +75,7 @@ class Component implements EventListenerInterface
      *
      * @var array
      */
-    public $components = [];
+    protected $components = [];
 
     /**
      * Default config

+ 1 - 1
src/Controller/Component/AuthComponent.php

@@ -176,7 +176,7 @@ class AuthComponent extends Component implements EventDispatcherInterface
      *
      * @var array
      */
-    public $components = ['RequestHandler', 'Flash'];
+    protected $components = ['RequestHandler', 'Flash'];
 
     /**
      * Objects that will be used for authentication checks.

+ 2 - 2
src/Core/ObjectRegistry.php

@@ -62,9 +62,9 @@ abstract class ObjectRegistry implements Countable, IteratorAggregate
      * an object by setting the 'className' key, i.e.,
      *
      * ```
-     * public $components = [
+     * protected $components = [
      *   'Email' => [
-     *     'className' => '\App\Controller\Component\AliasedEmailComponent'
+     *     'className' => 'App\Controller\Component\AliasedEmailComponent'
      *   ];
      * ];
      * ```

+ 1 - 1
tests/test_app/Plugin/TestPlugin/src/Controller/Component/PluginsComponent.php

@@ -24,5 +24,5 @@ use Cake\Controller\Component;
 
 class PluginsComponent extends Component
 {
-    public $components = ['TestPlugin.Other'];
+    protected $components = ['TestPlugin.Other'];
 }

+ 1 - 1
tests/test_app/Plugin/TestPlugin/src/Controller/Component/TestPluginComponent.php

@@ -24,5 +24,5 @@ use Cake\Controller\Component;
 
 class TestPluginComponent extends Component
 {
-    public $components = ['TestPlugin.TestPluginOther'];
+    protected $components = ['TestPlugin.TestPluginOther'];
 }

+ 1 - 1
tests/test_app/TestApp/Controller/Component/AppleComponent.php

@@ -30,7 +30,7 @@ class AppleComponent extends Component
      *
      * @var array
      */
-    public $components = ['Orange'];
+    protected $components = ['Orange'];
 
     /**
      * startup method

+ 1 - 1
tests/test_app/TestApp/Controller/Component/ConfiguredComponent.php

@@ -33,7 +33,7 @@ class ConfiguredComponent extends Component
      *
      * @var array
      */
-    public $components = [];
+    protected $components = [];
 
     /**
      * Constructor

+ 1 - 1
tests/test_app/TestApp/Controller/Component/MutuallyReferencingOneComponent.php

@@ -29,5 +29,5 @@ class MutuallyReferencingOneComponent extends Component
      *
      * @var array
      */
-    public $components = ['MutuallyReferencingTwo'];
+    protected $components = ['MutuallyReferencingTwo'];
 }

+ 1 - 1
tests/test_app/TestApp/Controller/Component/MutuallyReferencingTwoComponent.php

@@ -29,5 +29,5 @@ class MutuallyReferencingTwoComponent extends Component
      *
      * @var array
      */
-    public $components = ['MutuallyReferencingOne'];
+    protected $components = ['MutuallyReferencingOne'];
 }

+ 1 - 1
tests/test_app/TestApp/Controller/Component/OrangeComponent.php

@@ -30,7 +30,7 @@ class OrangeComponent extends Component
      *
      * @var array
      */
-    public $components = ['Banana'];
+    protected $components = ['Banana'];
 
     /**
      * controller property

+ 1 - 1
tests/test_app/TestApp/Controller/Component/ParamTestComponent.php

@@ -29,5 +29,5 @@ class ParamTestComponent extends Component
      *
      * @var array
      */
-    public $components = ['Banana' => ['config' => 'value']];
+    protected $components = ['Banana' => ['config' => 'value']];
 }

+ 1 - 1
tests/test_app/TestApp/Controller/Component/SomethingWithFlashComponent.php

@@ -29,5 +29,5 @@ class SomethingWithFlashComponent extends Component
      *
      * @var array
      */
-    public $components = ['Flash'];
+    protected $components = ['Flash'];
 }

+ 1 - 1
tests/test_app/TestApp/Controller/PaginatorTestController.php

@@ -12,5 +12,5 @@ class PaginatorTestController extends Controller
      *
      * @var array
      */
-    public $components = ['Paginator'];
+    protected $components = ['Paginator'];
 }