Skip to content
This repository was archived by the owner on Dec 19, 2022. It is now read-only.

Commit 3286e1e

Browse files
author
Seif Kamal
committed
Update method doc
1 parent f7184ba commit 3286e1e

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/Struct.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ class Struct
66
{
77
/** @var string */
88
private $name;
9-
/** @var callable|Struct[] */
9+
/** @var callable[]|Struct[] */
1010
private $interface;
1111
/** @var bool */
1212
private $exhaustive;
1313

1414
/**
1515
* Struct constructor.
1616
*
17-
* @param string $name
18-
* @param callable|Struct[] $interface
17+
* @param string $name Used in error messaging, useful when nesting or validating multiple Structs.
18+
* @param callable[]|Struct[] $interface A list of expected keys and their associated validator.
1919
* @param bool $exhaustive Used to specify whether the declared Struct properties are exhaustive,
2020
* meaning data arrays submitted for validation must not contain unknown keys. This defaults
2121
* to `true`; Set to `false` if you only want to validate some of the array elements.
@@ -39,7 +39,7 @@ public function name(): string
3939
}
4040

4141
/**
42-
* @return callable|Struct[]
42+
* @return callable[]|Struct[]
4343
*/
4444
public function interface(): array
4545
{

src/functions.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ function optional(callable $validator, $default = Missing::class): callable
7575
/**
7676
* @see Struct::of()
7777
*
78-
* @param string $name
79-
* @param callable|Struct[] $interface
80-
* @param bool $exhaustive
78+
* @param string $name Used in error messaging, useful when nesting or validating multiple Structs.
79+
* @param callable[]|Struct[] $interface A list of expected keys and their associated validator.
80+
* @param bool $exhaustive Used to specify whether the declared Struct properties are exhaustive,
81+
* meaning data arrays submitted for validation must not contain unknown keys. This defaults
82+
* to `true`; Set to `false` if you only want to validate some of the array elements.
8183
* @return Struct
8284
*/
8385
function struct(string $name, array $interface, bool $exhaustive = true): Struct

0 commit comments

Comments
 (0)