Browse Source

Fix CS errors and use correct exceptions

Bryan Crowe 11 years ago
parent
commit
e45abe3449

+ 1 - 1
src/Auth/ControllerAuthorize.php

@@ -61,7 +61,7 @@ class ControllerAuthorize extends BaseAuthorize {
  *
  * @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) {

+ 1 - 1
src/Console/ShellDispatcher.php

@@ -94,7 +94,7 @@ class ShellDispatcher {
 			static::$_aliases[$short] = $original;
 		}
 
-		return isset(static::$_aliases[$short]) ?  static::$_aliases[$short] : false;
+		return isset(static::$_aliases[$short]) ? static::$_aliases[$short] : false;
 	}
 
 /**

+ 1 - 1
src/Core/Plugin.php

@@ -251,7 +251,7 @@ class 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'];
 	}

+ 0 - 1
src/Database/Driver.php

@@ -167,7 +167,6 @@ abstract class Driver {
 		return true;
 	}
 
-
 /**
  * Returns a value in a safe representation to be used in a query string
  *

+ 1 - 1
src/I18n/Number.php

@@ -187,7 +187,7 @@ class Number {
 /**
  * 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

+ 1 - 1
src/I18n/Parser/MoFileParser.php

@@ -130,7 +130,7 @@ class MoFileParser {
  * 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) {

+ 2 - 2
src/I18n/PluralRules.php

@@ -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) {

+ 1 - 1
src/Utility/Security.php

@@ -176,7 +176,7 @@ class Security {
  * @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()');

+ 1 - 0
src/Validation/Validation.php

@@ -15,6 +15,7 @@
 namespace Cake\Validation;
 
 use Cake\Utility\String;
+use LogicException;
 use RuntimeException;
 
 /**

+ 1 - 1
src/View/Helper/NumberHelper.php

@@ -202,7 +202,7 @@ class NumberHelper extends Helper {
 /**
  * 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

+ 1 - 0
tests/TestCase/Error/ErrorHandlerTest.php

@@ -58,6 +58,7 @@ class TestErrorHandler extends ErrorHandler {
 	protected function _sendResponse($response) {
 		$this->response = $response;
 	}
+
 }
 
 /**

+ 0 - 1
tests/TestCase/Event/EventManagerTraitTest.php

@@ -64,7 +64,6 @@ class EventManagerTraitTest extends TestCase {
  * @return void
  */
 	public function testDispatchEvent() {
-
 		$event = $this->subject->dispatchEvent('some.event', ['foo' => 'bar']);
 
 		$this->assertInstanceOf('\Cake\Event\Event', $event);

+ 0 - 1
tests/TestCase/ORM/MarshallerTest.php

@@ -233,7 +233,6 @@ class MarshallerTest extends TestCase {
 		$this->assertTrue($result->not_in_schema);
 	}
 
-
 /**
  * test one() with a wrapping model name.
  *

+ 0 - 1
tests/TestCase/Validation/ValidationTest.php

@@ -2464,5 +2464,4 @@ class ValidationTest extends TestCase {
 		$this->assertTrue(Validation::uploadedFile($file, $options), 'Wrong order');
 	}
 
-
 }