Skip to content
Snippets Groups Projects
Commit 0a563108 authored by Demian Katz's avatar Demian Katz
Browse files

Use class_alias() instead of eval() for cleaner/safer code.

parent 1a806152
Branches
Tags
No related merge requests found
......@@ -170,7 +170,7 @@ class Importer implements ServiceLocatorAwareInterface
$parts = explode('\\', $class);
$class = preg_replace('/[^A-Za-z0-9_]/', '', array_pop($parts));
$ns = implode('\\', $parts);
eval("class $class extends \\$ns\\$class { }");
class_alias("$ns\\$class", $class);
}
$methods = get_class_methods($class);
if (method_exists($class, 'setServiceLocator')) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment