| Conditions | 5 |
| Paths | 4 |
| Total Lines | 25 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 21 | public function register(Container $container) |
||
| 22 | { |
||
| 23 | if (class_exists('ChromePhp') && !class_exists('Chrome')) { |
||
| 24 | class_alias('ChromePhp', 'Chrome'); |
||
| 25 | } |
||
| 26 | |||
| 27 | $configuration = $container->resolve('Darya\Foundation\Configuration'); |
||
| 28 | |||
| 29 | if (!$configuration->get('debug')) { |
||
| 30 | return; |
||
| 31 | } |
||
| 32 | |||
| 33 | ini_set('display_errors', 1); |
||
| 34 | |||
| 35 | $listener = function ($result) { |
||
| 36 | Chrome::log(array($result->query->string, json_encode($result->query->parameters))); |
||
| 37 | |||
| 38 | if ($result->error) { |
||
| 39 | Chrome::error(array($result->error->number, $result->error->message)); |
||
| 40 | } |
||
| 41 | }; |
||
| 42 | |||
| 43 | $container->event->listen('mysql.query', $listener); |
||
|
|
|||
| 44 | $container->event->listen('mssql.query', $listener); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: