Skip to content

Commit 3fd0d24

Browse files
Fix style issues
1 parent 532d8d7 commit 3fd0d24

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

src/Config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ public function isFailureAllowed(): bool
165165
*/
166166
public function isHookEnabled(string $hook, bool $withVirtual = true): bool
167167
{
168-
//Either this hook is explicitely enabled
168+
// either this hook is explicitly enabled
169169
$hookConfig = $this->getHookConfig($hook);
170170
if ($hookConfig->isEnabled()) {
171171
return true;
172172
}
173173

174-
//Or any virtual hook that triggers it is enabled
174+
// or any virtual hook that triggers it is enabled
175175
if ($withVirtual && Hooks::triggersVirtualHook($hookConfig->getName())) {
176176
$virtualHookConfig = $this->getHookConfig(Hooks::getVirtualHook($hookConfig->getName()));
177177
if ($virtualHookConfig->isEnabled()) {

src/Console/Command/Install.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ protected function configure(): void
5454
'only-enabled',
5555
null,
5656
InputOption::VALUE_NONE,
57-
'Limit the hooks you want to install to those enabled in your conf. By default all hooks get installed.'
57+
'Limit the hooks you want to install to those enabled in your conf. ' .
58+
'By default all hooks get installed.'
5859
)
5960
->addOption(
6061
'force',

src/Runner/Hook.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function run(): void
137137

138138
$this->io->write('<comment>' . $this->hook . ':</comment> ');
139139

140-
if(!$this->config->isHookEnabled($this->hook)) {
140+
if (!$this->config->isHookEnabled($this->hook)) {
141141
$this->io->write(' - hook is disabled');
142142
return;
143143
}

src/Runner/Installer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public function getHooksToInstall(): array
217217
return array_map(fn($hook) => false, array_flip($this->hooksToHandle));
218218
}
219219
$hooks = Hooks::nativeHooks();
220-
if($this->onlyEnabled) {
220+
if ($this->onlyEnabled) {
221221
$hooks = array_filter(
222222
$hooks,
223223
fn($hook) => $this->config->isHookEnabled($hook),

tests/unit/Runner/Hook/PostRewriteTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ public function testRunVirtualHookDisabled(): void
8888
->method('getHookConfig')
8989
->willReturnOnConsecutiveCalls($hookConfig, $vHookConfig);
9090

91-
$config->expects($this->atLeastOnce())->method('isHookEnabled')->willReturnCallback(function($hook){
92-
return $hook === 'post-rewrite';
93-
});
91+
$config->expects($this->atLeastOnce())->method('isHookEnabled')->willReturnCallback(
92+
fn($hook) => $hook === 'post-rewrite'
93+
);
9494

9595
$io->expects($this->atLeast(1))->method('write');
9696

0 commit comments

Comments
 (0)