浏览代码

Doc blocks

Mark Scherer 10 年之前
父节点
当前提交
9bba877a94
共有 1 个文件被更改,包括 25 次插入7 次删除
  1. 25 7
      src/Utility/Random.php

+ 25 - 7
src/Utility/Random.php

@@ -12,7 +12,7 @@ class Random {
 	/**
 	 * @param int $min
 	 * @param int $max
-	 * @return random int value
+	 * @return int Random int value
 	 */
 	public static function int($min = 0, $max = 999) {
 		return mt_rand($min, $max);
@@ -21,7 +21,7 @@ class Random {
 	/**
 	 * @param float $min
 	 * @param float $max
-	 * @return random float value
+	 * @return random Float value
 	 */
 	public static function float($min = 0.0, $max = 999.0) {
 		$rand = rand(1, 358);
@@ -32,6 +32,10 @@ class Random {
 	 * Randomly return one of the values provided
 	 * careful: only works with numerical keys (0 based!)
 	 *
+	 * @param $array
+	 * @param int|null $minPosition
+	 * @param int|null $maxPosition
+	 * @param bool $integerKeys
 	 * @return mixed
 	 */
 	public static function arrayValue($array, $minPosition = null, $maxPosition = null, $integerKeys = false) {
@@ -54,6 +58,11 @@ class Random {
 
 	/**
 	 * 1950-01-01 - 2050-12-31
+	 *
+	 * @param int|null $min
+	 * @param int|null $max
+	 * @param bool|null $formatReturn
+	 * @return int|null|string
 	 */
 	public static function date($min = null, $max = null, $formatReturn = null) {
 		if ($min === null && $max === null) {
@@ -80,6 +89,11 @@ class Random {
 	//TODO
 	/**
 	 * 00:00:00 - 23:59:59
+	 *
+	 * @param int|null $min
+	 * @param int|null $max
+	 * @param bool|null $formatReturn
+	 * @return int
 	 */
 	public static function time($min = null, $max = null, $formatReturn = null) {
 		$res = 0;
@@ -94,9 +108,9 @@ class Random {
 	/**
 	 * Returns a date of birth within the specified age range
 	 *
-	 * @param (int) $min minimum age in years
-	 * @param (int) $max maximum age in years
-	 * @return (string) $dob a db (ISO) format datetime string
+	 * @param int $min minimum age in years
+	 * @param int $max maximum age in years
+	 * @return string Dob a db (ISO) format datetime string
 	 */
 	public static function dob($min = 18, $max = 100) {
 		$dobYear = date('Y') - (static::int($min, $max));
@@ -166,6 +180,10 @@ class Random {
 	 * Few years ago i had written Joomla component AutoContent. That component generates new unique content and add it to Joomla site. In general, this is not good tool, because it does black SEO things. If search engine (ex. Google) finds that there is autogenerated text without sense then site can be banned
 	 *
 	 * @link http://www.gelembjuk.com/index.php?option=com_content&view=article&id=60&catid=37:php&Itemid=56
+	 *
+	 * @param array $sentences
+	 * @param int $wordscount
+	 * @return array
 	 */
 	public static function sentences($sentences, $wordscount = 2) {
 		$hash = [];
@@ -254,8 +272,8 @@ class Random {
 	 * You can also create a custom type by providing the "pool" of characters
 	 * as the type.
 	 *
-	 * @param string a type of pool, or a string of characters to use as the pool
-	 * @param int length of string to return
+	 * @param string $type Type of pool, or a string of characters to use as the pool
+	 * @param int $length of string to return
 	 * @return string
 	 */
 	public static function generate($type = 'alnum', $length = 8) {