@@ -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' |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | ob_start(); |
77 | 77 | $class::$method(); |
78 | - return (string)ob_get_clean(); |
|
78 | + return (string) ob_get_clean(); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -104,6 +104,6 @@ discard block |
||
104 | 104 | */ |
105 | 105 | protected function isStaticMethodCall(string $class) : bool |
106 | 106 | { |
107 | - return (bool)preg_match('#^\\\\.+::.+$#i', $class); |
|
107 | + return (bool) preg_match('#^\\\\.+::.+$#i', $class); |
|
108 | 108 | } |
109 | 109 | } |
@@ -65,9 +65,9 @@ |
||
65 | 65 | public function beforeHook() : void |
66 | 66 | { |
67 | 67 | $this->commentChar = $this->repository->getConfigOperator()->getSafely('core.commentchar', '#'); |
68 | - $this->file = (string)$this->io->getArgument('file'); |
|
69 | - $this->mode = (string)$this->io->getArgument('mode'); |
|
70 | - $this->hash = (string)$this->io->getArgument('hash'); |
|
68 | + $this->file = (string) $this->io->getArgument('file'); |
|
69 | + $this->mode = (string) $this->io->getArgument('mode'); |
|
70 | + $this->hash = (string) $this->io->getArgument('hash'); |
|
71 | 71 | |
72 | 72 | if (empty($this->file)) { |
73 | 73 | throw new \RuntimeException('commit message file argument is missing'); |
@@ -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) { |
@@ -52,7 +52,7 @@ |
||
52 | 52 | { |
53 | 53 | $this->isCaseSensitive = $caseSensitive; |
54 | 54 | $this->hint = 'Commit message should not contain blacklisted words'; |
55 | - $this->stringDetection = function (string $content, string $term) : bool { |
|
55 | + $this->stringDetection = function(string $content, string $term) : bool { |
|
56 | 56 | return strpos($content, $term) !== false; |
57 | 57 | }; |
58 | 58 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | |
44 | 44 | if ($checkOnlyBeginning) { |
45 | 45 | // overwrite the detection logic to only check the beginning og the string |
46 | - $this->stringDetection = function (string $content, string $term) : bool { |
|
46 | + $this->stringDetection = function(string $content, string $term) : bool { |
|
47 | 47 | return strpos($content, $term) === 0; |
48 | 48 | }; |
49 | 49 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | } |
110 | 110 | ksort($relevantContent); |
111 | 111 | |
112 | - return md5((string)json_encode($relevantContent)); |
|
112 | + return md5((string) json_encode($relevantContent)); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -124,6 +124,6 @@ discard block |
||
124 | 124 | if (!file_exists($file)) { |
125 | 125 | throw new \Exception($file . ' not found'); |
126 | 126 | } |
127 | - return (string)file_get_contents($file); |
|
127 | + return (string) file_get_contents($file); |
|
128 | 128 | } |
129 | 129 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | { |
25 | 25 | $this->expectException(\Exception::class); |
26 | 26 | |
27 | - $input = new ArrayInput( |
|
27 | + $input = new ArrayInput( |
|
28 | 28 | [ |
29 | 29 | 'hook' => 'pre-commit', |
30 | 30 | '--configuration' => 'foo' |
@@ -24,7 +24,7 @@ |
||
24 | 24 | { |
25 | 25 | $this->expectException(\Exception::class); |
26 | 26 | |
27 | - $input = new ArrayInput( |
|
27 | + $input = new ArrayInput( |
|
28 | 28 | [ |
29 | 29 | 'hook' => 'pre-commit', |
30 | 30 | '--configuration' => 'foo' |