Skip to content

Commit

Permalink
Merge pull request #3717 from ADmad/3.0-api-docs
Browse files Browse the repository at this point in the history
Fix api docblock CS errors for View/
  • Loading branch information
markstory committed Jun 15, 2014
2 parents 0d620a7 + 82da080 commit c3824d2
Show file tree
Hide file tree
Showing 24 changed files with 84 additions and 91 deletions.
8 changes: 4 additions & 4 deletions src/View/AjaxView.php
Expand Up @@ -36,10 +36,10 @@ class AjaxView extends View {
/**
* Constructor
*
* @param Request $request
* @param Response $response
* @param EventManager $eventManager
* @param array $viewOptions
* @param \Cake\Network\Request $request The request object.
* @param \Cake\Network\Response $response The response object.
* @param \Cake\Event\EventManager $eventManager Event manager object.
* @param array $viewOptions View options.
*/
public function __construct(Request $request = null, Response $response = null,
EventManager $eventManager = null, array $viewOptions = []) {
Expand Down
3 changes: 2 additions & 1 deletion src/View/CellTrait.php
Expand Up @@ -51,7 +51,8 @@ trait CellTrait {
* `cell('TagCloud::smallList', ['a1' => 'v1', 'a2' => 'v2'])` maps to `View\Cell\TagCloud::smallList(v1, v2)`
* @param array $options Options for Cell's constructor
* @return \Cake\View\Cell The cell instance
* @throws \Cake\View\Error\MissingCellException If Cell class was not found
* @throws \Cake\View\Error\MissingCellException If Cell class was not found.
* @throws \BadMethodCallException If Cell class does not specified cell action.
*/
public function cell($cell, $data = [], $options = []) {
$parts = explode('::', $cell);
Expand Down
4 changes: 2 additions & 2 deletions src/View/Form/ArrayContext.php
Expand Up @@ -76,8 +76,8 @@ class ArrayContext implements ContextInterface {
/**
* Constructor.
*
* @param \Cake\Network\Request
* @param array
* @param \Cake\Network\Request $request The request object.
* @param array $context Context info.
*/
public function __construct(Request $request, array $context) {
$this->_request = $request;
Expand Down
4 changes: 2 additions & 2 deletions src/View/Form/EntityContext.php
Expand Up @@ -84,8 +84,8 @@ class EntityContext implements ContextInterface {
/**
* Constructor.
*
* @param \Cake\Network\Request
* @param array
* @param \Cake\Network\Request $request The request object.
* @param array $context Context info.
*/
public function __construct(Request $request, array $context) {
$this->_request = $request;
Expand Down
4 changes: 2 additions & 2 deletions src/View/Form/NullContext.php
Expand Up @@ -35,8 +35,8 @@ class NullContext implements ContextInterface {
/**
* Constructor.
*
* @param \Cake\Network\Request
* @param array
* @param \Cake\Network\Request $request The request object.
* @param array $context Context info.
*/
public function __construct(Request $request, array $context) {
$this->_request = $request;
Expand Down
2 changes: 1 addition & 1 deletion src/View/Helper.php
Expand Up @@ -239,7 +239,7 @@ public function webroot($file) {
* Generate URL for given asset file. Depending on options passed provides full URL with domain name.
* Also calls Helper::assetTimestamp() to add timestamp to local files
*
* @param string|array Path string or URL array
* @param string|array $path Path string or URL array
* @param array $options Options array. Possible keys:
* `fullBase` Return full URL with domain name
* `pathPrefix` Path prefix for relative URLs
Expand Down
36 changes: 18 additions & 18 deletions src/View/Helper/FormHelper.php
Expand Up @@ -231,7 +231,7 @@ protected function _addDefaultContextProviders() {
/**
* Returns if a field is required to be filled based on validation properties from the validating object.
*
* @param \Cake\Validation\ValidationSet $validationRules
* @param \Cake\Validation\ValidationSet $validationRules Validation rules set.
* @return bool true if field is required to be filled, false otherwise
*/
protected function _isRequiredField($validationRules) {
Expand Down Expand Up @@ -962,8 +962,8 @@ protected function _getInput($fieldName, $options) {
/**
* Generates input options array
*
* @param string $fieldName the name of the field to parse options for
* @param array $options
* @param string $fieldName The name of the field to parse options for.
* @param array $options Options list.
* @return array Options
*/
protected function _parseOptions($fieldName, $options) {
Expand Down Expand Up @@ -1024,8 +1024,8 @@ protected function _inputType($fieldName, $options) {
* Selects the variable containing the options for a select field if present,
* and sets the value to the 'options' key in the options array.
*
* @param string $fieldName the name of the field to find options for
* @param array $options
* @param string $fieldName The name of the field to find options for.
* @param array $options Options list.
* @return array
*/
protected function _optionsOptions($fieldName, $options) {
Expand All @@ -1051,10 +1051,10 @@ protected function _optionsOptions($fieldName, $options) {
/**
* Magically set option type and corresponding options
*
* @param string $fieldName the name of the field to generate options for
* @param array $options
* @param bool $allowOverride whether or not it is allowed for this method to
* overwrite the 'type' key in options
* @param string $fieldName The name of the field to generate options for.
* @param array $options Options list.
* @param bool $allowOverride Whether or not it is allowed for this method to
* overwrite the 'type' key in options.
* @return array
*/
protected function _magicOptions($fieldName, $options, $allowOverride) {
Expand Down Expand Up @@ -1110,8 +1110,8 @@ protected function _magicOptions($fieldName, $options, $allowOverride) {
/**
* Generate label for input
*
* @param string $fieldName
* @param array $options
* @param string $fieldName The name of the field to generate label for.
* @param array $options Options list.
* @return bool|string false or Generated label element
*/
protected function _getLabel($fieldName, $options) {
Expand Down Expand Up @@ -1151,9 +1151,9 @@ protected function _extractOption($name, $options, $default = null) {
* $options can contain a hash of id overrides. These overrides will be
* used instead of the generated values if present.
*
* @param string $fieldName
* @param string $label
* @param array $options Options for the label element. 'NONE' option is deprecated and will be removed in 3.0
* @param string $fieldName The name of the field to generate label for.
* @param string $label Label text.
* @param array $options Options for the label element.
* @return string Generated label element
*/
protected function _inputLabel($fieldName, $label, $options) {
Expand Down Expand Up @@ -1685,8 +1685,8 @@ public function select($fieldName, $options = [], array $attributes = []) {
* Can be used in place of a select box with the multiple attribute.
*
* @param string $fieldName Name attribute of the SELECT
* @param array $options|\Traversable Array of the OPTION elements (as 'value'=>'Text' pairs) to be used in the
* checkboxes element.
* @param array|\Traversable $options Array of the OPTION elements
* (as 'value'=>'Text' pairs) to be used in the checkboxes element.
* @param array $attributes The HTML attributes of the select element.
* @return string Formatted SELECT element
* @see \Cake\View\Helper\FormHelper::select() for supported option formats.
Expand Down Expand Up @@ -2248,8 +2248,8 @@ protected function _getContext($data = []) {
* Allows you to add or replace widget instances with custom code.
*
* @param string $name The name of the widget. e.g. 'text'.
* @param array|\Cake\View\Widget\WidgetInterface Either a string class name or an object
* implementing the WidgetInterface.
* @param array|\Cake\View\Widget\WidgetInterface $spec Either a string class
* name or an object implementing the WidgetInterface.
* @return void
*/
public function addWidget($name, $spec) {
Expand Down
3 changes: 1 addition & 2 deletions src/View/Helper/NumberHelper.php
Expand Up @@ -85,7 +85,6 @@ public function __call($method, $params) {
/**
* Formats a number with a level of precision.
*
*
* @param float $number A floating point number.
* @param int $precision The precision of the returned number.
* @return float Formatted float.
Expand Down Expand Up @@ -173,7 +172,7 @@ public function format($number, array $options = []) {
* @param string $currency Shortcut to default options. Valid values are 'USD', 'EUR', 'GBP', otherwise
* set at least 'before' and 'after' options.
* 'USD' is the default currency, use Number::defaultCurrency() to change this default.
* @param array $options
* @param array $options Options list.
* @return string Number formatted as a currency.
* @see Cake\Utility\Number::currency()
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::currency
Expand Down
2 changes: 1 addition & 1 deletion src/View/Helper/PaginatorHelper.php
Expand Up @@ -73,7 +73,7 @@ class PaginatorHelper extends Helper {
* Before render callback. Overridden to merge passed args with URL options.
*
* @param \Cake\Event\Event $event The event instance.
* @param string $viewFile
* @param string $viewFile The view file being rendered.
* @return void
*/
public function beforeRender($event, $viewFile) {
Expand Down
30 changes: 11 additions & 19 deletions src/View/Helper/TimeHelper.php
Expand Up @@ -47,7 +47,7 @@ public function fromString($dateString, $timezone = null) {
*
* @param int|string|\DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
* @param string|\DateTimeZone $timezone User's timezone string or DateTimeZone object
* @param string $format The format to use. If null, `CakeTime::$niceFormat` is used
* @param string $locale Locale string.
* @return string Formatted date string
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
Expand Down Expand Up @@ -155,11 +155,10 @@ public function isTomorrow($dateString, $timezone = null) {
/**
* Returns the quarter
*
* @see \Cake\Utility\Time::toQuarter()
*
* @param int|string|\DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
* @param bool $range if true returns a range in Y-m-d format
* @return mixed 1, 2, 3, or 4 quarter of year or array if $range true
* @see \Cake\Utility\Time::toQuarter()
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function toQuarter($dateString, $range = false) {
Expand All @@ -169,11 +168,10 @@ public function toQuarter($dateString, $range = false) {
/**
* Returns a UNIX timestamp from a textual datetime description. Wrapper for PHP function strtotime().
*
* @see \Cake\Utility\Time::toUnix()
*
* @param int|string|\DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
* @param string|\DateTimeZone $timezone User's timezone string or DateTimeZone object
* @return int Unix timestamp
* @see \Cake\Utility\Time::toUnix()
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function toUnix($dateString, $timezone = null) {
Expand All @@ -183,11 +181,10 @@ public function toUnix($dateString, $timezone = null) {
/**
* Returns a date formatted for Atom RSS feeds.
*
* @see \Cake\Utility\Time::toAtom()
*
* @param int|string|\DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
* @param string|\DateTimeZone $timezone User's timezone string or DateTimeZone object
* @return string Formatted date string
* @see \Cake\Utility\Time::toAtom()
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function toAtom($dateString, $timezone = null) {
Expand All @@ -211,8 +208,6 @@ public function toRSS($dateString, $timezone = null) {
/**
* Formats date for RSS feeds
*
* @see \Cake\Utility\Time::timeAgoInWords()
*
* ## Additional options
*
* - `element` - The element to wrap the formatted time in.
Expand All @@ -224,6 +219,7 @@ public function toRSS($dateString, $timezone = null) {
* @param int|string|\DateTime $dateTime UNIX timestamp, strtotime() valid string or DateTime object
* @param array $options Default format if timestamp is used in $dateString
* @return string Relative time string.
* @see \Cake\Utility\Time::timeAgoInWords()
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function timeAgoInWords($dateTime, array $options = array()) {
Expand Down Expand Up @@ -259,13 +255,13 @@ public function timeAgoInWords($dateTime, array $options = array()) {

/**
* Returns true if specified datetime was within the interval specified, else false.
* @see \Cake\Utility\Time::wasWithinLast()
*
* @param string|int $timeInterval the numeric value with space then time type.
* Example of valid types: 6 hours, 2 days, 1 minute.
* @param int|string|\DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
* @param string|\DateTimeZone $timezone User's timezone string or DateTimeZone object
* @return bool
* @see \Cake\Utility\Time::wasWithinLast()
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
*/
public function wasWithinLast($timeInterval, $dateString, $timezone = null) {
Expand All @@ -275,13 +271,12 @@ public function wasWithinLast($timeInterval, $dateString, $timezone = null) {
/**
* Returns true if specified datetime is within the interval specified, else false.
*
* @see \Cake\Utility\Time::isWithinLast()
*
* @param string|int $timeInterval the numeric value with space then time type.
* Example of valid types: 6 hours, 2 days, 1 minute.
* @param int|string|\DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
* @param string|\DateTimeZone $timezone User's timezone string or DateTimeZone object
* @return bool
* @see \Cake\Utility\Time::isWithinLast()
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
*/
public function isWithinNext($timeInterval, $dateString, $timezone = null) {
Expand All @@ -291,10 +286,9 @@ public function isWithinNext($timeInterval, $dateString, $timezone = null) {
/**
* Returns gmt as a UNIX timestamp.
*
* @see \Cake\Utility\Time::gmt()
*
* @param int|string|\DateTime $string UNIX timestamp, strtotime() valid string or DateTime object
* @return int UNIX timestamp
* @see \Cake\Utility\Time::gmt()
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function gmt($string = null) {
Expand All @@ -306,13 +300,12 @@ public function gmt($string = null) {
* This function also accepts a time string and a format string as first and second parameters.
* In that case this function behaves as a wrapper for Time::i18nFormat()
*
* @see \Cake\Utility\Time::i18nFormat()
*
* @param int|string|\DateTime $date UNIX timestamp, strtotime() valid string or DateTime object (or a date format string)
* @param int|string $format date format string (or a UNIX timestamp, strtotime() valid string or DateTime object)
* @param bool|string $invalid Default value to display on invalid dates
* @param string|\DateTimeZone $timezone User's timezone string or DateTimeZone object
* @return string Formatted and translated date string
* @see \Cake\Utility\Time::i18nFormat()
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function format($date, $format = null, $invalid = false, $timezone = null) {
Expand All @@ -323,15 +316,14 @@ public function format($date, $format = null, $invalid = false, $timezone = null
* Returns a formatted date string, given either a UNIX timestamp or a valid strtotime() date string.
* It takes into account the default date format for the current language if a LC_TIME file is used.
*
* @see \Cake\Utility\Time::i18nFormat()
*
* @param int|string|\DateTime $date UNIX timestamp, strtotime() valid string or DateTime object
* @param string $format strftime format string.
* @param bool|string $invalid Default value to display on invalid dates
* @param string|\DateTimeZone $timezone User's timezone string or DateTimeZone object
* @return string Formatted and translated date string
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
* @throws \InvalidArgumentException When the date cannot be parsed
* @see \Cake\Utility\Time::i18nFormat()
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
*/
public function i18nFormat($date, $format = null, $invalid = false, $timezone = null) {
try {
Expand Down
3 changes: 2 additions & 1 deletion src/View/HelperRegistry.php
Expand Up @@ -38,7 +38,7 @@ class HelperRegistry extends ObjectRegistry {
/**
* Constructor
*
* @param View $view
* @param \Cake\View\View $view View object.
*/
public function __construct(View $view) {
$this->_View = $view;
Expand Down Expand Up @@ -111,6 +111,7 @@ protected function _resolveClassName($class) {
*
* @param string $class The classname that is missing.
* @param string $plugin The plugin the helper is missing in.
* @return void
* @throws \Cake\View\Error\MissingHelperException
*/
protected function _throwMissingClassError($class, $plugin) {
Expand Down
2 changes: 1 addition & 1 deletion src/View/StringTemplate.php
Expand Up @@ -57,7 +57,7 @@ class StringTemplate {
/**
* Constructor.
*
* @param array $templates A set of templates to add.
* @param array $config A set of templates to add.
*/
public function __construct(array $config = []) {
$this->config($config);
Expand Down
2 changes: 1 addition & 1 deletion src/View/Widget/Basic.php
Expand Up @@ -54,7 +54,7 @@ public function __construct($templates) {
* Any other keys provided in $data will be converted into HTML attributes.
*
* @param array $data The data to build an input with.
* @param \Cake\View\Form\ContextInterface The current form context.
* @param \Cake\View\Form\ContextInterface $context The current form context.
* @return string
*/
public function render(array $data, ContextInterface $context) {
Expand Down
4 changes: 2 additions & 2 deletions src/View/Widget/Button.php
Expand Up @@ -36,7 +36,7 @@ class Button implements WidgetInterface {
/**
* Constructor.
*
* @param \Cake\View\StringTemplate $templates
* @param \Cake\View\StringTemplate $templates Templates list.
*/
public function __construct($templates) {
$this->_templates = $templates;
Expand All @@ -55,7 +55,7 @@ public function __construct($templates) {
* Any other keys provided in $data will be converted into HTML attributes.
*
* @param array $data The data to build a button with.
* @param \Cake\View\Form\ContextInterface The current form context.
* @param \Cake\View\Form\ContextInterface $context The current form context.
* @return string
*/
public function render(array $data, ContextInterface $context) {
Expand Down
4 changes: 2 additions & 2 deletions src/View/Widget/Checkbox.php
Expand Up @@ -32,7 +32,7 @@ class Checkbox implements WidgetInterface {
/**
* Constructor
*
* @param \Cake\View\StringTemplate $templates
* @param \Cake\View\StringTemplate $templates Templates list.
*/
public function __construct($templates) {
$this->_templates = $templates;
Expand All @@ -52,7 +52,7 @@ public function __construct($templates) {
* Any other attributes passed in will be treated as HTML attributes.
*
* @param array $data The data to create a checkbox with.
* @param \Cake\View\Form\ContextInterface The current form context.
* @param \Cake\View\Form\ContextInterface $context The current form context.
* @return string Generated HTML string.
*/
public function render(array $data, ContextInterface $context) {
Expand Down

0 comments on commit c3824d2

Please sign in to comment.