| Total Complexity | 5 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | final class AreOfType implements Specifies |
||
| 20 | { |
||
| 21 | use Specifying; |
||
| 22 | |||
| 23 | /** @var string */ |
||
| 24 | private $expectation; |
||
| 25 | |||
| 26 | private function __construct(string $expectation) |
||
| 27 | { |
||
| 28 | $this->expectation = $expectation; |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Produces a condition that accepts boolean type input. |
||
| 33 | * |
||
| 34 | * @return Specifies The type enforcing condition. |
||
| 35 | */ |
||
| 36 | public static function boolean(): Specifies |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Produces a condition that accepts integer type input. |
||
| 43 | * |
||
| 44 | * @return Specifies The type enforcing condition. |
||
| 45 | */ |
||
| 46 | public static function integer(): Specifies |
||
| 47 | { |
||
| 48 | return new self('integer'); |
||
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Produces a condition that accepts string type input. |
||
| 53 | * |
||
| 54 | * @return Specifies The type enforcing condition. |
||
| 55 | */ |
||
| 56 | public static function string(): Specifies |
||
| 57 | { |
||
| 58 | return new self('string'); |
||
| 59 | } |
||
| 60 | |||
| 61 | /** @inheritdoc */ |
||
| 62 | public function isSatisfiedBy($input): bool |
||
| 65 | } |
||
| 66 | } |
||
| 67 |