X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fpsy%2Fpsysh%2Fsrc%2FPsy%2FCodeCleaner%2FFinalClassPass.php;fp=vendor%2Fpsy%2Fpsysh%2Fsrc%2FPsy%2FCodeCleaner%2FFinalClassPass.php;h=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=c509bef50b0a073b22fdc1f87c0e73eea431b07f;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/psy/psysh/src/Psy/CodeCleaner/FinalClassPass.php b/vendor/psy/psysh/src/Psy/CodeCleaner/FinalClassPass.php deleted file mode 100644 index c509bef50..000000000 --- a/vendor/psy/psysh/src/Psy/CodeCleaner/FinalClassPass.php +++ /dev/null @@ -1,70 +0,0 @@ -finalClasses = array(); - } - - /** - * @throws RuntimeException 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(); - } -}