mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-17 14:57:23 +08:00
fixed exception.
This commit is contained in:
@@ -184,7 +184,7 @@ class Dictionary extends Object implements \IteratorAggregate, \ArrayAccess, \Co
|
||||
* Copies iterable data into the dictionary.
|
||||
* Note, existing data in the dictionary will be cleared first.
|
||||
* @param mixed $data the data to be copied from, must be an array or an object implementing `Traversable`
|
||||
* @throws InvalidCallException if data is neither an array nor an iterator.
|
||||
* @throws InvalidParamException if data is neither an array nor an iterator.
|
||||
*/
|
||||
public function copyFrom($data)
|
||||
{
|
||||
@@ -199,7 +199,7 @@ class Dictionary extends Object implements \IteratorAggregate, \ArrayAccess, \Co
|
||||
$this->add($key, $value);
|
||||
}
|
||||
} else {
|
||||
throw new InvalidCallException('Data must be either an array or an object implementing Traversable.');
|
||||
throw new InvalidParamException('Data must be either an array or an object implementing Traversable.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ class Dictionary extends Object implements \IteratorAggregate, \ArrayAccess, \Co
|
||||
*
|
||||
* @param array|\Traversable $data the data to be merged with. It must be an array or object implementing Traversable
|
||||
* @param boolean $recursive whether the merging should be recursive.
|
||||
* @throws InvalidCallException if data is neither an array nor an object implementing `Traversable`.
|
||||
* @throws InvalidParamException if data is neither an array nor an object implementing `Traversable`.
|
||||
*/
|
||||
public function mergeWith($data, $recursive = true)
|
||||
{
|
||||
@@ -240,7 +240,7 @@ class Dictionary extends Object implements \IteratorAggregate, \ArrayAccess, \Co
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new InvalidCallException('The data to be merged with must be an array or an object implementing Traversable.');
|
||||
throw new InvalidParamException('The data to be merged with must be an array or an object implementing Traversable.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user