Passed
Push — main ( 222c14...83f636 )
by Sebastian
10:37 queued 06:56
created
src/Hook/Util.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@
 block discarded – undo
103 103
             $info = explode(' ', $stdIn[0]);
104 104
             // If we find a rewritten commit, we return the first commit before the rewritten one.
105 105
             // If we do not find any rewritten commits (awkward) we use the last ref-log position.
106
-            return isset($info[1]) ? trim($info[1]) . '^' :  'HEAD@{1}';
106
+            return isset($info[1]) ? trim($info[1]) . '^' : 'HEAD@{1}';
107 107
         }
108 108
 
109 109
         return $io->getArgument(Hooks::ARG_PREVIOUS_HEAD, 'HEAD@{1}');
Please login to merge, or discard this patch.
src/Hook/PHP/CoverageResolver/CloverXML.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,6 +77,6 @@
 block discarded – undo
77 77
             );
78 78
         }
79 79
 
80
-        return $covered / ((int)$statements * 0.01);
80
+        return $covered / ((int) $statements * 0.01);
81 81
     }
82 82
 }
Please login to merge, or discard this patch.
src/Hook/Message/Rule/UseImperativeMood.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
         parent::__construct();
32 32
 
33 33
         $this->hint = 'A commit message subject should always complete the following sentence.'  . PHP_EOL .
34
-                      'This commit will [YOUR COMMIT MESSAGE].';
34
+                        'This commit will [YOUR COMMIT MESSAGE].';
35 35
 
