public function enterScope(NodeTraversal $traversal) { $typeInference = new TypeInference($traversal->getControlFlowGraph(), $this->reverseInterpreter, $this->functionInterpreter, $this->methodInterpreter, $this->commentParser, $traversal->getScope(), $this->registry, $this->logger); try { $typeInference->analyze(); } catch (MaxIterationsExceededException $ex) { $scopeRoot = $traversal->getScopeRoot(); $this->logger->warning($ex->getMessage() . ' - Scope-Root: ' . get_class($scopeRoot) . ' on line ' . $scopeRoot->getLine() . ' in ' . $this->file->getName()); } }
public static function fromException(\Exception $ex, File $file) { $message = 'An error occurred while analyzing "' . $file->getName() . '": ' . $ex->getMessage(); $ex = new self($message, (int) $ex->getCode(), $ex); $ex->setAnalyzedFile($file); return $ex; }
public function add(File $file) { if (isset($this->files[$name = $file->getName()])) { throw new \InvalidArgumentException(sprintf('There already exists a file named "%s".', $name)); } $this->files[$name] = $file; $this->size += strlen($file->getContent()); }