Conditions | 25 |
Paths | 3535 |
Total Lines | 62 |
Code Lines | 44 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
63 | public function configure(Event $event = null) |
||
64 | { |
||
65 | if (!$this->firstCall) { |
||
66 | return; |
||
67 | } |
||
68 | $this->firstCall = false; |
||
69 | if ($this->logger || null !== $this->throwAt) { |
||
70 | $handler = set_error_handler('var_dump'); |
||
71 | $handler = is_array($handler) ? $handler[0] : null; |
||
72 | restore_error_handler(); |
||
73 | if ($handler instanceof ErrorHandler) { |
||
74 | if ($this->logger) { |
||
75 | $handler->setDefaultLogger($this->logger, $this->levels); |
||
76 | if (is_array($this->levels)) { |
||
77 | $scream = 0; |
||
78 | foreach ($this->levels as $type => $log) { |
||
79 | $scream |= $type; |
||
80 | } |
||
81 | } else { |
||
82 | $scream = null === $this->levels ? E_ALL | E_STRICT : $this->levels; |
||
83 | } |
||
84 | if ($this->scream) { |
||
85 | $handler->screamAt($scream); |
||
86 | } |
||
87 | $this->logger = $this->levels = null; |
||
88 | } |
||
89 | if (null !== $this->throwAt) { |
||
90 | $handler->throwAt($this->throwAt, true); |
||
91 | } |
||
92 | } |
||
93 | } |
||
94 | if (!$this->exceptionHandler) { |
||
95 | if ($event instanceof KernelEvent) { |
||
96 | if (method_exists($event->getKernel(), 'terminateWithException')) { |
||
97 | $this->exceptionHandler = array($event->getKernel(), 'terminateWithException'); |
||
98 | } |
||
99 | } elseif ($event instanceof ConsoleEvent && $app = $event->getCommand()->getApplication()) { |
||
100 | $output = $event->getOutput(); |
||
101 | if ($output instanceof ConsoleOutputInterface) { |
||
102 | $output = $output->getErrorOutput(); |
||
103 | } |
||
104 | $this->exceptionHandler = function ($e) use ($app, $output) { |
||
105 | $app->renderException($e, $output); |
||
106 | }; |
||
107 | } |
||
108 | } |
||
109 | if ($this->exceptionHandler) { |
||
110 | $handler = set_exception_handler('var_dump'); |
||
111 | $handler = is_array($handler) ? $handler[0] : null; |
||
112 | restore_exception_handler(); |
||
113 | if ($handler instanceof ErrorHandler) { |
||
114 | $h = $handler->setExceptionHandler('var_dump') ?: $this->exceptionHandler; |
||
115 | $handler->setExceptionHandler($h); |
||
116 | $handler = is_array($h) ? $h[0] : null; |
||
117 | } |
||
118 | if ($handler instanceof ExceptionHandler) { |
||
119 | $handler->setHandler($this->exceptionHandler); |
||
120 | if (null !== $this->fileLinkFormat) { |
||
121 | $handler->setFileLinkFormat($this->fileLinkFormat); |
||
122 | } |
||
123 | } |
||
124 | $this->exceptionHandler = null; |
||
125 | } |
||
139 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths