@@ 1639-1647 (lines=9) @@ | ||
1636 | * |
|
1637 | * @throws InvalidArgumentException |
|
1638 | */ |
|
1639 | public static function methodExists($classOrObject, $method, $message = '') |
|
1640 | { |
|
1641 | if (!(\is_string($classOrObject) || \is_object($classOrObject)) || !\method_exists($classOrObject, $method)) { |
|
1642 | static::reportInvalidArgument(\sprintf( |
|
1643 | $message ?: 'Expected the method %s to exist.', |
|
1644 | static::valueToString($method) |
|
1645 | )); |
|
1646 | } |
|
1647 | } |
|
1648 | ||
1649 | /** |
|
1650 | * @psalm-pure |
|
@@ 1659-1667 (lines=9) @@ | ||
1656 | * |
|
1657 | * @throws InvalidArgumentException |
|
1658 | */ |
|
1659 | public static function methodNotExists($classOrObject, $method, $message = '') |
|
1660 | { |
|
1661 | if ((\is_string($classOrObject) || \is_object($classOrObject)) && \method_exists($classOrObject, $method)) { |
|
1662 | static::reportInvalidArgument(\sprintf( |
|
1663 | $message ?: 'Expected the method %s to not exist.', |
|
1664 | static::valueToString($method) |
|
1665 | )); |
|
1666 | } |
|
1667 | } |
|
1668 | ||
1669 | /** |
|
1670 | * @psalm-pure |