File tree Expand file tree Collapse file tree 5 files changed +9
-8
lines changed Expand file tree Collapse file tree 5 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -165,13 +165,13 @@ public function isFailureAllowed(): bool
165
165
*/
166
166
public function isHookEnabled (string $ hook , bool $ withVirtual = true ): bool
167
167
{
168
- //Either this hook is explicitely enabled
168
+ // either this hook is explicitly enabled
169
169
$ hookConfig = $ this ->getHookConfig ($ hook );
170
170
if ($ hookConfig ->isEnabled ()) {
171
171
return true ;
172
172
}
173
173
174
- //Or any virtual hook that triggers it is enabled
174
+ // or any virtual hook that triggers it is enabled
175
175
if ($ withVirtual && Hooks::triggersVirtualHook ($ hookConfig ->getName ())) {
176
176
$ virtualHookConfig = $ this ->getHookConfig (Hooks::getVirtualHook ($ hookConfig ->getName ()));
177
177
if ($ virtualHookConfig ->isEnabled ()) {
Original file line number Diff line number Diff line change @@ -54,7 +54,8 @@ protected function configure(): void
54
54
'only-enabled ' ,
55
55
null ,
56
56
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. '
58
59
)
59
60
->addOption (
60
61
'force ' ,
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ public function run(): void
137
137
138
138
$ this ->io ->write ('<comment> ' . $ this ->hook . ':</comment> ' );
139
139
140
- if (!$ this ->config ->isHookEnabled ($ this ->hook )) {
140
+ if (!$ this ->config ->isHookEnabled ($ this ->hook )) {
141
141
$ this ->io ->write (' - hook is disabled ' );
142
142
return ;
143
143
}
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ public function getHooksToInstall(): array
217
217
return array_map (fn ($ hook ) => false , array_flip ($ this ->hooksToHandle ));
218
218
}
219
219
$ hooks = Hooks::nativeHooks ();
220
- if ($ this ->onlyEnabled ) {
220
+ if ($ this ->onlyEnabled ) {
221
221
$ hooks = array_filter (
222
222
$ hooks ,
223
223
fn ($ hook ) => $ this ->config ->isHookEnabled ($ hook ),
Original file line number Diff line number Diff line change @@ -88,9 +88,9 @@ public function testRunVirtualHookDisabled(): void
88
88
->method ('getHookConfig ' )
89
89
->willReturnOnConsecutiveCalls ($ hookConfig , $ vHookConfig );
90
90
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
+ );
94
94
95
95
$ io ->expects ($ this ->atLeast (1 ))->method ('write ' );
96
96
You can’t perform that action at this time.
0 commit comments