| @@ 1778-1786 (lines=9) @@ | ||
| 1775 | * |
|
| 1776 | * @throws InvalidArgumentException |
|
| 1777 | */ |
|
| 1778 | public static function methodExists($classOrObject, $method, $message = '') |
|
| 1779 | { |
|
| 1780 | if (!\method_exists($classOrObject, $method)) { |
|
| 1781 | static::reportInvalidArgument(\sprintf( |
|
| 1782 | $message ?: 'Expected the method %s to exist.', |
|
| 1783 | static::valueToString($method) |
|
| 1784 | )); |
|
| 1785 | } |
|
| 1786 | } |
|
| 1787 | ||
| 1788 | /** |
|
| 1789 | * @psalm-pure |
|
| @@ 1798-1806 (lines=9) @@ | ||
| 1795 | * |
|
| 1796 | * @throws InvalidArgumentException |
|
| 1797 | */ |
|
| 1798 | public static function methodNotExists($classOrObject, $method, $message = '') |
|
| 1799 | { |
|
| 1800 | if (\method_exists($classOrObject, $method)) { |
|
| 1801 | static::reportInvalidArgument(\sprintf( |
|
| 1802 | $message ?: 'Expected the method %s to not exist.', |
|
| 1803 | static::valueToString($method) |
|
| 1804 | )); |
|
| 1805 | } |
|
| 1806 | } |
|
| 1807 | ||
| 1808 | /** |
|
| 1809 | * @psalm-pure |
|