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