Skip to content
Permalink
Browse files

Fixing @throws and use alphabetical order

  • Loading branch information...
jrbasso committed Oct 13, 2012
1 parent 5f73308 commit 1bbb68dd2c51ec79b252274fc846f12ad117e5df
Showing with 96 additions and 92 deletions.
  1. +3 −3 lib/Cake/Cache/Engine/FileEngine.php
  2. +2 −2 lib/Cake/Cache/Engine/MemcacheEngine.php
  3. +1 −1 lib/Cake/Configure/PhpReader.php
  4. +1 −1 lib/Cake/Console/Command/AclShell.php
  5. +1 −1 lib/Cake/Console/Command/Task/FixtureTask.php
  6. +1 −1 lib/Cake/Console/ConsoleInputArgument.php
  7. +1 −1 lib/Cake/Console/ConsoleInputOption.php
  8. +1 −1 lib/Cake/Console/Shell.php
  9. +2 −2 lib/Cake/Console/ShellDispatcher.php
  10. +1 −1 lib/Cake/Console/TaskCollection.php
  11. +1 −1 lib/Cake/Controller/Component/Acl/PhpAcl.php
  12. +1 −1 lib/Cake/Controller/Component/AuthComponent.php
  13. +2 −2 lib/Cake/Controller/Component/PaginatorComponent.php
  14. +1 −1 lib/Cake/Controller/ComponentCollection.php
  15. +3 −3 lib/Cake/Controller/Controller.php
  16. +3 −3 lib/Cake/Core/Plugin.php
  17. +1 −0 lib/Cake/Error/ErrorHandler.php
  18. +1 −1 lib/Cake/Log/Engine/ConsoleLog.php
  19. +2 −2 lib/Cake/Log/LogEngineCollection.php
  20. +3 −2 lib/Cake/Model/AclNode.php
  21. +3 −2 lib/Cake/Model/Behavior/TranslateBehavior.php
  22. +1 −1 lib/Cake/Model/BehaviorCollection.php
  23. +3 −3 lib/Cake/Model/ConnectionManager.php
  24. +1 −1 lib/Cake/Model/Datasource/Database/Mysql.php
  25. +1 −1 lib/Cake/Model/Datasource/Database/Postgres.php
  26. +1 −1 lib/Cake/Model/Datasource/Database/Sqlite.php
  27. +1 −1 lib/Cake/Model/Datasource/Database/Sqlserver.php
  28. +2 −2 lib/Cake/Model/Datasource/DboSource.php
  29. +1 −1 lib/Cake/Model/Datasource/Session.php
  30. +1 −1 lib/Cake/Model/Model.php
  31. +1 −1 lib/Cake/Model/ModelValidator.php
  32. +15 −15 lib/Cake/Network/Email/Email.php
  33. +2 −2 lib/Cake/Network/Http/HttpResponse.php
  34. +5 −5 lib/Cake/Network/Http/HttpSocket.php
  35. +2 −2 lib/Cake/Network/Socket.php
  36. +2 −2 lib/Cake/Routing/Dispatcher.php
  37. +1 −1 lib/Cake/Routing/Filter/AssetDispatcher.php
  38. +1 −1 lib/Cake/Routing/Filter/CacheDispatcher.php
  39. +1 −1 lib/Cake/Routing/RouteCollection.php
  40. +2 −1 lib/Cake/Routing/Router.php
  41. +2 −2 lib/Cake/TestSuite/ControllerTestCase.php
  42. +1 −1 lib/Cake/TestSuite/Fixture/TestFixture.php
  43. +2 −2 lib/Cake/TestSuite/TestSuiteCommand.php
  44. +3 −3 lib/Cake/Utility/Xml.php
  45. +1 −1 lib/Cake/View/Helper/HtmlHelper.php
  46. +1 −1 lib/Cake/View/Helper/JsBaseEngineHelper.php
  47. +1 −1 lib/Cake/View/Helper/NumberHelper.php
  48. +1 −1 lib/Cake/View/Helper/TextHelper.php
  49. +1 −1 lib/Cake/View/Helper/TimeHelper.php
  50. +1 −1 lib/Cake/View/HelperCollection.php
  51. +1 −1 lib/Cake/View/ScaffoldView.php
  52. +2 −2 lib/Cake/View/View.php
