From cfca6b1829cc305dd7563c431c3cf0c74c5defad Mon Sep 17 00:00:00 2001 From: Bryan Crowe Date: Fri, 24 Jan 2014 00:50:56 -0500 Subject: [PATCH] Additional ApiGen error fixes --- src/Network/Http/Client.php | 1 + src/Network/Http/Message.php | 76 ++++++++++++++++++++++++++++++++ src/ORM/Marshaller.php | 1 + src/ORM/Query.php | 4 +- src/ORM/ResultSet.php | 1 - src/ORM/ResultSetDecorator.php | 3 +- src/ORM/Table.php | 6 ++- src/Routing/DispatcherFilter.php | 2 - src/Routing/Route/Route.php | 2 +- src/Routing/Router.php | 37 ++++++++++++++-- src/TestSuite/TestCase.php | 2 - src/Utility/Folder.php | 6 +-- src/View/Helper/TimeHelper.php | 2 + src/View/View.php | 6 +++ src/View/ViewBlock.php | 4 +- 15 files changed, 134 insertions(+), 19 deletions(-) diff --git a/src/Network/Http/Client.php b/src/Network/Http/Client.php index 89d878aeae9..a643bec40ea 100644 --- a/src/Network/Http/Client.php +++ b/src/Network/Http/Client.php @@ -296,6 +296,7 @@ public function head($url, $data = [], $options = []) { * * @param string $method HTTP method. * @param string $url URL to request. + * @return Cake\Network\Http\Response */ protected function _doRequest($method, $url, $data, $options) { $request = $this->_createRequest( diff --git a/src/Network/Http/Message.php b/src/Network/Http/Message.php index 82f5379cbc7..f84157dd877 100644 --- a/src/Network/Http/Message.php +++ b/src/Network/Http/Message.php @@ -21,19 +21,95 @@ */ class Message { +/** + * HTTP 200 code + * + * @var integer + */ const STATUS_OK = 200; + +/** + * HTTP 201 code + * + * @var integer + */ const STATUS_CREATED = 201; + +/** + * HTTP 202 code + * + * @var integer + */ const STATUS_ACCEPTED = 202; + +/** + * HTTP 301 code + * + * @var integer + */ const STATUS_MOVED_PERMANENTLY = 301; + +/** + * HTTP 302 code + * + * @var integer + */ const STATUS_FOUND = 302; + +/** + * HTTP 303 code + * + * @var integer + */ const STATUS_SEE_OTHER = 303; + +/** + * HTTP 307 code + * + * @var integer + */ const STATUS_TEMPORARY_REDIRECT = 307; +/** + * HTTP GET method + * + * @var string + */ const METHOD_GET = 'GET'; + +/** + * HTTP POST method + * + * @var string + */ const METHOD_POST = 'POST'; + +/** + * HTTP PUT method + * + * @var string + */ const METHOD_PUT = 'PUT'; + +/** + * HTTP DELETE method + * + * @var string + */ const METHOD_DELETE = 'DELETE'; + +/** + * HTTP PATCH method + * + * @var string + */ const METHOD_PATCH = 'PATCH'; + +/** + * HTTP HEAD method + * + * @var string + */ const METHOD_HEAD = 'HEAD'; /** diff --git a/src/ORM/Marshaller.php b/src/ORM/Marshaller.php index 429f72dd1dc..42ad68febb4 100644 --- a/src/ORM/Marshaller.php +++ b/src/ORM/Marshaller.php @@ -46,6 +46,7 @@ class Marshaller { * Constructor. * * @param Cake\ORM\Table $table + * @param boolean Whether or not this masrhaller in safe mode */ public function __construct(Table $table, $safe = false) { $this->_table = $table; diff --git a/src/ORM/Query.php b/src/ORM/Query.php index 96a183b341b..1d1b794afbf 100644 --- a/src/ORM/Query.php +++ b/src/ORM/Query.php @@ -144,6 +144,8 @@ class Query extends DatabaseQuery { protected $_cache; /** + * Constuctor + * * @param Cake\Database\Connection $connection * @param Cake\ORM\Table $table */ @@ -908,7 +910,7 @@ public function hydrate($enable = null) { /** * Decorates the ResultSet iterator with MapReduce routines * - * @param $results Cake\ORM\ResultCollectionTrait original results + * @param $result Cake\ORM\ResultCollectionTrait original results * @return Cake\ORM\ResultCollectionTrait */ protected function _decorateResults($result) { diff --git a/src/ORM/ResultSet.php b/src/ORM/ResultSet.php index d4b7146dee0..21aba24ce3f 100644 --- a/src/ORM/ResultSet.php +++ b/src/ORM/ResultSet.php @@ -231,7 +231,6 @@ public function serialize() { * Part of Serializable interface. * * @param string Serialized object - * @return ResultSet The hydrated result set. */ public function unserialize($serialized) { $this->_results = unserialize($serialized); diff --git a/src/ORM/ResultSetDecorator.php b/src/ORM/ResultSetDecorator.php index 786b51df18a..73d0540144a 100644 --- a/src/ORM/ResultSetDecorator.php +++ b/src/ORM/ResultSetDecorator.php @@ -39,7 +39,7 @@ class ResultSetDecorator extends Collection implements Countable, Serializable, * will convert the underlying traversable object into an array and * get the count of the underlying data. * - * @return integer. + * @return integer */ public function count() { return count(iterator_to_array($this)); @@ -62,7 +62,6 @@ public function serialize() { * Part of Serializable interface. * * @param string Serialized object - * @return ResultSet The hydrated result set. */ public function unserialize($serialized) { parent::__construct(unserialize($serialized)); diff --git a/src/ORM/Table.php b/src/ORM/Table.php index 311e4b10555..193920e40df 100644 --- a/src/ORM/Table.php +++ b/src/ORM/Table.php @@ -1470,7 +1470,7 @@ public function callFinder($type, Query $query, $options = []) { * * @param string $method The method name that was fired. * @param array $args List of arguments passed to the function. - * @return mixed. + * @return mixed * @throws Cake\Error\Exception when there are missing arguments, or when * and & or are combined. */ @@ -1559,7 +1559,7 @@ public function __call($method, $args) { * * @param boolean $safe Whether or not this marshaller * should be in safe mode. - * @return Cake\ORM\Marhsaller; + * @return Cake\ORM\Marhsaller * @see Cake\ORM\Marshaller */ public function marshaller($safe = false) { @@ -1606,6 +1606,7 @@ public function entityValidator() { * @param array $data The data to build an entity with. * @param array $associations A whitelist of associations * to hydrate. Defaults to all associations + * @return Cake\ORM\Entity */ public function newEntity(array $data, $associations = null) { if ($associations === null) { @@ -1640,6 +1641,7 @@ public function newEntity(array $data, $associations = null) { * @param array $data The data to build an entity with. * @param array $associations A whitelist of associations * to hydrate. Defaults to all associations + * @return array An array of hydrated records. */ public function newEntities(array $data, $associations = null) { if ($associations === null) { diff --git a/src/Routing/DispatcherFilter.php b/src/Routing/DispatcherFilter.php index 434ddd02b55..6f3ada0e5bb 100644 --- a/src/Routing/DispatcherFilter.php +++ b/src/Routing/DispatcherFilter.php @@ -82,7 +82,6 @@ public function implementedEvents() { * * @param Cake\Event\Event $event container object having the `request`, `response` and `additionalParams` * keys in the data property. - * @return Cake\Network\Response|boolean */ public function beforeDispatch(Event $event) { } @@ -97,7 +96,6 @@ public function beforeDispatch(Event $event) { * * @param Cake\Event\Event $event container object having the `request` and `response` * keys in the data property. - * @return mixed boolean to stop the event dispatching or null to continue */ public function afterDispatch(Event $event) { } diff --git a/src/Routing/Route/Route.php b/src/Routing/Route/Route.php index 28c2e4ca11f..0af2bf8b11b 100644 --- a/src/Routing/Route/Route.php +++ b/src/Routing/Route/Route.php @@ -218,7 +218,7 @@ protected function _writeRoute() { * for a route. This will compile a route if it has not * already been compiled. * - * @return string. + * @return string */ public function getName() { if (!empty($this->_name)) { diff --git a/src/Routing/Router.php b/src/Routing/Router.php index 4edc82fe6b7..33d9bf84543 100644 --- a/src/Routing/Router.php +++ b/src/Routing/Router.php @@ -77,14 +77,45 @@ class Router { protected static $_validExtensions = array(); /** - * 'Constant' regular expression definitions for named route elements - * - */ + * Regular expression for action names + * + * @var string + */ const ACTION = 'index|show|add|create|edit|update|remove|del|delete|view|item'; + +/** + * Regular expression for years + * + * @var string + */ const YEAR = '[12][0-9]{3}'; + +/** + * Regular expression for months + * + * @var string + */ const MONTH = '0[1-9]|1[012]'; + +/** + * Regular expression for days + * + * @var string + */ const DAY = '0[1-9]|[12][0-9]|3[01]'; + +/** + * Regular expression for auto increment IDs + * + * @var string + */ const ID = '[0-9]+'; + +/** + * Regular expression for UUIds + * + * @var string + */ const UUID = '[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}'; /** diff --git a/src/TestSuite/TestCase.php b/src/TestSuite/TestCase.php index 97762470c0e..2f69a64b2aa 100644 --- a/src/TestSuite/TestCase.php +++ b/src/TestSuite/TestCase.php @@ -192,8 +192,6 @@ protected function assertPostConditions() { /** * Chooses which fixtures to load for a given test * - * @param string $fixture Each parameter is a model name that corresponds to a - * fixture, i.e. 'Post', 'Author', etc. * @return void * @see Cake\TestSuite\TestCase::$autoFixtures * @throws \Exception when no fixture manager is available. diff --git a/src/Utility/Folder.php b/src/Utility/Folder.php index 4e916f8350f..61c53f768d5 100644 --- a/src/Utility/Folder.php +++ b/src/Utility/Folder.php @@ -25,7 +25,7 @@ class Folder { * Default scheme for Folder::copy * Recursively merges subfolders with the same name * - * @constant MERGE + * @var string */ const MERGE = 'merge'; @@ -33,7 +33,7 @@ class Folder { * Overwrite scheme for Folder::copy * subfolders with the same name will be replaced * - * @constant OVERWRITE + * @var string */ const OVERWRITE = 'overwrite'; @@ -41,7 +41,7 @@ class Folder { * Skip scheme for Folder::copy * if a subfolder with the same name exists it will be skipped * - * @constant SKIP + * @var string */ const SKIP = 'skip'; diff --git a/src/View/Helper/TimeHelper.php b/src/View/Helper/TimeHelper.php index 23222e9c439..b09b4593e37 100644 --- a/src/View/Helper/TimeHelper.php +++ b/src/View/Helper/TimeHelper.php @@ -291,6 +291,8 @@ public function toAtom($dateString, $timezone = null) { } /** + * Formats date for RSS feeds + * * @see Cake\Utility\Time::toRSS() * * @param integer|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object diff --git a/src/View/View.php b/src/View/View.php index 3dcff100e85..7ec5bf6bd92 100644 --- a/src/View/View.php +++ b/src/View/View.php @@ -294,16 +294,22 @@ class View extends Object { /** * Constant for view file type 'view' + * + * @var string */ const TYPE_VIEW = 'view'; /** * Constant for view file type 'element' + * + * @var string */ const TYPE_ELEMENT = 'element'; /** * Constant for view file type 'layout' + * + * @var string */ const TYPE_LAYOUT = 'layout'; diff --git a/src/View/ViewBlock.php b/src/View/ViewBlock.php index 3c759f9d1d9..5c778e549b4 100644 --- a/src/View/ViewBlock.php +++ b/src/View/ViewBlock.php @@ -30,14 +30,14 @@ class ViewBlock { /** * Append content * - * @constant APPEND + * @var string */ const APPEND = 'append'; /** * Prepend content * - * @constant PREPEND + * @var string */ const PREPEND = 'prepend';