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 |
||
73 | public function full_task_configuration() |
||
74 | { |
||
75 | $schedule = $this->createSchedule([ |
||
76 | [ |
||
77 | 'command' => 'my:command --option', |
||
78 | 'frequency' => '0 0 * * *', |
||
79 | 'description' => 'my description', |
||
80 | 'without_overlapping' => null, |
||
81 | 'between' => [ |
||
82 | 'start' => 9, |
||
83 | 'end' => 17, |
||
84 | ], |
||
85 | 'unless_between' => [ |
||
86 | 'start' => 12, |
||
87 | 'end' => '13:30', |
||
88 | ], |
||
89 | 'ping_before' => [ |
||
90 | 'url' => 'https://example.com/before', |
||
91 | ], |
||
92 | 'ping_after' => [ |
||
93 | 'url' => 'https://example.com/after', |
||
94 | ], |
||
95 | 'ping_on_success' => [ |
||
96 | 'url' => 'https://example.com/success', |
||
97 | ], |
||
98 | 'ping_on_failure' => [ |
||
99 | 'url' => 'https://example.com/failure', |
||
100 | 'method' => 'POST', |
||
101 | ], |
||
102 | 'email_after' => null, |
||
103 | 'email_on_failure' => [ |
||
104 | 'to' => '[email protected]', |
||
105 | 'subject' => 'my subject', |
||
106 | ], |
||
107 | ], |
||
108 | ]); |
||
109 | |||
110 | $task = $schedule->all()[0]; |
||
111 | $extensions = $task->getExtensions(); |
||
112 | |||
113 | $this->assertSame('my description', $task->getDescription()); |
||
114 | $this->assertCount(9, $extensions); |
||
115 | $this->assertSame('Without overlapping', (string) $extensions[0]); |
||
116 | $this->assertSame('Only run between 9:00 and 17:00', (string) $extensions[1]); |
||
117 | $this->assertSame('Only run if not between 12:00 and 13:30', (string) $extensions[2]); |
||
118 | $this->assertSame('Before Task, ping "https://example.com/before"', (string) $extensions[3]); |
||
119 | $this->assertSame('After Task, ping "https://example.com/after"', (string) $extensions[4]); |
||
120 | $this->assertSame('On Task Success, ping "https://example.com/success"', (string) $extensions[5]); |
||
121 | $this->assertSame('On Task Failure, ping "https://example.com/failure"', (string) $extensions[6]); |
||
122 | $this->assertSame('After Task, email output', (string) $extensions[7]); |
||
123 | $this->assertSame('On Task Failure, email output to "[email protected]"', (string) $extensions[8]); |
||
124 | } |
||
138 |
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