Skip to content

Commit 5ceef1a

Browse files
committed
refactor
1 parent aa4c629 commit 5ceef1a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/Container/ServiceExtensions.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,7 @@ protected function resolveByType(
118118
}
119119

120120
// 2nd group of extensions: targeting parent classes
121-
$parents = class_parents($service, false);
122-
if ($parents === false) {
123-
$parents = [];
124-
}
121+
$parents = class_parents($service, false) ?: [];
125122
foreach ($parents as $parentName) {
126123
$byParent = $this->extensions[self::typeId($parentName)] ?? null;
127124
if (($byParent !== null) && ($byParent !== [])) {
@@ -130,10 +127,7 @@ protected function resolveByType(
130127
}
131128

132129
// 3rd group of extensions: targeting implemented interfaces
133-
$interfaces = class_implements($service, false);
134-
if ($interfaces === false) {
135-
$interfaces = [];
136-
}
130+
$interfaces = class_implements($service, false) ?: [];
137131
foreach ($interfaces as $interfaceName) {
138132
$byInterface = $this->extensions[self::typeId($interfaceName)] ?? null;
139133
if (($byInterface !== null) && ($byInterface !== [])) {

0 commit comments

Comments
 (0)