@@ -34,7 +34,7 @@ |
||
34 | 34 | $config->expects($this->exactly(2))->method('getHookConfig')->willReturn($this->createHookConfigMock()); |
35 | 35 | $io->method('ask')->will($this->onConsecutiveCalls('y', 'y', 'y', 'phpunit', 'y', 'phpcs')); |
36 | 36 | |
37 | - $setup = new Express($io); |
|
37 | + $setup = new Express($io); |
|
38 | 38 | $setup->configureHooks($config); |
39 | 39 | } |
40 | 40 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | $this->expectException(Exception::class); |
25 | 25 | |
26 | 26 | $path = realpath(CH_PATH_FILES . '/storage/invalid-xml.txt'); |
27 | - $file = new Xml($path); |
|
27 | + $file = new Xml($path); |
|
28 | 28 | $file->read(); |
29 | 29 | } |
30 | 30 | } |
@@ -43,8 +43,8 @@ |
||
43 | 43 | $options = $action->getOptions(); |
44 | 44 | $book = new RuleBook(); |
45 | 45 | $book->setRules(RuleBook\RuleSet::beams( |
46 | - (int) $options->get('subjectLength', 50), |
|
47 | - (int) $options->get('bodyLineLength', 72), |
|
46 | + (int) $options->get('subjectLength', 50), |
|
47 | + (int) $options->get('bodyLineLength', 72), |
|
48 | 48 | (bool) $options->get('checkImperativeBeginningOnly', false) |
49 | 49 | )); |
50 | 50 |
@@ -55,7 +55,7 @@ |
||
55 | 55 | null, |
56 | 56 | ['captainhook.json' => file_get_contents(CH_PATH_FILES . '/config/valid.json')] |
57 | 57 | ); |
58 | - $input = new ArrayInput([ |
|
58 | + $input = new ArrayInput([ |
|
59 | 59 | 'hook' => 'pre-push', |
60 | 60 | '--configuration' => $fakeConfig->url() . '/captainhook.json', |
61 | 61 | ]); |
@@ -37,17 +37,17 @@ discard block |
||
37 | 37 | { |
38 | 38 | parent::configure(); |
39 | 39 | $this->setName('configure') |
40 | - ->setDescription('Configure your hooks') |
|
41 | - ->setHelp('This command creates or updates your captainhook configuration') |
|
42 | - ->addOption('extend', 'e', InputOption::VALUE_NONE, 'Extend existing configuration file') |
|
43 | - ->addOption('force', 'f', InputOption::VALUE_NONE, 'Overwrite existing configuration file') |
|
44 | - ->addOption('advanced', 'a', InputOption::VALUE_NONE, 'More options, but more to type') |
|
45 | - ->addOption( |
|
46 | - 'bootstrap', |
|
47 | - null, |
|
48 | - InputOption::VALUE_OPTIONAL, |
|
49 | - 'Path to composers vendor/autoload.php' |
|
50 | - ); |
|
40 | + ->setDescription('Configure your hooks') |
|
41 | + ->setHelp('This command creates or updates your captainhook configuration') |
|
42 | + ->addOption('extend', 'e', InputOption::VALUE_NONE, 'Extend existing configuration file') |
|
43 | + ->addOption('force', 'f', InputOption::VALUE_NONE, 'Overwrite existing configuration file') |
|
44 | + ->addOption('advanced', 'a', InputOption::VALUE_NONE, 'More options, but more to type') |
|
45 | + ->addOption( |
|
46 | + 'bootstrap', |
|
47 | + null, |
|
48 | + InputOption::VALUE_OPTIONAL, |
|
49 | + 'Path to composers vendor/autoload.php' |
|
50 | + ); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | |
66 | 66 | $configurator = new Creator($io, $config); |
67 | 67 | $configurator->force(IOUtil::argToBool($input->getOption('force'))) |
68 | - ->extend(IOUtil::argToBool($input->getOption('extend'))) |
|
69 | - ->advanced(IOUtil::argToBool($input->getOption('advanced'))) |
|
70 | - ->setExecutable($this->resolver->getExecutable()) |
|
71 | - ->run(); |
|
68 | + ->extend(IOUtil::argToBool($input->getOption('extend'))) |
|
69 | + ->advanced(IOUtil::argToBool($input->getOption('advanced'))) |
|
70 | + ->setExecutable($this->resolver->getExecutable()) |
|
71 | + ->run(); |
|
72 | 72 | return 0; |
73 | 73 | } |
74 | 74 | } |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | public function createResolverMock(string $executable = 'vendor/bin/captainhook', bool $isPhar = false): Resolver |
30 | 30 | { |
31 | 31 | $repo = $this->getMockBuilder(Resolver::class) |
32 | - ->disableOriginalConstructor() |
|
33 | - ->getMock(); |
|
32 | + ->disableOriginalConstructor() |
|
33 | + ->getMock(); |
|
34 | 34 | |
35 | 35 | $repo->method('getExecutable')->willReturn($executable); |
36 | 36 | $repo->method('isPharRelease')->willReturn($isPhar); |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | public function createRepositoryMock(string $root = ''): Repository |
48 | 48 | { |
49 | 49 | $repo = $this->getMockBuilder(Repository::class) |
50 | - ->disableOriginalConstructor() |
|
51 | - ->getMock(); |
|
50 | + ->disableOriginalConstructor() |
|
51 | + ->getMock(); |
|
52 | 52 | |
53 | 53 | $repo->method('getRoot')->willReturn($root); |
54 | 54 | $repo->method('getHooksDir')->willReturn($root . '/.git/hooks'); |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | public function createGitInfoOperator(string $tag = 'v1.0.0'): Info |
66 | 66 | { |
67 | 67 | $operator = $this->getMockBuilder(Info::class) |
68 | - ->disableOriginalConstructor() |
|
69 | - ->getMock(); |
|
68 | + ->disableOriginalConstructor() |
|
69 | + ->getMock(); |
|
70 | 70 | |
71 | 71 | $operator->method('getCurrentTag')->willReturn($tag); |
72 | 72 | |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | public function createGitDiffOperator(array $changedFiles = []): Diff |
83 | 83 | { |
84 | 84 | $operator = $this->getMockBuilder(Diff::class) |
85 | - ->disableOriginalConstructor() |
|
86 | - ->getMock(); |
|
85 | + ->disableOriginalConstructor() |
|
86 | + ->getMock(); |
|
87 | 87 | |
88 | 88 | $operator->method('getChangedFiles')->willReturn($changedFiles); |
89 | 89 | |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | public function createGitIndexOperator(array $stagedFiles = []): Index |
100 | 100 | { |
101 | 101 | $operator = $this->getMockBuilder(Index::class) |
102 | - ->disableOriginalConstructor() |
|
103 | - ->getMock(); |
|
102 | + ->disableOriginalConstructor() |
|
103 | + ->getMock(); |
|
104 | 104 | |
105 | 105 | $operator->method('getStagedFiles')->willReturn($stagedFiles); |
106 | 106 |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | { |
27 | 27 | $input = new ArrayInput(['--version' => true]); |
28 | 28 | $output = $this->getMockBuilder(NullOutput::class) |
29 | - ->disableOriginalConstructor() |
|
30 | - ->getMock(); |
|
29 | + ->disableOriginalConstructor() |
|
30 | + ->getMock(); |
|
31 | 31 | |
32 | 32 | $output->expects($this->once())->method('writeLn'); |
33 | 33 | |
@@ -46,8 +46,8 @@ discard block |
||
46 | 46 | { |
47 | 47 | $input = new ArrayInput(['command' => 'list']); |
48 | 48 | $output = $this->getMockBuilder(NullOutput::class) |
49 | - ->disableOriginalConstructor() |
|
50 | - ->getMock(); |
|
49 | + ->disableOriginalConstructor() |
|
50 | + ->getMock(); |
|
51 | 51 | |
52 | 52 | $output->expects($this->atLeastOnce())->method('write'); |
53 | 53 |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | } |
106 | 106 | ob_start(); |
107 | 107 | $class::$method(); |
108 | - return (string)ob_get_clean(); |
|
108 | + return (string) ob_get_clean(); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | private function isStaticMethodCall(string $class): bool |
136 | 136 | { |
137 | - return (bool)preg_match('#^\\\\.+::.+$#i', $class); |
|
137 | + return (bool) preg_match('#^\\\\.+::.+$#i', $class); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | $template = $this->createTemplateMock(); |
120 | 120 | |
121 | 121 | $template->expects($this->once()) |
122 | - ->method('getCode') |
|
123 | - ->with('pre-commit') |
|
124 | - ->willReturn(''); |
|
122 | + ->method('getCode') |
|
123 | + ->with('pre-commit') |
|
124 | + ->willReturn(''); |
|
125 | 125 | |
126 | 126 | $runner = new Installer($io, $config, $repo, $template); |
127 | 127 | $runner->setHook('pre-commit'); |
@@ -156,14 +156,14 @@ discard block |
||
156 | 156 | $repo = new Repository($fakeRepo->getRoot()); |
157 | 157 | |
158 | 158 | $template->expects($this->once()) |
159 | - ->method('getCode') |
|
160 | - ->with('pre-commit') |
|
161 | - ->willReturn(''); |
|
159 | + ->method('getCode') |
|
160 | + ->with('pre-commit') |
|
161 | + ->willReturn(''); |
|
162 | 162 | |
163 | 163 | $runner = new Installer($io, $config, $repo, $template); |
164 | 164 | $runner->setHook('pre-commit') |
165 | - ->setMoveExistingTo('foo/bar/') |
|
166 | - ->run(); |
|
165 | + ->setMoveExistingTo('foo/bar/') |
|
166 | + ->run(); |
|
167 | 167 | |
168 | 168 | $this->assertFileExists($fakeRepo->getHookDir() . '/pre-commit'); |
169 | 169 | $this->assertFileExists($fakeRepo->getRoot() . '/foo/bar/pre-commit'); |
@@ -194,14 +194,14 @@ discard block |
||
194 | 194 | $repo = new Repository($fakeRepo->getRoot()); |
195 | 195 | |
196 | 196 | $template->expects($this->once()) |
197 | - ->method('getCode') |
|
198 | - ->with('pre-commit') |
|
199 | - ->willReturn(''); |
|
197 | + ->method('getCode') |
|
198 | + ->with('pre-commit') |
|
199 | + ->willReturn(''); |
|
200 | 200 | |
201 | 201 | $runner = new Installer($io, $config, $repo, $template); |
202 | 202 | $runner->setHook('pre-commit') |
203 | - ->setMoveExistingTo('foo/bar/') |
|
204 | - ->run(); |
|
203 | + ->setMoveExistingTo('foo/bar/') |
|
204 | + ->run(); |
|
205 | 205 | |
206 | 206 | $this->assertFileExists($fakeRepo->getHookDir() . '/pre-commit'); |
207 | 207 | } |
@@ -235,8 +235,8 @@ discard block |
||
235 | 235 | |
236 | 236 | $runner = new Installer($io, $config, $repo, $template); |
237 | 237 | $runner->setHook('pre-commit') |
238 | - ->setMoveExistingTo('foo') |
|
239 | - ->run(); |
|
238 | + ->setMoveExistingTo('foo') |
|
239 | + ->run(); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | /** |