ソースを参照

Fix missing default value types in doc block params.

Mark Scherer 9 年 前
コミット
8c3f7ef574

+ 1 - 1
src/Controller/Component/CommonComponent.php

@@ -155,7 +155,7 @@ class CommonComponent extends Component {
 	 *
 	 * @param mixed $whereTo URL
 	 * @param bool $allowSelf if redirect to the same controller/action (url) is allowed
-	 * @param int $status
+	 * @param int|null $status
 	 * @return \Cake\Network\Response
 	 */
 	public function autoRedirect($whereTo, $allowSelf = false, $status = null) {

+ 2 - 2
src/Controller/Component/FlashComponent.php

@@ -62,7 +62,7 @@ class FlashComponent extends Component {
 	 * Updates "messages" session content (to enable multiple messages of one type).
 	 *
 	 * @param string $message Message to output.
-	 * @param string $options Options
+	 * @param string|null $options Options
 	 * @return void
 	 */
 	public function message($message, $options = null) {
@@ -106,7 +106,7 @@ class FlashComponent extends Component {
 	 * will be merged into the session flash ones prior to output.
 	 *
 	 * @param string $message Message to output.
-	 * @param string $type Type ('error', 'warning', 'success', 'info' or custom class).
+	 * @param string|null $type Type ('error', 'warning', 'success', 'info' or custom class).
 	 * @return void
 	 */
 	public static function transientMessage($message, $type = null) {

+ 1 - 1
src/Controller/Controller.php

@@ -15,7 +15,7 @@ class Controller extends ShimController {
 	 *
 	 * @override To support defaults like limit etc.
 	 *
-	 * @param \Cake\ORM\Table|string|\Cake\ORM\Query $object Table to paginate
+	 * @param \Cake\ORM\Table|string|\Cake\ORM\Query|null $object Table to paginate
 	 *   (e.g: Table instance, 'TableName' or a Query object)
 	 * @return \Cake\ORM\ResultSet Query results
 	 */

+ 2 - 2
src/Utility/Mime.php

@@ -767,7 +767,7 @@ class Mime extends Response {
 	/**
 	 * Retrieve the corresponding MIME type, if one exists
 	 *
-	 * @param string $file File Name (relative location such as "image_test.jpg" or full "http://site.com/path/to/image_test.jpg")
+	 * @param string|null $file File Name (relative location such as "image_test.jpg" or full "http://site.com/path/to/image_test.jpg")
 	 * @return string MIMEType - The type of the file passed in the argument
 	 */
 	public function detectMimeType($file = null) {
@@ -843,7 +843,7 @@ class Mime extends Response {
 	/**
 	 * Get encoding.
 	 *
-	 * @param string $file
+	 * @param string|null $file
 	 * @param string $default
 	 * @return string
 	 */

+ 1 - 1
src/Utility/Number.php

@@ -142,7 +142,7 @@ class Number extends CakeNumber {
 	 * - signed: true/false
 	 *
 	 * @param float $number
-	 * @param string $currency
+	 * @param string|null $currency
 	 * @param array $options
 	 * @return string
 	 */

+ 14 - 14
src/Utility/Time.php

@@ -47,7 +47,7 @@ class Time extends CakeTime {
 	/**
 	 * Detect if a timezone has a DST
 	 *
-	 * @param string|\DateTimeZone $timezone User's timezone string or DateTimeZone object
+	 * @param string|\DateTimeZone|null $timezone User's timezone string or DateTimeZone object
 	 * @return bool
 	 */
 	public function hasDaylightSavingTime($timezone = null) {
@@ -66,7 +66,7 @@ class Time extends CakeTime {
 	/**
 	 * Calculate the current GMT offset from a timezone string (respecting DST)
 	 *
-	 * @param string|\DateTimeZone $timezone User's timezone string or DateTimeZone object
+	 * @param string|\DateTimeZone|null $timezone User's timezone string or DateTimeZone object
 	 * @return int Offset in hours
 	 */
 	public function getGmtOffset($timezone = null) {
@@ -135,7 +135,7 @@ class Time extends CakeTime {
 	 * to be before end for a valid result.
 	 *
 	 * @param int|string $start Start date (if empty, use today)
-	 * @param int|string $end End date (if empty, use today)
+	 * @param int|string|null $end End date (if empty, use today)
 	 * @return int Age (0 if both timestamps are equal or empty, -1 on invalid dates)
 	 */
 	public static function age($start, $end = null) {
@@ -172,7 +172,7 @@ class Time extends CakeTime {
 	 * can be e.g. 22/23
 	 *
 	 * @param int $year
-	 * @param int $month (optional)
+	 * @param int|null $month (optional)
 	 * @return int|string Age
 	 */
 	public static function ageByYear($year, $month = null) {
@@ -224,8 +224,8 @@ class Time extends CakeTime {
 	 * //TODO: move to helper?
 	 *
 	 * @param int $year
-	 * @param int $month
-	 * @param int $day
+	 * @param int|null $month
+	 * @param int|null $day
 	 * @param int $steps
 	 * @return mixed
 	 */
@@ -365,7 +365,7 @@ class Time extends CakeTime {
 	/**
 	 * Calculate the amount of calender weeks in a year
 	 *
-	 * @param int $year (format xxxx, defaults to current year)
+	 * @param int|null $year (format xxxx, defaults to current year)
 	 * @return int Amount of weeks - 52 or 53
 	 */
 	public static function cWeeks($year = null) {
@@ -382,7 +382,7 @@ class Time extends CakeTime {
 	 * @param int $years Years to increment/decrement
 	 * @param int $months Months to increment/decrement
 	 * @param int $days Days
-	 * @param string|\DateTimeZone $timezone Timezone string or DateTimeZone object
+	 * @param string|\DateTimeZone|null $timezone Timezone string or DateTimeZone object
 	 * @return object DateTime with incremented/decremented month/year values.
 	 */
 	public function incrementDate($startDate, $years = 0, $months = 0, $days = 0, $timezone = null) {
@@ -413,7 +413,7 @@ class Time extends CakeTime {
 	 * note: expects valid age (> 0 and < 120)
 	 *
 	 * @param int $firstAge
-	 * @param int $secondAge (defaults to first one if not specified)
+	 * @param int|null $secondAge (defaults to first one if not specified)
 	 * @param bool $returnAsString
 	 * @param mixed|null $relativeTime
 	 * @return array array('min'=>$min, 'max'=>$max);
@@ -1002,7 +1002,7 @@ class Time extends CakeTime {
 	 * Returns true if given datetime string is the day after tomorrow.
 	 *
 	 * @param string $dateString Datetime string or Unix timestamp
-	 * @param int $timezone User's timezone
+	 * @param int|null $timezone User's timezone
 	 * @return bool True if datetime string is day after tomorrow
 	 */
 	public static function isDayAfterTomorrow($dateString, $timezone = null) {
@@ -1015,7 +1015,7 @@ class Time extends CakeTime {
 	 * Returns true if given datetime string is not today AND is in the future.
 	 *
 	 * @param string $dateString Datetime string or Unix timestamp
-	 * @param int $timezone User's timezone
+	 * @param int|null $timezone User's timezone
 	 * @return bool True if datetime is not today AND is in the future
 	 */
 	public static function isNotTodayAndInTheFuture($dateString, $timezone = null) {
@@ -1028,7 +1028,7 @@ class Time extends CakeTime {
 	 * Returns true if given datetime string is not now AND is in the future.
 	 *
 	 * @param string $dateString Datetime string or Unix timestamp
-	 * @param int $timezone User's timezone
+	 * @param int|null $timezone User's timezone
 	 * @return bool True if datetime is not today AND is in the future
 	 */
 	public static function isInTheFuture($dateString, $timezone = null) {
@@ -1142,7 +1142,7 @@ class Time extends CakeTime {
 	 * @param int|string|\DateTime $begin UNIX timestamp, strtotime() valid string or DateTime object
 	 * @param int|string|\DateTime $end UNIX timestamp, strtotime() valid string or DateTime object
 	 * @param string $fieldName Name of database field to compare with
-	 * @param string|\DateTimeZone $timezone Timezone string or DateTimeZone object
+	 * @param string|\DateTimeZone|null $timezone Timezone string or DateTimeZone object
 	 * @return string Partial SQL string.
 	 */
 	public static function daysAsSql($begin, $end, $fieldName, $timezone = null) {
@@ -1162,7 +1162,7 @@ class Time extends CakeTime {
 	 *
 	 * @param int|string|\DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
 	 * @param string $fieldName Name of database field to compare with
-	 * @param string|\DateTimeZone $timezone Timezone string or DateTimeZone object
+	 * @param string|\DateTimeZone|null $timezone Timezone string or DateTimeZone object
 	 * @return string Partial SQL string.
 	 */
 	public static function dayAsSql($dateString, $fieldName, $timezone = null) {

+ 4 - 4
src/Utility/Utility.php

@@ -87,7 +87,7 @@ class Utility {
 	 * @param string $pattern The pattern to use.
 	 * @param string $subject The string to match.
 	 * @param int $flags
-	 * @param int $offset
+	 * @param int|null $offset
 	 * @return array Result
 	 */
 	public static function pregMatchAll($pattern, $subject, $flags = PREG_SET_ORDER, $offset = null) {
@@ -109,8 +109,8 @@ class Utility {
 	 *
 	 * @param string $pattern The pattern to use.
 	 * @param string $subject The string to match.
-	 * @param int $flags
-	 * @param int $offset
+	 * @param int|null $flags
+	 * @param int|null $offset
 	 * @return array Result
 	 */
 	public static function pregMatch($pattern, $subject, $flags = null, $offset = null) {
@@ -521,7 +521,7 @@ class Utility {
 	 *
 	 * @param array $data
 	 * @param string $separator
-	 * @param string $undefinedKey
+	 * @param string|null $undefinedKey
 	 * @return array
 	 */
 	public static function expandList(array $data, $separator = '.', $undefinedKey = null) {

+ 1 - 1
src/View/Helper/CommonHelper.php

@@ -62,7 +62,7 @@ class CommonHelper extends Helper {
 	/**
 	 * Convenience method for clean ROBOTS allowance
 	 *
-	 * @param string $type - private/public
+	 * @param string|null $type - private/public
 	 * @return string HTML
 	 */
 	public function metaRobots($type = null) {

+ 1 - 1
src/View/Helper/FlashHelper.php

@@ -115,7 +115,7 @@ class FlashHelper extends Helper {
 	 * Add a message on the fly
 	 *
 	 * @param string $msg
-	 * @param string $class
+	 * @param string|null $class
 	 * @return void
 	 */
 	public function addTransientMessage($msg, $class = null) {

+ 1 - 1
src/View/Helper/FormatHelper.php

@@ -463,7 +463,7 @@ class FormatHelper extends Helper {
 	 *
 	 * @param array $paginator
 	 * @param int $count (current post count on this page)
-	 * @param string $dir (ASC/DESC)
+	 * @param string|null $dir (ASC/DESC)
 	 * @return int
 	 * @deprecated
 	 */

+ 1 - 1
src/View/Helper/GravatarHelper.php

@@ -89,7 +89,7 @@ class GravatarHelper extends Helper {
 	 * TODO: rename to avoid E_STRICT errors here
 	 *
 	 * @param string $email Email address
-	 * @param string $options Array of options, keyed from default settings
+	 * @param string|array $options Array of options, keyed from default settings
 	 * @return string Gravatar Image URL
 	 */
 	public function url($email, $options = []) {

+ 1 - 1
src/View/Helper/JsHelper.php

@@ -323,7 +323,7 @@ class JsHelper extends Helper {
 	 * The Javascript variable used to output set variables can be controlled with `JsHelper::$setVariable`
 	 *
 	 * @param string|array $one Either an array of variables to set, or the name of the variable to set.
-	 * @param string|array $two If $one is a string, $two is the value for that key.
+	 * @param string|array|null $two If $one is a string, $two is the value for that key.
 	 * @return void
 	 * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/js.html#JsHelper::set
 	 */

+ 1 - 1
src/View/Helper/NumberHelper.php

@@ -18,7 +18,7 @@ class NumberHelper extends CakeNumberHelper {
 	 * - `engine` Class name to use to replace Number functionality.
 	 *            The class needs to be placed in the `Utility` directory.
 	 *
-	 * @param \Cake\View\View $View The View this helper is being attached to.
+	 * @param \Cake\View\View|null $View The View this helper is being attached to.
 	 * @param array $options Configuration settings for the helper
 	 * @throws \Cake\Core\Exception\Exception When the engine class could not be found.
 	 */

+ 1 - 1
src/View/Helper/TimelineHelper.php

@@ -213,7 +213,7 @@ JS;
 	/**
 	 * Format date to JS code.
 	 *
-	 * @param \DateTime $date
+	 * @param \DateTime|null $date
 	 * @return string
 	 */
 	protected function _date($date = null) {

+ 1 - 1
src/View/Helper/UrlHelper.php

@@ -50,7 +50,7 @@ class UrlHelper extends CoreUrlHelper {
 	/**
 	 * Returns a URL based on provided parameters.
 	 *
-	 * @param string|array $url URL.
+	 * @param string|array|null $url URL.
 	 * @param bool $full If true, the full base URL will be prepended to the result
 	 * @return string Full translated URL with base path.
 	 */