diff --git a/src/Controller/Component/AuthComponent.php b/src/Controller/Component/AuthComponent.php index 55f0f875410..bf8a1ae4883 100644 --- a/src/Controller/Component/AuthComponent.php +++ b/src/Controller/Component/AuthComponent.php @@ -230,15 +230,13 @@ class AuthComponent extends Component { protected $_authorizationProvider; /** - * Constructor + * Initialize properties. * - * @param ComponentRegistry $registry A ComponentRegistry object. - * @param array $config Array of configuration settings. + * @param array $config The config data. + * @return void */ - public function __construct(ComponentRegistry $registry, array $config = []) { - parent::__construct($registry, $config); - - $controller = $registry->getController(); + public function initialize(array $config) { + $controller = $this->_registry->getController(); $this->request = $controller->request; $this->response = $controller->response; $this->session = $controller->request->session(); diff --git a/src/Controller/Component/CookieComponent.php b/src/Controller/Component/CookieComponent.php index 624a8b2b126..b7845c69a42 100644 --- a/src/Controller/Component/CookieComponent.php +++ b/src/Controller/Component/CookieComponent.php @@ -120,19 +120,17 @@ class CookieComponent extends Component { protected $_validCiphers = ['aes', 'rijndael']; /** - * Constructor + * Initialize config data and properties. * - * @param ComponentRegistry $registry A ComponentRegistry for this component - * @param array $config Array of config. + * @param array $config The config data. + * @return void */ - public function __construct(ComponentRegistry $registry, array $config = array()) { - parent::__construct($registry, $config); - + public function initialize(array $config) { if (!$this->_config['key']) { $this->config('key', Security::salt()); } - $controller = $registry->getController(); + $controller = $this->_registry->getController(); if ($controller && isset($controller->request)) { $this->_request = $controller->request; } else { diff --git a/src/Controller/Component/SessionComponent.php b/src/Controller/Component/SessionComponent.php index 50c11bdede4..f556d0f6684 100644 --- a/src/Controller/Component/SessionComponent.php +++ b/src/Controller/Component/SessionComponent.php @@ -38,14 +38,13 @@ class SessionComponent extends Component { protected $_session; /** - * Constructor. Parses the accepted content types accepted by the client using HTTP_ACCEPT + * Initialize properties. * - * @param ComponentRegistry $registry ComponentRegistry object. - * @param array $config Array of config. + * @param array $config The config data. + * @return void */ - public function __construct(ComponentRegistry $registry, array $config = array()) { - parent::__construct($registry, $config); - $this->_session = $registry->getController()->request->session(); + public function initialize(array $config) { + $this->_session = $this->_registry->getController()->request->session(); } /**