class FunctionCalls in Drupal 7 to 8/9 Module Upgrader 8
Plugin annotation
@Indexer(
id = "function_call",
description = @Translation("Indexes all function calls in a target module."),
exclude = { "t" }
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\drupalmoduleupgrader\IndexerBase implements ContainerFactoryPluginInterface, IndexerInterface
- class \Drupal\drupalmoduleupgrader\Plugin\DMU\Indexer\FunctionCalls
- class \Drupal\drupalmoduleupgrader\IndexerBase implements ContainerFactoryPluginInterface, IndexerInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of FunctionCalls
3 files declare their use of FunctionCalls
- DBTest.php in tests/
src/ Unit/ Plugin/ DMU/ Analyzer/ DBTest.php - DisableTest.php in tests/
src/ Unit/ Plugin/ DMU/ Fixer/ DisableTest.php - FunctionCallTest.php in tests/
src/ Unit/ Plugin/ DMU/ Analyzer/ FunctionCallTest.php
File
- src/
Plugin/ DMU/ Indexer/ FunctionCalls.php, line 18
Namespace
Drupal\drupalmoduleupgrader\Plugin\DMU\IndexerView source
class FunctionCalls extends IndexerBase {
/**
* {@inheritdoc}
*/
public function build() {
/** @var \Symfony\Component\Finder\SplFileInfo $file */
foreach ($this->target
->getFinder() as $file) {
$path = $file
->getPathname();
$this->target
->open($path)
->find(Filter::isInstanceOf('\\Pharborist\\Functions\\FunctionCallNode'))
->not(function (FunctionCallNode $function_call) {
return in_array($function_call
->getName()
->getText(), $this->pluginDefinition['exclude']);
})
->each([
$this,
'add',
]);
}
}
/**
* {@inheritdoc}
*/
public function get($id) {
$all = new NodeCollection([]);
$files = $this
->getQuery([
'file',
])
->distinct(TRUE)
->condition('id', $id)
->execute()
->fetchCol();
array_walk($files, function ($file) use ($all, $id) {
$all
->add($this->target
->open($file)
->find(Filter::isFunctionCall($id)));
});
return $all;
}
/**
* {@inheritdoc}
*/
public function addFile($path) {
$doc = Parser::parseFile($path);
$doc
->find(Filter::isInstanceOf('\\Pharborist\\Functions\\FunctionCallNode'))
->each([
$this,
'add',
]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
FunctionCalls:: |
public | function |
Overrides IndexerInterface:: |
|
FunctionCalls:: |
public | function |
Overrides IndexerBase:: |
|
FunctionCalls:: |
public | function |
Overrides IndexerInterface:: |
|
IndexerBase:: |
protected | property | ||
IndexerBase:: |
protected | property | ||
IndexerBase:: |
protected | property | ||
IndexerBase:: |
public | function |
Overrides IndexerInterface:: |
3 |
IndexerBase:: |
public | function |
Overrides IndexerInterface:: |
|
IndexerBase:: |
public | function |
Overrides IndexerInterface:: |
|
IndexerBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
IndexerBase:: |
public | function |
Overrides IndexerInterface:: |
1 |
IndexerBase:: |
public | function |
Overrides IndexerInterface:: |
|
IndexerBase:: |
public | function |
Overrides IndexerInterface:: |
|
IndexerBase:: |
public | function |
Overrides IndexerInterface:: |
1 |
IndexerBase:: |
public | function |
Overrides IndexerInterface:: |
2 |
IndexerBase:: |
public | function |
Overrides IndexerInterface:: |
2 |
IndexerBase:: |
public | function |
Overrides IndexerInterface:: |
1 |
IndexerBase:: |
public | function |
Overrides IndexerInterface:: |
1 |
IndexerBase:: |
public | function |
Overrides IndexerInterface:: |
2 |
IndexerBase:: |
public | function |
Overrides IndexerInterface:: |
2 |
IndexerBase:: |
public | function |
Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase:: |
|
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |