Browse Source

Merge pull request #5728 from cakephp/3.0-method-signatures

Cleanup: Harden method signatures and correct doc blocks.
Mark Story 11 years ago
parent
commit
4a7929b2d0

+ 3 - 3
src/Console/ConsoleOptionParser.php

@@ -334,7 +334,7 @@ class ConsoleOptionParser
      * @param array $options An array of parameters that define the behavior of the option
      * @return $this
      */
-    public function addOption($name, $options = [])
+    public function addOption($name, array $options = [])
     {
         if ($name instanceof ConsoleInputOption) {
             $option = $name;
@@ -388,7 +388,7 @@ class ConsoleOptionParser
      * @param array $params Parameters for the argument, see above.
      * @return $this
      */
-    public function addArgument($name, $params = [])
+    public function addArgument($name, array $params = [])
     {
         if ($name instanceof ConsoleInputArgument) {
             $arg = $name;
@@ -471,7 +471,7 @@ class ConsoleOptionParser
      * @param array $options Array of params, see above.
      * @return $this
      */
-    public function addSubcommand($name, $options = [])
+    public function addSubcommand($name, array $options = [])
     {
         if ($name instanceof ConsoleInputSubcommand) {
             $command = $name;

+ 1 - 1
src/Datasource/EntityInterface.php

@@ -36,7 +36,7 @@ interface EntityInterface extends ArrayAccess, JsonSerializable
      * keys are `setter` and `guard`
      * @return \Cake\Datasource\EntityInterface
      */
-    public function set($property, $value = null, $options = []);
+    public function set($property, $value = null, array $options = []);
 
     /**
      * Returns the value of a property by name

+ 1 - 1
src/Datasource/EntityTrait.php

@@ -213,7 +213,7 @@ trait EntityTrait
      * @return $this
      * @throws \InvalidArgumentException
      */
-    public function set($property, $value = null, $options = [])
+    public function set($property, $value = null, array $options = [])
     {
         $isString = is_string($property);
         if ($isString && $property !== '') {

+ 1 - 1
src/Network/Session.php

@@ -238,7 +238,7 @@ class Session
      * @return \SessionHandlerInterface|null
      * @throws \InvalidArgumentException
      */
-    public function engine($class = null, $options = [])
+    public function engine($class = null, array $options = [])
     {
         if ($class instanceof SessionHandlerInterface) {
             return $this->_engine = $class;

+ 1 - 1
src/Utility/Xml.php

@@ -177,7 +177,7 @@ class Xml
      * `<root><tag id="1" value="defect">description</tag></root>`
      *
      * @param array|\Cake\Collection\Collection $input Array with data or a collection instance.
-     * @param string|array $options The options to use
+     * @param string|array $options The options to use or a string to use as format.
      * @return \SimpleXMLElement|\DOMDocument SimpleXMLElement or DOMDocument
      * @throws \Cake\Utility\Exception\XmlException
      */

+ 1 - 1
src/Validation/Validation.php

@@ -937,7 +937,7 @@ class Validation
      * @param array $options An array of options for the validation.
      * @return bool
      */
-    public static function uploadedFile($file, $options = [])
+    public static function uploadedFile($file, array $options = [])
     {
         $options += [
             'minSize' => null,