Permalink
Browse files

Included @throws in API that was missing.

  • Loading branch information...
1 parent 9bc3e56 commit fedadc091c04424399301af14929223047f24e65 @jrbasso jrbasso committed Jul 31, 2011
View
@@ -145,7 +145,8 @@ public static function config($name = null, $settings = array()) {
* Finds and builds the instance of the required engine class.
*
* @param string $name Name of the config array that needs an engine instance built
- * @return void
+ * @return boolean
+ * @throws CacheException
*/
protected static function _buildEngine($name) {
$config = self::$_config[$name];
@@ -85,6 +85,7 @@ public function __construct($path, $section = null) {
* @param string $file Name of the file to read. The chosen file
* must be on the reader's path.
* @return array
+ * @throws ConfigureException
*/
public function read($file) {
$filename = $this->_path . $file;
@@ -165,6 +165,7 @@ public function getOptionParser() {
* Initialization method installs PHPUnit and loads all plugins
*
* @return void
+ * @throws Exception
*/
public function initialize() {
$this->_dispatcher = new CakeTestSuiteDispatcher();
@@ -442,8 +442,7 @@ public function subcommands() {
* @param string $command The subcommand to use. If this parameter is a subcommand, that has a parser,
* That parser will be used to parse $argv instead.
* @return Array array($params, $args)
- * @throws InvalidArgumentException When an invalid parameter is encountered.
- * RuntimeException when required arguments are not supplied.
+ * @throws ConsoleException When an invalid parameter is encountered.
*/
public function parse($argv, $command = null) {
if (isset($this->_subcommands[$command]) && $this->_subcommands[$command]->parser()) {
@@ -555,6 +554,7 @@ protected function _parseShortOption($option, $params) {
* @param string $name The name to parse.
* @param array $params The params to append the parsed value into
* @return array Params with $option added in.
+ * @throws ConsoleException
*/
protected function _parseOption($name, $params) {
if (!isset($this->_options[$name])) {
@@ -584,6 +584,7 @@ protected function _parseOption($name, $params) {
* @param string $argument The argument to append
* @param array $args The array of parsed args to append to.
* @return array Args
+ * @throws ConsoleException
*/
protected function _parseArg($argument, $args) {
if (empty($this->_args)) {
@@ -96,6 +96,7 @@ protected function _initConstants() {
* Defines current working environment.
*
* @return void
+ * @throws CakeException
*/
protected function _initEnvironment() {
if (!$this->__bootstrap()) {
@@ -149,6 +150,7 @@ private function __bootstrap() {
* Dispatches a CLI request
*
* @return boolean
+ * @throws MissingShellMethodException
*/
public function dispatch() {
$shell = $this->shiftArgs();
@@ -84,7 +84,8 @@ public function __construct(ComponentCollection $collection, $settings = array()
* Accessor to the controller object.
*
* @param mixed $controller null to get, a controller to set.
- * @return mixed.
+ * @return mixed
+ * @throws CakeException
*/
public function controller($controller = null) {
if ($controller) {
@@ -41,7 +41,8 @@ class ControllerAuthorize extends BaseAuthorize {
* Get/set the controller this authorize object will be working with. Also checks that isAuthorized is implemented.
*
* @param mixed $controller null to get, a controller to set.
- * @return mixed.
+ * @return mixed
+ * @throws CakeException
*/
public function controller($controller = null) {
if ($controller) {
@@ -385,6 +385,7 @@ public function isAuthorized($user = null, $request = null) {
* Loads the authorization objects configured.
*
* @return mixed Either null when authorize is empty, or the loaded authorization objects.
+ * @throws CakeException
*/
public function constructAuthorize() {
if (empty($this->authorize)) {
@@ -632,6 +633,7 @@ public function identify(CakeRequest $request, CakeResponse $response) {
* loads the configured authentication objects.
*
* @return mixed either null on empty authenticate value, or an array of loaded objects.
+ * @throws CakeException
*/
public function constructAuthenticate() {
if (empty($this->authenticate)) {
@@ -104,6 +104,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
*/
public function paginate($object = null, $scope = array(), $whitelist = array()) {
if (is_array($object)) {
@@ -660,6 +660,7 @@ public function mapAlias($alias) {
* be the handling callback, all other arguments should be additional parameters
* for the handler.
* @return void
+ * @throws CakeException
*/
public function addInputType($type, $handler) {
if (!is_array($handler) || !isset($handler[0]) || !is_callable($handler[0])) {
@@ -451,7 +451,8 @@ public function setRequest(CakeRequest $request) {
* exists and isn't private.
*
* @param CakeRequest $request
- * @return The resulting response.
+ * @return mixed The resulting response.
+ * @throws PrivateActionException, MissingActionException
*/
public function invokeAction(CakeRequest $request) {
$reflection = new ReflectionClass($this);
@@ -102,6 +102,7 @@ class Scaffold {
*
* @param Controller $controller Controller to scaffold
* @param CakeRequest $request Request parameters.
+ * @throws MissingModelException
*/
public function __construct(Controller $controller, CakeRequest $request) {
$this->controller = $controller;
@@ -154,6 +155,7 @@ public function __construct(Controller $controller, CakeRequest $request) {
*
* @param CakeRequest $request Request Object for scaffolding
* @return mixed A rendered view of a row from Models database table
+ * @throws NotFoundException
*/
protected function _scaffoldView(CakeRequest $request) {
if ($this->controller->_beforeScaffold('view')) {
@@ -212,6 +214,7 @@ protected function _scaffoldForm($action = 'edit') {
* @param CakeRequest $request Request Object for scaffolding
* @param string $action add or edt
* @return mixed Success on save/update, add/edit form if data is empty or error if save or update fails
+ * @throws NotFoundException
*/
protected function _scaffoldSave(CakeRequest $request, $action = 'edit') {
$formAction = 'edit';
@@ -284,7 +287,7 @@ protected function _scaffoldSave(CakeRequest $request, $action = 'edit') {
*
* @param CareRequest $request Request for scaffolding
* @return mixed Success on delete, error if delete fails
- * @throws NotFoundException
+ * @throws MethodNotAllowedException, NotFoundException
*/
protected function _scaffoldDelete(CakeRequest $request) {
if ($this->controller->_beforeScaffold('delete')) {
@@ -347,6 +350,7 @@ protected function _scaffoldError() {
*
* @param CakeRequest $request Request object for scaffolding
* @return mixed A rendered view of scaffold action, or showing the error
+ * @throws MissingActionException, MissingDatabaseException
*/
protected function _scaffold(CakeRequest $request) {
$db = ConnectionManager::getDataSource($this->ScaffoldModel->useDbConfig);
View
@@ -103,6 +103,7 @@ public static function config($key, $config) {
*
* @param string $loggerName the plugin.className of the logger class you want to build.
* @return mixed boolean false on any failures, string of classname to use if search was successful.
+ * @throws CakeLogException
*/
protected static function _getLogger($loggerName) {
list($plugin, $loggerName) = pluginSplit($loggerName, true);
@@ -510,6 +510,7 @@ protected static function _configureSession() {
*
* @param string $handler
* @return void
+ * @throws CakeSessionException
*/
protected static function _getHandler($handler) {
list($plugin, $class) = pluginSplit($handler, true);
@@ -133,6 +133,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
*/
public function connect() {
$config = $this->config;
@@ -287,6 +288,7 @@ public function getCharsetName($name) {
*
* @param Model $model Name of database table to inspect or model instance
* @return array Fields in table. Keys are name and type
+ * @throws CakeException
*/
public function describe(Model $model) {
$cache = parent::describe($model);
@@ -103,7 +103,8 @@ class Postgres extends DboSource {
/**
* Connects to the database using options in the given configuration array.
*
- * @return True if successfully connected.
+ * @return boolean True if successfully connected.
+ * @throws MissingConnectionException
*/
public function connect() {
$config = $this->config;
@@ -100,6 +100,7 @@ class Sqlite extends DboSource {
* Connects to the database using config['database'] as a filename.
*
* @return boolean
+ * @throws MissingConnectionException
*/
public function connect() {
$config = $this->config;
@@ -133,6 +133,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
*/
public function connect() {
$config = $this->config;
@@ -200,6 +201,7 @@ public function listSources($data = null) {
*
* @param Model $model Model object to describe
* @return array Fields in table. Keys are name and type
+ * @throws CakeException
*/
public function describe(Model $model) {
$cache = parent::describe($model);
View
@@ -2888,6 +2888,7 @@ public function getAffectedRows() {
*
* @param string $dataSource The name of the DataSource, as defined in app/Config/database.php
* @return boolean True on success
+ * @throws MissingConnectionException
*/
public function setDataSource($dataSource = null) {
$oldConfig = $this->useDbConfig;
@@ -384,7 +384,7 @@ public function referer($local = false) {
* @param string $name The method called
* @param array $params Array of parameters for the method call
* @return mixed
- * @throws BadMethodCallException when an invalid method is called.
+ * @throws CakeException when an invalid method is called.
*/
public function __call($name, $params) {
if (strpos($name, 'is') === 0) {
@@ -471,7 +471,7 @@ protected function _setEmail($varName, $email, $name) {
* @param string $name
* @param string $throwMessage
* @return object $this
- * @throws SocketExpceiton
+ * @throws SocketException
*/
protected function _setEmailSingle($varName, $email, $name, $throwMessage) {
$current = $this->{$varName};
@@ -490,6 +490,7 @@ protected function _setEmailSingle($varName, $email, $name, $throwMessage) {
* @param mixed $email
* @param mixed $name
* @return object $this
+ * @throws SocketException
*/
protected function _addEmail($varName, $email, $name) {
if (!is_array($email)) {
@@ -987,6 +988,7 @@ public function send($content = null) {
* @param mixed $transportConfig String to use config from EmailConfig or array with configs
* @param boolean $send Send the email or just return the instance pre-configured
* @return object Instance of CakeEmail
+ * @throws SocketException
*/
public static function deliver($to = null, $subject = null, $message = null, $transportConfig = 'fast', $send = true) {
$class = __CLASS__;
@@ -124,7 +124,7 @@ public function isOk() {
*
* @param string $message Message to parse
* @return void
- * @throw SocketException
+ * @throws SocketException
*/
public function parseResponse($message) {
if (!is_string($message)) {
@@ -203,7 +203,7 @@ public function configProxy($host, $port = 3128, $method = null, $user = null, $
*
* @param mixed $resource Resource or false to disable the resource use
* @return void
- * @throw SocketException
+ * @throws SocketException
*/
public function setContentResource($resource) {
if ($resource === false) {
@@ -222,6 +222,7 @@ public function setContentResource($resource) {
*
* @param mixed $request Either an URI string, or an array defining host/uri
* @return mixed false on error, HttpResponse on success
+ * @throws SocketException
*/
public function request($request = array()) {
$this->reset(false);
View
@@ -180,6 +180,7 @@ public static function fromArray($input, $options = array()) {
* @param array $data Array of data to append to the $node.
* @param string $format Either 'attribute' or 'tags'. This determines where nested keys go.
* @return void
+ * @throws XmlException
*/
protected static function _fromArray($dom, $node, &$data, $format) {
if (empty($data) || !is_array($data)) {
@@ -905,6 +905,7 @@ function __nestedListItem($items, $options, $itemOptions, $tag) {
* @param mixed $configFile String with the config file (load using PhpReader) or an array with file and reader name
* @param string $path Path with config file
* @return mixed False to error or loaded configs
+ * @throws ConfigureException
*/
public function loadConfig($configFile, $path = null) {
if (!$path) {
@@ -722,7 +722,7 @@ public function format($format, $date = null, $invalid = false, $userOffset = nu
* @param string $format strftime format string.
* @param boolean $invalid flag to ignore results of fromString == false
* @param int $userOffset User's offset from GMT (in hours)
- * @return string Formatted and translated date string @access public
+ * @return string Formatted and translated date string
*/
public function i18nFormat($date, $format = null, $invalid = false, $userOffset = null) {
$date = $this->fromString($date, $userOffset);
@@ -89,6 +89,7 @@ public function __construct($controller = null) {
* @param string $view Not used
* @param string $layout Not used
* @return mixed
+ * @throws NotFoundException
*/
public function render($view = null, $layout = null) {
$name = $download = $extension = $id = $modified = $path = $cache = $mimeType = $compress = null;
@@ -32,6 +32,7 @@ class ScaffoldView extends ThemeView {
*
* @param string $name name of the view file to get.
* @return string action
+ * @throws MissingViewException
*/
protected function _getViewFileName($name = null) {
if ($name === null) {

0 comments on commit fedadc0

Please sign in to comment.