Fix support for readonly classes as plugins, fixes #11404
parent
658ab073ea
commit
44ebeb7e8f
|
@ -276,7 +276,7 @@ class PluginManager
|
||||||
if ($separatorPos) {
|
if ($separatorPos) {
|
||||||
$className = substr($class, $separatorPos + 1);
|
$className = substr($class, $separatorPos + 1);
|
||||||
}
|
}
|
||||||
$code = Preg::replace('{^((?:final\s+)?(?:\s*))class\s+('.preg_quote($className).')}mi', '$1class $2_composer_tmp'.self::$classCounter, $code, 1);
|
$code = Preg::replace('{^((?:(?:final|readonly)\s+)*(?:\s*))class\s+('.preg_quote($className).')}mi', '$1class $2_composer_tmp'.self::$classCounter, $code, 1);
|
||||||
$code = strtr($code, array(
|
$code = strtr($code, array(
|
||||||
'__FILE__' => var_export($path, true),
|
'__FILE__' => var_export($path, true),
|
||||||
'__DIR__' => var_export(dirname($path), true),
|
'__DIR__' => var_export(dirname($path), true),
|
||||||
|
|
Loading…
Reference in New Issue