Passed
Push — master ( de7969...0d30a7 )
by Sebastian
02:09
created
tests/CaptainHook/Hook/Message/Action/RegexTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
src/Runner/Config/Setup/Express.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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'
Please login to merge, or discard this patch.
src/Hook/Message/Action/Book.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
src/Hook/Message/Rule/UseImperativeMood.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Hook/Message/Rule/Blacklist.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Hook/Composer/Action/CheckLockFile.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Console/IO/DefaultIO.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/Runner/Hook/PrepareCommitMsg.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,9 +67,9 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
tests/CaptainHook/Console/IO/ComposerIOTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@
 block discarded – undo
126 126
             true,
127 127
             $this->io->askAndValidate(
128 128
                 'foo',
129
-                function () {
129
+                function() {
130 130
                     return true;
131 131
                 },
132 132
                 null,
Please login to merge, or discard this patch.