Skip to content

Commit 859f0c1

Browse files
committed
Add PHP 8.4 compatibility
1 parent ace0f72 commit 859f0c1

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

src/InstallerPlugin.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ class InstallerPlugin implements PluginInterface, EventSubscriberInterface
3232
*/
3333
public function __construct(?ConfigPatcherInterface $patcher = null)
3434
{
35-
$this->patcher = $patcher !== null
36-
? $patcher
37-
: new ConfigPatcher();
35+
$this->patcher = $patcher ?? new ConfigPatcher();
3836
}
3937

4038
/**

src/Patcher/ConfigPatcher.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,17 @@ class ConfigPatcher implements ConfigPatcherInterface
2424
*
2525
* @param array $patchers
2626
*/
27-
public function __construct(array $patchers = null)
27+
public function __construct(?array $patchers = null)
2828
{
2929
$xmlAccessor = new XmlAccessor();
3030

31-
$this->patchers = $patchers !== null
32-
? $patchers
33-
: [
34-
new CodeStylePatcher(),
35-
new FileTemplatesPatcher($xmlAccessor),
36-
new InspectionsPatcher($xmlAccessor),
37-
new TemplateSettingsPatcher($xmlAccessor),
38-
new LiveTemplatesPatcher()
39-
];
31+
$this->patchers = $patchers ?? [
32+
new CodeStylePatcher(),
33+
new FileTemplatesPatcher($xmlAccessor),
34+
new InspectionsPatcher($xmlAccessor),
35+
new TemplateSettingsPatcher($xmlAccessor),
36+
new LiveTemplatesPatcher()
37+
];
4038
}
4139

4240
/**

src/Plugin.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@ class Plugin implements PluginInterface, EventSubscriberInterface
3737
*
3838
* @param ConfigPatcherInterface $patcher
3939
*/
40-
public function __construct(ConfigPatcherInterface $patcher = null)
40+
public function __construct(?ConfigPatcherInterface $patcher = null)
4141
{
42-
$this->patcher = $patcher !== null
43-
? $patcher
44-
: new ConfigPatcher();
42+
$this->patcher = $patcher ?? new ConfigPatcher();
4543
}
4644

4745
/**

0 commit comments

Comments
 (0)