renamed exception classes.

This commit is contained in:
Qiang Xue
2013-01-17 19:55:10 -05:00
parent b51d347465
commit ed8b795295
21 changed files with 92 additions and 111 deletions

View File

@ -9,6 +9,8 @@
namespace yii\util;
use yii\base\InvalidCallException;
/**
* ArrayHelper provides additional array functionality you can use in your
* application.
@ -240,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 \yii\base\BadParamException if the $ascending or $sortFlag parameters do not have
* @throws InvalidCallException 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)
@ -253,12 +255,12 @@ class ArrayHelper
if (is_scalar($ascending)) {
$ascending = array_fill(0, $n, $ascending);
} elseif (count($ascending) !== $n) {
throw new \yii\base\BadParamException('The length of $ascending parameter must be the same as that of $keys.');
throw new InvalidCallException('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 \yii\base\BadParamException('The length of $ascending parameter must be the same as that of $keys.');
throw new InvalidCallException('The length of $ascending parameter must be the same as that of $keys.');
}
$args = array();
foreach ($keys as $i => $key) {