Skip to content

Commit 3630964

Browse files
author
Dominik Schmelz
committed
Add missing @throws in phpDocs
1 parent db4a23e commit 3630964

File tree

23 files changed

+50
-11
lines changed

23 files changed

+50
-11
lines changed

src/Controller/Controller.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,7 @@ public function paginate($object = null, array $settings = [])
881881
*
882882
* @param string $action The action to check.
883883
* @return bool Whether or not the method is accessible from a URL.
884+
* @throws ReflectionException
884885
*/
885886
public function isAction($action)
886887
{

src/Core/ObjectRegistry.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ abstract class ObjectRegistry implements Countable, IteratorAggregate
7070
* @param string $objectName The name/class of the object to load.
7171
* @param array $config Additional settings to use when loading the object.
7272
* @return mixed
73+
* @throws \Exception
7374
*/
7475
public function load($objectName, $config = [])
7576
{
@@ -337,6 +338,7 @@ public function set($objectName, $object)
337338
*
338339
* @param string $objectName The name of the object to remove from the registry.
339340
* @return $this
341+
* @throws \Exception
340342
*/
341343
public function unload($objectName)
342344
{

src/Core/Retry/CommandRetry.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public function __construct(RetryStrategyInterface $strategy, $retries = 1)
5656
*
5757
* @param callable $action The callable action to execute with a retry strategy
5858
* @return mixed The return value of the passed action callable
59+
* @throws Exception
5960
*/
6061
public function run(callable $action)
6162
{

src/Database/Connection.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ public function isConnected()
268268
*
269269
* @param string|\Cake\Database\Query $sql The SQL to convert into a prepared statement.
270270
* @return \Cake\Database\StatementInterface
271+
* @throws Exception
271272
*/
272273
public function prepare($sql)
273274
{
@@ -290,6 +291,7 @@ public function prepare($sql)
290291
* @param array $params list or associative array of params to be interpolated in $query as values
291292
* @param array $types list or associative array of types to be used for casting values in query
292293
* @return \Cake\Database\StatementInterface executed statement
294+
* @throws Exception
293295
*/
294296
public function execute($query, array $params = [], array $types = [])
295297
{
@@ -325,6 +327,7 @@ public function compileQuery(Query $query, ValueBinder $generator)
325327
*
326328
* @param \Cake\Database\Query $query The query to be executed
327329
* @return \Cake\Database\StatementInterface executed statement
330+
* @throws Exception
328331
*/
329332
public function run(Query $query)
330333
{
@@ -342,6 +345,7 @@ public function run(Query $query)
342345
*
343346
* @param string $sql The SQL query to execute.
344347
* @return \Cake\Database\StatementInterface
348+
* @throws Exception
345349
*/
346350
public function query($sql)
347351
{
@@ -421,6 +425,7 @@ public function schemaCollection(SchemaCollection $collection = null)
421425
* @param array $data values to be inserted
422426
* @param array $types list of associative array containing the types to be used for casting
423427
* @return \Cake\Database\StatementInterface
428+
* @throws Exception
424429
*/
425430
public function insert($table, array $data, array $types = [])
426431
{
@@ -442,6 +447,7 @@ public function insert($table, array $data, array $types = [])
442447
* @param array $conditions conditions to be set for update statement
443448
* @param array $types list of associative array containing the types to be used for casting
444449
* @return \Cake\Database\StatementInterface
450+
* @throws Exception
445451
*/
446452
public function update($table, array $data, array $conditions = [], $types = [])
447453
{
@@ -460,6 +466,7 @@ public function update($table, array $data, array $conditions = [], $types = [])
460466
* @param array $conditions conditions to be set for delete statement
461467
* @param array $types list of associative array containing the types to be used for casting
462468
* @return \Cake\Database\StatementInterface
469+
* @throws Exception
463470
*/
464471
public function delete($table, $conditions = [], $types = [])
465472
{
@@ -474,6 +481,7 @@ public function delete($table, $conditions = [], $types = [])
474481
* Starts a new transaction.
475482
*
476483
* @return void
484+
* @throws Exception
477485
*/
478486
public function begin()
479487
{
@@ -676,6 +684,7 @@ public function rollbackSavepoint($name)
676684
* Run driver specific SQL to disable foreign key checks.
677685
*
678686
* @return void
687+
* @throws Exception
679688
*/
680689
public function disableForeignKeys()
681690
{
@@ -688,6 +697,7 @@ public function disableForeignKeys()
688697
* Run driver specific SQL to enable foreign key checks.
689698
*
690699
* @return void
700+
* @throws Exception
691701
*/
692702
public function enableForeignKeys()
693703
{

src/Error/BaseErrorHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ public function handleError($code, $description, $file = null, $line = null, $co
162162
*
163163
* @param \Exception|\Error $exception The exception to handle
164164
* @return void
165+
* @throws Exception
165166
*/
166167
public function wrapAndHandleException($exception)
167168
{
@@ -210,6 +211,7 @@ protected function _stop($code)
210211
* @param string $file File on which error occurred
211212
* @param int $line Line that triggered the error
212213
* @return bool
214+
* @throws Exception
213215
*/
214216
public function handleFatalError($code, $description, $file, $line)
215217
{

src/Error/Middleware/ErrorHandlerMiddleware.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public function __invoke($request, $response, $next)
110110
* @param \Psr\Http\Message\ServerRequestInterface $request The request.
111111
* @param \Psr\Http\Message\ResponseInterface $response The response.
112112
* @return \Psr\Http\Message\ResponseInterface A response
113+
* @throws Exception
113114
*/
114115
public function handleException($exception, $request, $response)
115116
{

src/Http/ControllerFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class ControllerFactory
3030
* @param \Cake\Http\ServerRequest $request The request to build a controller for.
3131
* @param \Cake\Http\Response $response The response to use.
3232
* @return \Cake\Controller\Controller
33+
* @throws \ReflectionException
3334
*/
3435
public function create(ServerRequest $request, Response $response)
3536
{

src/Http/Cookie/CookieCollection.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ public function addToRequest(RequestInterface $request, array $extraCookies = []
248248
* @param string $host The host to match.
249249
* @param string $path The path to match
250250
* @return array An array of cookie name/value pairs
251+
* @throws \Exception
251252
*/
252253
protected function findMatchingCookies($scheme, $host, $path)
253254
{
@@ -334,6 +335,7 @@ protected function setRequestDefaults(array $cookies, $host, $path)
334335
*
335336
* @param array $values List of Set-Cookie Header values.
336337
* @return \Cake\Http\Cookie\Cookie[] An array of cookie objects
338+
* @throws \Exception
337339
*/
338340
protected static function parseSetCookieHeader($values)
339341
{
@@ -396,6 +398,7 @@ protected static function parseSetCookieHeader($values)
396398
* @param string $host The host to check for expired cookies on.
397399
* @param string $path The path to check for expired cookies on.
398400
* @return void
401+
* @throws \Exception
399402
*/
400403
protected function removeExpiredCookies($host, $path)
401404
{

src/I18n/Formatter/IcuFormatter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class IcuFormatter implements FormatterInterface
3333
* @param string|array $message The message to be translated
3434
* @param array $vars The list of values to interpolate in the message
3535
* @return string The formatted message
36+
* @throws CannotFormat
37+
* @throws CannotInstantiateFormatter
3638
*/
3739
public function format($locale, $message, array $vars)
3840
{

src/I18n/I18n.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ public static function setTranslator($name, callable $loader, $locale = null)
195195
* @param string $name The domain of the translation messages.
196196
* @param string|null $locale The locale for the translator.
197197
* @return \Aura\Intl\TranslatorInterface The configured translator.
198+
* @throws \Aura\Intl\Exception
198199
*/
199200
public static function getTranslator($name = 'default', $locale = null)
200201
{

0 commit comments

Comments
 (0)