浏览代码

Docblocks

mscherer 6 年之前
父节点
当前提交
e03b7a0553
共有 4 个文件被更改,包括 13 次插入15 次删除
  1. 2 2
      src/Utility/Language.php
  2. 3 5
      src/Utility/Text.php
  3. 6 6
      src/Utility/Time.php
  4. 2 2
      src/Utility/Utility.php

+ 2 - 2
src/Utility/Language.php

@@ -89,7 +89,7 @@ class Language {
 	/**
 	 * Compares two parsed arrays of language tags and find the matches
 	 *
-	 * @param array $accepted
+	 * @param string[] $accepted
 	 * @param array $available
 	 * @return string|null
 	 */
@@ -110,7 +110,7 @@ class Language {
 	/**
 	 * Compares two parsed arrays of language tags and find the matches
 	 *
-	 * @param array $accepted
+	 * @param string[] $accepted
 	 * @param array $available
 	 * @return array
 	 */

+ 3 - 5
src/Utility/Text.php

@@ -178,7 +178,7 @@ class Text extends CakeText {
 	 * Explode a string of given tags into an array.
 	 *
 	 * @param string $tags
-	 * @return array
+	 * @return string[]
 	 */
 	public function explodeTags($tags) {
 		// This regexp allows the following types of user input:
@@ -204,7 +204,7 @@ class Text extends CakeText {
 	/**
 	 * Implode an array of tags into a string.
 	 *
-	 * @param array $tags
+	 * @param string[] $tags
 	 * @return string
 	 */
 	public function implodeTags(array $tags) {
@@ -240,15 +240,13 @@ class Text extends CakeText {
 		return $str;
 	}
 
-/* text object specific */
-
 	/**
 	 * Extract words
 	 *
 	 * @param string $text
 	 * @param array $options
 	 * - min_char, max_char, case_sensititive, ...
-	 * @return array
+	 * @return string[]
 	 */
 	public function words($text, array $options = []) {
 		$text = str_replace([PHP_EOL, "\t"], ' ', $text);

+ 6 - 6
src/Utility/Time.php

@@ -642,9 +642,9 @@ class Time extends CakeTime {
 	/**
 	 * Months
 	 *
-	 * @param array $monthKeys
+	 * @param int[] $monthKeys
 	 * @param array $options
-	 * @return array
+	 * @return string[]
 	 */
 	public static function monthNames(array $monthKeys = [], array $options = []) {
 		if (!$monthKeys) {
@@ -661,9 +661,9 @@ class Time extends CakeTime {
 	/**
 	 * Weekdays
 	 *
-	 * @param array $dayKeys
+	 * @param int[] $dayKeys
 	 * @param array $options
-	 * @return array
+	 * @return string[]
 	 */
 	public static function dayNames(array $dayKeys = [], array $options = []) {
 		if (!$dayKeys) {
@@ -1165,7 +1165,7 @@ class Time extends CakeTime {
 	 * now supports negative values like -2,5 -2,5 -2:30 -:30 or -4
 	 *
 	 * @param string $duration
-	 * @param array $allowed
+	 * @param string[] $allowed
 	 * @return int Seconds
 	 */
 	public static function parseLocalTime($duration, array $allowed = [':', '.', ',']) {
@@ -1206,7 +1206,7 @@ class Time extends CakeTime {
 	 * Parse 2022-11-12 or 12.11.2022 or even 12.11.22
 	 *
 	 * @param string $date
-	 * @param array $allowed
+	 * @param string[] $allowed
 	 * @return int Seconds
 	 */
 	public static function parseLocalDate($date, array $allowed = ['.', '-']) {

+ 2 - 2
src/Utility/Utility.php

@@ -128,7 +128,7 @@ class Utility {
 	 *
 	 * @param string $str
 	 * @param int $length
-	 * @return array Result
+	 * @return string[] Result
 	 */
 	public static function strSplit($str, $length = 1) {
 		if ($length < 1) {
@@ -222,7 +222,7 @@ class Utility {
 	 * Removes http:// or other protocols from the link.
 	 *
 	 * @param string $url
-	 * @param array $protocols Defaults to http and https. Pass empty array for all.
+	 * @param string[] $protocols Defaults to http and https. Pass empty array for all.
 	 * @return string strippedUrl
 	 */
 	public static function stripProtocol($url, $protocols = ['http', 'https']) {