Skip to content

Commit 8a3d0b9

Browse files
committed
minor #18021 Don't use reflections when possible (Ener-Getick)
This PR was merged into the 2.3 branch. Discussion ---------- Don't use reflections when possible | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Use php functions instead of reflection when possible (to improve a bit the performance). Commits ------- a46270a Don't use reflections when possible
2 parents 158020a + 92ad25d commit 8a3d0b9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Container.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,8 @@ public function initialized($id)
363363
public function getServiceIds()
364364
{
365365
$ids = array();
366-
$r = new \ReflectionClass($this);
367-
foreach ($r->getMethods() as $method) {
368-
if (preg_match('/^get(.+)Service$/', $method->name, $match)) {
366+
foreach (get_class_methods($this) as $method) {
367+
if (preg_match('/^get(.+)Service$/', $method, $match)) {
369368
$ids[] = self::underscore($match[1]);
370369
}
371370
}

0 commit comments

Comments
 (0)