Skip to content
Permalink
Browse files

Fix CS errors and use correct exceptions

  • Loading branch information...
bcrowe committed Sep 19, 2014
1 parent 0ad4219 commit e45abe3449c24043b9ab888d2a4b0a29aef94996
@@ -61,7 +61,7 @@ public function __construct(ComponentRegistry $registry, array $config = array()
*
* @param Controller $controller null to get, a controller to set.
* @return \Cake\Controller\Controller
* @throws \Cake\Error\Exception If controller does not have method `isAuthorized()`.
* @throws \Cake\Core\Exception\Exception If controller does not have method `isAuthorized()`.
*/
public function controller(Controller $controller = null) {
if ($controller) {
@@ -94,7 +94,7 @@ public static function alias($short, $original = null) {
static::$_aliases[$short] = $original;
}
return isset(static::$_aliases[$short]) ? static::$_aliases[$short] : false;
return isset(static::$_aliases[$short]) ? static::$_aliases[$short] : false;
}
/**
@@ -251,7 +251,7 @@ public static function classPath($plugin) {
*/
public static function configPath($plugin) {
if (empty(static::$_plugins[$plugin])) {
throw new Error\MissingPluginException(['plugin' => $plugin]);
throw new Exception\MissingPluginException(['plugin' => $plugin]);
}
return static::$_plugins[$plugin]['configPath'];
}
@@ -167,7 +167,6 @@ public function supportsSavePoints() {
return true;
}
/**
* Returns a value in a safe representation to be used in a query string
*
@@ -187,7 +187,7 @@ public static function currency($value, $currency = null, array $options = array
/**
* Getter/setter for default currency
*
* @param string|boolean $currency Default currency string to be used by currency()
* @param string|bool $currency Default currency string to be used by currency()
* if $currency argument is not provided. If boolean false is passed, it will clear the
* currently stored value
* @return string Currency
@@ -130,7 +130,7 @@ public function parse($resource) {
* Reads an unsigned long from stream respecting endianess.
*
* @param resource $stream The File being read.
* @param boolean $isBigEndian Whether or not the current platfomr is Big Endian
* @param bool $isBigEndian Whether or not the current platfomr is Big Endian
* @return int
*/
protected function _readLong($stream, $isBigEndian) {
@@ -129,8 +129,8 @@ class PluralRules {
* to the countable provided in $n.
*
* @param string $locale The locale to get the rule calculated for.
* @param integer|float $n The number to apply the rules to.
* @return integer The plural rule number that should be used.
* @param int|float $n The number to apply the rules to.
* @return int The plural rule number that should be used.
* @link http://localization-guide.readthedocs.org/en/latest/l10n/pluralforms.html
*/
public static function calculate($locale, $n) {
@@ -176,7 +176,7 @@ protected static function _checkKey($key, $method) {
* @param string $key The 256 bit/32 byte key to use as a cipher key.
* @param string $hmacSalt The salt to use for the HMAC process. Leave null to use Security.salt.
* @return string Decrypted data. Any trailing null bytes will be removed.
* @throws \Cake\Core\Exception\Exception On invalid data or key.
* @throws InvalidArgumentException On invalid data or key.
*/
public static function decrypt($cipher, $key, $hmacSalt = null) {
self::_checkKey($key, 'decrypt()');
@@ -15,6 +15,7 @@
namespace Cake\Validation;
use Cake\Utility\String;
use LogicException;
use RuntimeException;
/**
@@ -202,7 +202,7 @@ public function formatDelta($value, array $options = array()) {
/**
* Getter/setter for default currency
*
* @param string|boolean $currency Default currency string to be used by currency()
* @param string|bool $currency Default currency string to be used by currency()
* if $currency argument is not provided. If boolean false is passed, it will clear the
* currently stored value
* @return string Currency
@@ -58,6 +58,7 @@ protected function _clearOutput() {
protected function _sendResponse($response) {
$this->response = $response;
}
}
/**
@@ -64,7 +64,6 @@ public function testSettingEventManager() {
* @return void
*/
public function testDispatchEvent() {
$event = $this->subject->dispatchEvent('some.event', ['foo' => 'bar']);
$this->assertInstanceOf('\Cake\Event\Event', $event);
@@ -233,7 +233,6 @@ public function testOneAccessibleFieldsOption() {
$this->assertTrue($result->not_in_schema);
}
/**
* test one() with a wrapping model name.
*
@@ -2464,5 +2464,4 @@ public function testUploadedFileWithDifferentFileParametersOrder() {
$this->assertTrue(Validation::uploadedFile($file, $options), 'Wrong order');
}
}

0 comments on commit e45abe3

Please sign in to comment.
You can’t perform that action at this time.