| @@ 1821-1829 (lines=9) @@ | ||
| 1818 | * |
|
| 1819 | * @throws InvalidArgumentException |
|
| 1820 | */ |
|
| 1821 | public static function methodExists($classOrObject, $method, $message = '') |
|
| 1822 | { |
|
| 1823 | if (!\method_exists($classOrObject, $method)) { |
|
| 1824 | static::reportInvalidArgument(\sprintf( |
|
| 1825 | $message ?: 'Expected the method %s to exist.', |
|
| 1826 | static::valueToString($method) |
|
| 1827 | )); |
|
| 1828 | } |
|
| 1829 | } |
|
| 1830 | ||
| 1831 | /** |
|
| 1832 | * @psalm-pure |
|
| @@ 1841-1849 (lines=9) @@ | ||
| 1838 | * |
|
| 1839 | * @throws InvalidArgumentException |
|
| 1840 | */ |
|
| 1841 | public static function methodNotExists($classOrObject, $method, $message = '') |
|
| 1842 | { |
|
| 1843 | if (\method_exists($classOrObject, $method)) { |
|
| 1844 | static::reportInvalidArgument(\sprintf( |
|
| 1845 | $message ?: 'Expected the method %s to not exist.', |
|
| 1846 | static::valueToString($method) |
|
| 1847 | )); |
|
| 1848 | } |
|
| 1849 | } |
|
| 1850 | ||
| 1851 | /** |
|
| 1852 | * @psalm-pure |
|