Conditions | 2 |
Paths | 1 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
30 | public function handle(AppVeyorCommand $command): PromiseInterface |
||
31 | { |
||
32 | return new Promise(function ($resolve, $reject) use ($command) { |
||
33 | $repo = false; |
||
34 | $this->appveyor->projects()->filter(function (ProjectInterface $project) use ($command) { |
||
35 | return \strtolower($project->repositoryType()) === 'github' && |
||
36 | \strtolower($project->repositoryName()) === \strtolower($command->getRepository()); |
||
37 | })->take(1)->subscribe(function ($repository) use (&$repo) { |
||
38 | $repo = $repository; |
||
39 | }, function ($error) use ($reject) { |
||
40 | $reject($error); |
||
41 | }, function () use (&$repo, $resolve) { |
||
42 | $resolve($repo); |
||
43 | }); |
||
44 | }); |
||
45 | } |
||
46 | } |
||
47 |