@@ 1609-1619 (lines=11) @@ | ||
1606 | * |
|
1607 | * @throws InvalidArgumentException |
|
1608 | */ |
|
1609 | public static function file($value, $message = '') |
|
1610 | { |
|
1611 | static::fileExists($value, $message); |
|
1612 | ||
1613 | if (!\is_file($value)) { |
|
1614 | static::reportInvalidArgument(\sprintf( |
|
1615 | $message ?: 'The path %s is not a file.', |
|
1616 | static::valueToString($value) |
|
1617 | )); |
|
1618 | } |
|
1619 | } |
|
1620 | ||
1621 | /** |
|
1622 | * @param mixed $value |
|
@@ 1627-1637 (lines=11) @@ | ||
1624 | * |
|
1625 | * @throws InvalidArgumentException |
|
1626 | */ |
|
1627 | public static function directory($value, $message = '') |
|
1628 | { |
|
1629 | static::fileExists($value, $message); |
|
1630 | ||
1631 | if (!\is_dir($value)) { |
|
1632 | static::reportInvalidArgument(\sprintf( |
|
1633 | $message ?: 'The path %s is no directory.', |
|
1634 | static::valueToString($value) |
|
1635 | )); |
|
1636 | } |
|
1637 | } |
|
1638 | ||
1639 | /** |
|
1640 | * @param string $value |