Skip to content

Commit b6341f0

Browse files
committed
removed useless annotations @param and @return
1 parent eca4ae2 commit b6341f0

19 files changed

+70
-375
lines changed

src/Iterators/CachingIterator.php

+4-13
Original file line numberDiff line numberDiff line change
@@ -56,29 +56,24 @@ public function __construct($iterator)
5656

5757
/**
5858
* Is the current element the first one?
59-
* @param int grid width
60-
* @return bool
6159
*/
62-
public function isFirst(int $width = NULL): bool
60+
public function isFirst(int $gridWidth = NULL): bool
6361
{
64-
return $this->counter === 1 || ($width && $this->counter !== 0 && (($this->counter - 1) % $width) === 0);
62+
return $this->counter === 1 || ($gridWidth && $this->counter !== 0 && (($this->counter - 1) % $gridWidth) === 0);
6563
}
6664

6765

6866
/**
6967
* Is the current element the last one?
70-
* @param int grid width
71-
* @return bool
7268
*/
73-
public function isLast(int $width = NULL): bool
69+
public function isLast(int $gridWidth = NULL): bool
7470
{
75-
return !$this->hasNext() || ($width && ($this->counter % $width) === 0);
71+
return !$this->hasNext() || ($gridWidth && ($this->counter % $gridWidth) === 0);
7672
}
7773

7874

