diff --git a/framework/base/Dictionary.php b/framework/base/Dictionary.php index cc61886..d7085b8 100644 --- a/framework/base/Dictionary.php +++ b/framework/base/Dictionary.php @@ -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.'); } } diff --git a/framework/base/Vector.php b/framework/base/Vector.php index c271ccc..4238a8a 100644 --- a/framework/base/Vector.php +++ b/framework/base/Vector.php @@ -101,7 +101,7 @@ class Vector extends Object implements \IteratorAggregate, \ArrayAccess, \Counta * Returns the item at the specified index. * @param integer $index the index of the item * @return mixed the item at the index - * @throws InvalidCallException if the index is out of range + * @throws InvalidParamException if the index is out of range */ public function itemAt($index) { @@ -110,7 +110,7 @@ class Vector extends Object implements \IteratorAggregate, \ArrayAccess, \Counta } elseif ($index >= 0 && $index < $this->_c) { // in case the value is null return $this->_d[$index]; } else { - throw new InvalidCallException('Index out of range: ' . $index); + throw new InvalidParamException('Index out of range: ' . $index); } } @@ -132,7 +132,7 @@ class Vector extends Object implements \IteratorAggregate, \ArrayAccess, \Counta * one step towards the end. * @param integer $index the specified position. * @param mixed $item new item to be inserted into the vector - * @throws InvalidCallException if the index specified is out of range, or the vector is read-only. + * @throws InvalidParamException if the index specified is out of range, or the vector is read-only. */ public function insertAt($index, $item) { @@ -142,7 +142,7 @@ class Vector extends Object implements \IteratorAggregate, \ArrayAccess, \Counta array_splice($this->_d, $index, 0, array($item)); $this->_c++; } else { - throw new InvalidCallException('Index out of range: ' . $index); + throw new InvalidParamException('Index out of range: ' . $index); } } @@ -169,7 +169,7 @@ class Vector extends Object implements \IteratorAggregate, \ArrayAccess, \Counta * Removes an item at the specified position. * @param integer $index the index of the item to be removed. * @return mixed the removed item. - * @throws InvalidCallException if the index is out of range, or the vector is read only. + * @throws InvalidParamException if the index is out of range, or the vector is read only. */ public function removeAt($index) { @@ -183,7 +183,7 @@ class Vector extends Object implements \IteratorAggregate, \ArrayAccess, \Counta return $item; } } else { - throw new InvalidCallException('Index out of range: ' . $index); + throw new InvalidParamException('Index out of range: ' . $index); } } @@ -242,7 +242,7 @@ class Vector extends Object implements \IteratorAggregate, \ArrayAccess, \Counta * Copies iterable data into the vector. * Note, existing data in the vector 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 object implementing `Traversable`. + * @throws InvalidParamException if data is neither an array nor an object implementing `Traversable`. */ public function copyFrom($data) { @@ -257,7 +257,7 @@ class Vector extends Object implements \IteratorAggregate, \ArrayAccess, \Counta $this->add($item); } } 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.'); } } @@ -265,7 +265,7 @@ class Vector extends Object implements \IteratorAggregate, \ArrayAccess, \Counta * Merges iterable data into the vector. * New items will be appended to the end of the existing items. * @param array|\Traversable $data the data to be merged with. It must be an array or object implementing Traversable - * @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) { @@ -277,7 +277,7 @@ class Vector extends Object implements \IteratorAggregate, \ArrayAccess, \Counta $this->add($item); } } 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.'); } } diff --git a/framework/base/View.php b/framework/base/View.php index 9caa4ef..7eca57f 100644 --- a/framework/base/View.php +++ b/framework/base/View.php @@ -122,7 +122,7 @@ class View extends Component * @param array $params the parameters that should be made available in the view. The PHP function `extract()` * will be called on this variable to extract the variables from this parameter. * @return string the rendering result - * @throws InvalidCallException if the view file cannot be found + * @throws InvalidParamException if the view file cannot be found * @see findViewFile() */ public function renderPartial($view, $params = array()) @@ -131,7 +131,7 @@ class View extends Component if ($file !== false) { return $this->renderFile($file, $params); } else { - throw new InvalidCallException("Unable to find the view file for view '$view'."); + throw new InvalidParamException("Unable to find the view file for view '$view'."); } } diff --git a/framework/db/ActiveRecord.php b/framework/db/ActiveRecord.php index 0b2451f..9ec1fac 100644 --- a/framework/db/ActiveRecord.php +++ b/framework/db/ActiveRecord.php @@ -11,6 +11,7 @@ namespace yii\db; use yii\base\Model; +use yii\base\InvalidParamException; use yii\base\Event; use yii\base\ModelEvent; use yii\base\UnknownMethodException; @@ -1045,7 +1046,7 @@ class ActiveRecord extends Model * It can be declared in either the Active Record class itself or one of its behaviors. * @param string $name the relation name * @return ActiveRelation the relation object - * @throws InvalidCallException if the named relation does not exist. + * @throws InvalidParamException if the named relation does not exist. */ public function getRelation($name) { @@ -1057,7 +1058,7 @@ class ActiveRecord extends Model } } catch (UnknownMethodException $e) { } - throw new InvalidCallException(get_class($this) . ' has no relation named "' . $name . '".'); + throw new InvalidParamException(get_class($this) . ' has no relation named "' . $name . '".'); } /** diff --git a/framework/db/TableSchema.php b/framework/db/TableSchema.php index 987d221..d6d1a0f 100644 --- a/framework/db/TableSchema.php +++ b/framework/db/TableSchema.php @@ -9,7 +9,7 @@ namespace yii\db; -use yii\base\InvalidCallException; +use yii\base\InvalidParamException; /** * TableSchema represents the metadata of a database table. @@ -83,7 +83,7 @@ class TableSchema extends \yii\base\Object /** * Manually specifies the primary key for this table. * @param string|array $keys the primary key (can be composite) - * @throws InvalidCallException if the specified key cannot be found in the table. + * @throws InvalidParamException if the specified key cannot be found in the table. */ public function fixPrimaryKey($keys) { @@ -98,7 +98,7 @@ class TableSchema extends \yii\base\Object if (isset($this->columns[$key])) { $this->columns[$key]->isPrimaryKey = true; } else { - throw new InvalidCallException("Primary key '$key' cannot be found in table '{$this->name}'."); + throw new InvalidParamException("Primary key '$key' cannot be found in table '{$this->name}'."); } } } diff --git a/framework/db/mysql/QueryBuilder.php b/framework/db/mysql/QueryBuilder.php index 6168409..9610967 100644 --- a/framework/db/mysql/QueryBuilder.php +++ b/framework/db/mysql/QueryBuilder.php @@ -10,7 +10,7 @@ namespace yii\db\mysql; use yii\db\Exception; -use yii\base\InvalidCallException; +use yii\base\InvalidParamException; /** * QueryBuilder is the query builder for MySQL databases. @@ -98,7 +98,7 @@ class QueryBuilder extends \yii\db\QueryBuilder * @param mixed $value the value for the primary key of the next new row inserted. If this is not set, * the next new row's primary key will have a value 1. * @return string the SQL statement for resetting sequence - * @throws InvalidCallException if the table does not exist or there is no sequence associated with the table. + * @throws InvalidParamException if the table does not exist or there is no sequence associated with the table. */ public function resetSequence($tableName, $value = null) { @@ -113,9 +113,9 @@ class QueryBuilder extends \yii\db\QueryBuilder } return "ALTER TABLE $tableName AUTO_INCREMENT=$value"; } elseif ($table === null) { - throw new InvalidCallException("Table not found: $tableName"); + throw new InvalidParamException("Table not found: $tableName"); } else { - throw new InvalidCallException("There is not sequence associated with table '$tableName'.'"); + throw new InvalidParamException("There is not sequence associated with table '$tableName'.'"); } } diff --git a/framework/db/sqlite/QueryBuilder.php b/framework/db/sqlite/QueryBuilder.php index b9b8f5e..1bc22f3 100644 --- a/framework/db/sqlite/QueryBuilder.php +++ b/framework/db/sqlite/QueryBuilder.php @@ -10,8 +10,8 @@ namespace yii\db\sqlite; use yii\db\Exception; +use yii\base\InvalidParamException; use yii\base\NotSupportedException; -use yii\base\InvalidCallException; /** * QueryBuilder is the query builder for SQLite databases. @@ -50,7 +50,7 @@ class QueryBuilder extends \yii\db\QueryBuilder * @param mixed $value the value for the primary key of the next new row inserted. If this is not set, * the next new row's primary key will have a value 1. * @return string the SQL statement for resetting sequence - * @throws InvalidCallException if the table does not exist or there is no sequence associated with the table. + * @throws InvalidParamException if the table does not exist or there is no sequence associated with the table. */ public function resetSequence($tableName, $value = null) { @@ -70,9 +70,9 @@ class QueryBuilder extends \yii\db\QueryBuilder } catch (Exception $e) { } } elseif ($table === null) { - throw new InvalidCallException("Table not found: $tableName"); + throw new InvalidParamException("Table not found: $tableName"); } else { - throw new InvalidCallException("There is not sequence associated with table '$tableName'.'"); + throw new InvalidParamException("There is not sequence associated with table '$tableName'.'"); } } diff --git a/framework/util/ArrayHelper.php b/framework/util/ArrayHelper.php index c14121b..0f76b16 100644 --- a/framework/util/ArrayHelper.php +++ b/framework/util/ArrayHelper.php @@ -9,7 +9,7 @@ namespace yii\util; -use yii\base\InvalidCallException; +use yii\base\InvalidParamException; /** * ArrayHelper provides additional array functionality you can use in your @@ -242,7 +242,7 @@ class ArrayHelper * value is for sorting strings in case-insensitive manner. Please refer to * See [PHP manual](http://php.net/manual/en/function.sort.php) for more details. * When sorting by multiple keys with different sort flags, use an array of sort flags. - * @throws InvalidCallException if the $ascending or $sortFlag parameters do not have + * @throws InvalidParamException if the $ascending or $sortFlag parameters do not have * correct number of elements as that of $key. */ public static function multisort(&$array, $key, $ascending = true, $sortFlag = SORT_REGULAR) @@ -255,12 +255,12 @@ class ArrayHelper if (is_scalar($ascending)) { $ascending = array_fill(0, $n, $ascending); } elseif (count($ascending) !== $n) { - throw new InvalidCallException('The length of $ascending parameter must be the same as that of $keys.'); + throw new InvalidParamException('The length of $ascending parameter must be the same as that of $keys.'); } if (is_scalar($sortFlag)) { $sortFlag = array_fill(0, $n, $sortFlag); } elseif (count($sortFlag) !== $n) { - throw new InvalidCallException('The length of $ascending parameter must be the same as that of $keys.'); + throw new InvalidParamException('The length of $ascending parameter must be the same as that of $keys.'); } $args = array(); foreach ($keys as $i => $key) { diff --git a/framework/util/VarDumper.php b/framework/util/VarDumper.php index 7497a03..1316bab 100644 --- a/framework/util/VarDumper.php +++ b/framework/util/VarDumper.php @@ -17,14 +17,15 @@ namespace yii\util; * recursive display of some peculiar variables. * * VarDumper can be used as follows, - *
+ * + * ~~~ * VarDumper::dump($var); - *+ * ~~~ * * @author Qiang Xue