| @@ 1841-1849 (lines=9) @@ | ||
| 1838 | * |
|
| 1839 | * @throws InvalidArgumentException |
|
| 1840 | */ |
|
| 1841 | public static function methodExists($classOrObject, $method, $message = '') |
|
| 1842 | { |
|
| 1843 | if (!\method_exists($classOrObject, $method)) { |
|
| 1844 | static::reportInvalidArgument(\sprintf( |
|
| 1845 | $message ?: 'Expected the method %s to exist.', |
|
| 1846 | static::valueToString($method) |
|
| 1847 | )); |
|
| 1848 | } |
|
| 1849 | } |
|
| 1850 | ||
| 1851 | /** |
|
| 1852 | * @psalm-pure |
|
| @@ 1861-1869 (lines=9) @@ | ||
| 1858 | * |
|
| 1859 | * @throws InvalidArgumentException |
|
| 1860 | */ |
|
| 1861 | public static function methodNotExists($classOrObject, $method, $message = '') |
|
| 1862 | { |
|
| 1863 | if (\method_exists($classOrObject, $method)) { |
|
| 1864 | static::reportInvalidArgument(\sprintf( |
|
| 1865 | $message ?: 'Expected the method %s to not exist.', |
|
| 1866 | static::valueToString($method) |
|
| 1867 | )); |
|
| 1868 | } |
|
| 1869 | } |
|
| 1870 | ||
| 1871 | /** |
|
| 1872 | * @psalm-pure |
|