PhpDumper dumps a service container as a PHP class.
- author Fabien Potencier
- author Johannes M.
Schmitt
Constants |
public Symfony Characters that might appear in the generated variable name as first character. |
public Symfony Characters that might appear in the generated variable name as any but the first character. |
Methods |
public __construct(Symfony |
public dump(array $options = []) : array|string Dumps the service container as a PHP class. Available options:
|
public setProxyDumper(Symfony Sets the dumper to be used when dumping proxies in the generated container. |
Properties |
Properties |
private bool $addGetService = false |
private bool $asFiles |
private string $baseClass |
private array $circularReferences = [] |
private string $class |
private ?SplObjectStorage $definitionVariables = NULL
|
private string $docStar |
private array $dynamicParameters = [] |
private array $exportedVariables = [] |
private Symfony |
private bool $hasProxyDumper = true |
private string $hotPathTag |
private ?SplObjectStorage $inlinedDefinitions = NULL |
private array $inlinedRequires = [] |
private bool $inlineFactories |
private bool $inlineRequires |
private array $locatedIds = [] |
private string $namespace |
private array $preload = [] |
private array $preloadTags |
private Symfony |
private ?array $referenceVariables = NULL |
private array $reservedVariables = ['instance', 'class', 'this', 'container'] |
private ?array $serviceCalls = NULL |
private array $serviceIdToMethodNameMap |
private string $serviceLocatorTag |
private array $singleUsePrivateIds = [] |
private int $targetDirMaxMatches |
private ?string $targetDirRegex = NULL |
private array $usedMethodNames |
private int $variableCount |
Methods |
private addAliases() : string |
private addCircularReferences(string $sourceId, array $currentPath, bool $byConstructor) : void |
private addDefaultParametersMethod() : string |
private addDeprecatedAliases() : string |
private addDeprecatedParameters() : string |
private addFileMap() : string |
private addInlineReference(string $id, Symfony |
private addInlineRequires(bool $hasProxyClasses) : string |
private addInlineService(string $id, Symfony |
private addInlineVariables(string $id, Symfony |
private addMethodMap() : string |
private addNewInstance(Symfony |
private addNonEmptyParameters() : string |
private addRemovedIds() : string |
private addService(string $id, Symfony |
private addServiceConfigurator(Symfony |
private addServiceInclude(string $cId, Symfony |
private addServiceInstance(string $id, Symfony
|
private addServiceMethodCalls(Symfony |
private addServiceProperties(Symfony |
private addServices(?array $services = NULL) : string |
private addSyntheticIds() : string |
private analyzeReferences() : void |
private collectCircularReferences(string $sourceId, array $edges, array $checkedNodes, array $loops = [], array $path = [], bool $byConstructor = true) : void |
private collectLineage(string $class, array $lineage) : void |
private doExport(?mixed $value, bool $resolveEnv = false) : ?mixed |
private dumpLiteralClass(string $class) : string Dumps a string to a literal (aka PHP Code) class value.
|
private dumpParameter(string $name) : string |
private dumpValue(?mixed $value, bool $interpolate = true) : string
|
private endClass() : string |
private export(?mixed $value) : ?mixed |
private exportParameters(array $parameters, string $path = '', int $indent = 12, bool $hasEnum = false) : string
|
private generateMethodName(string $id) : string
|
private generateProxyClasses() : array |
private generateServiceFiles(array $services) : iterable |
private getAutoloadFile() : ?string |
private getClasses(Symfony |
private getDefinitionsFromArguments(array $arguments, ?SplObjectStorage $definitions = NULL, array $calls = [], ?bool $byConstructor = NULL) : SplObjectStorage |
private getExpressionLanguage() : Symfony |
private getNextVariableName() : string |
private getProxyDumper() : Symfony Retrieves the currently set proxy dumper or instantiates one. |
private getServiceCall(string $id, ?Symfony |
private getServiceConditionals(?mixed $value) : string |
private initializeMethodNamesMap(string $class) : void Initializes the method names map to avoid conflicts with the Container methods. |
private isHotPath(Symfony |
private isProxyCandidate(Symfony |
private isSingleUsePrivateNode(Symfony |
private isTrivialInstance(Symfony |
private startClass(string $class, string $baseClass, bool $hasProxyClasses) : string |
private static stripComments(string $source) : string Removes comments from a PHP source string. We don't use the PHP php_strip_whitespace() function as we want the content to be readable and well-formatted. |
private wrapServiceConditionals(?mixed $value, string $code) : string |
Methods |
private static stripComments(string $source) : string Removes comments from a PHP source string. We don't use the PHP php_strip_whitespace() function as we want the content to be readable and well-formatted. |