Skip to content

Commit

Permalink
Fix all phpDocs @throws FQN
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Schmelz committed Apr 16, 2018
1 parent d52144c commit 86194c5
Show file tree
Hide file tree
Showing 44 changed files with 99 additions and 54 deletions.
2 changes: 1 addition & 1 deletion src/Cache/Cache.php
Expand Up @@ -154,7 +154,7 @@ public static function registry(ObjectRegistry $registry = null)
*
* @param string $name Name of the config array that needs an engine instance built
* @return void
* @throws \InvalidArgumentException When a cache engine cannot be created.
* @throws \Exception
*/
protected static function _buildEngine($name)
{
Expand Down
1 change: 1 addition & 0 deletions src/Console/ConsoleIo.php
Expand Up @@ -512,6 +512,7 @@ public function setLoggers($enable)
* @param string $name The name of the helper to render
* @param array $settings Configuration data for the helper.
* @return \Cake\Console\Helper The created helper instance.
* @throws \Exception
*/
public function helper($name, array $settings = [])
{
Expand Down
1 change: 1 addition & 0 deletions src/Console/Shell.php
Expand Up @@ -603,6 +603,7 @@ public function getOptionParser()
*
* @param string $name The task to get.
* @return \Cake\Console\Shell Object of Task
* @throws \Exception
*/
public function __get($name)
{
Expand Down
1 change: 1 addition & 0 deletions src/Controller/Component.php
Expand Up @@ -162,6 +162,7 @@ public function initialize(array $config)
*
* @param string $name Name of component to get.
* @return mixed A Component object or null.
* @throws \Exception
*/
public function __get($name)
{
Expand Down
1 change: 1 addition & 0 deletions src/Controller/Component/AuthComponent.php
Expand Up @@ -285,6 +285,7 @@ public function startup(Event $event)
*
* @param \Cake\Event\Event $event Event instance.
* @return \Cake\Http\Response|null
* @throws \ReflectionException
*/
public function authCheck(Event $event)
{
Expand Down
1 change: 1 addition & 0 deletions src/Controller/Component/CsrfComponent.php
Expand Up @@ -127,6 +127,7 @@ public function implementedEvents()
* @param \Cake\Http\ServerRequest $request The request object.
* @param \Cake\Http\Response $response The response object.
* @return array An array of the modified request, response.
* @throws \Exception
*/
protected function _setCookie(ServerRequest $request, Response $response)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Controller/Controller.php
Expand Up @@ -323,6 +323,7 @@ public function components($components = null)
* @param string $name The name of the component to load.
* @param array $config The config for the component.
* @return \Cake\Controller\Component
* @throws \Exception
*/
public function loadComponent($name, array $config = [])
{
Expand Down Expand Up @@ -571,8 +572,7 @@ public function setResponse(Response $response)
* exists and isn't private.
*
* @return mixed The resulting response.
* @throws \LogicException When request is not set.
* @throws \Cake\Controller\Exception\MissingActionException When actions are not defined or inaccessible.
* @throws \ReflectionException
*/
public function invokeAction()
{
Expand Down Expand Up @@ -881,7 +881,7 @@ public function paginate($object = null, array $settings = [])
*
* @param string $action The action to check.
* @return bool Whether or not the method is accessible from a URL.
* @throws ReflectionException
* @throws \ReflectionException
*/
public function isAction($action)
{
Expand Down
3 changes: 3 additions & 0 deletions src/Core/ObjectRegistry.php
Expand Up @@ -256,6 +256,7 @@ public function __set($name, $object)
*
* @param string $name Name of a property to unset.
* @return void
* @throws \Exception
*/
public function __unset($name)
{
Expand Down Expand Up @@ -295,6 +296,7 @@ public function normalizeArray($objects)
* If the registry subclass has an event manager, the objects will be detached from events as well.
*
* @return $this
* @throws \Exception
*/
public function reset()
{
Expand All @@ -314,6 +316,7 @@ public function reset()
* @param string $objectName The name of the object to set in the registry.
* @param object $object instance to store in the registry
* @return $this
* @throws \Exception
*/
public function set($objectName, $object)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Retry/CommandRetry.php
Expand Up @@ -56,7 +56,7 @@ public function __construct(RetryStrategyInterface $strategy, $retries = 1)
*
* @param callable $action The callable action to execute with a retry strategy
* @return mixed The return value of the passed action callable
* @throws Exception
* @throws \Exception
*/
public function run(callable $action)
{
Expand Down
25 changes: 15 additions & 10 deletions src/Database/Connection.php
Expand Up @@ -268,7 +268,7 @@ public function isConnected()
*
* @param string|\Cake\Database\Query $sql The SQL to convert into a prepared statement.
* @return \Cake\Database\StatementInterface
* @throws Exception
* @throws \Exception
*/
public function prepare($sql)
{
Expand All @@ -291,7 +291,7 @@ public function prepare($sql)
* @param array $params list or associative array of params to be interpolated in $query as values
* @param array $types list or associative array of types to be used for casting values in query
* @return \Cake\Database\StatementInterface executed statement
* @throws Exception
* @throws \Exception
*/
public function execute($query, array $params = [], array $types = [])
{
Expand Down Expand Up @@ -327,7 +327,7 @@ public function compileQuery(Query $query, ValueBinder $generator)
*
* @param \Cake\Database\Query $query The query to be executed
* @return \Cake\Database\StatementInterface executed statement
* @throws Exception
* @throws \Exception
*/
public function run(Query $query)
{
Expand All @@ -345,7 +345,7 @@ public function run(Query $query)
*
* @param string $sql The SQL query to execute.
* @return \Cake\Database\StatementInterface
* @throws Exception
* @throws \Exception
*/
public function query($sql)
{
Expand Down Expand Up @@ -425,7 +425,7 @@ public function schemaCollection(SchemaCollection $collection = null)
* @param array $data values to be inserted
* @param array $types list of associative array containing the types to be used for casting
* @return \Cake\Database\StatementInterface
* @throws Exception
* @throws \Exception
*/
public function insert($table, array $data, array $types = [])
{
Expand All @@ -447,7 +447,7 @@ public function insert($table, array $data, array $types = [])
* @param array $conditions conditions to be set for update statement
* @param array $types list of associative array containing the types to be used for casting
* @return \Cake\Database\StatementInterface
* @throws Exception
* @throws \Exception
*/
public function update($table, array $data, array $conditions = [], $types = [])
{
Expand All @@ -466,7 +466,7 @@ public function update($table, array $data, array $conditions = [], $types = [])
* @param array $conditions conditions to be set for delete statement
* @param array $types list of associative array containing the types to be used for casting
* @return \Cake\Database\StatementInterface
* @throws Exception
* @throws \Exception
*/
public function delete($table, $conditions = [], $types = [])
{
Expand All @@ -481,7 +481,7 @@ public function delete($table, $conditions = [], $types = [])
* Starts a new transaction.
*
* @return void
* @throws Exception
* @throws \Exception
*/
public function begin()
{
Expand Down Expand Up @@ -511,6 +511,7 @@ public function begin()
* Commits current transaction.
*
* @return bool true on success, false otherwise
* @throws \Exception
*/
public function commit()
{
Expand Down Expand Up @@ -548,6 +549,7 @@ public function commit()
* @param bool|null $toBeginning Whether or not the transaction should be rolled back to the
* beginning of it. Defaults to false if using savepoints, or true if not.
* @return bool
* @throws \Exception
*/
public function rollback($toBeginning = null)
{
Expand Down Expand Up @@ -652,6 +654,7 @@ public function useSavePoints($enable = null)
*
* @param string $name The save point name.
* @return void
* @throws \Exception
*/
public function createSavePoint($name)
{
Expand All @@ -663,6 +666,7 @@ public function createSavePoint($name)
*
* @param string $name The save point name.
* @return void
* @throws \Exception
*/
public function releaseSavePoint($name)
{
Expand All @@ -674,6 +678,7 @@ public function releaseSavePoint($name)
*
* @param string $name The save point name.
* @return void
* @throws \Exception
*/
public function rollbackSavepoint($name)
{
Expand All @@ -684,7 +689,7 @@ public function rollbackSavepoint($name)
* Run driver specific SQL to disable foreign key checks.
*
* @return void
* @throws Exception
* @throws \Exception
*/
public function disableForeignKeys()
{
Expand All @@ -697,7 +702,7 @@ public function disableForeignKeys()
* Run driver specific SQL to enable foreign key checks.
*
* @return void
* @throws Exception
* @throws \Exception
*/
public function enableForeignKeys()
{
Expand Down
3 changes: 2 additions & 1 deletion src/Database/Query.php
Expand Up @@ -213,6 +213,7 @@ public function connection($connection = null)
* around query execution.
*
* @return \Cake\Database\StatementInterface
* @throws \Exception
*/
public function execute()
{
Expand Down Expand Up @@ -1857,7 +1858,7 @@ public function getIterator()
*
* @param string $name name of the clause to be returned
* @return mixed
* @throws InvalidArgumentException When the named clause does not exist.
* @throws \InvalidArgumentException When the named clause does not exist.
*/
public function clause($name)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Database/Schema/Collection.php
Expand Up @@ -56,6 +56,7 @@ public function __construct(Connection $connection)
* Get the list of tables available in the current connection.
*
* @return array The list of tables in the connected database/schema.
* @throws \Exception
*/
public function listTables()
{
Expand Down Expand Up @@ -114,7 +115,7 @@ public function describe($name, array $options = [])
* @param array $config The config data.
* @param \Cake\Database\Schema\TableSchema $schema The table instance
* @return void
* @throws \Cake\Database\Exception on query failure.
* @throws \Exception
*/
protected function _reflect($stage, $name, $config, $schema)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Datasource/ConnectionManager.php
Expand Up @@ -184,8 +184,7 @@ public static function dropAlias($name)
* @param string $name The connection name.
* @param bool $useAliases Set to false to not use aliased connections.
* @return \Cake\Datasource\ConnectionInterface A connection object.
* @throws \Cake\Datasource\Exception\MissingDatasourceConfigException When config
* data is missing.
* @throws \Exception
*/
public static function get($name, $useAliases = true)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Datasource/FactoryLocator.php
Expand Up @@ -57,7 +57,7 @@ public static function drop($type)
* Get the factory for the specified repository type.
*
* @param string $type The repository type to get the factory for.
* @throws InvalidArgumentException If the specified repository type has no factory.
* @throws \InvalidArgumentException If the specified repository type has no factory.
* @return callable The factory for the repository type.
*/
public static function get($type)
Expand Down
5 changes: 3 additions & 2 deletions src/Error/BaseErrorHandler.php
Expand Up @@ -122,6 +122,7 @@ public function register()
* @param int|null $line Line that triggered the error
* @param array|null $context Context
* @return bool True if error was handled
* @throws \Exception
*/
public function handleError($code, $description, $file = null, $line = null, $context = null)
{
Expand Down Expand Up @@ -162,7 +163,7 @@ public function handleError($code, $description, $file = null, $line = null, $co
*
* @param \Exception|\Error $exception The exception to handle
* @return void
* @throws Exception
* @throws \Exception
*/
public function wrapAndHandleException($exception)
{
Expand Down Expand Up @@ -211,7 +212,7 @@ protected function _stop($code)
* @param string $file File on which error occurred
* @param int $line Line that triggered the error
* @return bool
* @throws Exception
* @throws \Exception
*/
public function handleFatalError($code, $description, $file, $line)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Error/Middleware/ErrorHandlerMiddleware.php
Expand Up @@ -91,6 +91,7 @@ public function __construct($exceptionRenderer = null, array $config = [])
* @param \Psr\Http\Message\ResponseInterface $response The response.
* @param callable $next Callback to invoke the next middleware.
* @return \Psr\Http\Message\ResponseInterface A response
* @throws \Exception
*/
public function __invoke($request, $response, $next)
{
Expand All @@ -110,7 +111,7 @@ public function __invoke($request, $response, $next)
* @param \Psr\Http\Message\ServerRequestInterface $request The request.
* @param \Psr\Http\Message\ResponseInterface $response The response.
* @return \Psr\Http\Message\ResponseInterface A response
* @throws Exception
* @throws \Exception
*/
public function handleException($exception, $request, $response)
{
Expand Down
1 change: 1 addition & 0 deletions src/Http/ActionDispatcher.php
Expand Up @@ -69,6 +69,7 @@ public function __construct($factory = null, $eventManager = null, array $filter
* @param \Cake\Http\ServerRequest $request The request to dispatch.
* @param \Cake\Http\Response $response The response to dispatch.
* @return \Cake\Http\Response A modified/replaced response.
* @throws \ReflectionException
*/
public function dispatch(ServerRequest $request, Response $response)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Client/Auth/Oauth.php
Expand Up @@ -164,7 +164,7 @@ protected function _hmacSha1($request, $credentials)
* @param array $credentials Authentication credentials.
* @return string
*
* @throws \RuntimeException
* @throws \Exception
*/
protected function _rsaSha1($request, $credentials)
{
Expand Down
2 changes: 2 additions & 0 deletions src/Http/Client/CookieCollection.php
Expand Up @@ -46,6 +46,7 @@ public function __construct(array $cookies = [])
* @param Response $response The response to read cookies from
* @param string $url The request URL used for default host/path values.
* @return void
* @throws \Exception
*/
public function store(Response $response, $url)
{
Expand All @@ -70,6 +71,7 @@ public function store(Response $response, $url)
*
* @param string $url The URL to find cookies for.
* @return array
* @throws \Exception
*/
public function get($url)
{
Expand Down
3 changes: 3 additions & 0 deletions src/Http/Cookie/CookieCollection.php
Expand Up @@ -57,6 +57,7 @@ public function __construct(array $cookies = [])
*
* @param array $header The array of set-cookie header values.
* @return static
* @throws \Exception
*/
public static function createFromHeader(array $header)
{
Expand Down Expand Up @@ -211,6 +212,7 @@ public function getIterator()
* @param array $extraCookies Associative array of additional cookies to add into the request. This
* is useful when you have cookie data from outside the collection you want to send.
* @return \Psr\Http\Message\RequestInterface An updated request.
* @throws \Exception
*/
public function addToRequest(RequestInterface $request, array $extraCookies = [])
{
Expand Down Expand Up @@ -288,6 +290,7 @@ protected function findMatchingCookies($scheme, $host, $path)
* @param \Psr\Http\Message\ResponseInterface $response Response to extract cookies from.
* @param \Psr\Http\Message\RequestInterface $request Request to get cookie context from.
* @return static
* @throws \Exception
*/
public function addFromResponse(ResponseInterface $response, RequestInterface $request)
{
Expand Down
1 change: 1 addition & 0 deletions src/Http/Middleware/CsrfProtectionMiddleware.php
Expand Up @@ -130,6 +130,7 @@ protected function _validateAndUnsetTokenField(ServerRequest $request)
* Create a new token to be used for CSRF protection
*
* @return string
* @throws \Exception
*/
protected function _createToken()
{
Expand Down

0 comments on commit 86194c5

Please sign in to comment.