File tree Expand file tree Collapse file tree 5 files changed +15
-44
lines changed Expand file tree Collapse file tree 5 files changed +15
-44
lines changed Original file line number Diff line number Diff line change 23
23
24
24
final class GitlabApiClient
25
25
{
26
- private const API_URL = 'https://%s/api/v4/ ci/lint ' ;
26
+ private const API_URL = 'https://%s/ci/lint ' ;
27
27
28
28
private string $ gitlabToken ;
29
29
Original file line number Diff line number Diff line change 15
15
use GrumPHP \Runner \TaskResult ;
16
16
use GrumPHP \Runner \TaskResultInterface ;
17
17
use GrumPHP \Task \AbstractExternalTask ;
18
+ use GrumPHP \Task \Config \ConfigOptionsResolver ;
18
19
use GrumPHP \Task \Context \ContextInterface ;
19
20
use GrumPHP \Task \Context \GitPreCommitContext ;
20
21
use GrumPHP \Task \Context \RunContext ;
21
22
use Symfony \Component \OptionsResolver \OptionsResolver ;
22
23
23
24
final class GitlabLintTask extends AbstractExternalTask
24
25
{
25
- public static function getConfigurableOptions (): OptionsResolver
26
+ public static function getConfigurableOptions (): ConfigOptionsResolver
26
27
{
27
28
$ resolver = new OptionsResolver ();
28
29
$ resolver ->setDefaults ([
@@ -37,7 +38,7 @@ public static function getConfigurableOptions(): OptionsResolver
37
38
->addAllowedTypes ('gitlab_url ' , ['string ' ])
38
39
;
39
40
40
- return $ resolver ;
41
+ return ConfigOptionsResolver:: fromOptionsResolver ( $ resolver) ;
41
42
}
42
43
43
44
public function canRunInContext (ContextInterface $ context ): bool
Original file line number Diff line number Diff line change 13
13
namespace Headsnet \GrumPHP \GitlabLint ;
14
14
15
15
use GrumPHP \Extension \ExtensionInterface ;
16
- use Symfony \Component \DependencyInjection \ContainerBuilder ;
17
- use Symfony \Component \DependencyInjection \Reference ;
18
16
19
17
final class Loader implements ExtensionInterface
20
18
{
21
- public const SERVICE_ID = 'task.gitlab_lint ' ;
22
-
23
- public function load (ContainerBuilder $ container ): void
19
+ public function imports (): iterable
24
20
{
25
- $ container ->register (self ::SERVICE_ID , GitlabLintTask::class)
26
- ->addArgument (new Reference ('process_builder ' ))
27
- ->addArgument (new Reference ('formatter.raw_process ' ))
28
- ->addTag ('grumphp.task ' , [
29
- 'task ' => 'gitlab_lint ' ,
30
- ]);
21
+ yield __DIR__ . '/Resources/config/services.yaml ' ;
31
22
}
32
23
}
Original file line number Diff line number Diff line change
1
+
2
+ services :
3
+ task.gitlab_lint :
4
+ class : Headsnet\GrumPHP\GitlabLint\GitlabLintTask
5
+ arguments :
6
+ - ' @process_builder'
7
+ - ' @formatter.raw_process'
8
+ tags :
9
+ - { name: 'grumphp.task', task: 'gitlab_lint' }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments