@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | $io = new NullIO(); |
79 | 79 | $config = new Config(CH_PATH_FILES . '/captainhook.json'); |
80 | - $repo = $this->createRepositoryMock(); |
|
80 | + $repo = $this->createRepositoryMock(); |
|
81 | 81 | $action = new Config\Action(Regex::class); |
82 | 82 | |
83 | 83 | $standard = new Regex(); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | 'error' => 'No match for %s' |
120 | 120 | ] |
121 | 121 | ); |
122 | - $repo = $this->createRepositoryMock(); |
|
122 | + $repo = $this->createRepositoryMock(); |
|
123 | 123 | $repo->expects($this->once())->method('getCommitMsg')->willReturn(new CommitMessage('Foo bar baz')); |
124 | 124 | |
125 | 125 | $standard = new Regex(); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | ); |
80 | 80 | |
81 | 81 | if (IOUtil::answerToBool($answer)) { |
82 | - $call = '\\CaptainHook\\App\\Hook\\PHP\\Action\\Linting'; |
|
82 | + $call = '\\CaptainHook\\App\\Hook\\PHP\\Action\\Linting'; |
|
83 | 83 | $config->addAction(new Config\Action($call)); |
84 | 84 | } |
85 | 85 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | ); |
123 | 123 | |
124 | 124 | if (IOUtil::answerToBool($answer)) { |
125 | - $call = $this->io->ask( |
|
125 | + $call = $this->io->ask( |
|
126 | 126 | ' <info>Enter the phpcs command you want to execute.</info> ' |
127 | 127 | . '<comment>[phpcs --standard=psr2 src]</comment> ', |
128 | 128 | 'phpcs --standard=psr2 src' |
@@ -80,7 +80,7 @@ |
||
80 | 80 | 'CAPTAINHOOK FOUND ' . $err . ' PROBLEM' . ($err === 1 ? '' : 'S') . ' IN YOUR COMMIT MESSAGE', |
81 | 81 | IOUtil::getLineSeparator(80, '-') |
82 | 82 | ]; |
83 | - $msg = OutputUtil::trimEmptyLines($repository->getCommitMsg()->getLines()); |
|
83 | + $msg = OutputUtil::trimEmptyLines($repository->getCommitMsg()->getLines()); |
|
84 | 84 | |
85 | 85 | $lines = [IOUtil::getLineSeparator(80, '-')]; |
86 | 86 | foreach ($problems as $problem) { |
@@ -45,7 +45,7 @@ |
||
45 | 45 | |
46 | 46 | if ($checkOnlyBeginning) { |
47 | 47 | // overwrite the detection logic to only check the beginning og the string |
48 | - $this->stringDetection = function (string $content, string $term): bool { |
|
48 | + $this->stringDetection = function(string $content, string $term): bool { |
|
49 | 49 | return strpos($content, $term) === 0; |
50 | 50 | }; |
51 | 51 | } |
@@ -54,7 +54,7 @@ |
||
54 | 54 | { |
55 | 55 | $this->isCaseSensitive = $caseSensitive; |
56 | 56 | $this->hint = 'Commit message should not contain blacklisted words'; |
57 | - $this->stringDetection = function (string $content, string $term): bool { |
|
57 | + $this->stringDetection = function(string $content, string $term): bool { |
|
58 | 58 | return strpos($content, $term) !== false; |
59 | 59 | }; |
60 | 60 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | ksort($relevantContent); |
114 | 114 | |
115 | - return md5((string)json_encode($relevantContent)); |
|
115 | + return md5((string) json_encode($relevantContent)); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /** |
@@ -127,6 +127,6 @@ discard block |
||
127 | 127 | if (!file_exists($file)) { |
128 | 128 | throw new Exception($file . ' not found'); |
129 | 129 | } |
130 | - return (string)file_get_contents($file); |
|
130 | + return (string) file_get_contents($file); |
|
131 | 131 | } |
132 | 132 | } |
@@ -90,7 +90,7 @@ |
||
90 | 90 | */ |
91 | 91 | public function getArgument(string $name, string $default = ''): string |
92 | 92 | { |
93 | - return (string)($this->getArguments()[$name] ?? $default); |
|
93 | + return (string) ($this->getArguments()[$name] ?? $default); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -67,9 +67,9 @@ |
||
67 | 67 | public function beforeHook(): void |
68 | 68 | { |
69 | 69 | $this->commentChar = $this->repository->getConfigOperator()->getSafely('core.commentchar', '#'); |
70 | - $this->file = (string)$this->io->getArgument('file'); |
|
71 | - $this->mode = (string)$this->io->getArgument('mode'); |
|
72 | - $this->hash = (string)$this->io->getArgument('hash'); |
|
70 | + $this->file = (string) $this->io->getArgument('file'); |
|
71 | + $this->mode = (string) $this->io->getArgument('mode'); |
|
72 | + $this->hash = (string) $this->io->getArgument('hash'); |
|
73 | 73 | |
74 | 74 | if (empty($this->file)) { |
75 | 75 | throw new RuntimeException('commit message file argument is missing'); |
@@ -126,7 +126,7 @@ |
||
126 | 126 | true, |
127 | 127 | $this->io->askAndValidate( |
128 | 128 | 'foo', |
129 | - function () { |
|
129 | + function() { |
|
130 | 130 | return true; |
131 | 131 | }, |
132 | 132 | null, |