Skip to content

Commit

Permalink
Older versions of PHP do not support object dereferencing (instantiat…
Browse files Browse the repository at this point in the history
…ing an object in parentheses and immediately calling a function on that object).
  • Loading branch information
mtudor committed Mar 12, 2014
1 parent 1b9c71a commit fba35e6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/TccAbstractModule/Module/AbstractModuleNoTraits.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ public function getViewHelperConfig()
*/
protected function getDir()
{
return dirname((new \ReflectionClass(get_class($this)))->getFileName());
$reflectionClass = new \ReflectionClass(get_class($this));
return dirname($reflectionClass->getFileName());
}

/**
Expand All @@ -177,6 +178,7 @@ protected function getDir()
*/
protected function getNamespace()
{
return (new \ReflectionClass(get_class($this)))->getNamespaceName();
$reflectionClass = new \ReflectionClass(get_class($this));
return dirname($reflectionClass->getNamespaceName());
}
}

0 comments on commit fba35e6

Please sign in to comment.