You are here

public function Target::open in Drupal 7 to 8/9 Module Upgrader 8

Parses a file into a syntax tree, keeping a reference to it, and returns it.

Parameters

string $file: The path of the file to open, relative to the CWD.

Return value

\Pharborist\RootNode|null

Overrides TargetInterface::open

File

src/Target.php, line 209

Class

Target
Default implementation of TargetInterface.

Namespace

Drupal\drupalmoduleupgrader

Code

public function open($file) {
  if (empty($this->documents[$file])) {
    $this->documents[$file] = Parser::parseFile($file);
  }
  return $this->documents[$file];
}