Conditions | 2 |
Paths | 1 |
Total Lines | 25 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
12 | public function __invoke($payload) |
||
13 | { |
||
14 | $this->info('Analisando Repository: '.$payload->getTargetPath()); |
||
15 | |||
16 | $p = new GitRepo($payload->getTargetPath()); |
||
17 | |||
18 | // (new Collection($p->listBranches()))->map(function ($branch) use ($p) { |
||
19 | // if (!$commit = Commit:: |
||
20 | // $payload->commits |
||
21 | // }); |
||
22 | |||
23 | (new Collection($p->getRevisions()))->map(function ($revision) use ($p) { |
||
24 | if (!$commit = Commit::where('code', $revision['sha1'])->first()) { |
||
25 | $commit = Commit::create([ |
||
26 | 'code' => $revision['sha1'], |
||
27 | 'date' => $revision['date'], |
||
28 | 'author' => $revision['author'], |
||
29 | 'message' => $revision['message'], |
||
30 | ]); |
||
31 | } |
||
32 | $payload->commits()->attach($commit); |
||
|
|||
33 | }); |
||
34 | |||
35 | return $payload; |
||
36 | } |
||
37 | } |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.