Skip to content
Permalink
Browse files

Added correct generalized @throws as well as specialized @throws

  • Loading branch information...
Dominik Schmelz
Dominik Schmelz committed Apr 24, 2018
1 parent bde6b0a commit c3447246fb6040212f1d167be517ae8ecf4a5b2c
@@ -154,6 +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)
@@ -86,6 +86,7 @@ public function listTables()
* @param array $options The options to use, see above.
* @return \Cake\Database\Schema\TableSchema Object with column metadata.
* @throws \Cake\Database\Exception when table cannot be described.
* @throws \Exception
*/
public function describe($name, array $options = [])
{
@@ -115,6 +116,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)
@@ -184,6 +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)
@@ -704,6 +704,7 @@ public function saveStrategy($strategy = null)
* @param array $options options to be passed to the save method in the target table
* @return bool|\Cake\Datasource\EntityInterface false if $entity could not be saved, otherwise it returns
* the saved entity
* @throws \InvalidArgumentException if the property representing the association in the parent entity cannot be traversed
* @throws \Exception
* @see \Cake\ORM\Table::save()
* @see \Cake\ORM\Association\BelongsToMany::replaceLinks()
@@ -886,6 +887,7 @@ protected function _saveLinks(EntityInterface $sourceEntity, $targetEntities, $o
* 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 \InvalidArgumentException when any of the values in $targetEntities is detected to not be already persisted
* @throws \Exception
*/
public function link(EntityInterface $sourceEntity, array $targetEntities, array $options = [])
@@ -936,6 +938,7 @@ function () use ($sourceEntity, $targetEntities, $options) {
* @param array|bool $options list of options to be passed to the internal `delete` call,
* or a `boolean`
* @return bool Success
* @throws \InvalidArgumentException if non persisted entities are passed or if any of them is lacking a primary key value
* @throws \Exception
*/
public function unlink(EntityInterface $sourceEntity, array $targetEntities, $options = [])
@@ -1190,6 +1193,7 @@ protected function _appendJunctionJoin($query, $conditions)
* when persisting/updating new links, or deleting existing ones
* @return bool success
* @throws \Exception
* @throws \InvalidArgumentException if non persisted entities are passed or if any of them is lacking a primary key value
*/
public function replaceLinks(EntityInterface $sourceEntity, array $targetEntities, array $options = [])
{
@@ -609,6 +609,7 @@ 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
* @return \Cake\Datasource\EntityInterface|bool $node The node after being moved or false on failure
* @throws \Cake\Datasource\Exception\RecordNotFoundException When node was not found
* @throws \Exception
*/
public function moveUp(EntityInterface $node, $number = 1)
@@ -699,6 +700,7 @@ 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
* @return \Cake\Datasource\EntityInterface|bool the entity after being moved or false on failure
* @throws \Cake\Datasource\Exception\RecordNotFoundException When node was not found
* @throws \Exception
*/
public function moveDown(EntityInterface $node, $number = 1)
@@ -853,6 +853,7 @@ public function entityClass($name = null)
* @param array $options The options for the behavior to use.
* @return $this
* @throws \Exception
* @throws \RuntimeException If a behavior is being reloaded.
* @see \Cake\ORM\Behavior
*/
public function addBehavior($name, array $options = [])
@@ -1878,6 +1879,7 @@ public function exists($conditions)
* @param \Cake\Datasource\EntityInterface $entity
* @param array $options
* @return bool|\Cake\Datasource\EntityInterface|mixed
* @throws \Cake\ORM\Exception\RolledbackTransactionException If the transaction is aborted in the afterSave event.
* @throws \Exception
*/
public function save(EntityInterface $entity, $options = [])
@@ -269,6 +269,7 @@ protected function _setupTable($fixture, $db, array $sources, $drop = true)
*
* @param \Cake\TestSuite\TestCase $test The test to inspect for fixture loading.
* @return void
* @throws \Cake\Core\Exception\Exception When fixture records cannot be inserted.
* @throws \Exception
*/
public function load($test)
@@ -49,11 +49,12 @@ public function __construct(View $view)
/**
* Tries to lazy load a helper based on its name, if it cannot be found
* in the application folder, then it tries looking under the current plugin
* if any
* in the application folder, then it tries looking under the current plugin.
* App helpers are searched, and then plugin helpers.
*
* @param string $helper The helper name to be loaded
* @return bool whether the helper could be loaded or not
* @throws \Cake\View\Exception\MissingHelperException When a helper could not be found.
* @throws \Exception
*/
public function __isset($helper)
@@ -136,6 +136,7 @@ public function add(array $widgets)
*
* @param string $name The widget name to get.
* @return \Cake\View\Widget\WidgetInterface widget interface class.
* @throws \RuntimeException when widget is undefined.
* @throws \ReflectionException
*/
public function get($name)
@@ -166,6 +167,7 @@ public function clear()
*
* @param mixed $widget The widget to get
* @return \Cake\View\Widget\WidgetInterface
* @throws \RuntimeException when class cannot be loaded or does not implement WidgetInterface.
* @throws \ReflectionException
*/
protected function _resolveWidget($widget)

0 comments on commit c344724

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