Browse Source

Merge pull request #4498 from dereuromark/3.0-method-signatures-controller

Better method signatures for controller and auth.
ADmad 11 years ago
parent
commit
a2b1d4a751
3 changed files with 3 additions and 3 deletions
  1. 1 1
      src/Auth/BaseAuthenticate.php
  2. 1 1
      src/Auth/DigestAuthenticate.php
  3. 1 1
      src/Controller/Controller.php

+ 1 - 1
src/Auth/BaseAuthenticate.php

@@ -81,7 +81,7 @@ abstract class BaseAuthenticate {
  * @param \Cake\Controller\ComponentRegistry $registry The Component registry used on this request.
  * @param array $config Array of config to use.
  */
-	public function __construct(ComponentRegistry $registry, $config) {
+	public function __construct(ComponentRegistry $registry, array $config = []) {
 		$this->_registry = $registry;
 		$this->config($config);
 	}

+ 1 - 1
src/Auth/DigestAuthenticate.php

@@ -77,7 +77,7 @@ class DigestAuthenticate extends BasicAuthenticate {
  *   used on this request.
  * @param array $config Array of config to use.
  */
-	public function __construct(ComponentRegistry $registry, $config) {
+	public function __construct(ComponentRegistry $registry, array $config = []) {
 		$this->_registry = $registry;
 
 		$this->config([

+ 1 - 1
src/Controller/Controller.php

@@ -234,7 +234,7 @@ class Controller implements EventListener {
  * @param \Cake\Network\Response $response Response object for this controller.
  * @param string $name Override the name useful in testing when using mocks.
  */
-	public function __construct($request = null, $response = null, $name = null) {
+	public function __construct(Request $request = null, Response $response = null, $name = null) {
 		if ($this->name === null && $name === null) {
 			list(, $name) = namespaceSplit(get_class($this));
 			$name = substr($name, 0, -10);