| 1 | <?php |
||
| 14 | class BitrixException extends \RuntimeException |
||
| 15 | { |
||
| 16 | public static function hasException(\CMain $APPLICATION = null) |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Check for legacy bitrix exception, throws new self if any |
||
| 27 | * |
||
| 28 | * @param string $message [optional] Additional error message |
||
| 29 | * @param \CMain $APPLICATION [optional] $APPLICATION instance |
||
| 30 | * @throws static |
||
| 31 | */ |
||
| 32 | public static function generate($message = null, \CMain $APPLICATION = null) |
||
| 44 | } |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: