Skip to content
Permalink
Browse files

Add missing @throws in phpDocs

  • Loading branch information...
Dominik Schmelz
Dominik Schmelz committed Apr 16, 2018
1 parent db4a23e commit 3630964f96b8daf9f1bfa730564b4a10c9a5f7f4
@@ -881,6 +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
*/
public function isAction($action)
{
@@ -70,6 +70,7 @@ abstract class ObjectRegistry implements Countable, IteratorAggregate
* @param string $objectName The name/class of the object to load.
* @param array $config Additional settings to use when loading the object.
* @return mixed
* @throws \Exception
*/
public function load($objectName, $config = [])
{
@@ -337,6 +338,7 @@ public function set($objectName, $object)
*
* @param string $objectName The name of the object to remove from the registry.
* @return $this
* @throws \Exception
*/
public function unload($objectName)
{
@@ -56,6 +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
*/
public function run(callable $action)
{
@@ -268,6 +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
*/
public function prepare($sql)
{
@@ -290,6 +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
*/
public function execute($query, array $params = [], array $types = [])
{
@@ -325,6 +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
*/
public function run(Query $query)
{
@@ -342,6 +345,7 @@ public function run(Query $query)
*
* @param string $sql The SQL query to execute.
* @return \Cake\Database\StatementInterface
* @throws Exception
*/
public function query($sql)
{
@@ -421,6 +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
*/
public function insert($table, array $data, array $types = [])
{
@@ -442,6 +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
*/
public function update($table, array $data, array $conditions = [], $types = [])
{
@@ -460,6 +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
*/
public function delete($table, $conditions = [], $types = [])
{
@@ -474,6 +481,7 @@ public function delete($table, $conditions = [], $types = [])
* Starts a new transaction.
*
* @return void
* @throws Exception
*/
public function begin()
{
@@ -676,6 +684,7 @@ public function rollbackSavepoint($name)
* Run driver specific SQL to disable foreign key checks.
*
* @return void
* @throws Exception
*/
public function disableForeignKeys()
{
@@ -688,6 +697,7 @@ public function disableForeignKeys()
* Run driver specific SQL to enable foreign key checks.
*
* @return void
* @throws Exception
*/
public function enableForeignKeys()
{
@@ -162,6 +162,7 @@ public function handleError($code, $description, $file = null, $line = null, $co
*
* @param \Exception|\Error $exception The exception to handle
* @return void
* @throws Exception
*/
public function wrapAndHandleException($exception)
{
@@ -210,6 +211,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
*/
public function handleFatalError($code, $description, $file, $line)
{
@@ -110,6 +110,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
*/
public function handleException($exception, $request, $response)
{
@@ -30,6 +30,7 @@ class ControllerFactory
* @param \Cake\Http\ServerRequest $request The request to build a controller for.
* @param \Cake\Http\Response $response The response to use.
* @return \Cake\Controller\Controller
* @throws \ReflectionException
*/
public function create(ServerRequest $request, Response $response)
{
@@ -248,6 +248,7 @@ public function addToRequest(RequestInterface $request, array $extraCookies = []
* @param string $host The host to match.
* @param string $path The path to match
* @return array An array of cookie name/value pairs
* @throws \Exception
*/
protected function findMatchingCookies($scheme, $host, $path)
{
@@ -334,6 +335,7 @@ protected function setRequestDefaults(array $cookies, $host, $path)
*
* @param array $values List of Set-Cookie Header values.
* @return \Cake\Http\Cookie\Cookie[] An array of cookie objects
* @throws \Exception
*/
protected static function parseSetCookieHeader($values)
{
@@ -396,6 +398,7 @@ protected static function parseSetCookieHeader($values)
* @param string $host The host to check for expired cookies on.
* @param string $path The path to check for expired cookies on.
* @return void
* @throws \Exception
*/
protected function removeExpiredCookies($host, $path)
{
@@ -33,6 +33,8 @@ class IcuFormatter implements FormatterInterface
* @param string|array $message The message to be translated
* @param array $vars The list of values to interpolate in the message
* @return string The formatted message
* @throws CannotFormat
* @throws CannotInstantiateFormatter
*/
public function format($locale, $message, array $vars)
{
@@ -195,6 +195,7 @@ public static function setTranslator($name, callable $loader, $locale = null)
* @param string $name The domain of the translation messages.
* @param string|null $locale The locale for the translator.
* @return \Aura\Intl\TranslatorInterface The configured translator.
* @throws \Aura\Intl\Exception
*/
public static function getTranslator($name = 'default', $locale = null)
{
@@ -2895,6 +2895,7 @@ public function createFromArray($config)
* Serializes the Email object.
*
* @return string
* @throws Exception
*/
public function serialize()
{
@@ -886,9 +886,8 @@ protected function _saveLinks(EntityInterface $sourceEntity, $targetEntities, $o
* @param array $targetEntities list of entities belonging to the `target` side
* of this association
* @param array $options list of options to be passed to the internal `save` call
* @throws \InvalidArgumentException when any of the values in $targetEntities is
* detected to not be already persisted
* @return bool true on success, false otherwise
* @throws \Exception
*/
public function link(EntityInterface $sourceEntity, array $targetEntities, array $options = [])
{
@@ -937,9 +936,8 @@ function () use ($sourceEntity, $targetEntities, $options) {
* this association
* @param array|bool $options list of options to be passed to the internal `delete` call,
* or a `boolean`
* @throws \InvalidArgumentException if non persisted entities are passed or if
* any of them is lacking a primary key value
* @return bool Success
* @throws \Exception
*/
public function unlink(EntityInterface $sourceEntity, array $targetEntities, $options = [])
{
@@ -1191,9 +1189,8 @@ protected function _appendJunctionJoin($query, $conditions)
* @param array $targetEntities list of entities from the target table to be linked
* @param array $options list of options to be passed to the internal `save`/`delete` calls
* when persisting/updating new links, or deleting existing ones
* @throws \InvalidArgumentException if non persisted entities are passed or if
* any of them is lacking a primary key value
* @return bool success
* @throws \Exception
*/
public function replaceLinks(EntityInterface $sourceEntity, array $targetEntities, array $options = [])
{
@@ -282,6 +282,7 @@ protected function _saveTarget(array $foreignKeyReference, EntityInterface $pare
* of this association
* @param array $options list of options to be passed to the internal `save` call
* @return bool true on success, false otherwise
* @throws \Exception
*/
public function link(EntityInterface $sourceEntity, array $targetEntities, array $options = [])
{
@@ -365,6 +365,7 @@ public function implementedMethods()
* declared on Cake\ORM\Behavior
*
* @return array
* @throws \ReflectionException
*/
protected function _reflectionCache()
{
@@ -548,6 +548,7 @@ public function formatTreeList(Query $query, array $options = [])
* @param \Cake\Datasource\EntityInterface $node The node to remove from the tree
* @return \Cake\Datasource\EntityInterface|false the node after being removed from the tree or
* false on error
* @throws \Exception
*/
public function removeFromTree(EntityInterface $node)
{
@@ -607,8 +608,8 @@ protected function _removeFromTree($node)
*
* @param \Cake\Datasource\EntityInterface $node The node to move
* @param int|bool $number How many places to move the node, or true to move to first position
* @throws \Cake\Datasource\Exception\RecordNotFoundException When node was not found
* @return \Cake\Datasource\EntityInterface|bool $node The node after being moved or false on failure
* @throws \Exception
*/
public function moveUp(EntityInterface $node, $number = 1)
{
@@ -697,8 +698,8 @@ protected function _moveUp($node, $number)
*
* @param \Cake\Datasource\EntityInterface $node The node to move
* @param int|bool $number How many places to move the node or true to move to last position
* @throws \Cake\Datasource\Exception\RecordNotFoundException When node was not found
* @return \Cake\Datasource\EntityInterface|bool the entity after being moved or false on failure
* @throws \Exception
*/
public function moveDown(EntityInterface $node, $number = 1)
{
@@ -813,6 +814,7 @@ protected function _getNode($id)
* parent column.
*
* @return void
* @throws \Exception
*/
public function recover()
{
@@ -1616,6 +1616,7 @@ public function get($primaryKey, $options = [])
* @param callable $worker The worker that will run inside the transaction.
* @param bool $atomic Whether to execute the worker inside a database transaction.
* @return mixed
* @throws \Exception
*/
protected function _executeTransaction(callable $worker, $atomic = true)
{
@@ -2192,6 +2193,7 @@ protected function _update($entity, $data)
* @param \Cake\Datasource\EntityInterface[]|\Cake\ORM\ResultSet $entities Entities to save.
* @param array|\ArrayAccess $options Options used when calling Table::save() for each entity.
* @return bool|\Cake\Datasource\EntityInterface[]|\Cake\ORM\ResultSet False on failure, entities list on success.
* @throws \Exception
*/
public function saveMany($entities, $options = [])
{
@@ -165,6 +165,7 @@ public function commands()
*
* @param string $commandName The command you want subcommands from.
* @return array
* @throws \ReflectionException
*/
public function subCommands($commandName)
{
@@ -363,6 +363,7 @@ public function load($test)
* @param array $fixtures A list of fixtures to operate on.
* @param callable $operation The operation to run on each connection + fixture set.
* @return void
* @throws \Exception
*/
protected function _runOperation($fixtures, $operation)
{
@@ -368,6 +368,7 @@ public function cookieEncrypted($name, $value, $encrypt = 'aes', $key = null)
*
* @param string|array $url The URL to request.
* @return void
* @throws PhpunitException
*/
public function get($url)
{
@@ -384,6 +385,7 @@ public function get($url)
* @param string|array $url The URL to request.
* @param array $data The data for the request.
* @return void
* @throws PhpunitException
*/
public function post($url, $data = [])
{
@@ -400,6 +402,7 @@ public function post($url, $data = [])
* @param string|array $url The URL to request.
* @param array $data The data for the request.
* @return void
* @throws PhpunitException
*/
public function patch($url, $data = [])
{
@@ -416,6 +419,7 @@ public function patch($url, $data = [])
* @param string|array $url The URL to request.
* @param array $data The data for the request.
* @return void
* @throws PhpunitException
*/
public function put($url, $data = [])
{
@@ -431,6 +435,7 @@ public function put($url, $data = [])
*
* @param string|array $url The URL to request.
* @return void
* @throws PhpunitException
*/
public function delete($url)
{
@@ -446,6 +451,7 @@ public function delete($url)
*
* @param string|array $url The URL to request.
* @return void
* @throws PhpunitException
*/
public function head($url)
{
@@ -461,6 +467,7 @@ public function head($url)
*
* @param string|array $url The URL to request.
* @return void
* @throws PhpunitException
*/
public function options($url)
{
@@ -476,7 +483,7 @@ public function options($url)
* @param string $method The HTTP method
* @param array|null $data The request data.
* @return void
* @throws \Exception
* @throws PhpunitException
*/
protected function _sendRequest($url, $method, $data = [])
{
@@ -106,6 +106,7 @@ public static function setHash($hash)
*
* @param int $length The number of bytes you want.
* @return string Random bytes in binary.
* @throws \Exception
*/
public static function randomBytes($length)
{
@@ -41,6 +41,7 @@ class RulesProvider
* Constructor, sets the default class to use for calling methods
*
* @param string|object $class the default class to proxy
* @throws \ReflectionException
*/
public function __construct($class = Validation::class)
{
@@ -350,6 +350,7 @@ public function gmt($string = null)
* @param bool|string $invalid Default value to display on invalid dates
* @param string|\DateTimeZone|null $timezone User's timezone string or DateTimeZone object
* @return string Formatted and translated date string
* @throws Exception
* @see \Cake\I18n\Time::i18nFormat()
*/
public function format($date, $format = null, $invalid = false, $timezone = null)
Oops, something went wrong.

0 comments on commit 3630964

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