36 36
         $this->setSubjectBlacklist(
37 37
             [
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     {
31 31
         parent::__construct();
32 32
 
33
-        $this->hint = 'A commit message subject should always complete the following sentence.'  . PHP_EOL .
33
+        $this->hint = 'A commit message subject should always complete the following sentence.' . PHP_EOL .
34 34
                       'This commit will [YOUR COMMIT MESSAGE].';
35 35
 
36 36
         $this->setSubjectBlacklist(
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
         if ($checkOnlyBeginning) {
51 51
             // overwrite the detection logic to only check the beginning og the string
52
-            $this->stringDetection = function (string $content, string $term): bool {
52
+            $this->stringDetection = function(string $content, string $term): bool {
53 53
                 return strpos($content, $term) === 0;
54 54
             };
55 55
         }
Please login to merge, or discard this patch.
src/Hook/Message/Action/PrepareFromFile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
 
63 63
         // if there is a commit message don't do anything just delete the file
64 64
         if ($repository->getCommitMsg()->isEmpty()) {
65
-            $msg = (string)file_get_contents($cacheFile);
65
+            $msg = (string) file_get_contents($cacheFile);
66 66
             $repository->setCommitMsg(
67 67
                 new CommitMessage($msg, $repository->getCommitMsg()->getCommentCharacter())
68 68
             );
Please login to merge, or discard this patch.
src/Hook/Condition/FileStaged/ThatIs.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function __construct(array $options)
71 71
     {
72
-        $this->directories = (array)($options['inDirectory'] ?? []);
73
-        $this->suffixes    = (array)($options['ofType'] ?? []);
72
+        $this->directories = (array) ($options['inDirectory'] ?? []);
73
+        $this->suffixes    = (array) ($options['ofType'] ?? []);
74 74
 
75 75
         $diffFilter = $options['diffFilter'] ?? [];
76 76
         $this->diffFilter  = FilterUtil::sanitize(is_array($diffFilter) ? $diffFilter : str_split($diffFilter));
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         if (empty($this->directories)) {
113 113
             return $files;
114 114
         }
115
-        return array_filter($files, function ($file) {
115
+        return array_filter($files, function($file) {
116 116
             foreach ($this->directories as $directory) {
117 117
                 if (str_starts_with($file, $directory)) {
118 118
                     return true;
Please login to merge, or discard this patch.
src/Hook/Condition/Logic.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
     {
49 49
         $realConditions = [];
50 50
         foreach ($conditions as $condition) {
51
-            if (! $condition instanceof Condition) {
51
+            if (!$condition instanceof Condition) {
52 52
                 continue;
53 53
             }
54 54
             $realConditions[] = $condition;
Please login to merge, or discard this patch.
src/Hook/File/Action/DoesNotContainRegex.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
     protected function errorDetails(string $file): string
123 123
     {
124 124
         return ' <comment>('
125
-               . $this->fileMatches[$file] . ' match'
126
-               . ($this->fileMatches[$file] > 1 ? 'es' : '')
127
-               . ')</comment>';
125
+                . $this->fileMatches[$file] . ' match'
126
+                . ($this->fileMatches[$file] > 1 ? 'es' : '')
127
+                . ')</comment>';
128 128
     }
129 129
 
130 130
     /**
@@ -136,10 +136,10 @@  discard block
 block discarded – undo
136 136
     protected function errorMessage(int $filesFailed): string
137 137
     {
138 138
         return 'Regex \'' . $this->regexName . '\' failed: '
139
-               . 'found ' . $this->totalMatches . ' match'
140
-               . ($this->totalMatches > 1 ? 'es' : '')
141
-               . ' in ' . $filesFailed . ' file'
142
-               . ($filesFailed > 1 ? 's' : '' );
139
+                . 'found ' . $this->totalMatches . ' match'
140
+                . ($this->totalMatches > 1 ? 'es' : '')
141
+                . ' in ' . $filesFailed . ' file'
142
+                . ($filesFailed > 1 ? 's' : '' );
143 143
     }
144 144
 
145 145
     /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@
 block discarded – undo
139 139
                . 'found ' . $this->totalMatches . ' match'
140 140
                . ($this->totalMatches > 1 ? 'es' : '')
141 141
                . ' in ' . $filesFailed . ' file'
142
-               . ($filesFailed > 1 ? 's' : '' );
142
+               . ($filesFailed > 1 ? 's' : '');
143 143
     }
144 144
 
145 145
     /**
Please login to merge, or discard this patch.
tests/unit/Runner/Hook/PreCommitTest.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
 
79 79
         // every action has to get executed
80 80
         $actionConfigFail->expects($this->atLeastOnce())
81
-                         ->method('getAction')
82
-                         ->willReturn(CH_PATH_FILES . '/bin/failure');
81
+                            ->method('getAction')
82
+                            ->willReturn(CH_PATH_FILES . '/bin/failure');
83 83
 
84 84
         // so even if the first actions fails this action has to get executed
85 85
         $actionConfigSuccess->expects($this->atLeastOnce())
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
 
89 89
         $hookConfig->method('isEnabled')->willReturn(true);
90 90
         $hookConfig->expects($this->once())
91
-                   ->method('getActions')
92
-                   ->willReturn([$actionConfigFail, $actionConfigSuccess]);
91
+                    ->method('getActions')
92
+                    ->willReturn([$actionConfigFail, $actionConfigSuccess]);
93 93
 
94 94
         $config->expects($this->once())->method('getHookConfigToExecute')->willReturn($hookConfig);
95 95
         $config->method('isHookEnabled')->willReturn(true);
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 
126 126
         $hookConfig->method('isEnabled')->willReturn(true);
127 127
         $hookConfig->expects($this->once())
128
-                   ->method('getActions')
129
-                   ->willReturn([$actionConfigFail, $actionConfigSuccess]);
128
+                    ->method('getActions')
129
+                    ->willReturn([$actionConfigFail, $actionConfigSuccess]);
130 130
 
131 131
         $config->expects($this->once())->method('getHookConfigToExecute')->willReturn($hookConfig);
132 132
         $config->expects($this->atLeastOnce())->method('isHookEnabled')->willReturn(true);
Please login to merge, or discard this patch.
src/Git/ChangedFiles/Detector/Factory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
         $command = $io->getArgument(Hooks::ARG_COMMAND);
51 51
 
52 52
         /** @var \CaptainHook\App\Git\ChangedFiles\Detecting $class */
53
-        $class    = self::$detectors[$command] ?? '\\CaptainHook\\App\\Git\\ChangedFiles\\Detector\\Fallback';
53
+        $class = self::$detectors[$command] ?? '\\CaptainHook\\App\\Git\\ChangedFiles\\Detector\\Fallback';
54 54
         return new $class($io, $repository);
55 55
     }
56 56
 }
Please login to merge, or discard this patch.