@@ -21,8 +21,8 @@
*/
namespace Cake\Cache\Engine;
use Cake\Cache\CacheEngine;
use Cake\Utility\Inflector;
use Cake\Error;
use Cake\Utility\Inflector;
/**
* File Storage engine for cache. Filestorage is the slowest cache storage
@@ -267,7 +267,7 @@ public function clear($check) {
* @param string $key
* @param integer $offset
* @return void
* @throws CacheException
* @throws Cake\Error\CacheException
*/
public function decrement($key, $offset = 1) {
throw new Error\CacheException(__d('cake_dev', 'Files cannot be atomically decremented.'));
@@ -279,7 +279,7 @@ public function decrement($key, $offset = 1) {
* @param string $key
* @param integer $offset
* @return void
* @throws CacheException
* @throws Cake\Error\CacheException
*/
public function increment($key, $offset = 1) {
throw new Error\CacheException(__d('cake_dev', 'Files cannot be atomically incremented.'));
@@ -158,7 +158,7 @@ public function read($key) {
* @param string $key Identifier for the data
* @param integer $offset How much to increment
* @return New incremented value, false otherwise
* @throws CacheException when you try to increment with compress = true
* @throws Cake\Error\CacheException when you try to increment with compress = true
*/
public function increment($key, $offset = 1) {
if ($this->settings['compress']) {
@@ -175,7 +175,7 @@ public function increment($key, $offset = 1) {
* @param string $key Identifier for the data
* @param integer $offset How much to subtract
* @return New decremented value, false otherwise
* @throws CacheException when you try to decrement with compress = true
* @throws Cake\Error\CacheException when you try to decrement with compress = true
*/
public function decrement($key, $offset = 1) {
if ($this->settings['compress']) {
@@ -58,7 +58,7 @@ public function __construct($path = null) {
* @param string $key The identifier to read from. If the key has a . it will be treated
* as a plugin prefix.
* @return array Parsed configuration values.
* @throws ConfigureException when files don't exist or they don't contain `$config`.
* @throws Cake\Error\ConfigureException when files don't exist or they don't contain `$config`.
* Or when files contain '..' as this could lead to abusive reads.
*/
public function read($key) {
@@ -18,9 +18,9 @@
namespace Cake\Console\Command;
use Cake\Console\Shell;
use Cake\Controller\Controller;
use Cake\Controller\ComponentCollection;
use Cake\Controller\Component\AclComponent;
use Cake\Controller\Controller;
use Cake\Core\App;
use Cake\Core\Configure;
use Cake\Utility\Hash;
@@ -13,8 +13,8 @@
*/
namespace Cake\Console\Command\Task;
use Cake\Core\Configure;
use Cake\Console\Shell;
use Cake\Core\Configure;
use Cake\Model\Model;
use Cake\Model\Schema;
use Cake\Utility\Inflector;
@@ -137,7 +137,7 @@ public function isRequired() {
*
* @param string $value
* @return boolean
* @throws ConsoleException
* @throws Cake\Error\ConsoleException
*/
public function validChoice($value) {
if (empty($this->_choices)) {
@@ -182,7 +182,7 @@ public function isBoolean() {
*
* @param string $value
* @return boolean
* @throws ConsoleException
* @throws Cake\Error\ConsoleException
*/
public function validChoice($value) {
if (empty($this->_choices)) {
@@ -22,8 +22,8 @@
use Cake\Core\Object;
use Cake\Core\Plugin;
use Cake\Error;
use Cake\Log\Log;
use Cake\Log\Engine\ConsoleLog;
use Cake\Log\Log;
use Cake\Utility\ClassRegistry;
use Cake\Utility\File;
use Cake\Utility\Inflector;
@@ -173,7 +173,7 @@ public function dispatch() {
* Dispatch a request.
*
* @return boolean
* @throws MissingShellMethodException
* @throws Cake\Error\MissingShellMethodException
*/
protected function _dispatch() {
$shell = $this->shiftArgs();
@@ -225,7 +225,7 @@ protected function _dispatch() {
*
* @param string $shell Optionally the name of a plugin
* @return mixed An object
* @throws MissingShellException when errors are encountered.
* @throws Cake\Error\MissingShellException when errors are encountered.
*/
protected function _getShell($shell) {
list($plugin, $shell) = pluginSplit($shell);
@@ -57,7 +57,7 @@ public function __construct(Shell $Shell) {
* @param string $task Task name to load
* @param array $settings Settings for the task.
* @return Task A task object, Either the existing loaded task or a new one.
* @throws MissingTaskException when the task could not be found
* @throws Cake\Error\MissingTaskException when the task could not be found
*/
public function load($task, $settings = array()) {
list($plugin, $name) = pluginSplit($task, true);
@@ -89,7 +89,7 @@ public function initialize(Component $Component) {
*
* @param array $config configuration array, see docs
* @return void
* @throws Cake\Error\Exception When required keys are missing.
* @throws Cake\Error\AclException When required keys are missing.
*/
public function build(array $config) {
if (empty($config['roles'])) {
@@ -345,7 +345,7 @@ public function startup(Controller $controller) {
*
* @param Controller $controller A reference to the controller object
* @return boolean Returns false
* @throws ForbiddenException
* @throws Cake\Error\ForbiddenException
*/
protected function _unauthorized(Controller $controller) {
if (!$this->unauthorizedRedirect) {
@@ -20,8 +20,8 @@
use Cake\Controller\Component;
use Cake\Controller\ComponentCollection;
use Cake\Model\Model;
use Cake\Error;
use Cake\Model\Model;
use Cake\Utility\Hash;
/**
@@ -122,7 +122,7 @@ public function __construct(ComponentCollection $collection, $settings = array()
* @param array $whitelist List of allowed fields for ordering. This allows you to prevent ordering
* on non-indexed, or undesirable columns.
* @return array Model query results
* @throws MissingModelException
* @throws Cake\Error\MissingModelException
*/
public function paginate($object = null, $scope = array(), $whitelist = array()) {
if (is_array($object)) {
@@ -81,7 +81,7 @@ public function getController() {
* @param string $component Component name to load
* @param array $settings Settings for the component.
* @return Component A component object, Either the existing loaded component or a new one.
* @throws MissingComponentException when the component could not be found
* @throws Cake\Error\MissingComponentException when the component could not be found
*/
public function load($component, $settings = array()) {
if (is_array($settings) && isset($settings['className'])) {
@@ -466,8 +466,8 @@ public function setRequest(Request $request) {
*
* @param Cake\Network\Request $request
* @return mixed The resulting response.
* @throws PrivateActionException When actions are not public or prefixed by _
* @throws MissingActionException When actions are not defined and scaffolding is
* @throws Cake\Error\PrivateActionException When actions are not public or prefixed by _
* @throws Cake\Error\MissingActionException When actions are not defined and scaffolding is
* not enabled.
*/
public function invokeAction(Request $request) {
@@ -716,7 +716,7 @@ public function httpCodes($code = null) {
* @param string $modelClass Name of model class to load
* @param integer|string $id Initial ID the instanced model class should have
* @return mixed true when single model found and instance created, error returned if model not found.
* @throws MissingModelException if the model class cannot be found.
* @throws Cake\Error\MissingModelException if the model class cannot be found.
*/
public function loadModel($modelClass = null, $id = null) {
if ($modelClass === null) {
@@ -67,7 +67,7 @@ class Plugin {
*
* @param string|array $plugin name of the plugin to be loaded in CamelCase format or array or plugins to load
* @param array $config configuration options for the plugin
* @throws MissingPluginException if the folder for the plugin to be loaded is not found
* @throws Cake\Error\MissingPluginException if the folder for the plugin to be loaded is not found
* @return void
*/
public static function load($plugin, $config = array()) {
@@ -139,7 +139,7 @@ public static function loadAll($options = array()) {
*
* @param string $plugin name of the plugin in CamelCase format
* @return string path to the plugin folder
* @throws MissingPluginException if the folder for plugin was not found or plugin has not been loaded
* @throws Cake\Error\MissingPluginException if the folder for plugin was not found or plugin has not been loaded
*/
public static function path($plugin) {
if (empty(static::$_plugins[$plugin])) {
@@ -153,7 +153,7 @@ public static function path($plugin) {
*
* @param string $plugin name of the plugin in CamelCase format
* @return string namespace to the plugin
* @throws MissingPluginException if the namespace for plugin was not found or plugin has not been loaded
* @throws Cake\Error\MissingPluginException if the namespace for plugin was not found or plugin has not been loaded
*/
public static function getNamespace($plugin) {
if (empty(static::$_plugins[$plugin])) {
@@ -105,6 +105,7 @@ class ErrorHandler {
*
* @param \Exception $exception
* @return void
* @throws Exception When renderer class not found
* @see http://php.net/manual/en/function.set-exception-handler.php
*/
public static function handleException(\Exception $exception) {
@@ -14,8 +14,8 @@
namespace Cake\Log\Engine;
use Cake\Console\ConsoleOutput;
use Cake\Utility\Hash;
use Cake\Error;
use Cake\Utility\Hash;
/**
* Console logging. Writes logs to console output.
@@ -14,8 +14,8 @@
namespace Cake\Log;
use Cake\Core\App;
use Cake\Log\LogInterface;
use Cake\Error;
use Cake\Log\LogInterface;
use Cake\Utility\ObjectCollection;
/**
@@ -63,7 +63,7 @@ public function load($name, $options = array()) {
*
* @param array $options The configuration options to load a logger with.
* @return false|LogInterface boolean false on any failures, log adapter interface on success
* @throws Cake\Error\LogException
* @throws Cake\Error\Exception
*/
protected static function _getLogger($options) {
$name = isset($options['engine']) ? $options['engine'] : null;
@@ -18,6 +18,7 @@
namespace Cake\Model;
use Cake\Core\Configure;
use Cake\Error;
use Cake\Utility\ClassRegistry;
use Cake\Utility\Inflector;
@@ -132,7 +133,7 @@ public function node($ref = null) {
$model = ClassRegistry::init(array('class' => $name, 'alias' => $alias));
if (empty($model)) {
throw new CakeException('cake_dev', "Model class '%s' not found in AclNode::node() when trying to bind %s object", $type, $this->alias);
throw new Error\Exception('cake_dev', "Model class '%s' not found in AclNode::node() when trying to bind %s object", $type, $this->alias);
}
$tmpRef = null;
@@ -176,7 +177,7 @@ public function node($ref = null) {
$result = $db->read($this, $queryData, -1);
if (!$result) {
throw new CakeException(__d('cake_dev', "AclNode::node() - Couldn't find %s node identified by \"%s\"", $type, print_r($ref, true)));
throw new Error\Exception(__d('cake_dev', "AclNode::node() - Couldn't find %s node identified by \"%s\"", $type, print_r($ref, true)));
}
}
return $result;
@@ -14,6 +14,7 @@
*/
namespace Cake\Model\Behavior;
use Cake\Core\Configure;
use Cake\Error;
use Cake\I18n\I18n;
use Cake\Model\ConnectionManager;
use Cake\Model\Model;
@@ -548,7 +549,7 @@ public function translateModel(Model $Model) {
* @param boolean $reset Leave true to have the fields only modified for the next operation.
* if false the field will be added for all future queries.
* @return boolean
* @throws CakeException when attempting to bind a translating called name. This is not allowed
* @throws Cake\Error\Exception when attempting to bind a translating called name. This is not allowed
* as it shadows Model::$name.
*/
public function bindTranslation(Model $Model, $fields, $reset = true) {
@@ -568,7 +569,7 @@ public function bindTranslation(Model $Model, $fields, $reset = true) {
$association = $value;
}
if ($association === 'name') {
throw new CakeException(
throw new Error\Exception(
__d('cake_dev', 'You cannot bind a translation named "name".')
);
}
@@ -103,7 +103,7 @@ public function attach($behavior, $config = array()) {
* @param string $behavior CamelCased name of the behavior to load
* @param array $config Behavior configuration parameters
* @return boolean True on success, false on failure
* @throws MissingBehaviorException when a behavior could not be found.
* @throws Cake\Error\MissingBehaviorException when a behavior could not be found.
*/
public function load($behavior, $config = array()) {
if (is_array($config) && isset($config['className'])) {
@@ -81,8 +81,8 @@ protected static function _init() {
*
* @param string $name The name of the DataSource, as defined in app/Config/database.php
* @return DataSource Instance
* @throws MissingDatasourceConfigException
* @throws MissingDatasourceException
* @throws Cake\Error\MissingDatasourceConfigException
* @throws Cake\Error\MissingDatasourceException
*/
public static function getDataSource($name) {
if (empty(static::$_init)) {
@@ -237,7 +237,7 @@ public static function drop($name) {
*
* @param string $name Connection name
* @return void
* @throws MissingDatasourceConfigException
* @throws Cake\Error\MissingDatasourceConfigException
*/
protected static function _getConnectionObject($name) {
if (!empty(static::$config->{$name})) {
@@ -135,7 +135,7 @@ class Mysql extends DboSource {
* Connects to the database using options in the given configuration array.
*
* @return boolean True if the database could be connected, else false
* @throws MissingConnectionException
* @throws Cake\Error\MissingConnectionException
*/
public function connect() {
$config = $this->config;
@@ -99,7 +99,7 @@ class Postgres extends DboSource {
* Connects to the database using options in the given configuration array.
*
* @return boolean True if successfully connected.
* @throws MissingConnectionException
* @throws Cake\Error\MissingConnectionException
*/
public function connect() {
$config = $this->config;
@@ -103,7 +103,7 @@ class Sqlite extends DboSource {
* Connects to the database using config['database'] as a filename.
*
* @return boolean
* @throws MissingConnectionException
* @throws Cake\Error\MissingConnectionException
*/
public function connect() {
$config = $this->config;
@@ -111,7 +111,7 @@ class Sqlserver extends DboSource {
* Connects to the database using options in the given configuration array.
*
* @return boolean True if the database could be connected, else false
* @throws MissingConnectionException
* @throws Cake\Error\MissingConnectionException
*/
public function connect() {
$config = $this->config;
@@ -250,7 +250,7 @@ class DboSource extends DataSource {
*
* @param array $config Array of configuration information for the Datasource.
* @param boolean $autoConnect Whether or not the datasource should automatically connect.
* @throws MissingConnectionException when a connection cannot be made.
* @throws Cake\Error\MissingConnectionException when a connection cannot be made.
*/
public function __construct($config = null, $autoConnect = true) {
if (!isset($config['prefix'])) {
@@ -1185,7 +1185,7 @@ protected function _filterResults(&$results, Model $model, $filtered = array())
* @param integer $recursive Number of levels of association
* @param array $stack
* @return mixed
* @throws CakeException when results cannot be created.
* @throws Cake\Error\Exception when results cannot be created.
*/
public function queryAssociation(Model $model, &$linkModel, $type, $association, $assocData, &$queryData, $external, &$resultSet, $recursive, $stack) {
if (isset($stack['_joined'])) {
Oops, something went wrong.

0 comments on commit 1bbb68d

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