芝麻web文件管理V1.00
编辑当前文件:/home/royashxg/bit-alphas-ltd.com/user/project/vendor/psy/psysh/src/CodeCleaner/FinalClassPass.php
finalClasses = []; } /** * @throws FatalErrorException if the node is a class that extends a final class * * @param Node $node */ public function enterNode(Node $node) { if ($node instanceof Class_) { if ($node->extends) { $extends = (string) $node->extends; if ($this->isFinalClass($extends)) { $msg = \sprintf('Class %s may not inherit from final class (%s)', $node->name, $extends); throw new FatalErrorException($msg, 0, \E_ERROR, null, $node->getLine()); } } if ($node->isFinal()) { $this->finalClasses[\strtolower($node->name)] = true; } } } /** * @param string $name Class name * * @return bool */ private function isFinalClass($name) { if (!\class_exists($name)) { return isset($this->finalClasses[\strtolower($name)]); } $refl = new \ReflectionClass($name); return $refl->isFinal(); } }