| Total Complexity | 6 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 90.91% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class EventSubscriber |
||
| 9 | { |
||
| 10 | /** @var XDebug */ |
||
| 11 | protected $xdebug; |
||
| 12 | |||
| 13 | 210 | public function __construct(XDebug $xdebug) |
|
| 16 | } |
||
| 17 | |||
| 18 | 3 | public function setXDebug($event) |
|
| 19 | { |
||
| 20 | 3 | if (($event->service ?? false) && strpos('php_fpm', $event->service) === false) { |
|
| 21 | 2 | return; |
|
| 22 | } |
||
| 23 | |||
| 24 | 1 | if (setting('use_xdebug', 'on') === 'off') { |
|
| 25 | $this->xdebug->turnOff(); |
||
| 26 | } |
||
| 27 | |||
| 28 | 1 | $this->xdebug->turnOn(); |
|
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Register the listeners for the subscriber. |
||
| 33 | * |
||
| 34 | * @param \Illuminate\Events\Dispatcher $events |
||
| 35 | * |
||
| 36 | * @return void |
||
| 37 | */ |
||
| 38 | 210 | public function subscribe($events) |
|
| 42 | } |
||
| 43 | } |
||
| 44 |