| @@ 1750-1758 (lines=9) @@ | ||
| 1747 | * |
|
| 1748 | * @throws InvalidArgumentException |
|
| 1749 | */ |
|
| 1750 | public static function methodExists($classOrObject, $method, $message = '') |
|
| 1751 | { |
|
| 1752 | if (!\method_exists($classOrObject, $method)) { |
|
| 1753 | static::reportInvalidArgument(\sprintf( |
|
| 1754 | $message ?: 'Expected the method %s to exist.', |
|
| 1755 | static::valueToString($method) |
|
| 1756 | )); |
|
| 1757 | } |
|
| 1758 | } |
|
| 1759 | ||
| 1760 | /** |
|
| 1761 | * @psalm-pure |
|
| @@ 1770-1778 (lines=9) @@ | ||
| 1767 | * |
|
| 1768 | * @throws InvalidArgumentException |
|
| 1769 | */ |
|
| 1770 | public static function methodNotExists($classOrObject, $method, $message = '') |
|
| 1771 | { |
|
| 1772 | if (\method_exists($classOrObject, $method)) { |
|
| 1773 | static::reportInvalidArgument(\sprintf( |
|
| 1774 | $message ?: 'Expected the method %s to not exist.', |
|
| 1775 | static::valueToString($method) |
|
| 1776 | )); |
|
| 1777 | } |
|
| 1778 | } |
|
| 1779 | ||
| 1780 | /** |
|
| 1781 | * @psalm-pure |
|