Skip to content

Commit 92ad25d

Browse files
committed
Don't use reflections when possible
1 parent fc821a7 commit 92ad25d

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)