7975
/**
8076
* Is the iterator empty?
81-
* @return bool
8277
*/
8378
public function isEmpty(): bool
8479
{
@@ -88,7 +83,6 @@ public function isEmpty(): bool
8883

8984
/**
9085
* Is the counter odd?
91-
* @return bool
9286
*/
9387
public function isOdd(): bool
9488
{
@@ -98,7 +92,6 @@ public function isOdd(): bool
9892

9993
/**
10094
* Is the counter even?
101-
* @return bool
10295
*/
10396
public function isEven(): bool
10497
{
@@ -108,7 +101,6 @@ public function isEven(): bool
108101

109102
/**
110103
* Returns the counter.
111-
* @return int
112104
*/
113105
public function getCounter(): int
114106
{
@@ -118,7 +110,6 @@ public function getCounter(): int
118110

119111
/**
120112
* Returns the count of elements.
121-
* @return int
122113
*/
123114
public function count(): int
124115
{

src/Utils/ArrayHash.php

-5
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ class ArrayHash extends \stdClass implements \ArrayAccess, \Countable, \Iterator
1919
{
2020

2121
/**
22-
* @param array to wrap
23-
* @param bool
2422
* @return static
2523
*/
2624
public static function from(array $arr, bool $recursive = TRUE): self
@@ -39,7 +37,6 @@ public static function from(array $arr, bool $recursive = TRUE): self
3937

4038
/**
4139
* Returns an iterator over all items.
42-
* @return \RecursiveArrayIterator
4340
*/
4441
public function getIterator(): \RecursiveArrayIterator
4542
{
@@ -49,7 +46,6 @@ public function getIterator(): \RecursiveArrayIterator
4946

5047
/**
5148
* Returns items count.
52-
* @return int
5349
*/
5450
public function count(): int
5551
{
@@ -82,7 +78,6 @@ public function offsetGet($key)
8278

8379
/**
8480
* Determines whether a item exists.
85-
* @return bool
8681
*/
8782
public function offsetExists($key): bool
8883
{

src/Utils/ArrayList.php

-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class ArrayList implements \ArrayAccess, \Countable, \IteratorAggregate
2424

2525
/**
2626
* Returns an iterator over all items.
27-
* @return \ArrayIterator
2827
*/
2928
public function getIterator(): \ArrayIterator
3029
{
@@ -34,7 +33,6 @@ public function getIterator(): \ArrayIterator
3433

3534
/**
3635
* Returns items count.
37-
* @return int
3836
*/
3937
public function count(): int
4038
{
@@ -45,7 +43,6 @@ public function count(): int
4543
/**
4644
* Replaces or appends a item.
4745
* @param int|NULL
48-
* @param mixed
4946
* @return void
5047
* @throws Nette\OutOfRangeException
5148
*/
@@ -81,7 +78,6 @@ public function offsetGet($index)
8178
/**
8279
* Determines whether a item exists.
8380
* @param int
84-
* @return bool
8581
*/
8682
public function offsetExists($index): bool
8783
{
@@ -106,7 +102,6 @@ public function offsetUnset($index)
106102

107103
/**
108104
* Prepends a item.
109-
* @param mixed
110105
* @return void
111106
*/
112107
public function prepend($value)

src/Utils/Arrays.php

+3-16
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ class Arrays
2222

2323
/**
2424
* Returns item from array or $default if item is not set.
25-
* @param array
26-
* @param string|int|array one or more keys
27-
* @param mixed
25+
* @param string|int|array $key one or more keys
2826
* @return mixed
2927
* @throws Nette\InvalidArgumentException if item does not exist and default value is not provided
3028
*/
@@ -46,8 +44,7 @@ public static function get(array $arr, $key, $default = NULL)
4644

4745
/**
4846
* Returns reference to array item.
49-
* @param array
50-
* @param string|int|array one or more keys
47+
* @param string|int|array $key one or more keys
5148
* @return mixed
5249
* @throws Nette\InvalidArgumentException if traversed item is not an array
5350
*/
@@ -66,7 +63,6 @@ public static function &getRef(array &$arr, $key)
6663

6764
/**
6865
* Recursively appends elements of remaining keys from the second array to the first.
69-
* @return array
7066
*/
7167
public static function mergeTree(array $arr1, array $arr2): array
7268
{
@@ -131,7 +127,6 @@ public static function renameKey(array &$arr, $oldKey, $newKey)
131127

132128
/**
133129
* Returns array entries that match the pattern.
134-
* @return array
135130
*/
136131
public static function grep(array $arr, string $pattern, int $flags = 0): array
137132
{
@@ -141,7 +136,6 @@ public static function grep(array $arr, string $pattern, int $flags = 0): array
141136

142137
/**
143138
* Returns flattened array.
144-
* @return array
145139
*/
146140
public static function flatten(array $arr, bool $preserveKeys = FALSE): array
147141
{
@@ -156,7 +150,6 @@ public static function flatten(array $arr, bool $preserveKeys = FALSE): array
156150

157151
/**
158152
* Finds whether a variable is a zero-based integer indexed array.
159-
* @return bool
160153
*/
161154
public static function isList($value): bool
162155
{
@@ -218,7 +211,6 @@ public static function associate(array $arr, $path)
218211

219212
/**
220213
* Normalizes to associative array.
221-
* @return array
222214
*/
223215
public static function normalize(array $arr, $filling = NULL): array
224216
{
@@ -232,9 +224,7 @@ public static function normalize(array $arr, $filling = NULL): array
232224

233225
/**
234226
* Picks element from the array by key and return its value.
235-
* @param array
236-
* @param string|int array key
237-
* @param mixed
227+
* @param string|int $key array key
238228
* @return mixed
239229
* @throws Nette\InvalidArgumentException if item does not exist and default value is not provided
240230
*/
@@ -256,7 +246,6 @@ public static function pick(array &$arr, $key, $default = NULL)
256246

257247
/**
258248
* Tests whether some element in the array passes the callback test.
259-
* @return bool
260249
*/
261250
public static function some(array $arr, callable $callback): bool
262251
{
@@ -271,7 +260,6 @@ public static function some(array $arr, callable $callback): bool
271260

272261
/**
273262
* Tests whether all elements in the array pass the callback test.
274-
* @return bool
275263
*/
276264
public static function every(array $arr, callable $callback): bool
277265
{
@@ -286,7 +274,6 @@ public static function every(array $arr, callable $callback): bool
286274

287275
/**
288276
* Applies the callback to the elements of the array.
289-
* @return array
290277
*/
291278
public static function map(array $arr, callable $callback): array
292279
{

src/Utils/Callback.php

+4-14
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ class Callback
2121
use Nette\StaticClass;
2222

2323
/**
24-
* @param mixed class, object, callable
25-
* @param string method
26-
* @return \Closure
24+
* @param string|object|callable class, object, callable
2725
*/
28-
public static function closure($callable, string $m = NULL): \Closure
26+
public static function closure($callable, string $method = NULL): \Closure
2927
{
30-
if ($m !== NULL) {
31-
$callable = [$callable, $m];
28+
if ($method !== NULL) {
29+
$callable = [$callable, $method];
3230

3331
} elseif (is_string($callable) && count($tmp = explode('::', $callable)) === 2) {
3432
$callable = $tmp;
@@ -79,7 +77,6 @@ public static function invokeArgs($callable, array $args = [])
7977

8078
/**
8179
* Invokes internal PHP function with own error handler.
82-
* @param string
8380
* @return mixed
8481
*/
8582
public static function invokeSafe(string $function, array $args, callable $onError)
@@ -120,9 +117,6 @@ public static function check($callable, bool $syntax = FALSE)
120117
}
121118

122119

123-
/**
124-
* @return string
125-
*/
126120
public static function toString($callable): string
127121
{
128122
if ($callable instanceof \Closure) {
@@ -160,9 +154,6 @@ public static function toReflection($callable)
160154
}
161155

162156

163-
/**
164-
* @return bool
165-
*/
166157
public static function isStatic(callable $callable): bool
167158
{
168159
return is_array($callable) ? is_string($callable[0]) : is_string($callable);
@@ -172,7 +163,6 @@ public static function isStatic(callable $callable): bool
172163
/**
173164
* Unwraps closure created by self::closure()
174165
* @internal
175-
* @return callable
176166
*/
177167
public static function unwrap(\Closure $closure): callable
178168
{

src/Utils/DateTime.php

+3-8
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,13 @@ public static function fromParts(int $year, int $month, int $day, int $hour = 0,
7474
}
7575

7676

77-
/**
78-
* @return string
79-
*/
8077
public function __toString(): string
8178
{
8279
return $this->format('Y-m-d H:i:s');
8380
}
8481

8582

8683
/**
87-
* @param string
8884
* @return static
8985
*/
9086
public function modifyClone(string $modify = ''): self
@@ -118,9 +114,9 @@ public function getTimestamp()
118114

119115
/**
120116
* Returns new DateTime object formatted according to the specified format.
121-
* @param string The format the $time parameter should be in
122-
* @param string String representing the time
123-
* @param string|\DateTimeZone desired timezone (default timezone is used if NULL is passed)
117+
* @param string The format the $time parameter should be in
118+
* @param string String representing the time
119+
* @param string|\DateTimeZone desired timezone (default timezone is used if NULL is passed)
124120
* @return static|FALSE
125121
*/
126122
public static function createFromFormat($format, $time, $timezone = NULL)
@@ -142,7 +138,6 @@ public static function createFromFormat($format, $time, $timezone = NULL)
142138

143139
/**
144140
* Returns JSON representation in ISO 8601 (used by JavaScript).
145-
* @return string
146141
*/
147142
public function jsonSerialize(): string
148143
{

src/Utils/FileSystem.php

-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ public static function rename(string $name, string $newName, bool $overwrite = T
117117

118118
/**
119119
* Reads file content.
120-
* @return string
121120
* @throws Nette\IOException
122121
*/
123122
public static function read(string $file): string
@@ -149,7 +148,6 @@ public static function write(string $file, string $content, int $mode = 0666)
149148

150149
/**
151150
* Is path absolute?
152-
* @return bool
153151
*/
154152
public static function isAbsolute(string $path): bool
155153
{

0 commit comments

Comments
 (0)