Conditions | 3 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 16 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
28 | 4 | public function __construct(ContainerInterface $ci, Handler $handler) |
|
29 | { |
||
30 | 4 | $this->ci = $ci; |
|
|
|||
31 | 4 | $this->secret = $ci->get('settings')['secret']; |
|
32 | 4 | $this->scripts = $ci->get('scripts'); |
|
33 | |||
34 | $this->router['pipeline'] = function (array $event) use($handler) { |
||
35 | 1 | foreach ($event['builds'] as $build) { |
|
36 | 1 | if ($build['stage'] === 'deploy') { |
|
37 | 1 | $handler->handleDeploy($event, $build); |
|
38 | 1 | } |
|
39 | 1 | } |
|
40 | 1 | }; |
|
41 | |||
42 | $this->router['push'] = function (array $event) use($handler) { |
||
43 | 1 | $handler->handlePush($event); |
|
44 | 1 | }; |
|
45 | |||
46 | 1 | $this->router['tag_push'] = function (array $event) use($handler) { |
|
47 | 1 | $handler->handleTag($event); |
|
48 | 1 | }; |
|
49 | 4 | } |
|
50 | |||
78 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: