protected function ConverterBase::parse in Drupal 7 to 8/9 Module Upgrader 8
Parses a generated class into a syntax tree.
Parameters
string|array $class: The class to parse, either as a string of PHP code or a renderable array.
Return value
\Pharborist\Objects\ClassNode
11 calls to ConverterBase::parse()
- Blocks::convert in src/
Plugin/ DMU/ Converter/ Blocks.php - Performs required conversions.
- ContentRoute::getController in src/
Plugin/ DMU/ Routing/ ContentRoute.php - HookBoot::convert in src/
Plugin/ DMU/ Converter/ HookBoot.php - Performs required conversions.
- HookEntityInfo::convert in src/
Plugin/ DMU/ Converter/ HookEntityInfo.php - Performs required conversions.
- HookExit::convert in src/
Plugin/ DMU/ Converter/ HookExit.php - Performs required conversions.
File
- src/
ConverterBase.php, line 195
Class
- ConverterBase
- Base class for converters.
Namespace
Drupal\drupalmoduleupgraderCode
protected function parse($class) {
if (is_array($class)) {
$class = \Drupal::service('renderer')
->renderPlain($class);
}
return Parser::parseSnippet($class)
->find(Filter::isInstanceOf('Pharborist\\Objects\\ClassNode'))[0];
}