- Added a new getExtensionInstanceOf() method in Compiler
This commit is contained in:
1 parent
0f95171575
commit
3d293aa417
1 file changed
+13
@@ -158,6 +158,19 @@ class Compiler
|
||||
return $this->extensionList[$tokenName];
|
||||
}
|
||||
|
||||
public function getExtensionInstanceOf(string $class) : Extension\Extension
|
||||
{
|
||||
foreach(array_reverse($this->extensionList) as $ext) {
|
||||
if ( is_a($ext, $class, false) ) {
|
||||
return $ext;
|
||||
}
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException(<<<MSG
|
||||
Requested extension instance of `$class` could not be found from loaded Picea compiler's extension.
|
||||
MSG);
|
||||
}
|
||||
|
||||
public function exportFunctions() : void
|
||||
{
|
||||
static $caching = [];
|
||||
|
||||
Reference in new issue
Block a user