Conditions | 1 |
Paths | 1 |
Total Lines | 53 |
Code Lines | 39 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
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 |
||
140 | public function full_task_configuration() |
||
141 | { |
||
142 | $schedule = $this->createSchedule([ |
||
143 | [ |
||
144 | 'command' => 'my:command --option', |
||
145 | 'frequency' => '0 0 * * *', |
||
146 | 'description' => 'my description', |
||
147 | 'timezone' => 'UTC', |
||
148 | 'without_overlapping' => null, |
||
149 | 'between' => [ |
||
150 | 'start' => 9, |
||
151 | 'end' => 17, |
||
152 | ], |
||
153 | 'unless_between' => [ |
||
154 | 'start' => 12, |
||
155 | 'end' => '13:30', |
||
156 | ], |
||
157 | 'ping_before' => [ |
||
158 | 'url' => 'https://example.com/before', |
||
159 | ], |
||
160 | 'ping_after' => [ |
||
161 | 'url' => 'https://example.com/after', |
||
162 | ], |
||
163 | 'ping_on_success' => [ |
||
164 | 'url' => 'https://example.com/success', |
||
165 | ], |
||
166 | 'ping_on_failure' => [ |
||
167 | 'url' => 'https://example.com/failure', |
||
168 | 'method' => 'POST', |
||
169 | ], |
||
170 | 'email_after' => null, |
||
171 | 'email_on_failure' => [ |
||
172 | 'to' => '[email protected]', |
||
173 | 'subject' => 'my subject', |
||
174 | ], |
||
175 | ], |
||
176 | ]); |
||
177 | |||
178 | $task = $schedule->all()[0]; |
||
179 | $extensions = $task->getExtensions(); |
||
180 | |||
181 | $this->assertSame('my description', $task->getDescription()); |
||
182 | $this->assertSame('UTC', $task->getTimezone()->getName()); |
||
183 | $this->assertCount(9, $extensions); |
||
184 | $this->assertSame('Without overlapping', (string) $extensions[0]); |
||
185 | $this->assertSame('Only run between 9:00 and 17:00', (string) $extensions[1]); |
||
186 | $this->assertSame('Only run if not between 12:00 and 13:30', (string) $extensions[2]); |
||
187 | $this->assertSame('Before Task, ping "https://example.com/before"', (string) $extensions[3]); |
||
188 | $this->assertSame('After Task, ping "https://example.com/after"', (string) $extensions[4]); |
||
189 | $this->assertSame('On Task Success, ping "https://example.com/success"', (string) $extensions[5]); |
||
190 | $this->assertSame('On Task Failure, ping "https://example.com/failure"', (string) $extensions[6]); |
||
191 | $this->assertSame('After Task, email output', (string) $extensions[7]); |
||
192 | $this->assertSame('On Task Failure, email output to "[email protected]"', (string) $extensions[8]); |
||
193 | } |
||
207 |
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