@@ -103,7 +103,7 @@ |
||
| 103 | 103 | $io = new NullIO(); |
| 104 | 104 | $config = new Config(CH_PATH_FILES . '/captainhook.json'); |
| 105 | 105 | $action = new Config\Action(IsEmpty::class, ['files' => [ |
| 106 | - CH_PATH_FILES . '/doesNotExist.txt', // pass |
|
| 106 | + CH_PATH_FILES . '/doesNotExist.txt', // pass |
|
| 107 | 107 | CH_PATH_FILES . '/storage/empty.log', // pass |
| 108 | 108 | CH_PATH_FILES . '/storage/test.json', // fail |
| 109 | 109 | ]]); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | $io = new NullIO(); |
| 35 | 35 | $config = new Config(CH_PATH_FILES . '/captainhook.json'); |
| 36 | - $repo = $this->createRepositoryMock(); |
|
| 36 | + $repo = $this->createRepositoryMock(); |
|
| 37 | 37 | $action = new Config\Action(DoesNotContainRegex::class); |
| 38 | 38 | |
| 39 | 39 | $standard = new DoesNotContainRegex(); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | 'regex' => '#foo#', |
| 106 | 106 | 'fileExtensions' => '' |
| 107 | 107 | ]); |
| 108 | - $repo = $this->createRepositoryMock(); |
|
| 108 | + $repo = $this->createRepositoryMock(); |
|
| 109 | 109 | $repo->method('getIndexOperator')->willReturn( |
| 110 | 110 | $this->createGitIndexOperator([ |
| 111 | 111 | CH_PATH_FILES . '/storage/regextest1.txt', |
@@ -154,10 +154,10 @@ discard block |
||
| 154 | 154 | 'regex' => '#.#', |
| 155 | 155 | 'fileExtensions' => ['php'] |
| 156 | 156 | ]); |
| 157 | - $index = $this->createGitIndexOperator([ |
|
| 157 | + $index = $this->createGitIndexOperator([ |
|
| 158 | 158 | CH_PATH_FILES . '/storage/regextest1.txt' |
| 159 | 159 | ]); |
| 160 | - $index->method('getStagedFilesOfType')->willReturnCallback(function ($ext) { |
|
| 160 | + $index->method('getStagedFilesOfType')->willReturnCallback(function($ext) { |
|
| 161 | 161 | if ($ext === 'txt') { |
| 162 | 162 | return [ |
| 163 | 163 | CH_PATH_FILES . '/storage/regextest1.txt' |
@@ -189,10 +189,10 @@ discard block |
||
| 189 | 189 | 'regex' => '#foo#', |
| 190 | 190 | 'fileExtensions' => ['txt'] |
| 191 | 191 | ]); |
| 192 | - $index = $this->createGitIndexOperator([ |
|
| 192 | + $index = $this->createGitIndexOperator([ |
|
| 193 | 193 | CH_PATH_FILES . '/storage/regextest1.txt' |
| 194 | 194 | ]); |
| 195 | - $index->method('getStagedFilesOfType')->willReturnCallback(function ($ext) { |
|
| 195 | + $index->method('getStagedFilesOfType')->willReturnCallback(function($ext) { |
|
| 196 | 196 | if ($ext === 'txt') { |
| 197 | 197 | return [ |
| 198 | 198 | CH_PATH_FILES . '/storage/regextest1.txt' |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | } |
| 201 | 201 | return []; |
| 202 | 202 | }); |
| 203 | - $repo = $this->createRepositoryMock(); |
|
| 203 | + $repo = $this->createRepositoryMock(); |
|
| 204 | 204 | $repo->method('getIndexOperator')->willReturn($index); |
| 205 | 205 | |
| 206 | 206 | $standard = new DoesNotContainRegex(); |
@@ -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 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $this->io->write('<info>Unstaged intent-to-add files detected.</info>'); |
| 121 | 121 | |
| 122 | 122 | $this->repository->getIndexOperator()->removeFiles( |
| 123 | - array_map(function (Path $path): string { |
|
| 123 | + array_map(function(Path $path): string { |
|
| 124 | 124 | return $path->getPath(); |
| 125 | 125 | }, $this->intentToAddFiles), |
| 126 | 126 | false, |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | $this->repository->getIndexOperator()->recordIntentToAddFiles( |
| 144 | - array_map(function (Path $path): string { |
|
| 144 | + array_map(function(Path $path): string { |
|
| 145 | 145 | return $path->getPath(); |
| 146 | 146 | }, $this->intentToAddFiles) |
| 147 | 147 | ); |
@@ -120,7 +120,7 @@ |
||
| 120 | 120 | return array_keys( |
| 121 | 121 | array_filter( |
| 122 | 122 | self::$virtualHookTriggers, |
| 123 | - function ($e) use ($virtualHook) { |
|
| 123 | + function($e) use ($virtualHook) { |
|
| 124 | 124 | return $e === $virtualHook; |
| 125 | 125 | } |
| 126 | 126 | ) |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @var string|array<string> |
| 28 | 28 | */ |
| 29 | - private string|array $message; |
|
| 29 | + private string | array $message; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Should message be ended with a new line character |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * @param bool $newLine |
| 50 | 50 | * @param int $verbosity |
| 51 | 51 | */ |
| 52 | - public function __construct(string|array $message, bool $newLine, int $verbosity) |
|
| 52 | + public function __construct(string | array $message, bool $newLine, int $verbosity) |
|
| 53 | 53 | { |
| 54 | 54 | $this->message = $message; |
| 55 | 55 | $this->newLine = $newLine; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | * |
| 62 | 62 | * @return string|array<string> |
| 63 | 63 | */ |
| 64 | - public function message(): string|array |
|
| 64 | + public function message(): string | array |
|
| 65 | 65 | { |
| 66 | 66 | return $this->message; |
| 67 | 67 | } |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | $hooks = explode(',', $hook); |
| 90 | 90 | $hooks = array_map('trim', $hooks); |
| 91 | 91 | |
| 92 | - $hooksValidationCallback = static function (string $hook): bool { |
|
| 92 | + $hooksValidationCallback = static function(string $hook): bool { |
|
| 93 | 93 | return !HookUtil::isInstallable($hook); |
| 94 | 94 | }; |
| 95 | 95 | if (!empty(($invalidHooks = array_filter($hooks, $hooksValidationCallback)))) { |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | |
| 101 | 101 | $executableInclude = substr($executablePath, 0, 1) == '/' |
| 102 | 102 | ? '\'' . $executablePath . '\'' |
| 103 | - : '__DIR__ . \'/../../' . $executablePath . '\''; |
|
| 103 | + : '__DIR__ . \'/../../' . $executablePath . '\''; |
|
| 104 | 104 | return [ |
| 105 | 105 | '#!/usr/bin/env php', |
| 106 | 106 | '<?php', |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | $executable = substr($command, 0, $endExec); |
| 109 | 109 | $options = substr($command, $endExec); |
| 110 | 110 | |
| 111 | - $command = trim($executable) |
|
| 111 | + $command = trim($executable) |
|
| 112 | 112 | . $this->createInteractiveOptions($options) |
| 113 | 113 | . $this->createTTYOptions($options) |
| 114 | 114 | . $this->createEnvOptions($options, $hook) |