Skip to content

Commit bdea849

Browse files
committed
phpDoc: added $var name to @param
1 parent 146d4ca commit bdea849

File tree

7 files changed

+40
-44
lines changed

7 files changed

+40
-44
lines changed

src/Utils/ArrayList.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function count(): int
4242

4343
/**
4444
* Replaces or appends a item.
45-
* @param int|null
45+
* @param int|null $index
4646
* @throws Nette\OutOfRangeException
4747
*/
4848
public function offsetSet($index, $value): void
@@ -61,7 +61,7 @@ public function offsetSet($index, $value): void
6161

6262
/**
6363
* Returns a item.
64-
* @param int
64+
* @param int $index
6565
* @return mixed
6666
* @throws Nette\OutOfRangeException
6767
*/
@@ -76,7 +76,7 @@ public function offsetGet($index)
7676

7777
/**
7878
* Determines whether a item exists.
79-
* @param int
79+
* @param int $index
8080
*/
8181
public function offsetExists($index): bool
8282
{
@@ -86,7 +86,7 @@ public function offsetExists($index): bool
8686

8787
/**
8888
* Removes the element at the specified position in this list.
89-
* @param int
89+
* @param int $index
9090
* @throws Nette\OutOfRangeException
9191
*/
9292
public function offsetUnset($index): void

src/Utils/Callback.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class Callback
2121
use Nette\StaticClass;
2222

2323
/**
24-
* @param string|object|callable class, object, callable
24+
* @param string|object|callable $callable class, object, callable
2525
* @deprecated use Closure::fromCallable()
2626
*/
2727
public static function closure($callable, string $method = null): \Closure

src/Utils/DateTime.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class DateTime extends \DateTime implements \JsonSerializable
4040

4141
/**
4242
* DateTime object factory.
43-
* @param string|int|\DateTimeInterface
43+
* @param string|int|\DateTimeInterface $time
4444
* @return static
4545
*/
4646
public static function from($time)
@@ -91,7 +91,7 @@ public function modifyClone(string $modify = '')
9191

9292

9393
/**
94-
* @param int|string
94+
* @param int|string $timestamp
9595
* @return static
9696
*/
9797
public function setTimestamp($timestamp)
@@ -114,9 +114,9 @@ public function getTimestamp()
114114

115115
/**
116116
* Returns new DateTime object formatted according to the specified format.
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)
117+
* @param string $format The format the $time parameter should be in
118+
* @param string $time
119+
* @param string|\DateTimeZone $timezone (default timezone is used if null is passed)
120120
* @return static|false
121121
*/
122122
public static function createFromFormat($format, $time, $timezone = null)

src/Utils/Html.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public function data(string $name, $value = null)
290290

291291
/**
292292
* Sets element's HTML content.
293-
* @param IHtmlString|string
293+
* @param IHtmlString|string $html
294294
* @return static
295295
*/
296296
final public function setHtml($html)
@@ -311,7 +311,7 @@ final public function getHtml(): string
311311

312312
/**
313313
* Sets element's textual content.
314-
* @param IHtmlString|string
314+
* @param IHtmlString|string $text
315315
* @return static
316316
*/
317317
final public function setText($text)
@@ -335,7 +335,7 @@ final public function getText(): string
335335

336336
/**
337337
* Adds new element's child.
338-
* @param IHtmlString|string Html node or raw HTML string
338+
* @param IHtmlString|string $child Html node or raw HTML string
339339
* @return static
340340
*/
341341
final public function addHtml($child)
@@ -346,7 +346,7 @@ final public function addHtml($child)
346346

347347
/**
348348
* Appends plain-text string to element content.
349-
* @param IHtmlString|string|int|float
349+
* @param IHtmlString|string|int|float $text
350350
* @return static
351351
*/
352352
public function addText($text)
@@ -391,8 +391,8 @@ public function insert(int $index = null, $child, bool $replace = false)
391391

392392
/**
393393
* Inserts (replaces) child node (\ArrayAccess implementation).
394-
* @param int|null position or null for appending
395-
* @param Html|string Html node or raw HTML string
394+
* @param int|null $index position or null for appending
395+
* @param Html|string $child Html node or raw HTML string
396396
*/
397397
final public function offsetSet($index, $child): void
398398
{
@@ -402,7 +402,7 @@ final public function offsetSet($index, $child): void
402402

403403
/**
404404
* Returns child node (\ArrayAccess implementation).
405-
* @param int
405+
* @param int $index
406406
* @return static|string
407407
*/
408408
final public function offsetGet($index)
@@ -413,7 +413,7 @@ final public function offsetGet($index)
413413

414414
/**
415415
* Exists child node? (\ArrayAccess implementation).
416-
* @param int
416+
* @param int $index
417417
*/
418418
final public function offsetExists($index): bool
419419
{
@@ -423,7 +423,7 @@ final public function offsetExists($index): bool
423423

424424
/**
425425
* Removes child node (\ArrayAccess implementation).
426-
* @param int
426+
* @param int $index
427427
*/
428428
public function offsetUnset($index): void
429429
{

src/Utils/Image.php

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public static function fromBlank(int $width, int $height, array $color = null)
208208

209209
/**
210210
* Wraps GD image.
211-
* @param resource
211+
* @param resource $image
212212
*/
213213
public function __construct($image)
214214
{
@@ -237,7 +237,7 @@ public function getHeight(): int
237237

238238
/**
239239
* Sets image resource.
240-
* @param resource
240+
* @param resource $image
241241
* @return static
242242
*/
243243
protected function setImageResource($image)
@@ -262,8 +262,8 @@ public function getImageResource()
262262

263263
/**
264264
* Resizes image.
265-
* @param mixed width in pixels or percent
266-
* @param mixed height in pixels or percent
265+
* @param int|string $width in pixels or percent
266+
* @param int|string $height in pixels or percent
267267
* @return static
268268
*/
269269
public function resize($width, $height, int $flags = self::FIT)
@@ -293,8 +293,8 @@ public function resize($width, $height, int $flags = self::FIT)
293293

294294
/**
295295
* Calculates dimensions of resized image.
296-
* @param mixed $newWidth in pixels or percent
297-
* @param mixed $newHeight in pixels or percent
296+
* @param int|string $newWidth in pixels or percent
297+
* @param int|string $newHeight in pixels or percent
298298
*/
299299
public static function calculateSize(int $srcWidth, int $srcHeight, $newWidth, $newHeight, int $flags = self::FIT): array
300300
{
@@ -355,10 +355,10 @@ public static function calculateSize(int $srcWidth, int $srcHeight, $newWidth, $
355355

356356
/**
357357
* Crops image.
358-
* @param mixed x-offset in pixels or percent
359-
* @param mixed y-offset in pixels or percent
360-
* @param mixed width in pixels or percent
361-
* @param mixed height in pixels or percent
358+
* @param int|string $left in pixels or percent
359+
* @param int|string $top in pixels or percent
360+
* @param int|string $width in pixels or percent
361+
* @param int|string $height in pixels or percent
362362
* @return static
363363
*/
364364
public function crop($left, $top, $width, $height)
@@ -372,12 +372,10 @@ public function crop($left, $top, $width, $height)
372372

373373
/**
374374
* Calculates dimensions of cutout in image.
375-
* @param int
376-
* @param int
377-
* @param mixed x-offset in pixels or percent
378-
* @param mixed y-offset in pixels or percent
379-
* @param mixed width in pixels or percent
380-
* @param mixed height in pixels or percent
375+
* @param int|string $left in pixels or percent
376+
* @param int|string $top in pixels or percent
377+
* @param int|string $newWidth in pixels or percent
378+
* @param int|string $newHeight in pixels or percent
381379
*/
382380
public static function calculateCutout(int $srcWidth, int $srcHeight, $left, $top, $newWidth, $newHeight): array
383381
{
@@ -424,10 +422,9 @@ public function sharpen()
424422

425423
/**
426424
* Puts another image into this image.
427-
* @param Image
428-
* @param mixed x-coordinate in pixels or percent
429-
* @param mixed y-coordinate in pixels or percent
430-
* @param int opacity 0..100
425+
* @param int|string $left in pixels or percent
426+
* @param int|string $top in pixels or percent
427+
* @param int $opacity 0..100
431428
* @return static
432429
*/
433430
public function place(self $image, $left = 0, $top = 0, int $opacity = 100)

src/Utils/ObjectHelpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public static function getMagicProperties(string $class): array
126126

127127
/**
128128
* Finds the best suggestion (for 8-bit encoding).
129-
* @param (\ReflectionFunctionAbstract|\ReflectionParameter|\ReflectionClass|\ReflectionProperty|string)[]
129+
* @param (\ReflectionFunctionAbstract|\ReflectionParameter|\ReflectionClass|\ReflectionProperty|string)[] $possibilities
130130
* @internal
131131
*/
132132
public static function getSuggestion(array $possibilities, string $value): ?string

src/Utils/Strings.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public static function compare(string $left, string $right, int $len = null): bo
288288

289289
/**
290290
* Finds the length of common prefix of strings.
291-
* @param string[]
291+
* @param string[] $strings
292292
*/
293293
public static function findPrefix(array $strings): string
294294
{
@@ -469,9 +469,8 @@ public static function matchAll(string $subject, string $pattern, int $flags = 0
469469

470470
/**
471471
* Perform a regular expression search and replace.
472-
* @param string
473-
* @param string|array
474-
* @param string|callable
472+
* @param string|array $pattern
473+
* @param string|callable $replacement
475474
*/
476475
public static function replace(string $subject, $pattern, $replacement = null, int $limit = -1): string
477476
{

0 commit comments

Comments
 (0)