code
stringlengths
2.5k
150k
kind
stringclasses
1 value
symfony GraphvizDumper GraphvizDumper =============== class **GraphvizDumper** implements [DumperInterface](dumperinterface "Symfony\Component\Workflow\Dumper\DumperInterface") GraphvizDumper dumps a workflow as a graphviz file. You can convert the generated dot file with the dot utility (http://www.graphviz.org/): dot -Tpng workflow.dot > workflow.png Properties ---------- | | | | | | --- | --- | --- | --- | | static protected | $defaultOptions | | | Methods ------- | | | | | --- | --- | --- | | string | [dump](#method_dump)([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking = null, array $options = array()) Dumps a workflow definition. | | | | [findPlaces](#method_findPlaces)([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking = null) | | | | [findTransitions](#method_findTransitions)([Definition](../definition "Symfony\Component\Workflow\Definition") $definition) | | | | [addPlaces](#method_addPlaces)(array $places) | | | | [addTransitions](#method_addTransitions)(array $transitions) | | | | [findEdges](#method_findEdges)([Definition](../definition "Symfony\Component\Workflow\Definition") $definition) | | | | [addEdges](#method_addEdges)(array $edges) | | | | [startDot](#method_startDot)(array $options) | | | | [endDot](#method_endDot)() | | | | [dotize](#method_dotize)($id) | | | string | [escape](#method_escape)(string $string) | | Details ------- ### string dump([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking = null, array $options = array()) Dumps a workflow definition. #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\Workflow\Definition") | $definition | A Definition instance | | [Marking](../marking "Symfony\Component\Workflow\Marking") | $marking | A Marking instance | | array | $options | An array of options | #### Return Value | | | | --- | --- | | string | The representation of the workflow | ### protected findPlaces([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking = null) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\Workflow\Definition") | $definition | | | [Marking](../marking "Symfony\Component\Workflow\Marking") | $marking | | ### protected findTransitions([Definition](../definition "Symfony\Component\Workflow\Definition") $definition) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\Workflow\Definition") | $definition | | ### protected addPlaces(array $places) #### Parameters | | | | | --- | --- | --- | | array | $places | | ### protected addTransitions(array $transitions) #### Parameters | | | | | --- | --- | --- | | array | $transitions | | ### protected findEdges([Definition](../definition "Symfony\Component\Workflow\Definition") $definition) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\Workflow\Definition") | $definition | | ### protected addEdges(array $edges) #### Parameters | | | | | --- | --- | --- | | array | $edges | | ### protected startDot(array $options) #### Parameters | | | | | --- | --- | --- | | array | $options | | ### protected endDot() ### protected dotize($id) #### Parameters | | | | | --- | --- | --- | | | $id | | ### protected string escape(string $string) #### Parameters | | | | | --- | --- | --- | | string | $string | | #### Return Value | | | | --- | --- | | string | | symfony StateMachineGraphvizDumper StateMachineGraphvizDumper =========================== class **StateMachineGraphvizDumper** extends [GraphvizDumper](graphvizdumper "Symfony\Component\Workflow\Dumper\GraphvizDumper") Properties ---------- | | | | | | --- | --- | --- | --- | | static protected | $defaultOptions | | from [GraphvizDumper](graphvizdumper#property_defaultOptions "Symfony\Component\Workflow\Dumper\GraphvizDumper") | Methods ------- | | | | | --- | --- | --- | | string | [dump](#method_dump)([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking = null, array $options = array()) Dumps a workflow definition. | | | | [findPlaces](#method_findPlaces)([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking = null) | from [GraphvizDumper](graphvizdumper#method_findPlaces "Symfony\Component\Workflow\Dumper\GraphvizDumper") | | | [findTransitions](#method_findTransitions)([Definition](../definition "Symfony\Component\Workflow\Definition") $definition) | from [GraphvizDumper](graphvizdumper#method_findTransitions "Symfony\Component\Workflow\Dumper\GraphvizDumper") | | | [addPlaces](#method_addPlaces)(array $places) | from [GraphvizDumper](graphvizdumper#method_addPlaces "Symfony\Component\Workflow\Dumper\GraphvizDumper") | | | [addTransitions](#method_addTransitions)(array $transitions) | from [GraphvizDumper](graphvizdumper#method_addTransitions "Symfony\Component\Workflow\Dumper\GraphvizDumper") | | | [findEdges](#method_findEdges)([Definition](../definition "Symfony\Component\Workflow\Definition") $definition) | | | | [addEdges](#method_addEdges)(array $edges) | | | | [startDot](#method_startDot)(array $options) | from [GraphvizDumper](graphvizdumper#method_startDot "Symfony\Component\Workflow\Dumper\GraphvizDumper") | | | [endDot](#method_endDot)() | from [GraphvizDumper](graphvizdumper#method_endDot "Symfony\Component\Workflow\Dumper\GraphvizDumper") | | | [dotize](#method_dotize)($id) | from [GraphvizDumper](graphvizdumper#method_dotize "Symfony\Component\Workflow\Dumper\GraphvizDumper") | | string | [escape](#method_escape)(string $string) | from [GraphvizDumper](graphvizdumper#method_escape "Symfony\Component\Workflow\Dumper\GraphvizDumper") | Details ------- ### string dump([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking = null, array $options = array()) Dumps a workflow definition. #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\Workflow\Definition") | $definition | A Definition instance | | [Marking](../marking "Symfony\Component\Workflow\Marking") | $marking | A Marking instance | | array | $options | An array of options | #### Return Value | | | | --- | --- | | string | The representation of the workflow | ### protected findPlaces([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking = null) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\Workflow\Definition") | $definition | | | [Marking](../marking "Symfony\Component\Workflow\Marking") | $marking | | ### protected findTransitions([Definition](../definition "Symfony\Component\Workflow\Definition") $definition) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\Workflow\Definition") | $definition | | ### protected addPlaces(array $places) #### Parameters | | | | | --- | --- | --- | | array | $places | | ### protected addTransitions(array $transitions) #### Parameters | | | | | --- | --- | --- | | array | $transitions | | ### protected findEdges([Definition](../definition "Symfony\Component\Workflow\Definition") $definition) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\Workflow\Definition") | $definition | | ### protected addEdges(array $edges) #### Parameters | | | | | --- | --- | --- | | array | $edges | | ### protected startDot(array $options) #### Parameters | | | | | --- | --- | --- | | array | $options | | ### protected endDot() ### protected dotize($id) #### Parameters | | | | | --- | --- | --- | | | $id | | ### protected string escape(string $string) #### Parameters | | | | | --- | --- | --- | | string | $string | | #### Return Value | | | | --- | --- | | string | | symfony PlantUmlDumper PlantUmlDumper =============== class **PlantUmlDumper** implements [DumperInterface](dumperinterface "Symfony\Component\Workflow\Dumper\DumperInterface") PlantUmlDumper dumps a workflow as a PlantUML file. You can convert the generated puml file with the plantuml.jar utility (http://plantuml.com/): php bin/console workflow:dump pull\_request travis --dump-format=puml | java -jar plantuml.jar -p > workflow.png Constants --------- | | | | --- | --- | | INITIAL | | | MARKED | | | STATEMACHINE\_TRANSITION | | | WORKFLOW\_TRANSITION | | | TRANSITION\_TYPES | | | DEFAULT\_OPTIONS | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $transitionType = null) | | | string | [dump](#method_dump)([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking = null, array $options = array()) Dumps a workflow definition. | | Details ------- ### \_\_construct(string $transitionType = null) #### Parameters | | | | | --- | --- | --- | | string | $transitionType | | ### string dump([Definition](../definition "Symfony\Component\Workflow\Definition") $definition, [Marking](../marking "Symfony\Component\Workflow\Marking") $marking = null, array $options = array()) Dumps a workflow definition. #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\Workflow\Definition") | $definition | A Definition instance | | [Marking](../marking "Symfony\Component\Workflow\Marking") | $marking | A Marking instance | | array | $options | An array of options | #### Return Value | | | | --- | --- | | string | The representation of the workflow | symfony AuditTrailListener AuditTrailListener =================== class **AuditTrailListener** implements [EventSubscriberInterface](../../eventdispatcher/eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(LoggerInterface $logger) | | | | [onLeave](#method_onLeave)([Event](../event/event "Symfony\Component\Workflow\Event\Event") $event) | | | | [onTransition](#method_onTransition)([Event](../event/event "Symfony\Component\Workflow\Event\Event") $event) | | | | [onEnter](#method_onEnter)([Event](../event/event "Symfony\Component\Workflow\Event\Event") $event) | | | static array | [getSubscribedEvents](#method_getSubscribedEvents)() Returns an array of event names this subscriber wants to listen to. | | Details ------- ### \_\_construct(LoggerInterface $logger) #### Parameters | | | | | --- | --- | --- | | LoggerInterface | $logger | | ### onLeave([Event](../event/event "Symfony\Component\Workflow\Event\Event") $event) #### Parameters | | | | | --- | --- | --- | | [Event](../event/event "Symfony\Component\Workflow\Event\Event") | $event | | ### onTransition([Event](../event/event "Symfony\Component\Workflow\Event\Event") $event) #### Parameters | | | | | --- | --- | --- | | [Event](../event/event "Symfony\Component\Workflow\Event\Event") | $event | | ### onEnter([Event](../event/event "Symfony\Component\Workflow\Event\Event") $event) #### Parameters | | | | | --- | --- | --- | | [Event](../event/event "Symfony\Component\Workflow\Event\Event") | $event | | ### static array getSubscribedEvents() Returns an array of event names this subscriber wants to listen to. The array keys are event names and the value can be: * The method name to call (priority defaults to 0) * An array composed of the method name to call and the priority * An array of arrays composed of the method names to call and respective priorities, or 0 if unset For instance: * array('eventName' => 'methodName') * array('eventName' => array('methodName', $priority)) * array('eventName' => array(array('methodName1', $priority), array('methodName2'))) #### Return Value | | | | --- | --- | | array | The event names to listen to | symfony ExpressionLanguage ExpressionLanguage =================== class **ExpressionLanguage** extends [ExpressionLanguage](../../security/core/authorization/expressionlanguage "Symfony\Component\Security\Core\Authorization\ExpressionLanguage") Adds some function to the default Symfony Security ExpressionLanguage. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $functions | | from [ExpressionLanguage](../../expressionlanguage/expressionlanguage#property_functions "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(CacheItemPoolInterface $cache = null, array $providers = array()) | from [ExpressionLanguage](../../security/core/authorization/expressionlanguage#method___construct "Symfony\Component\Security\Core\Authorization\ExpressionLanguage") | | string | [compile](#method_compile)([Expression](../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $names = array()) Compiles an expression source code. | from [ExpressionLanguage](../../expressionlanguage/expressionlanguage#method_compile "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | mixed | [evaluate](#method_evaluate)([Expression](../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $values = array()) Evaluate an expression. | from [ExpressionLanguage](../../expressionlanguage/expressionlanguage#method_evaluate "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | [ParsedExpression](../../expressionlanguage/parsedexpression "Symfony\Component\ExpressionLanguage\ParsedExpression") | [parse](#method_parse)([Expression](../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $names) Parses an expression. | from [ExpressionLanguage](../../expressionlanguage/expressionlanguage#method_parse "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | | [register](#method_register)(string $name, callable $compiler, callable $evaluator) Registers a function. | from [ExpressionLanguage](../../expressionlanguage/expressionlanguage#method_register "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | | [addFunction](#method_addFunction)([ExpressionFunction](../../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") $function) | from [ExpressionLanguage](../../expressionlanguage/expressionlanguage#method_addFunction "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | | [registerProvider](#method_registerProvider)([ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) | from [ExpressionLanguage](../../expressionlanguage/expressionlanguage#method_registerProvider "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | | [registerFunctions](#method_registerFunctions)() | | Details ------- ### \_\_construct(CacheItemPoolInterface $cache = null, array $providers = array()) #### Parameters | | | | | --- | --- | --- | | CacheItemPoolInterface | $cache | | | array | $providers | | ### string compile([Expression](../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $names = array()) Compiles an expression source code. #### Parameters | | | | | --- | --- | --- | | [Expression](../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string | $expression | The expression to compile | | array | $names | An array of valid names | #### Return Value | | | | --- | --- | | string | The compiled PHP source code | ### mixed evaluate([Expression](../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $values = array()) Evaluate an expression. #### Parameters | | | | | --- | --- | --- | | [Expression](../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string | $expression | The expression to compile | | array | $values | An array of values | #### Return Value | | | | --- | --- | | mixed | The result of the evaluation of the expression | ### [ParsedExpression](../../expressionlanguage/parsedexpression "Symfony\Component\ExpressionLanguage\ParsedExpression") parse([Expression](../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $names) Parses an expression. #### Parameters | | | | | --- | --- | --- | | [Expression](../../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string | $expression | The expression to parse | | array | $names | An array of valid names | #### Return Value | | | | --- | --- | | [ParsedExpression](../../expressionlanguage/parsedexpression "Symfony\Component\ExpressionLanguage\ParsedExpression") | A ParsedExpression instance | ### register(string $name, callable $compiler, callable $evaluator) Registers a function. #### Parameters | | | | | --- | --- | --- | | string | $name | The function name | | callable | $compiler | A callable able to compile the function | | callable | $evaluator | A callable able to evaluate the function | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | when registering a function after calling evaluate(), compile() or parse() | #### See also | | | | --- | --- | | [ExpressionFunction](../../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") | | ### addFunction([ExpressionFunction](../../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") $function) #### Parameters | | | | | --- | --- | --- | | [ExpressionFunction](../../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") | $function | | ### registerProvider([ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) #### Parameters | | | | | --- | --- | --- | | [ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") | $provider | | ### protected registerFunctions() symfony GuardListener GuardListener ============== class **GuardListener** Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $configuration, [ExpressionLanguage](expressionlanguage "Symfony\Component\Workflow\EventListener\ExpressionLanguage") $expressionLanguage, [TokenStorageInterface](../../security/core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthorizationCheckerInterface](../../security/core/authorization/authorizationcheckerinterface "Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface") $authenticationChecker, [AuthenticationTrustResolverInterface](../../security/core/authentication/authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface") $trustResolver, [RoleHierarchyInterface](../../security/core/role/rolehierarchyinterface "Symfony\Component\Security\Core\Role\RoleHierarchyInterface") $roleHierarchy = null, [ValidatorInterface](../../validator/validator/validatorinterface "Symfony\Component\Validator\Validator\ValidatorInterface") $validator = null) | | | | [onTransition](#method_onTransition)([GuardEvent](../event/guardevent "Symfony\Component\Workflow\Event\GuardEvent") $event, $eventName) | | Details ------- ### \_\_construct(array $configuration, [ExpressionLanguage](expressionlanguage "Symfony\Component\Workflow\EventListener\ExpressionLanguage") $expressionLanguage, [TokenStorageInterface](../../security/core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage, [AuthorizationCheckerInterface](../../security/core/authorization/authorizationcheckerinterface "Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface") $authenticationChecker, [AuthenticationTrustResolverInterface](../../security/core/authentication/authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface") $trustResolver, [RoleHierarchyInterface](../../security/core/role/rolehierarchyinterface "Symfony\Component\Security\Core\Role\RoleHierarchyInterface") $roleHierarchy = null, [ValidatorInterface](../../validator/validator/validatorinterface "Symfony\Component\Validator\Validator\ValidatorInterface") $validator = null) #### Parameters | | | | | --- | --- | --- | | array | $configuration | | | [ExpressionLanguage](expressionlanguage "Symfony\Component\Workflow\EventListener\ExpressionLanguage") | $expressionLanguage | | | [TokenStorageInterface](../../security/core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [AuthorizationCheckerInterface](../../security/core/authorization/authorizationcheckerinterface "Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface") | $authenticationChecker | | | [AuthenticationTrustResolverInterface](../../security/core/authentication/authenticationtrustresolverinterface "Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface") | $trustResolver | | | [RoleHierarchyInterface](../../security/core/role/rolehierarchyinterface "Symfony\Component\Security\Core\Role\RoleHierarchyInterface") | $roleHierarchy | | | [ValidatorInterface](../../validator/validator/validatorinterface "Symfony\Component\Validator\Validator\ValidatorInterface") | $validator | | ### onTransition([GuardEvent](../event/guardevent "Symfony\Component\Workflow\Event\GuardEvent") $event, $eventName) #### Parameters | | | | | --- | --- | --- | | [GuardEvent](../event/guardevent "Symfony\Component\Workflow\Event\GuardEvent") | $event | | | | $eventName | |
programming_docs
symfony StopwatchEvent StopwatchEvent =============== class **StopwatchEvent** Represents an Event managed by Stopwatch. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(float $origin, string $category = null, bool $morePrecision = false) | | | string | [getCategory](#method_getCategory)() Gets the category. | | | float | [getOrigin](#method_getOrigin)() Gets the origin. | | | $this | [start](#method_start)() Starts a new event period. | | | $this | [stop](#method_stop)() Stops the last started event period. | | | bool | [isStarted](#method_isStarted)() Checks if the event was started. | | | $this | [lap](#method_lap)() Stops the current period and then starts a new one. | | | | [ensureStopped](#method_ensureStopped)() Stops all non already stopped periods. | | | [StopwatchPeriod](stopwatchperiod "Symfony\Component\Stopwatch\StopwatchPeriod")[] | [getPeriods](#method_getPeriods)() Gets all event periods. | | | int|float | [getStartTime](#method_getStartTime)() Gets the relative time of the start of the first period. | | | int|float | [getEndTime](#method_getEndTime)() Gets the relative time of the end of the last period. | | | int|float | [getDuration](#method_getDuration)() Gets the duration of the events (including all periods). | | | int | [getMemory](#method_getMemory)() Gets the max memory usage of all periods. | | | float | [getNow](#method_getNow)() Return the current time relative to origin. | | | string | [\_\_toString](#method___toString)() | | Details ------- ### \_\_construct(float $origin, string $category = null, bool $morePrecision = false) #### Parameters | | | | | --- | --- | --- | | float | $origin | The origin time in milliseconds | | string | $category | The event category or null to use the default | | bool | $morePrecision | If true, time is stored as float to keep the original microsecond precision | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When the raw time is not valid | ### string getCategory() Gets the category. #### Return Value | | | | --- | --- | | string | The category | ### float getOrigin() Gets the origin. #### Return Value | | | | --- | --- | | float | The origin in milliseconds | ### $this start() Starts a new event period. #### Return Value | | | | --- | --- | | $this | | ### $this stop() Stops the last started event period. #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | When stop() is called without a matching call to start() | ### bool isStarted() Checks if the event was started. #### Return Value | | | | --- | --- | | bool | | ### $this lap() Stops the current period and then starts a new one. #### Return Value | | | | --- | --- | | $this | | ### ensureStopped() Stops all non already stopped periods. ### [StopwatchPeriod](stopwatchperiod "Symfony\Component\Stopwatch\StopwatchPeriod")[] getPeriods() Gets all event periods. #### Return Value | | | | --- | --- | | [StopwatchPeriod](stopwatchperiod "Symfony\Component\Stopwatch\StopwatchPeriod")[] | An array of StopwatchPeriod instances | ### int|float getStartTime() Gets the relative time of the start of the first period. #### Return Value | | | | --- | --- | | int|float | The time (in milliseconds) | ### int|float getEndTime() Gets the relative time of the end of the last period. #### Return Value | | | | --- | --- | | int|float | The time (in milliseconds) | ### int|float getDuration() Gets the duration of the events (including all periods). #### Return Value | | | | --- | --- | | int|float | The duration (in milliseconds) | ### int getMemory() Gets the max memory usage of all periods. #### Return Value | | | | --- | --- | | int | The memory usage (in bytes) | ### protected float getNow() Return the current time relative to origin. #### Return Value | | | | --- | --- | | float | Time in ms | ### string \_\_toString() #### Return Value | | | | --- | --- | | string | | symfony Stopwatch Stopwatch ========== class **Stopwatch** Stopwatch provides a way to profile code. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(bool $morePrecision = false) | | | [Section](section "Symfony\Component\Stopwatch\Section")[] | [getSections](#method_getSections)() | | | | [openSection](#method_openSection)(string|null $id = null) Creates a new section or re-opens an existing section. | | | | [stopSection](#method_stopSection)(string $id) Stops the last started section. | | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") | [start](#method_start)(string $name, string $category = null) Starts an event. | | | bool | [isStarted](#method_isStarted)(string $name) Checks if the event was started. | | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") | [stop](#method_stop)(string $name) Stops an event. | | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") | [lap](#method_lap)(string $name) Stops then restarts an event. | | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") | [getEvent](#method_getEvent)(string $name) Returns a specific event by name. | | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent")[] | [getSectionEvents](#method_getSectionEvents)(string $id) Gets all events for a given section. | | | | [reset](#method_reset)() Resets the stopwatch to its original state. | | Details ------- ### \_\_construct(bool $morePrecision = false) #### Parameters | | | | | --- | --- | --- | | bool | $morePrecision | If true, time is stored as float to keep the original microsecond precision | ### [Section](section "Symfony\Component\Stopwatch\Section")[] getSections() #### Return Value | | | | --- | --- | | [Section](section "Symfony\Component\Stopwatch\Section")[] | | ### openSection(string|null $id = null) Creates a new section or re-opens an existing section. #### Parameters | | | | | --- | --- | --- | | string|null | $id | The id of the session to re-open, null to create a new one | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | When the section to re-open is not reachable | ### stopSection(string $id) Stops the last started section. The id parameter is used to retrieve the events from this section. #### Parameters | | | | | --- | --- | --- | | string | $id | The identifier of the section | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | When there's no started section to be stopped | #### See also | | | | --- | --- | | getSectionEvents() | | ### [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") start(string $name, string $category = null) Starts an event. #### Parameters | | | | | --- | --- | --- | | string | $name | The event name | | string | $category | The event category | #### Return Value | | | | --- | --- | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") | | ### bool isStarted(string $name) Checks if the event was started. #### Parameters | | | | | --- | --- | --- | | string | $name | The event name | #### Return Value | | | | --- | --- | | bool | | ### [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") stop(string $name) Stops an event. #### Parameters | | | | | --- | --- | --- | | string | $name | The event name | #### Return Value | | | | --- | --- | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") | | ### [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") lap(string $name) Stops then restarts an event. #### Parameters | | | | | --- | --- | --- | | string | $name | The event name | #### Return Value | | | | --- | --- | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") | | ### [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") getEvent(string $name) Returns a specific event by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The event name | #### Return Value | | | | --- | --- | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") | | ### [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent")[] getSectionEvents(string $id) Gets all events for a given section. #### Parameters | | | | | --- | --- | --- | | string | $id | A section identifier | #### Return Value | | | | --- | --- | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent")[] | | ### reset() Resets the stopwatch to its original state. symfony StopwatchPeriod StopwatchPeriod ================ class **StopwatchPeriod** Represents an Period for an Event. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(int|float $start, int|float $end, bool $morePrecision = false) | | | int|float | [getStartTime](#method_getStartTime)() Gets the relative time of the start of the period. | | | int|float | [getEndTime](#method_getEndTime)() Gets the relative time of the end of the period. | | | int|float | [getDuration](#method_getDuration)() Gets the time spent in this period. | | | int | [getMemory](#method_getMemory)() Gets the memory usage. | | Details ------- ### \_\_construct(int|float $start, int|float $end, bool $morePrecision = false) #### Parameters | | | | | --- | --- | --- | | int|float | $start | The relative time of the start of the period (in milliseconds) | | int|float | $end | The relative time of the end of the period (in milliseconds) | | bool | $morePrecision | If true, time is stored as float to keep the original microsecond precision | ### int|float getStartTime() Gets the relative time of the start of the period. #### Return Value | | | | --- | --- | | int|float | The time (in milliseconds) | ### int|float getEndTime() Gets the relative time of the end of the period. #### Return Value | | | | --- | --- | | int|float | The time (in milliseconds) | ### int|float getDuration() Gets the time spent in this period. #### Return Value | | | | --- | --- | | int|float | The period duration (in milliseconds) | ### int getMemory() Gets the memory usage. #### Return Value | | | | --- | --- | | int | The memory usage (in bytes) | symfony Section Section ======== class **Section** Stopwatch section. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(float $origin = null, bool $morePrecision = false) | | | [Section](section "Symfony\Component\Stopwatch\Section")|null | [get](#method_get)(string $id) Returns the child section. | | | [Section](section "Symfony\Component\Stopwatch\Section") | [open](#method_open)(string|null $id) Creates or re-opens a child section. | | | string | [getId](#method_getId)() | | | $this | [setId](#method_setId)(string $id) Sets the session identifier. | | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") | [startEvent](#method_startEvent)(string $name, string $category) Starts an event. | | | bool | [isEventStarted](#method_isEventStarted)(string $name) Checks if the event was started. | | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") | [stopEvent](#method_stopEvent)(string $name) Stops an event. | | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") | [lap](#method_lap)(string $name) Stops then restarts an event. | | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") | [getEvent](#method_getEvent)(string $name) Returns a specific event by name. | | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent")[] | [getEvents](#method_getEvents)() Returns the events from this section. | | Details ------- ### \_\_construct(float $origin = null, bool $morePrecision = false) #### Parameters | | | | | --- | --- | --- | | float | $origin | Set the origin of the events in this section, use null to set their origin to their start time | | bool | $morePrecision | If true, time is stored as float to keep the original microsecond precision | ### [Section](section "Symfony\Component\Stopwatch\Section")|null get(string $id) Returns the child section. #### Parameters | | | | | --- | --- | --- | | string | $id | The child section identifier | #### Return Value | | | | --- | --- | | [Section](section "Symfony\Component\Stopwatch\Section")|null | The child section or null when none found | ### [Section](section "Symfony\Component\Stopwatch\Section") open(string|null $id) Creates or re-opens a child section. #### Parameters | | | | | --- | --- | --- | | string|null | $id | Null to create a new section, the identifier to re-open an existing one | #### Return Value | | | | --- | --- | | [Section](section "Symfony\Component\Stopwatch\Section") | | ### string getId() #### Return Value | | | | --- | --- | | string | The identifier of the section | ### $this setId(string $id) Sets the session identifier. #### Parameters | | | | | --- | --- | --- | | string | $id | The session identifier | #### Return Value | | | | --- | --- | | $this | | ### [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") startEvent(string $name, string $category) Starts an event. #### Parameters | | | | | --- | --- | --- | | string | $name | The event name | | string | $category | The event category | #### Return Value | | | | --- | --- | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") | The event | ### bool isEventStarted(string $name) Checks if the event was started. #### Parameters | | | | | --- | --- | --- | | string | $name | The event name | #### Return Value | | | | --- | --- | | bool | | ### [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") stopEvent(string $name) Stops an event. #### Parameters | | | | | --- | --- | --- | | string | $name | The event name | #### Return Value | | | | --- | --- | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") | The event | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | When the event has not been started | ### [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") lap(string $name) Stops then restarts an event. #### Parameters | | | | | --- | --- | --- | | string | $name | The event name | #### Return Value | | | | --- | --- | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") | The event | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | When the event has not been started | ### [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") getEvent(string $name) Returns a specific event by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The event name | #### Return Value | | | | --- | --- | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent") | The event | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | When the event is not known | ### [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent")[] getEvents() Returns the events from this section. #### Return Value | | | | --- | --- | | [StopwatchEvent](stopwatchevent "Symfony\Component\Stopwatch\StopwatchEvent")[] | An array of StopwatchEvent instances | symfony Form Form ===== class **Form** extends [Link](link "Symfony\Component\DomCrawler\Link") implements [ArrayAccess](http://php.net/ArrayAccess) Form represents an HTML form. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [DOMElement](http://php.net/DOMElement) | $node | | from [AbstractUriElement](abstracturielement#property_node "Symfony\Component\DomCrawler\AbstractUriElement") | | protected string | $method | | from [AbstractUriElement](abstracturielement#property_method "Symfony\Component\DomCrawler\AbstractUriElement") | | protected string | $currentUri | | from [AbstractUriElement](abstracturielement#property_currentUri "Symfony\Component\DomCrawler\AbstractUriElement") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([DOMElement](http://php.net/DOMElement) $node, string $currentUri, string|null $method = null, string $baseHref = null) | | | [DOMElement](http://php.net/DOMElement) | [getNode](#method_getNode)() Gets the node associated with this link. | from [AbstractUriElement](abstracturielement#method_getNode "Symfony\Component\DomCrawler\AbstractUriElement") | | string | [getMethod](#method_getMethod)() Gets the form method. | | | string | [getUri](#method_getUri)() Gets the URI of the form. | | | string | [getRawUri](#method_getRawUri)() Returns raw URI data. | | | string | [canonicalizePath](#method_canonicalizePath)(string $path) Returns the canonicalized URI path (see RFC 3986, section 5.2.4). | from [AbstractUriElement](abstracturielement#method_canonicalizePath "Symfony\Component\DomCrawler\AbstractUriElement") | | | [setNode](#method_setNode)([DOMElement](http://php.net/DOMElement) $node) Sets the node for the form. | | | [DOMElement](http://php.net/DOMElement) | [getFormNode](#method_getFormNode)() Gets the form node associated with this form. | | | $this | [setValues](#method_setValues)(array $values) Sets the value of the fields. | | | array | [getValues](#method_getValues)() Gets the field values. | | | array | [getFiles](#method_getFiles)() Gets the file field values. | | | array | [getPhpValues](#method_getPhpValues)() Gets the field values as PHP. | | | array | [getPhpFiles](#method_getPhpFiles)() Gets the file field values as PHP. | | | bool | [has](#method_has)(string $name) Returns true if the named field exists. | | | | [remove](#method_remove)(string $name) Removes a field from the form. | | | [FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField") | [get](#method_get)(string $name) Gets a named field. | | | | [set](#method_set)([FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField") $field) Sets a named field. | | | [FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField")[] | [all](#method_all)() Gets all fields. | | | bool | [offsetExists](#method_offsetExists)(string $name) Returns true if the named field exists. | | | [FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField") | [offsetGet](#method_offsetGet)(string $name) Gets the value of a field. | | | | [offsetSet](#method_offsetSet)(string $name, string|array $value) Sets the value of a field. | | | | [offsetUnset](#method_offsetUnset)(string $name) Removes a field from the form. | | | [Form](form "Symfony\Component\DomCrawler\Form") | [disableValidation](#method_disableValidation)() Disables validation. | | Details ------- ### \_\_construct([DOMElement](http://php.net/DOMElement) $node, string $currentUri, string|null $method = null, string $baseHref = null) #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $node | A \DOMElement instance | | string | $currentUri | The URI of the page where the link is embedded (or the base href) | | string|null | $method | The method to use for the link (GET by default) | | string | $baseHref | The URI of the used for relative links, but not for empty action | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | if the node is not a button inside a form tag | ### [DOMElement](http://php.net/DOMElement) getNode() Gets the node associated with this link. #### Return Value | | | | --- | --- | | [DOMElement](http://php.net/DOMElement) | A \DOMElement instance | ### string getMethod() Gets the form method. If no method is defined in the form, GET is returned. #### Return Value | | | | --- | --- | | string | The method | ### string getUri() Gets the URI of the form. The returned URI is not the same as the form "action" attribute. This method merges the value if the method is GET to mimics browser behavior. #### Return Value | | | | --- | --- | | string | The URI | ### protected string getRawUri() Returns raw URI data. #### Return Value | | | | --- | --- | | string | | ### protected string canonicalizePath(string $path) Returns the canonicalized URI path (see RFC 3986, section 5.2.4). #### Parameters | | | | | --- | --- | --- | | string | $path | URI path | #### Return Value | | | | --- | --- | | string | | ### protected setNode([DOMElement](http://php.net/DOMElement) $node) Sets the node for the form. Expects a 'submit' button \DOMElement and finds the corresponding form element, or the form element itself. #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $node | A \DOMElement instance | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | If given node is not a button or input or does not have a form ancestor | ### [DOMElement](http://php.net/DOMElement) getFormNode() Gets the form node associated with this form. #### Return Value | | | | --- | --- | | [DOMElement](http://php.net/DOMElement) | A \DOMElement instance | ### $this setValues(array $values) Sets the value of the fields. #### Parameters | | | | | --- | --- | --- | | array | $values | An array of field values | #### Return Value | | | | --- | --- | | $this | | ### array getValues() Gets the field values. The returned array does not include file fields (see getFiles). #### Return Value | | | | --- | --- | | array | An array of field values | ### array getFiles() Gets the file field values. #### Return Value | | | | --- | --- | | array | An array of file field values | ### array getPhpValues() Gets the field values as PHP. This method converts fields with the array notation (like foo[bar] to arrays) like PHP does. #### Return Value | | | | --- | --- | | array | An array of field values | ### array getPhpFiles() Gets the file field values as PHP. This method converts fields with the array notation (like foo[bar] to arrays) like PHP does. The returned array is consistent with the array for field values (see getPhpValues), rather than uploaded files found in $\_FILES. For a compound file field foo[bar] it will create foo[bar][name], instead of foo[name][bar] which would be found in $\_FILES. #### Return Value | | | | --- | --- | | array | An array of file field values | ### bool has(string $name) Returns true if the named field exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The field name | #### Return Value | | | | --- | --- | | bool | true if the field exists, false otherwise | ### remove(string $name) Removes a field from the form. #### Parameters | | | | | --- | --- | --- | | string | $name | The field name | ### [FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField") get(string $name) Gets a named field. #### Parameters | | | | | --- | --- | --- | | string | $name | The field name | #### Return Value | | | | --- | --- | | [FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField") | The field instance | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When field is not present in this form | ### set([FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField") $field) Sets a named field. #### Parameters | | | | | --- | --- | --- | | [FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField") | $field | | ### [FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField")[] all() Gets all fields. #### Return Value | | | | --- | --- | | [FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField")[] | | ### bool offsetExists(string $name) Returns true if the named field exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The field name | #### Return Value | | | | --- | --- | | bool | true if the field exists, false otherwise | ### [FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField") offsetGet(string $name) Gets the value of a field. #### Parameters | | | | | --- | --- | --- | | string | $name | The field name | #### Return Value | | | | --- | --- | | [FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField") | The associated Field instance | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the field does not exist | ### offsetSet(string $name, string|array $value) Sets the value of a field. #### Parameters | | | | | --- | --- | --- | | string | $name | The field name | | string|array | $value | The value of the field | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the field does not exist | ### offsetUnset(string $name) Removes a field from the form. #### Parameters | | | | | --- | --- | --- | | string | $name | The field name | ### [Form](form "Symfony\Component\DomCrawler\Form") disableValidation() Disables validation. #### Return Value | | | | --- | --- | | [Form](form "Symfony\Component\DomCrawler\Form") | |
programming_docs
symfony Image Image ====== class **Image** extends [AbstractUriElement](abstracturielement "Symfony\Component\DomCrawler\AbstractUriElement") Image represents an HTML image (an HTML img tag). Properties ---------- | | | | | | --- | --- | --- | --- | | protected [DOMElement](http://php.net/DOMElement) | $node | | from [AbstractUriElement](abstracturielement#property_node "Symfony\Component\DomCrawler\AbstractUriElement") | | protected string | $method | | from [AbstractUriElement](abstracturielement#property_method "Symfony\Component\DomCrawler\AbstractUriElement") | | protected string | $currentUri | | from [AbstractUriElement](abstracturielement#property_currentUri "Symfony\Component\DomCrawler\AbstractUriElement") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([DOMElement](http://php.net/DOMElement) $node, string $currentUri) | | | [DOMElement](http://php.net/DOMElement) | [getNode](#method_getNode)() Gets the node associated with this link. | from [AbstractUriElement](abstracturielement#method_getNode "Symfony\Component\DomCrawler\AbstractUriElement") | | string | [getMethod](#method_getMethod)() Gets the method associated with this link. | from [AbstractUriElement](abstracturielement#method_getMethod "Symfony\Component\DomCrawler\AbstractUriElement") | | string | [getUri](#method_getUri)() Gets the URI associated with this link. | from [AbstractUriElement](abstracturielement#method_getUri "Symfony\Component\DomCrawler\AbstractUriElement") | | string | [getRawUri](#method_getRawUri)() Returns raw URI data. | | | string | [canonicalizePath](#method_canonicalizePath)(string $path) Returns the canonicalized URI path (see RFC 3986, section 5.2.4). | from [AbstractUriElement](abstracturielement#method_canonicalizePath "Symfony\Component\DomCrawler\AbstractUriElement") | | | [setNode](#method_setNode)([DOMElement](http://php.net/DOMElement) $node) Sets current \DOMElement instance. | | Details ------- ### \_\_construct([DOMElement](http://php.net/DOMElement) $node, string $currentUri) #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $node | A \DOMElement instance | | string | $currentUri | The URI of the page where the link is embedded (or the base href) | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the node is not a link | ### [DOMElement](http://php.net/DOMElement) getNode() Gets the node associated with this link. #### Return Value | | | | --- | --- | | [DOMElement](http://php.net/DOMElement) | A \DOMElement instance | ### string getMethod() Gets the method associated with this link. #### Return Value | | | | --- | --- | | string | The method | ### string getUri() Gets the URI associated with this link. #### Return Value | | | | --- | --- | | string | The URI | ### protected string getRawUri() Returns raw URI data. #### Return Value | | | | --- | --- | | string | | ### protected string canonicalizePath(string $path) Returns the canonicalized URI path (see RFC 3986, section 5.2.4). #### Parameters | | | | | --- | --- | --- | | string | $path | URI path | #### Return Value | | | | --- | --- | | string | | ### protected setNode([DOMElement](http://php.net/DOMElement) $node) Sets current \DOMElement instance. #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $node | A \DOMElement instance | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | If given node is not an anchor | symfony Link Link ===== class **Link** extends [AbstractUriElement](abstracturielement "Symfony\Component\DomCrawler\AbstractUriElement") Link represents an HTML link (an HTML a, area or link tag). Properties ---------- | | | | | | --- | --- | --- | --- | | protected [DOMElement](http://php.net/DOMElement) | $node | | from [AbstractUriElement](abstracturielement#property_node "Symfony\Component\DomCrawler\AbstractUriElement") | | protected string | $method | | from [AbstractUriElement](abstracturielement#property_method "Symfony\Component\DomCrawler\AbstractUriElement") | | protected string | $currentUri | | from [AbstractUriElement](abstracturielement#property_currentUri "Symfony\Component\DomCrawler\AbstractUriElement") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([DOMElement](http://php.net/DOMElement) $node, string $currentUri, string|null $method = 'GET') | from [AbstractUriElement](abstracturielement#method___construct "Symfony\Component\DomCrawler\AbstractUriElement") | | [DOMElement](http://php.net/DOMElement) | [getNode](#method_getNode)() Gets the node associated with this link. | from [AbstractUriElement](abstracturielement#method_getNode "Symfony\Component\DomCrawler\AbstractUriElement") | | string | [getMethod](#method_getMethod)() Gets the method associated with this link. | from [AbstractUriElement](abstracturielement#method_getMethod "Symfony\Component\DomCrawler\AbstractUriElement") | | string | [getUri](#method_getUri)() Gets the URI associated with this link. | from [AbstractUriElement](abstracturielement#method_getUri "Symfony\Component\DomCrawler\AbstractUriElement") | | string | [getRawUri](#method_getRawUri)() Returns raw URI data. | | | string | [canonicalizePath](#method_canonicalizePath)(string $path) Returns the canonicalized URI path (see RFC 3986, section 5.2.4). | from [AbstractUriElement](abstracturielement#method_canonicalizePath "Symfony\Component\DomCrawler\AbstractUriElement") | | | [setNode](#method_setNode)([DOMElement](http://php.net/DOMElement) $node) Sets current \DOMElement instance. | | Details ------- ### \_\_construct([DOMElement](http://php.net/DOMElement) $node, string $currentUri, string|null $method = 'GET') #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $node | A \DOMElement instance | | string | $currentUri | The URI of the page where the link is embedded (or the base href) | | string|null | $method | The method to use for the link (GET by default) | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the node is not a link | ### [DOMElement](http://php.net/DOMElement) getNode() Gets the node associated with this link. #### Return Value | | | | --- | --- | | [DOMElement](http://php.net/DOMElement) | A \DOMElement instance | ### string getMethod() Gets the method associated with this link. #### Return Value | | | | --- | --- | | string | The method | ### string getUri() Gets the URI associated with this link. #### Return Value | | | | --- | --- | | string | The URI | ### protected string getRawUri() Returns raw URI data. #### Return Value | | | | --- | --- | | string | | ### protected string canonicalizePath(string $path) Returns the canonicalized URI path (see RFC 3986, section 5.2.4). #### Parameters | | | | | --- | --- | --- | | string | $path | URI path | #### Return Value | | | | --- | --- | | string | | ### protected setNode([DOMElement](http://php.net/DOMElement) $node) Sets current \DOMElement instance. #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $node | A \DOMElement instance | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | If given node is not an anchor | symfony FormFieldRegistry FormFieldRegistry ================== class **FormFieldRegistry** This is an internal class that must not be used directly. Methods ------- | | | | | --- | --- | --- | | | [add](#method_add)([FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField") $field) Adds a field to the registry. | | | | [remove](#method_remove)(string $name) Removes a field and its children from the registry. | | | mixed | [get](#method_get)(string $name) Returns the value of the field and its children. | | | bool | [has](#method_has)(string $name) Tests whether the form has the given field. | | | | [set](#method_set)(string $name, mixed $value) Set the value of a field and its children. | | | [FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField")[] | [all](#method_all)() Returns the list of field with their value. | | Details ------- ### add([FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField") $field) Adds a field to the registry. #### Parameters | | | | | --- | --- | --- | | [FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField") | $field | | ### remove(string $name) Removes a field and its children from the registry. #### Parameters | | | | | --- | --- | --- | | string | $name | The fully qualified name of the base field | ### mixed get(string $name) Returns the value of the field and its children. #### Parameters | | | | | --- | --- | --- | | string | $name | The fully qualified name of the field | #### Return Value | | | | --- | --- | | mixed | The value of the field | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the field does not exist | ### bool has(string $name) Tests whether the form has the given field. #### Parameters | | | | | --- | --- | --- | | string | $name | The fully qualified name of the field | #### Return Value | | | | --- | --- | | bool | Whether the form has the given field | ### set(string $name, mixed $value) Set the value of a field and its children. #### Parameters | | | | | --- | --- | --- | | string | $name | The fully qualified name of the field | | mixed | $value | The value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the field does not exist | ### [FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField")[] all() Returns the list of field with their value. #### Return Value | | | | --- | --- | | [FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField")[] | The list of fields as array((string) Fully qualified name => (mixed) value) | symfony AbstractUriElement AbstractUriElement =================== abstract class **AbstractUriElement** Any HTML element that can link to an URI. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [DOMElement](http://php.net/DOMElement) | $node | | | | protected string | $method | | | | protected string | $currentUri | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([DOMElement](http://php.net/DOMElement) $node, string $currentUri, string|null $method = 'GET') | | | [DOMElement](http://php.net/DOMElement) | [getNode](#method_getNode)() Gets the node associated with this link. | | | string | [getMethod](#method_getMethod)() Gets the method associated with this link. | | | string | [getUri](#method_getUri)() Gets the URI associated with this link. | | | string | [getRawUri](#method_getRawUri)() Returns raw URI data. | | | string | [canonicalizePath](#method_canonicalizePath)(string $path) Returns the canonicalized URI path (see RFC 3986, section 5.2.4). | | | | [setNode](#method_setNode)([DOMElement](http://php.net/DOMElement) $node) Sets current \DOMElement instance. | | Details ------- ### \_\_construct([DOMElement](http://php.net/DOMElement) $node, string $currentUri, string|null $method = 'GET') #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $node | A \DOMElement instance | | string | $currentUri | The URI of the page where the link is embedded (or the base href) | | string|null | $method | The method to use for the link (GET by default) | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | if the node is not a link | ### [DOMElement](http://php.net/DOMElement) getNode() Gets the node associated with this link. #### Return Value | | | | --- | --- | | [DOMElement](http://php.net/DOMElement) | A \DOMElement instance | ### string getMethod() Gets the method associated with this link. #### Return Value | | | | --- | --- | | string | The method | ### string getUri() Gets the URI associated with this link. #### Return Value | | | | --- | --- | | string | The URI | ### abstract protected string getRawUri() Returns raw URI data. #### Return Value | | | | --- | --- | | string | | ### protected string canonicalizePath(string $path) Returns the canonicalized URI path (see RFC 3986, section 5.2.4). #### Parameters | | | | | --- | --- | --- | | string | $path | URI path | #### Return Value | | | | --- | --- | | string | | ### abstract protected setNode([DOMElement](http://php.net/DOMElement) $node) Sets current \DOMElement instance. #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $node | A \DOMElement instance | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | If given node is not an anchor | symfony Crawler Crawler ======== class **Crawler** implements [Countable](http://php.net/Countable), [IteratorAggregate](http://php.net/IteratorAggregate) Crawler eases navigation of a list of \DOMNode objects. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $uri | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(mixed $node = null, string $uri = null, string $baseHref = null) | | | string | [getUri](#method_getUri)() Returns the current URI. | | | string | [getBaseHref](#method_getBaseHref)() Returns base href. | | | | [clear](#method_clear)() Removes all the nodes. | | | | [add](#method_add)([DOMNodeList](http://php.net/DOMNodeList)|[DOMNode](http://php.net/DOMNode)|array|string|null $node) Adds a node to the current list of nodes. | | | | [addContent](#method_addContent)(string $content, string|null $type = null) Adds HTML/XML content. | | | | [addHtmlContent](#method_addHtmlContent)(string $content, string $charset = 'UTF-8') Adds an HTML content to the list of nodes. | | | | [addXmlContent](#method_addXmlContent)(string $content, string $charset = 'UTF-8', int $options = LIBXML\_NONET) Adds an XML content to the list of nodes. | | | | [addDocument](#method_addDocument)([DOMDocument](http://php.net/DOMDocument) $dom) Adds a \DOMDocument to the list of nodes. | | | | [addNodeList](#method_addNodeList)([DOMNodeList](http://php.net/DOMNodeList) $nodes) Adds a \DOMNodeList to the list of nodes. | | | | [addNodes](#method_addNodes)(array $nodes) Adds an array of \DOMNode instances to the list of nodes. | | | | [addNode](#method_addNode)([DOMNode](http://php.net/DOMNode) $node) Adds a \DOMNode instance to the list of nodes. | | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | [eq](#method_eq)(int $position) Returns a node given its position in the node list. | | | array | [each](#method_each)([Closure](http://php.net/Closure) $closure) Calls an anonymous function on each node of the list. | | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | [slice](#method_slice)(int $offset = 0, int $length = null) Slices the list of nodes by $offset and $length. | | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | [reduce](#method_reduce)([Closure](http://php.net/Closure) $closure) Reduces the list of nodes by calling an anonymous function. | | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | [first](#method_first)() Returns the first node of the current selection. | | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | [last](#method_last)() Returns the last node of the current selection. | | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | [siblings](#method_siblings)() Returns the siblings nodes of the current selection. | | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | [nextAll](#method_nextAll)() Returns the next siblings nodes of the current selection. | | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | [previousAll](#method_previousAll)() Returns the previous sibling nodes of the current selection. | | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | [parents](#method_parents)() Returns the parents nodes of the current selection. | | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | [children](#method_children)() Returns the children nodes of the current selection. | | | string|null | [attr](#method_attr)(string $attribute) Returns the attribute value of the first node of the list. | | | string | [nodeName](#method_nodeName)() Returns the node name of the first node of the list. | | | string | [text](#method_text)() Returns the node value of the first node of the list. | | | string | [html](#method_html)() Returns the first node of the list as HTML. | | | array|[Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | [evaluate](#method_evaluate)(string $xpath) Evaluates an XPath expression. | | | array | [extract](#method_extract)(array $attributes) Extracts information from the list of nodes. | | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | [filterXPath](#method_filterXPath)(string $xpath) Filters the list of nodes with an XPath expression. | | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | [filter](#method_filter)(string $selector) Filters the list of nodes with a CSS selector. | | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | [selectLink](#method_selectLink)(string $value) Selects links by name or alt value for clickable images. | | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | [selectImage](#method_selectImage)(string $value) Selects images by alt value. | | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | [selectButton](#method_selectButton)(string $value) Selects a button by name or alt value for images. | | | [Link](link "Symfony\Component\DomCrawler\Link") | [link](#method_link)(string $method = 'get') Returns a Link object for the first node in the list. | | | [Link](link "Symfony\Component\DomCrawler\Link")[] | [links](#method_links)() Returns an array of Link objects for the nodes in the list. | | | [Image](image "Symfony\Component\DomCrawler\Image") | [image](#method_image)() Returns an Image object for the first node in the list. | | | [Image](image "Symfony\Component\DomCrawler\Image")[] | [images](#method_images)() Returns an array of Image objects for the nodes in the list. | | | [Form](form "Symfony\Component\DomCrawler\Form") | [form](#method_form)(array $values = null, string $method = null) Returns a Form object for the first node in the list. | | | | [setDefaultNamespacePrefix](#method_setDefaultNamespacePrefix)(string $prefix) Overloads a default namespace prefix to be used with XPath and CSS expressions. | | | | [registerNamespace](#method_registerNamespace)(string $prefix, string $namespace) | | | static string | [xpathLiteral](#method_xpathLiteral)(string $s) Converts string for XPath expressions. | | | [DOMElement](http://php.net/DOMElement)|null | [getNode](#method_getNode)(int $position) | | | int | [count](#method_count)() | | | [ArrayIterator](http://php.net/ArrayIterator)|[DOMElement](http://php.net/DOMElement)[] | [getIterator](#method_getIterator)() | | | array | [sibling](#method_sibling)([DOMElement](http://php.net/DOMElement) $node, string $siblingDir = 'nextSibling') | | Details ------- ### \_\_construct(mixed $node = null, string $uri = null, string $baseHref = null) #### Parameters | | | | | --- | --- | --- | | mixed | $node | A Node to use as the base for the crawling | | string | $uri | The current URI | | string | $baseHref | The base href value | ### string getUri() Returns the current URI. #### Return Value | | | | --- | --- | | string | | ### string getBaseHref() Returns base href. #### Return Value | | | | --- | --- | | string | | ### clear() Removes all the nodes. ### add([DOMNodeList](http://php.net/DOMNodeList)|[DOMNode](http://php.net/DOMNode)|array|string|null $node) Adds a node to the current list of nodes. This method uses the appropriate specialized add\*() method based on the type of the argument. #### Parameters | | | | | --- | --- | --- | | [DOMNodeList](http://php.net/DOMNodeList)|[DOMNode](http://php.net/DOMNode)|array|string|null | $node | A node | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | when node is not the expected type | ### addContent(string $content, string|null $type = null) Adds HTML/XML content. If the charset is not set via the content type, it is assumed to be UTF-8, or ISO-8859-1 as a fallback, which is the default charset defined by the HTTP 1.1 specification. #### Parameters | | | | | --- | --- | --- | | string | $content | A string to parse as HTML/XML | | string|null | $type | The content type of the string | ### addHtmlContent(string $content, string $charset = 'UTF-8') Adds an HTML content to the list of nodes. The libxml errors are disabled when the content is parsed. If you want to get parsing errors, be sure to enable internal errors via libxml\_use\_internal\_errors(true) and then, get the errors via libxml\_get\_errors(). Be sure to clear errors with libxml\_clear\_errors() afterward. #### Parameters | | | | | --- | --- | --- | | string | $content | The HTML content | | string | $charset | The charset | ### addXmlContent(string $content, string $charset = 'UTF-8', int $options = LIBXML\_NONET) Adds an XML content to the list of nodes. The libxml errors are disabled when the content is parsed. If you want to get parsing errors, be sure to enable internal errors via libxml\_use\_internal\_errors(true) and then, get the errors via libxml\_get\_errors(). Be sure to clear errors with libxml\_clear\_errors() afterward. #### Parameters | | | | | --- | --- | --- | | string | $content | The XML content | | string | $charset | The charset | | int | $options | Bitwise OR of the libxml option constants LIBXML\_PARSEHUGE is dangerous, see http://symfony.com/blog/security-release-symfony-2-0-17-released | ### addDocument([DOMDocument](http://php.net/DOMDocument) $dom) Adds a \DOMDocument to the list of nodes. #### Parameters | | | | | --- | --- | --- | | [DOMDocument](http://php.net/DOMDocument) | $dom | A \DOMDocument instance | ### addNodeList([DOMNodeList](http://php.net/DOMNodeList) $nodes) Adds a \DOMNodeList to the list of nodes. #### Parameters | | | | | --- | --- | --- | | [DOMNodeList](http://php.net/DOMNodeList) | $nodes | A \DOMNodeList instance | ### addNodes(array $nodes) Adds an array of \DOMNode instances to the list of nodes. #### Parameters | | | | | --- | --- | --- | | array | $nodes | An array of \DOMNode instances | ### addNode([DOMNode](http://php.net/DOMNode) $node) Adds a \DOMNode instance to the list of nodes. #### Parameters | | | | | --- | --- | --- | | [DOMNode](http://php.net/DOMNode) | $node | A \DOMNode instance | ### [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") eq(int $position) Returns a node given its position in the node list. #### Parameters | | | | | --- | --- | --- | | int | $position | The position | #### Return Value | | | | --- | --- | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | | ### array each([Closure](http://php.net/Closure) $closure) Calls an anonymous function on each node of the list. The anonymous function receives the position and the node wrapped in a Crawler instance as arguments. Example: ``` $crawler->filter('h1')->each(function ($node, $i) { return $node->text(); }); ``` #### Parameters | | | | | --- | --- | --- | | [Closure](http://php.net/Closure) | $closure | An anonymous function | #### Return Value | | | | --- | --- | | array | An array of values returned by the anonymous function | ### [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") slice(int $offset = 0, int $length = null) Slices the list of nodes by $offset and $length. #### Parameters | | | | | --- | --- | --- | | int | $offset | | | int | $length | | #### Return Value | | | | --- | --- | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | | ### [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") reduce([Closure](http://php.net/Closure) $closure) Reduces the list of nodes by calling an anonymous function. To remove a node from the list, the anonymous function must return false. #### Parameters | | | | | --- | --- | --- | | [Closure](http://php.net/Closure) | $closure | An anonymous function | #### Return Value | | | | --- | --- | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | | ### [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") first() Returns the first node of the current selection. #### Return Value | | | | --- | --- | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | | ### [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") last() Returns the last node of the current selection. #### Return Value | | | | --- | --- | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | | ### [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") siblings() Returns the siblings nodes of the current selection. #### Return Value | | | | --- | --- | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When current node is empty | ### [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") nextAll() Returns the next siblings nodes of the current selection. #### Return Value | | | | --- | --- | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When current node is empty | ### [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") previousAll() Returns the previous sibling nodes of the current selection. #### Return Value | | | | --- | --- | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") parents() Returns the parents nodes of the current selection. #### Return Value | | | | --- | --- | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When current node is empty | ### [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") children() Returns the children nodes of the current selection. #### Return Value | | | | --- | --- | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When current node is empty | ### string|null attr(string $attribute) Returns the attribute value of the first node of the list. #### Parameters | | | | | --- | --- | --- | | string | $attribute | The attribute name | #### Return Value | | | | --- | --- | | string|null | The attribute value or null if the attribute does not exist | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When current node is empty | ### string nodeName() Returns the node name of the first node of the list. #### Return Value | | | | --- | --- | | string | The node name | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When current node is empty | ### string text() Returns the node value of the first node of the list. #### Return Value | | | | --- | --- | | string | The node value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When current node is empty | ### string html() Returns the first node of the list as HTML. #### Return Value | | | | --- | --- | | string | The node html | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When current node is empty | ### array|[Crawler](crawler "Symfony\Component\DomCrawler\Crawler") evaluate(string $xpath) Evaluates an XPath expression. Since an XPath expression might evaluate to either a simple type or a \DOMNodeList, this method will return either an array of simple types or a new Crawler instance. #### Parameters | | | | | --- | --- | --- | | string | $xpath | An XPath expression | #### Return Value | | | | --- | --- | | array|[Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | An array of evaluation results or a new Crawler instance | ### array extract(array $attributes) Extracts information from the list of nodes. You can extract attributes or/and the node value (\_text). Example: ``` $crawler->filter('h1 a')->extract(array('_text', 'href')); ``` #### Parameters | | | | | --- | --- | --- | | array | $attributes | An array of attributes | #### Return Value | | | | --- | --- | | array | An array of extracted values | ### [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") filterXPath(string $xpath) Filters the list of nodes with an XPath expression. The XPath expression is evaluated in the context of the crawler, which is considered as a fake parent of the elements inside it. This means that a child selector "div" or "./div" will match only the div elements of the current crawler, not their children. #### Parameters | | | | | --- | --- | --- | | string | $xpath | An XPath expression | #### Return Value | | | | --- | --- | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | | ### [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") filter(string $selector) Filters the list of nodes with a CSS selector. This method only works if you have installed the CssSelector Symfony Component. #### Parameters | | | | | --- | --- | --- | | string | $selector | A CSS selector | #### Return Value | | | | --- | --- | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the CssSelector Component is not available | ### [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") selectLink(string $value) Selects links by name or alt value for clickable images. #### Parameters | | | | | --- | --- | --- | | string | $value | The link text | #### Return Value | | | | --- | --- | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | | ### [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") selectImage(string $value) Selects images by alt value. #### Parameters | | | | | --- | --- | --- | | string | $value | The image alt | #### Return Value | | | | --- | --- | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | A new instance of Crawler with the filtered list of nodes | ### [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") selectButton(string $value) Selects a button by name or alt value for images. #### Parameters | | | | | --- | --- | --- | | string | $value | The button text | #### Return Value | | | | --- | --- | | [Crawler](crawler "Symfony\Component\DomCrawler\Crawler") | | ### [Link](link "Symfony\Component\DomCrawler\Link") link(string $method = 'get') Returns a Link object for the first node in the list. #### Parameters | | | | | --- | --- | --- | | string | $method | The method for the link (get by default) | #### Return Value | | | | --- | --- | | [Link](link "Symfony\Component\DomCrawler\Link") | A Link instance | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | If the current node list is empty or the selected node is not instance of DOMElement | ### [Link](link "Symfony\Component\DomCrawler\Link")[] links() Returns an array of Link objects for the nodes in the list. #### Return Value | | | | --- | --- | | [Link](link "Symfony\Component\DomCrawler\Link")[] | An array of Link instances | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | If the current node list contains non-DOMElement instances | ### [Image](image "Symfony\Component\DomCrawler\Image") image() Returns an Image object for the first node in the list. #### Return Value | | | | --- | --- | | [Image](image "Symfony\Component\DomCrawler\Image") | An Image instance | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | If the current node list is empty | ### [Image](image "Symfony\Component\DomCrawler\Image")[] images() Returns an array of Image objects for the nodes in the list. #### Return Value | | | | --- | --- | | [Image](image "Symfony\Component\DomCrawler\Image")[] | An array of Image instances | ### [Form](form "Symfony\Component\DomCrawler\Form") form(array $values = null, string $method = null) Returns a Form object for the first node in the list. #### Parameters | | | | | --- | --- | --- | | array | $values | An array of values for the form fields | | string | $method | The method for the form | #### Return Value | | | | --- | --- | | [Form](form "Symfony\Component\DomCrawler\Form") | A Form instance | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | If the current node list is empty or the selected node is not instance of DOMElement | ### setDefaultNamespacePrefix(string $prefix) Overloads a default namespace prefix to be used with XPath and CSS expressions. #### Parameters | | | | | --- | --- | --- | | string | $prefix | | ### registerNamespace(string $prefix, string $namespace) #### Parameters | | | | | --- | --- | --- | | string | $prefix | | | string | $namespace | | ### static string xpathLiteral(string $s) Converts string for XPath expressions. Escaped characters are: quotes (") and apostrophe ('). Examples: ``` echo Crawler::xpathLiteral('foo " bar'); //prints 'foo " bar' echo Crawler::xpathLiteral("foo ' bar"); //prints "foo ' bar" echo Crawler::xpathLiteral('a\'b"c'); //prints concat('a', "'", 'b"c') ``` #### Parameters | | | | | --- | --- | --- | | string | $s | String to be escaped | #### Return Value | | | | --- | --- | | string | Converted string | ### [DOMElement](http://php.net/DOMElement)|null getNode(int $position) #### Parameters | | | | | --- | --- | --- | | int | $position | | #### Return Value | | | | --- | --- | | [DOMElement](http://php.net/DOMElement)|null | | ### int count() #### Return Value | | | | --- | --- | | int | | ### [ArrayIterator](http://php.net/ArrayIterator)|[DOMElement](http://php.net/DOMElement)[] getIterator() #### Return Value | | | | --- | --- | | [ArrayIterator](http://php.net/ArrayIterator)|[DOMElement](http://php.net/DOMElement)[] | | ### protected array sibling([DOMElement](http://php.net/DOMElement) $node, string $siblingDir = 'nextSibling') #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $node | | | string | $siblingDir | | #### Return Value | | | | --- | --- | | array | |
programming_docs
symfony Symfony\Component\DomCrawler\Field Symfony\Component\DomCrawler\Field ================================== Classes ------- | | | | --- | --- | | [ChoiceFormField](field/choiceformfield "Symfony\Component\DomCrawler\Field\ChoiceFormField") | ChoiceFormField represents a choice form field. | | [FileFormField](field/fileformfield "Symfony\Component\DomCrawler\Field\FileFormField") | FileFormField represents a file form field (an HTML file input tag). | | [FormField](field/formfield "Symfony\Component\DomCrawler\Field\FormField") | FormField is the abstract class for all form fields. | | [InputFormField](field/inputformfield "Symfony\Component\DomCrawler\Field\InputFormField") | InputFormField represents an input form field (an HTML input tag). | | [TextareaFormField](field/textareaformfield "Symfony\Component\DomCrawler\Field\TextareaFormField") | TextareaFormField represents a textarea form field (an HTML textarea tag). | symfony FileFormField FileFormField ============== class **FileFormField** extends [FormField](formfield "Symfony\Component\DomCrawler\Field\FormField") FileFormField represents a file form field (an HTML file input tag). Properties ---------- | | | | | | --- | --- | --- | --- | | protected [DOMElement](http://php.net/DOMElement) | $node | | from [FormField](formfield#property_node "Symfony\Component\DomCrawler\Field\FormField") | | protected string | $name | | from [FormField](formfield#property_name "Symfony\Component\DomCrawler\Field\FormField") | | protected string | $value | | from [FormField](formfield#property_value "Symfony\Component\DomCrawler\Field\FormField") | | protected [DOMDocument](http://php.net/DOMDocument) | $document | | from [FormField](formfield#property_document "Symfony\Component\DomCrawler\Field\FormField") | | protected [DOMXPath](http://php.net/DOMXPath) | $xpath | | from [FormField](formfield#property_xpath "Symfony\Component\DomCrawler\Field\FormField") | | protected bool | $disabled | | from [FormField](formfield#property_disabled "Symfony\Component\DomCrawler\Field\FormField") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([DOMElement](http://php.net/DOMElement) $node) | from [FormField](formfield#method___construct "Symfony\Component\DomCrawler\Field\FormField") | | [DOMElement](http://php.net/DOMElement)|null | [getLabel](#method_getLabel)() Returns the label tag associated to the field or null if none. | from [FormField](formfield#method_getLabel "Symfony\Component\DomCrawler\Field\FormField") | | string | [getName](#method_getName)() Returns the name of the field. | from [FormField](formfield#method_getName "Symfony\Component\DomCrawler\Field\FormField") | | string|array | [getValue](#method_getValue)() Gets the value of the field. | from [FormField](formfield#method_getValue "Symfony\Component\DomCrawler\Field\FormField") | | | [setValue](#method_setValue)(string $value) Sets the value of the field. | | | bool | [hasValue](#method_hasValue)() Returns true if the field should be included in the submitted values. | from [FormField](formfield#method_hasValue "Symfony\Component\DomCrawler\Field\FormField") | | bool | [isDisabled](#method_isDisabled)() Check if the current field is disabled. | from [FormField](formfield#method_isDisabled "Symfony\Component\DomCrawler\Field\FormField") | | | [initialize](#method_initialize)() Initializes the form field. | | | | [setErrorCode](#method_setErrorCode)(int $error) Sets the PHP error code associated with the field. | | | | [upload](#method_upload)(string $value) Sets the value of the field. | | | | [setFilePath](#method_setFilePath)(string $path) Sets path to the file as string for simulating HTTP request. | | Details ------- ### \_\_construct([DOMElement](http://php.net/DOMElement) $node) #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $node | The node associated with this field | ### [DOMElement](http://php.net/DOMElement)|null getLabel() Returns the label tag associated to the field or null if none. #### Return Value | | | | --- | --- | | [DOMElement](http://php.net/DOMElement)|null | | ### string getName() Returns the name of the field. #### Return Value | | | | --- | --- | | string | The name of the field | ### string|array getValue() Gets the value of the field. #### Return Value | | | | --- | --- | | string|array | The value of the field | ### setValue(string $value) Sets the value of the field. #### Parameters | | | | | --- | --- | --- | | string | $value | The value of the field | ### bool hasValue() Returns true if the field should be included in the submitted values. #### Return Value | | | | --- | --- | | bool | true if the field should be included in the submitted values, false otherwise | ### bool isDisabled() Check if the current field is disabled. #### Return Value | | | | --- | --- | | bool | | ### protected initialize() Initializes the form field. #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | When node type is incorrect | ### setErrorCode(int $error) Sets the PHP error code associated with the field. #### Parameters | | | | | --- | --- | --- | | int | $error | The error code (one of UPLOAD\_ERR\_INI\_SIZE, UPLOAD\_ERR\_FORM\_SIZE, UPLOAD\_ERR\_PARTIAL, UPLOAD\_ERR\_NO\_FILE, UPLOAD\_ERR\_NO\_TMP\_DIR, UPLOAD\_ERR\_CANT\_WRITE, or UPLOAD\_ERR\_EXTENSION) | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When error code doesn't exist | ### upload(string $value) Sets the value of the field. #### Parameters | | | | | --- | --- | --- | | string | $value | The value of the field | ### setFilePath(string $path) Sets path to the file as string for simulating HTTP request. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the file | symfony FormField FormField ========== abstract class **FormField** FormField is the abstract class for all form fields. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [DOMElement](http://php.net/DOMElement) | $node | | | | protected string | $name | | | | protected string | $value | | | | protected [DOMDocument](http://php.net/DOMDocument) | $document | | | | protected [DOMXPath](http://php.net/DOMXPath) | $xpath | | | | protected bool | $disabled | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([DOMElement](http://php.net/DOMElement) $node) | | | [DOMElement](http://php.net/DOMElement)|null | [getLabel](#method_getLabel)() Returns the label tag associated to the field or null if none. | | | string | [getName](#method_getName)() Returns the name of the field. | | | string|array | [getValue](#method_getValue)() Gets the value of the field. | | | | [setValue](#method_setValue)(string $value) Sets the value of the field. | | | bool | [hasValue](#method_hasValue)() Returns true if the field should be included in the submitted values. | | | bool | [isDisabled](#method_isDisabled)() Check if the current field is disabled. | | | | [initialize](#method_initialize)() Initializes the form field. | | Details ------- ### \_\_construct([DOMElement](http://php.net/DOMElement) $node) #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $node | The node associated with this field | ### [DOMElement](http://php.net/DOMElement)|null getLabel() Returns the label tag associated to the field or null if none. #### Return Value | | | | --- | --- | | [DOMElement](http://php.net/DOMElement)|null | | ### string getName() Returns the name of the field. #### Return Value | | | | --- | --- | | string | The name of the field | ### string|array getValue() Gets the value of the field. #### Return Value | | | | --- | --- | | string|array | The value of the field | ### setValue(string $value) Sets the value of the field. #### Parameters | | | | | --- | --- | --- | | string | $value | The value of the field | ### bool hasValue() Returns true if the field should be included in the submitted values. #### Return Value | | | | --- | --- | | bool | true if the field should be included in the submitted values, false otherwise | ### bool isDisabled() Check if the current field is disabled. #### Return Value | | | | --- | --- | | bool | | ### abstract protected initialize() Initializes the form field. symfony TextareaFormField TextareaFormField ================== class **TextareaFormField** extends [FormField](formfield "Symfony\Component\DomCrawler\Field\FormField") TextareaFormField represents a textarea form field (an HTML textarea tag). Properties ---------- | | | | | | --- | --- | --- | --- | | protected [DOMElement](http://php.net/DOMElement) | $node | | from [FormField](formfield#property_node "Symfony\Component\DomCrawler\Field\FormField") | | protected string | $name | | from [FormField](formfield#property_name "Symfony\Component\DomCrawler\Field\FormField") | | protected string | $value | | from [FormField](formfield#property_value "Symfony\Component\DomCrawler\Field\FormField") | | protected [DOMDocument](http://php.net/DOMDocument) | $document | | from [FormField](formfield#property_document "Symfony\Component\DomCrawler\Field\FormField") | | protected [DOMXPath](http://php.net/DOMXPath) | $xpath | | from [FormField](formfield#property_xpath "Symfony\Component\DomCrawler\Field\FormField") | | protected bool | $disabled | | from [FormField](formfield#property_disabled "Symfony\Component\DomCrawler\Field\FormField") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([DOMElement](http://php.net/DOMElement) $node) | from [FormField](formfield#method___construct "Symfony\Component\DomCrawler\Field\FormField") | | [DOMElement](http://php.net/DOMElement)|null | [getLabel](#method_getLabel)() Returns the label tag associated to the field or null if none. | from [FormField](formfield#method_getLabel "Symfony\Component\DomCrawler\Field\FormField") | | string | [getName](#method_getName)() Returns the name of the field. | from [FormField](formfield#method_getName "Symfony\Component\DomCrawler\Field\FormField") | | string|array | [getValue](#method_getValue)() Gets the value of the field. | from [FormField](formfield#method_getValue "Symfony\Component\DomCrawler\Field\FormField") | | | [setValue](#method_setValue)(string $value) Sets the value of the field. | from [FormField](formfield#method_setValue "Symfony\Component\DomCrawler\Field\FormField") | | bool | [hasValue](#method_hasValue)() Returns true if the field should be included in the submitted values. | from [FormField](formfield#method_hasValue "Symfony\Component\DomCrawler\Field\FormField") | | bool | [isDisabled](#method_isDisabled)() Check if the current field is disabled. | from [FormField](formfield#method_isDisabled "Symfony\Component\DomCrawler\Field\FormField") | | | [initialize](#method_initialize)() Initializes the form field. | | Details ------- ### \_\_construct([DOMElement](http://php.net/DOMElement) $node) #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $node | The node associated with this field | ### [DOMElement](http://php.net/DOMElement)|null getLabel() Returns the label tag associated to the field or null if none. #### Return Value | | | | --- | --- | | [DOMElement](http://php.net/DOMElement)|null | | ### string getName() Returns the name of the field. #### Return Value | | | | --- | --- | | string | The name of the field | ### string|array getValue() Gets the value of the field. #### Return Value | | | | --- | --- | | string|array | The value of the field | ### setValue(string $value) Sets the value of the field. #### Parameters | | | | | --- | --- | --- | | string | $value | The value of the field | ### bool hasValue() Returns true if the field should be included in the submitted values. #### Return Value | | | | --- | --- | | bool | true if the field should be included in the submitted values, false otherwise | ### bool isDisabled() Check if the current field is disabled. #### Return Value | | | | --- | --- | | bool | | ### protected initialize() Initializes the form field. #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | When node type is incorrect | symfony ChoiceFormField ChoiceFormField ================ class **ChoiceFormField** extends [FormField](formfield "Symfony\Component\DomCrawler\Field\FormField") ChoiceFormField represents a choice form field. It is constructed from a HTML select tag, or a HTML checkbox, or radio inputs. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [DOMElement](http://php.net/DOMElement) | $node | | from [FormField](formfield#property_node "Symfony\Component\DomCrawler\Field\FormField") | | protected string | $name | | from [FormField](formfield#property_name "Symfony\Component\DomCrawler\Field\FormField") | | protected string | $value | | from [FormField](formfield#property_value "Symfony\Component\DomCrawler\Field\FormField") | | protected [DOMDocument](http://php.net/DOMDocument) | $document | | from [FormField](formfield#property_document "Symfony\Component\DomCrawler\Field\FormField") | | protected [DOMXPath](http://php.net/DOMXPath) | $xpath | | from [FormField](formfield#property_xpath "Symfony\Component\DomCrawler\Field\FormField") | | protected bool | $disabled | | from [FormField](formfield#property_disabled "Symfony\Component\DomCrawler\Field\FormField") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([DOMElement](http://php.net/DOMElement) $node) | from [FormField](formfield#method___construct "Symfony\Component\DomCrawler\Field\FormField") | | [DOMElement](http://php.net/DOMElement)|null | [getLabel](#method_getLabel)() Returns the label tag associated to the field or null if none. | from [FormField](formfield#method_getLabel "Symfony\Component\DomCrawler\Field\FormField") | | string | [getName](#method_getName)() Returns the name of the field. | from [FormField](formfield#method_getName "Symfony\Component\DomCrawler\Field\FormField") | | string|array | [getValue](#method_getValue)() Gets the value of the field. | from [FormField](formfield#method_getValue "Symfony\Component\DomCrawler\Field\FormField") | | | [setValue](#method_setValue)(string $value) Sets the value of the field. | | | bool | [hasValue](#method_hasValue)() Returns true if the field should be included in the submitted values. | | | bool | [isDisabled](#method_isDisabled)() Check if the current selected option is disabled. | | | | [initialize](#method_initialize)() Initializes the form field. | | | | [select](#method_select)(string|array $value) Sets the value of the field. | | | | [tick](#method_tick)() Ticks a checkbox. | | | | [untick](#method_untick)() Unticks a checkbox. | | | | [addChoice](#method_addChoice)([DOMElement](http://php.net/DOMElement) $node) Adds a choice to the current ones. | | | string | [getType](#method_getType)() Returns the type of the choice field (radio, select, or checkbox). | | | bool | [isMultiple](#method_isMultiple)() Returns true if the field accepts multiple values. | | | bool | [containsOption](#method_containsOption)(string $optionValue, array $options) Checks whether given value is in the existing options. | | | array | [availableOptionValues](#method_availableOptionValues)() Returns list of available field options. | | | [ChoiceFormField](choiceformfield "Symfony\Component\DomCrawler\Field\ChoiceFormField") | [disableValidation](#method_disableValidation)() Disables the internal validation of the field. | | Details ------- ### \_\_construct([DOMElement](http://php.net/DOMElement) $node) #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $node | The node associated with this field | ### [DOMElement](http://php.net/DOMElement)|null getLabel() Returns the label tag associated to the field or null if none. #### Return Value | | | | --- | --- | | [DOMElement](http://php.net/DOMElement)|null | | ### string getName() Returns the name of the field. #### Return Value | | | | --- | --- | | string | The name of the field | ### string|array getValue() Gets the value of the field. #### Return Value | | | | --- | --- | | string|array | The value of the field | ### setValue(string $value) Sets the value of the field. #### Parameters | | | | | --- | --- | --- | | string | $value | The value of the field | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When value type provided is not correct | ### bool hasValue() Returns true if the field should be included in the submitted values. #### Return Value | | | | --- | --- | | bool | true if the field should be included in the submitted values, false otherwise | ### bool isDisabled() Check if the current selected option is disabled. #### Return Value | | | | --- | --- | | bool | | ### protected initialize() Initializes the form field. #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | When node type is incorrect | ### select(string|array $value) Sets the value of the field. #### Parameters | | | | | --- | --- | --- | | string|array | $value | The value of the field | ### tick() Ticks a checkbox. #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | When the type provided is not correct | ### untick() Unticks a checkbox. #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | When the type provided is not correct | ### addChoice([DOMElement](http://php.net/DOMElement) $node) Adds a choice to the current ones. #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $node | | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | When choice provided is not multiple nor radio | ### string getType() Returns the type of the choice field (radio, select, or checkbox). #### Return Value | | | | --- | --- | | string | The type | ### bool isMultiple() Returns true if the field accepts multiple values. #### Return Value | | | | --- | --- | | bool | true if the field accepts multiple values, false otherwise | ### bool containsOption(string $optionValue, array $options) Checks whether given value is in the existing options. #### Parameters | | | | | --- | --- | --- | | string | $optionValue | | | array | $options | | #### Return Value | | | | --- | --- | | bool | | ### array availableOptionValues() Returns list of available field options. #### Return Value | | | | --- | --- | | array | | ### [ChoiceFormField](choiceformfield "Symfony\Component\DomCrawler\Field\ChoiceFormField") disableValidation() Disables the internal validation of the field. #### Return Value | | | | --- | --- | | [ChoiceFormField](choiceformfield "Symfony\Component\DomCrawler\Field\ChoiceFormField") | | symfony InputFormField InputFormField =============== class **InputFormField** extends [FormField](formfield "Symfony\Component\DomCrawler\Field\FormField") InputFormField represents an input form field (an HTML input tag). For inputs with type of file, checkbox, or radio, there are other more specialized classes (cf. FileFormField and ChoiceFormField). Properties ---------- | | | | | | --- | --- | --- | --- | | protected [DOMElement](http://php.net/DOMElement) | $node | | from [FormField](formfield#property_node "Symfony\Component\DomCrawler\Field\FormField") | | protected string | $name | | from [FormField](formfield#property_name "Symfony\Component\DomCrawler\Field\FormField") | | protected string | $value | | from [FormField](formfield#property_value "Symfony\Component\DomCrawler\Field\FormField") | | protected [DOMDocument](http://php.net/DOMDocument) | $document | | from [FormField](formfield#property_document "Symfony\Component\DomCrawler\Field\FormField") | | protected [DOMXPath](http://php.net/DOMXPath) | $xpath | | from [FormField](formfield#property_xpath "Symfony\Component\DomCrawler\Field\FormField") | | protected bool | $disabled | | from [FormField](formfield#property_disabled "Symfony\Component\DomCrawler\Field\FormField") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([DOMElement](http://php.net/DOMElement) $node) | from [FormField](formfield#method___construct "Symfony\Component\DomCrawler\Field\FormField") | | [DOMElement](http://php.net/DOMElement)|null | [getLabel](#method_getLabel)() Returns the label tag associated to the field or null if none. | from [FormField](formfield#method_getLabel "Symfony\Component\DomCrawler\Field\FormField") | | string | [getName](#method_getName)() Returns the name of the field. | from [FormField](formfield#method_getName "Symfony\Component\DomCrawler\Field\FormField") | | string|array | [getValue](#method_getValue)() Gets the value of the field. | from [FormField](formfield#method_getValue "Symfony\Component\DomCrawler\Field\FormField") | | | [setValue](#method_setValue)(string $value) Sets the value of the field. | from [FormField](formfield#method_setValue "Symfony\Component\DomCrawler\Field\FormField") | | bool | [hasValue](#method_hasValue)() Returns true if the field should be included in the submitted values. | from [FormField](formfield#method_hasValue "Symfony\Component\DomCrawler\Field\FormField") | | bool | [isDisabled](#method_isDisabled)() Check if the current field is disabled. | from [FormField](formfield#method_isDisabled "Symfony\Component\DomCrawler\Field\FormField") | | | [initialize](#method_initialize)() Initializes the form field. | | Details ------- ### \_\_construct([DOMElement](http://php.net/DOMElement) $node) #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $node | The node associated with this field | ### [DOMElement](http://php.net/DOMElement)|null getLabel() Returns the label tag associated to the field or null if none. #### Return Value | | | | --- | --- | | [DOMElement](http://php.net/DOMElement)|null | | ### string getName() Returns the name of the field. #### Return Value | | | | --- | --- | | string | The name of the field | ### string|array getValue() Gets the value of the field. #### Return Value | | | | --- | --- | | string|array | The value of the field | ### setValue(string $value) Sets the value of the field. #### Parameters | | | | | --- | --- | --- | | string | $value | The value of the field | ### bool hasValue() Returns true if the field should be included in the submitted values. #### Return Value | | | | --- | --- | | bool | true if the field should be included in the submitted values, false otherwise | ### bool isDisabled() Check if the current field is disabled. #### Return Value | | | | --- | --- | | bool | | ### protected initialize() Initializes the form field. #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | When node type is incorrect |
programming_docs
symfony Unescaper Unescaper ========== class **Unescaper** Unescaper encapsulates unescaping rules for single and double-quoted YAML strings. Constants --------- | | | | --- | --- | | REGEX\_ESCAPED\_CHARACTER | *Regex fragment that matches an escaped character in a double quoted string.* | Methods ------- | | | | | --- | --- | --- | | string | [unescapeSingleQuotedString](#method_unescapeSingleQuotedString)(string $value) Unescapes a single quoted string. | | | string | [unescapeDoubleQuotedString](#method_unescapeDoubleQuotedString)(string $value) Unescapes a double quoted string. | | Details ------- ### string unescapeSingleQuotedString(string $value) Unescapes a single quoted string. #### Parameters | | | | | --- | --- | --- | | string | $value | A single quoted string | #### Return Value | | | | --- | --- | | string | The unescaped string | ### string unescapeDoubleQuotedString(string $value) Unescapes a double quoted string. #### Parameters | | | | | --- | --- | --- | | string | $value | A double quoted string | #### Return Value | | | | --- | --- | | string | The unescaped string | symfony Parser Parser ======= class **Parser** Parser parses YAML strings to convert them to PHP arrays. Constants --------- | | | | --- | --- | | TAG\_PATTERN | | | BLOCK\_SCALAR\_HEADER\_PATTERN | | Methods ------- | | | | | --- | --- | --- | | mixed | [parseFile](#method_parseFile)(string $filename, int $flags = 0) Parses a YAML file into a PHP value. | | | mixed | [parse](#method_parse)(string $value, int $flags = 0) Parses a YAML string to a PHP value. | | | int | [getLastLineNumberBeforeDeprecation](#method_getLastLineNumberBeforeDeprecation)() | | | int | [getRealCurrentLineNb](#method_getRealCurrentLineNb)() Returns the current line number (takes the offset into account). | | | static int | [preg\_match](#method_preg_match)(string $pattern, string $subject, array $matches = null, int $flags = 0, int $offset = 0) A local wrapper for `preg_match` which will throw a ParseException if there is an internal error in the PCRE engine. | | Details ------- ### mixed parseFile(string $filename, int $flags = 0) Parses a YAML file into a PHP value. #### Parameters | | | | | --- | --- | --- | | string | $filename | The path to the YAML file to be parsed | | int | $flags | A bit field of PARSE\_\* constants to customize the YAML parser behavior | #### Return Value | | | | --- | --- | | mixed | The YAML converted to a PHP value | #### Exceptions | | | | --- | --- | | [ParseException](exception/parseexception "Symfony\Component\Yaml\Exception\ParseException") | If the file could not be read or the YAML is not valid | ### mixed parse(string $value, int $flags = 0) Parses a YAML string to a PHP value. #### Parameters | | | | | --- | --- | --- | | string | $value | A YAML string | | int | $flags | A bit field of PARSE\_\* constants to customize the YAML parser behavior | #### Return Value | | | | --- | --- | | mixed | A PHP value | #### Exceptions | | | | --- | --- | | [ParseException](exception/parseexception "Symfony\Component\Yaml\Exception\ParseException") | If the YAML is not valid | ### int getLastLineNumberBeforeDeprecation() #### Return Value | | | | --- | --- | | int | | ### int getRealCurrentLineNb() Returns the current line number (takes the offset into account). #### Return Value | | | | --- | --- | | int | The current line number | ### static int preg\_match(string $pattern, string $subject, array $matches = null, int $flags = 0, int $offset = 0) A local wrapper for `preg_match` which will throw a ParseException if there is an internal error in the PCRE engine. This avoids us needing to check for "false" every time PCRE is used in the YAML engine #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | string | $subject | | | array | $matches | | | int | $flags | | | int | $offset | | #### Return Value | | | | --- | --- | | int | | #### Exceptions | | | | --- | --- | | [ParseException](exception/parseexception "Symfony\Component\Yaml\Exception\ParseException") | on a PCRE internal error | #### See also | | | | --- | --- | | preg\_last\_error() | | symfony Symfony\Component\Yaml\Exception Symfony\Component\Yaml\Exception ================================ Classes ------- | | | | --- | --- | | [DumpException](exception/dumpexception "Symfony\Component\Yaml\Exception\DumpException") | Exception class thrown when an error occurs during dumping. | | [ParseException](exception/parseexception "Symfony\Component\Yaml\Exception\ParseException") | Exception class thrown when an error occurs during parsing. | | [RuntimeException](exception/runtimeexception "Symfony\Component\Yaml\Exception\RuntimeException") | Exception class thrown when an error occurs during parsing. | Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\Yaml\Exception\ExceptionInterface")* | Exception interface for all exceptions thrown by the component. | symfony Symfony\Component\Yaml\Tag Symfony\Component\Yaml\Tag ========================== Classes ------- | | | | --- | --- | | [TaggedValue](tag/taggedvalue "Symfony\Component\Yaml\Tag\TaggedValue") | | symfony Symfony\Component\Yaml\Command Symfony\Component\Yaml\Command ============================== Classes ------- | | | | --- | --- | | [LintCommand](command/lintcommand "Symfony\Component\Yaml\Command\LintCommand") | Validates YAML files syntax and outputs encountered errors. | symfony Yaml Yaml ===== class **Yaml** Yaml offers convenience methods to load and dump YAML. Constants --------- | | | | --- | --- | | DUMP\_OBJECT | | | PARSE\_EXCEPTION\_ON\_INVALID\_TYPE | | | PARSE\_OBJECT | | | PARSE\_OBJECT\_FOR\_MAP | | | DUMP\_EXCEPTION\_ON\_INVALID\_TYPE | | | PARSE\_DATETIME | | | DUMP\_OBJECT\_AS\_MAP | | | DUMP\_MULTI\_LINE\_LITERAL\_BLOCK | | | PARSE\_CONSTANT | | | PARSE\_CUSTOM\_TAGS | | | DUMP\_EMPTY\_ARRAY\_AS\_SEQUENCE | | Methods ------- | | | | | --- | --- | --- | | static mixed | [parseFile](#method_parseFile)(string $filename, int $flags = 0) Parses a YAML file into a PHP value. | | | static mixed | [parse](#method_parse)(string $input, int $flags = 0) Parses YAML into a PHP value. | | | static string | [dump](#method_dump)(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0) Dumps a PHP value to a YAML string. | | Details ------- ### static mixed parseFile(string $filename, int $flags = 0) Parses a YAML file into a PHP value. Usage: ``` $array = Yaml::parseFile('config.yml'); print_r($array); ``` #### Parameters | | | | | --- | --- | --- | | string | $filename | The path to the YAML file to be parsed | | int | $flags | A bit field of PARSE\_\* constants to customize the YAML parser behavior | #### Return Value | | | | --- | --- | | mixed | The YAML converted to a PHP value | #### Exceptions | | | | --- | --- | | [ParseException](exception/parseexception "Symfony\Component\Yaml\Exception\ParseException") | If the file could not be read or the YAML is not valid | ### static mixed parse(string $input, int $flags = 0) Parses YAML into a PHP value. Usage: `$array = Yaml::parse(file_get_contents('config.yml')); print_r($array);` #### Parameters | | | | | --- | --- | --- | | string | $input | A string containing YAML | | int | $flags | A bit field of PARSE\_\* constants to customize the YAML parser behavior | #### Return Value | | | | --- | --- | | mixed | The YAML converted to a PHP value | #### Exceptions | | | | --- | --- | | [ParseException](exception/parseexception "Symfony\Component\Yaml\Exception\ParseException") | If the YAML is not valid | ### static string dump(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0) Dumps a PHP value to a YAML string. The dump method, when supplied with an array, will do its best to convert the array into friendly YAML. #### Parameters | | | | | --- | --- | --- | | mixed | $input | The PHP value | | int | $inline | The level where you switch to inline YAML | | int | $indent | The amount of spaces to use for indentation of nested nodes | | int | $flags | A bit field of DUMP\_\* constants to customize the dumped YAML string | #### Return Value | | | | --- | --- | | string | A YAML string representing the original PHP value | symfony Escaper Escaper ======== class **Escaper** Escaper encapsulates escaping rules for single and double-quoted YAML strings. Constants --------- | | | | --- | --- | | REGEX\_CHARACTER\_TO\_ESCAPE | | Methods ------- | | | | | --- | --- | --- | | static bool | [requiresDoubleQuoting](#method_requiresDoubleQuoting)(string $value) Determines if a PHP value would require double quoting in YAML. | | | static string | [escapeWithDoubleQuotes](#method_escapeWithDoubleQuotes)(string $value) Escapes and surrounds a PHP value with double quotes. | | | static bool | [requiresSingleQuoting](#method_requiresSingleQuoting)(string $value) Determines if a PHP value would require single quoting in YAML. | | | static string | [escapeWithSingleQuotes](#method_escapeWithSingleQuotes)(string $value) Escapes and surrounds a PHP value with single quotes. | | Details ------- ### static bool requiresDoubleQuoting(string $value) Determines if a PHP value would require double quoting in YAML. #### Parameters | | | | | --- | --- | --- | | string | $value | A PHP value | #### Return Value | | | | --- | --- | | bool | True if the value would require double quotes | ### static string escapeWithDoubleQuotes(string $value) Escapes and surrounds a PHP value with double quotes. #### Parameters | | | | | --- | --- | --- | | string | $value | A PHP value | #### Return Value | | | | --- | --- | | string | The quoted, escaped string | ### static bool requiresSingleQuoting(string $value) Determines if a PHP value would require single quoting in YAML. #### Parameters | | | | | --- | --- | --- | | string | $value | A PHP value | #### Return Value | | | | --- | --- | | bool | True if the value would require single quotes | ### static string escapeWithSingleQuotes(string $value) Escapes and surrounds a PHP value with single quotes. #### Parameters | | | | | --- | --- | --- | | string | $value | A PHP value | #### Return Value | | | | --- | --- | | string | The quoted, escaped string | symfony Dumper Dumper ======= class **Dumper** Dumper dumps PHP variables to YAML strings. Properties ---------- | | | | | | --- | --- | --- | --- | | protected int | $indentation | The amount of spaces to use for indentation of nested nodes. | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(int $indentation = 4) | | | string | [dump](#method_dump)(mixed $input, int $inline = 0, int $indent = 0, int $flags = 0) Dumps a PHP value to YAML. | | Details ------- ### \_\_construct(int $indentation = 4) #### Parameters | | | | | --- | --- | --- | | int | $indentation | | ### string dump(mixed $input, int $inline = 0, int $indent = 0, int $flags = 0) Dumps a PHP value to YAML. #### Parameters | | | | | --- | --- | --- | | mixed | $input | The PHP value | | int | $inline | The level where you switch to inline YAML | | int | $indent | The level of indentation (used internally) | | int | $flags | A bit field of Yaml::DUMP\_\* constants to customize the dumped YAML string | #### Return Value | | | | --- | --- | | string | The YAML representation of the PHP value | symfony Inline Inline ======= class **Inline** Inline implements a YAML parser/dumper for the YAML inline syntax. Constants --------- | | | | --- | --- | | REGEX\_QUOTED\_STRING | | Properties ---------- | | | | | | --- | --- | --- | --- | | static | $parsedLineNumber | | | | static | $parsedFilename | | | Methods ------- | | | | | --- | --- | --- | | static | [initialize](#method_initialize)(int $flags, int|null $parsedLineNumber = null, string|null $parsedFilename = null) | | | static mixed | [parse](#method_parse)(string $value = null, int $flags = 0, array $references = array()) Converts a YAML string to a PHP value. | | | static string | [dump](#method_dump)(mixed $value, int $flags = 0) Dumps a given PHP variable to a YAML string. | | | static bool | [isHash](#method_isHash)(array|[ArrayObject](http://php.net/ArrayObject)|[stdClass](http://php.net/stdClass) $value) Check if given array is hash or just normal indexed array. | | | static mixed | [parseScalar](#method_parseScalar)(string $scalar, int $flags = 0, array $delimiters = null, int $i = 0, bool $evaluate = true, array $references = array()) Parses a YAML scalar. | | | static string | [evaluateBinaryScalar](#method_evaluateBinaryScalar)(string $scalar) | | Details ------- ### static initialize(int $flags, int|null $parsedLineNumber = null, string|null $parsedFilename = null) #### Parameters | | | | | --- | --- | --- | | int | $flags | | | int|null | $parsedLineNumber | | | string|null | $parsedFilename | | ### static mixed parse(string $value = null, int $flags = 0, array $references = array()) Converts a YAML string to a PHP value. #### Parameters | | | | | --- | --- | --- | | string | $value | A YAML string | | int | $flags | A bit field of PARSE\_\* constants to customize the YAML parser behavior | | array | $references | Mapping of variable names to values | #### Return Value | | | | --- | --- | | mixed | A PHP value | #### Exceptions | | | | --- | --- | | [ParseException](exception/parseexception "Symfony\Component\Yaml\Exception\ParseException") | | ### static string dump(mixed $value, int $flags = 0) Dumps a given PHP variable to a YAML string. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The PHP variable to convert | | int | $flags | A bit field of Yaml::DUMP\_\* constants to customize the dumped YAML string | #### Return Value | | | | --- | --- | | string | The YAML string representing the PHP value | #### Exceptions | | | | --- | --- | | [DumpException](exception/dumpexception "Symfony\Component\Yaml\Exception\DumpException") | When trying to dump PHP resource | ### static bool isHash(array|[ArrayObject](http://php.net/ArrayObject)|[stdClass](http://php.net/stdClass) $value) Check if given array is hash or just normal indexed array. #### Parameters | | | | | --- | --- | --- | | array|[ArrayObject](http://php.net/ArrayObject)|[stdClass](http://php.net/stdClass) | $value | The PHP array or array-like object to check | #### Return Value | | | | --- | --- | | bool | true if value is hash array, false otherwise | ### static mixed parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int $i = 0, bool $evaluate = true, array $references = array()) Parses a YAML scalar. #### Parameters | | | | | --- | --- | --- | | string | $scalar | | | int | $flags | | | array | $delimiters | | | int | $i | | | bool | $evaluate | | | array | $references | | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [ParseException](exception/parseexception "Symfony\Component\Yaml\Exception\ParseException") | When malformed inline YAML string is parsed | ### static string evaluateBinaryScalar(string $scalar) #### Parameters | | | | | --- | --- | --- | | string | $scalar | | #### Return Value | | | | --- | --- | | string | | symfony LintCommand LintCommand ============ class **LintCommand** extends [Command](../../console/command/command "Symfony\Component\Console\Command\Command") Validates YAML files syntax and outputs encountered errors. Properties ---------- | | | | | | --- | --- | --- | --- | | static protected | $defaultName | | | Methods ------- | | | | | --- | --- | --- | | static string|null | [getDefaultName](#method_getDefaultName)() | from [Command](../../console/command/command#method_getDefaultName "Symfony\Component\Console\Command\Command") | | | [\_\_construct](#method___construct)(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null) | | | | [ignoreValidationErrors](#method_ignoreValidationErrors)() Ignores validation errors. | from [Command](../../console/command/command#method_ignoreValidationErrors "Symfony\Component\Console\Command\Command") | | | [setApplication](#method_setApplication)([Application](../../console/application "Symfony\Component\Console\Application") $application = null) | from [Command](../../console/command/command#method_setApplication "Symfony\Component\Console\Command\Command") | | | [setHelperSet](#method_setHelperSet)([HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) | from [Command](../../console/command/command#method_setHelperSet "Symfony\Component\Console\Command\Command") | | [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set. | from [Command](../../console/command/command#method_getHelperSet "Symfony\Component\Console\Command\Command") | | [Application](../../console/application "Symfony\Component\Console\Application") | [getApplication](#method_getApplication)() Gets the application instance for this command. | from [Command](../../console/command/command#method_getApplication "Symfony\Component\Console\Command\Command") | | bool | [isEnabled](#method_isEnabled)() Checks whether the command is enabled or not in the current environment. | from [Command](../../console/command/command#method_isEnabled "Symfony\Component\Console\Command\Command") | | | [configure](#method_configure)() Configures the current command. | | | int|null | [execute](#method_execute)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. | | | | [interact](#method_interact)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. | from [Command](../../console/command/command#method_interact "Symfony\Component\Console\Command\Command") | | | [initialize](#method_initialize)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. | from [Command](../../console/command/command#method_initialize "Symfony\Component\Console\Command\Command") | | int | [run](#method_run)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. | from [Command](../../console/command/command#method_run "Symfony\Component\Console\Command\Command") | | $this | [setCode](#method_setCode)(callable $code) Sets the code to execute when running this command. | from [Command](../../console/command/command#method_setCode "Symfony\Component\Console\Command\Command") | | | [mergeApplicationDefinition](#method_mergeApplicationDefinition)(bool $mergeArgs = true) Merges the application definition with the command definition. | from [Command](../../console/command/command#method_mergeApplicationDefinition "Symfony\Component\Console\Command\Command") | | $this | [setDefinition](#method_setDefinition)(array|[InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. | from [Command](../../console/command/command#method_setDefinition "Symfony\Component\Console\Command\Command") | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getDefinition](#method_getDefinition)() Gets the InputDefinition attached to this Command. | from [Command](../../console/command/command#method_getDefinition "Symfony\Component\Console\Command\Command") | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getNativeDefinition](#method_getNativeDefinition)() Gets the InputDefinition to be used to create representations of this Command. | from [Command](../../console/command/command#method_getNativeDefinition "Symfony\Component\Console\Command\Command") | | $this | [addArgument](#method_addArgument)(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. | from [Command](../../console/command/command#method_addArgument "Symfony\Component\Console\Command\Command") | | $this | [addOption](#method_addOption)(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. | from [Command](../../console/command/command#method_addOption "Symfony\Component\Console\Command\Command") | | $this | [setName](#method_setName)(string $name) Sets the name of the command. | from [Command](../../console/command/command#method_setName "Symfony\Component\Console\Command\Command") | | $this | [setProcessTitle](#method_setProcessTitle)(string $title) Sets the process title of the command. | from [Command](../../console/command/command#method_setProcessTitle "Symfony\Component\Console\Command\Command") | | string | [getName](#method_getName)() Returns the command name. | from [Command](../../console/command/command#method_getName "Symfony\Component\Console\Command\Command") | | [Command](../../console/command/command "Symfony\Component\Console\Command\Command") | [setHidden](#method_setHidden)(bool $hidden) | from [Command](../../console/command/command#method_setHidden "Symfony\Component\Console\Command\Command") | | bool | [isHidden](#method_isHidden)() | from [Command](../../console/command/command#method_isHidden "Symfony\Component\Console\Command\Command") | | $this | [setDescription](#method_setDescription)(string $description) Sets the description for the command. | from [Command](../../console/command/command#method_setDescription "Symfony\Component\Console\Command\Command") | | string | [getDescription](#method_getDescription)() Returns the description for the command. | from [Command](../../console/command/command#method_getDescription "Symfony\Component\Console\Command\Command") | | $this | [setHelp](#method_setHelp)(string $help) Sets the help for the command. | from [Command](../../console/command/command#method_setHelp "Symfony\Component\Console\Command\Command") | | string | [getHelp](#method_getHelp)() Returns the help for the command. | from [Command](../../console/command/command#method_getHelp "Symfony\Component\Console\Command\Command") | | string | [getProcessedHelp](#method_getProcessedHelp)() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. | from [Command](../../console/command/command#method_getProcessedHelp "Symfony\Component\Console\Command\Command") | | $this | [setAliases](#method_setAliases)(string[] $aliases) Sets the aliases for the command. | from [Command](../../console/command/command#method_setAliases "Symfony\Component\Console\Command\Command") | | array | [getAliases](#method_getAliases)() Returns the aliases for the command. | from [Command](../../console/command/command#method_getAliases "Symfony\Component\Console\Command\Command") | | string | [getSynopsis](#method_getSynopsis)(bool $short = false) Returns the synopsis for the command. | from [Command](../../console/command/command#method_getSynopsis "Symfony\Component\Console\Command\Command") | | $this | [addUsage](#method_addUsage)(string $usage) Add a command usage example. | from [Command](../../console/command/command#method_addUsage "Symfony\Component\Console\Command\Command") | | array | [getUsages](#method_getUsages)() Returns alternative usages of the command. | from [Command](../../console/command/command#method_getUsages "Symfony\Component\Console\Command\Command") | | mixed | [getHelper](#method_getHelper)(string $name) Gets a helper instance by name. | from [Command](../../console/command/command#method_getHelper "Symfony\Component\Console\Command\Command") | Details ------- ### static string|null getDefaultName() #### Return Value | | | | --- | --- | | string|null | The default command name or null when no default name is set | ### \_\_construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null) #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the command; passing null means it must be set in configure() | | callable | $directoryIteratorProvider | | | callable | $isReadableProvider | | #### Exceptions | | | | --- | --- | | [LogicException](../../console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When the command name is empty | ### ignoreValidationErrors() Ignores validation errors. This is mainly useful for the help command. ### setApplication([Application](../../console/application "Symfony\Component\Console\Application") $application = null) #### Parameters | | | | | --- | --- | --- | | [Application](../../console/application "Symfony\Component\Console\Application") | $application | | ### setHelperSet([HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) #### Parameters | | | | | --- | --- | --- | | [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set. #### Return Value | | | | --- | --- | | [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### [Application](../../console/application "Symfony\Component\Console\Application") getApplication() Gets the application instance for this command. #### Return Value | | | | --- | --- | | [Application](../../console/application "Symfony\Component\Console\Application") | An Application instance | ### bool isEnabled() Checks whether the command is enabled or not in the current environment. Override this to check for x or y and return false if the command can not run properly under the current conditions. #### Return Value | | | | --- | --- | | bool | | ### protected configure() Configures the current command. ### protected int|null execute([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. This method is not abstract because you can use this class as a concrete class. In this case, instead of defining the execute() method, you set the code to execute by passing a Closure to the setCode() method. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int|null | null or 0 if everything went fine, or an error code | #### Exceptions | | | | --- | --- | | [LogicException](../../console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When this abstract method is not implemented | ### protected interact([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. This method is executed before the InputDefinition is validated. This means that this is the only place where the command can interactively ask for values of missing required arguments. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### protected initialize([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. This is mainly useful when a lot of commands extends one main command where some things need to be initialized based on the input arguments and options. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### See also | | | | --- | --- | | [InputInterface::bind](../../console/input/inputinterface#method_bind "Symfony\Component\Console\Input\InputInterface") | | | [InputInterface::validate](../../console/input/inputinterface#method_validate "Symfony\Component\Console\Input\InputInterface") | | ### int run([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. The code to execute is either defined directly with the setCode() method or by overriding the execute() method in a sub-class. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int | The command exit code | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | When binding input fails. Bypass this by calling {@link ignoreValidationErrors()}. | #### See also | | | | --- | --- | | setCode() | | | execute() | | ### $this setCode(callable $code) Sets the code to execute when running this command. If this method is used, it overrides the code defined in the execute() method. #### Parameters | | | | | --- | --- | --- | | callable | $code | A callable(InputInterface $input, OutputInterface $output) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | | #### See also | | | | --- | --- | | execute() | | ### mergeApplicationDefinition(bool $mergeArgs = true) Merges the application definition with the command definition. This method is not part of public API and should not be used directly. #### Parameters | | | | | --- | --- | --- | | bool | $mergeArgs | Whether to merge or not the Application definition arguments to Command definition arguments | ### $this setDefinition(array|[InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. #### Parameters | | | | | --- | --- | --- | | array|[InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | An array of argument and option instances or a definition instance | #### Return Value | | | | --- | --- | | $this | | ### [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getDefinition() Gets the InputDefinition attached to this Command. #### Return Value | | | | --- | --- | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getNativeDefinition() Gets the InputDefinition to be used to create representations of this Command. Can be overridden to provide the original command representation when it would otherwise be changed by merging with the application InputDefinition. This method is not part of public API and should not be used directly. #### Return Value | | | | --- | --- | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### $this addArgument(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | | int|null | $mode | The argument mode: self::REQUIRED or self::OPTIONAL | | string | $description | A description text | | string|string[]|null | $default | The default value (for self::OPTIONAL mode only) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument mode is not valid | ### $this addOption(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | | string|array | $shortcut | The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts | | int|null | $mode | The option mode: One of the VALUE\_\* constants | | string | $description | A description text | | string|string[]|bool|null | $default | The default value (must be null for self::VALUE\_NONE) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | If option mode is invalid or incompatible | ### $this setName(string $name) Sets the name of the command. This method can set both the namespace and the name if you separate them by a colon (:) ``` $command->setName('foo:bar'); ``` #### Parameters | | | | | --- | --- | --- | | string | $name | The command name | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When the name is invalid | ### $this setProcessTitle(string $title) Sets the process title of the command. This feature should be used only when creating a long process command, like a daemon. PHP 5.5+ or the proctitle PECL library is required #### Parameters | | | | | --- | --- | --- | | string | $title | The process title | #### Return Value | | | | --- | --- | | $this | | ### string getName() Returns the command name. #### Return Value | | | | --- | --- | | string | The command name | ### [Command](../../console/command/command "Symfony\Component\Console\Command\Command") setHidden(bool $hidden) #### Parameters | | | | | --- | --- | --- | | bool | $hidden | Whether or not the command should be hidden from the list of commands | #### Return Value | | | | --- | --- | | [Command](../../console/command/command "Symfony\Component\Console\Command\Command") | The current instance | ### bool isHidden() #### Return Value | | | | --- | --- | | bool | whether the command should be publicly shown or not | ### $this setDescription(string $description) Sets the description for the command. #### Parameters | | | | | --- | --- | --- | | string | $description | The description for the command | #### Return Value | | | | --- | --- | | $this | | ### string getDescription() Returns the description for the command. #### Return Value | | | | --- | --- | | string | The description for the command | ### $this setHelp(string $help) Sets the help for the command. #### Parameters | | | | | --- | --- | --- | | string | $help | The help for the command | #### Return Value | | | | --- | --- | | $this | | ### string getHelp() Returns the help for the command. #### Return Value | | | | --- | --- | | string | The help for the command | ### string getProcessedHelp() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. #### Return Value | | | | --- | --- | | string | The processed help for the command | ### $this setAliases(string[] $aliases) Sets the aliases for the command. #### Parameters | | | | | --- | --- | --- | | string[] | $aliases | An array of aliases for the command | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When an alias is invalid | ### array getAliases() Returns the aliases for the command. #### Return Value | | | | --- | --- | | array | An array of aliases for the command | ### string getSynopsis(bool $short = false) Returns the synopsis for the command. #### Parameters | | | | | --- | --- | --- | | bool | $short | Whether to show the short version of the synopsis (with options folded) or not | #### Return Value | | | | --- | --- | | string | The synopsis | ### $this addUsage(string $usage) Add a command usage example. #### Parameters | | | | | --- | --- | --- | | string | $usage | The usage, it'll be prefixed with the command name | #### Return Value | | | | --- | --- | | $this | | ### array getUsages() Returns alternative usages of the command. #### Return Value | | | | --- | --- | | array | | ### mixed getHelper(string $name) Gets a helper instance by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The helper name | #### Return Value | | | | --- | --- | | mixed | The helper value | #### Exceptions | | | | --- | --- | | [LogicException](../../console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | if no HelperSet is defined | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | if the helper is not defined |
programming_docs
symfony ExceptionInterface ExceptionInterface =================== interface **ExceptionInterface** Exception interface for all exceptions thrown by the component. symfony ParseException ParseException =============== class **ParseException** extends [RuntimeException](runtimeexception "Symfony\Component\Yaml\Exception\RuntimeException") Exception class thrown when an error occurs during parsing. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $message, int $parsedLine = -1, string $snippet = null, string $parsedFile = null, [Exception](http://php.net/Exception) $previous = null) | | | string | [getSnippet](#method_getSnippet)() Gets the snippet of code near the error. | | | | [setSnippet](#method_setSnippet)(string $snippet) Sets the snippet of code near the error. | | | string | [getParsedFile](#method_getParsedFile)() Gets the filename where the error occurred. | | | | [setParsedFile](#method_setParsedFile)(string $parsedFile) Sets the filename where the error occurred. | | | int | [getParsedLine](#method_getParsedLine)() Gets the line where the error occurred. | | | | [setParsedLine](#method_setParsedLine)(int $parsedLine) Sets the line where the error occurred. | | Details ------- ### \_\_construct(string $message, int $parsedLine = -1, string $snippet = null, string $parsedFile = null, [Exception](http://php.net/Exception) $previous = null) #### Parameters | | | | | --- | --- | --- | | string | $message | The error message | | int | $parsedLine | The line where the error occurred | | string | $snippet | The snippet of code near the problem | | string | $parsedFile | The file name where the error occurred | | [Exception](http://php.net/Exception) | $previous | The previous exception | ### string getSnippet() Gets the snippet of code near the error. #### Return Value | | | | --- | --- | | string | The snippet of code | ### setSnippet(string $snippet) Sets the snippet of code near the error. #### Parameters | | | | | --- | --- | --- | | string | $snippet | The code snippet | ### string getParsedFile() Gets the filename where the error occurred. This method returns null if a string is parsed. #### Return Value | | | | --- | --- | | string | The filename | ### setParsedFile(string $parsedFile) Sets the filename where the error occurred. #### Parameters | | | | | --- | --- | --- | | string | $parsedFile | The filename | ### int getParsedLine() Gets the line where the error occurred. #### Return Value | | | | --- | --- | | int | The file line | ### setParsedLine(int $parsedLine) Sets the line where the error occurred. #### Parameters | | | | | --- | --- | --- | | int | $parsedLine | The file line | symfony RuntimeException RuntimeException ================= class **RuntimeException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Yaml\Exception\ExceptionInterface") Exception class thrown when an error occurs during parsing. symfony DumpException DumpException ============== class **DumpException** extends [RuntimeException](runtimeexception "Symfony\Component\Yaml\Exception\RuntimeException") Exception class thrown when an error occurs during dumping. symfony TaggedValue TaggedValue ============ class **TaggedValue** Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $tag, $value) | | | string | [getTag](#method_getTag)() | | | | [getValue](#method_getValue)() | | Details ------- ### \_\_construct(string $tag, $value) #### Parameters | | | | | --- | --- | --- | | string | $tag | | | | $value | | ### string getTag() #### Return Value | | | | --- | --- | | string | | ### getValue() symfony Symfony\Component\OptionsResolver\Exception Symfony\Component\OptionsResolver\Exception =========================================== Classes ------- | | | | --- | --- | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | Thrown when trying to read an option outside of or write it inside of {@link \Symfony\Component\OptionsResolver\Options::resolve()}. | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\OptionsResolver\Exception\InvalidArgumentException") | Thrown when an argument is invalid. | | [InvalidOptionsException](exception/invalidoptionsexception "Symfony\Component\OptionsResolver\Exception\InvalidOptionsException") | Thrown when the value of an option does not match its validation rules. | | [MissingOptionsException](exception/missingoptionsexception "Symfony\Component\OptionsResolver\Exception\MissingOptionsException") | Exception thrown when a required option is missing. | | [NoConfigurationException](exception/noconfigurationexception "Symfony\Component\OptionsResolver\Exception\NoConfigurationException") | Thrown when trying to introspect an option definition property for which no value was configured inside the OptionsResolver instance. | | [NoSuchOptionException](exception/nosuchoptionexception "Symfony\Component\OptionsResolver\Exception\NoSuchOptionException") | Thrown when trying to read an option that has no value set. | | [OptionDefinitionException](exception/optiondefinitionexception "Symfony\Component\OptionsResolver\Exception\OptionDefinitionException") | Thrown when two lazy options have a cyclic dependency. | | [UndefinedOptionsException](exception/undefinedoptionsexception "Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException") | Exception thrown when an undefined option is passed. | Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\OptionsResolver\Exception\ExceptionInterface")* | Marker interface for all exceptions thrown by the OptionsResolver component. | symfony Symfony\Component\OptionsResolver\Debug Symfony\Component\OptionsResolver\Debug ======================================= Classes ------- | | | | --- | --- | | [OptionsResolverIntrospector](debug/optionsresolverintrospector "Symfony\Component\OptionsResolver\Debug\OptionsResolverIntrospector") | | symfony Options Options ======== interface **Options** implements [ArrayAccess](http://php.net/ArrayAccess), [Countable](http://php.net/Countable) Contains resolved option values. symfony OptionsResolver OptionsResolver ================ class **OptionsResolver** implements [Options](options "Symfony\Component\OptionsResolver\Options") Validates options and merges them with default values. Methods ------- | | | | | --- | --- | --- | | $this | [setDefault](#method_setDefault)(string $option, mixed $value) Sets the default value of a given option. | | | $this | [setDefaults](#method_setDefaults)(array $defaults) Sets a list of default values. | | | bool | [hasDefault](#method_hasDefault)(string $option) Returns whether a default value is set for an option. | | | $this | [setRequired](#method_setRequired)(string|string[] $optionNames) Marks one or more options as required. | | | bool | [isRequired](#method_isRequired)(string $option) Returns whether an option is required. | | | string[] | [getRequiredOptions](#method_getRequiredOptions)() Returns the names of all required options. | | | bool | [isMissing](#method_isMissing)(string $option) Returns whether an option is missing a default value. | | | string[] | [getMissingOptions](#method_getMissingOptions)() Returns the names of all options missing a default value. | | | $this | [setDefined](#method_setDefined)(string|string[] $optionNames) Defines a valid option name. | | | bool | [isDefined](#method_isDefined)(string $option) Returns whether an option is defined. | | | string[] | [getDefinedOptions](#method_getDefinedOptions)() Returns the names of all defined options. | | | $this | [setNormalizer](#method_setNormalizer)(string $option, [Closure](http://php.net/Closure) $normalizer) Sets the normalizer for an option. | | | $this | [setAllowedValues](#method_setAllowedValues)(string $option, mixed $allowedValues) Sets allowed values for an option. | | | $this | [addAllowedValues](#method_addAllowedValues)(string $option, mixed $allowedValues) Adds allowed values for an option. | | | $this | [setAllowedTypes](#method_setAllowedTypes)(string $option, string|string[] $allowedTypes) Sets allowed types for an option. | | | $this | [addAllowedTypes](#method_addAllowedTypes)(string $option, string|string[] $allowedTypes) Adds allowed types for an option. | | | $this | [remove](#method_remove)(string|string[] $optionNames) Removes the option with the given name. | | | $this | [clear](#method_clear)() Removes all options. | | | array | [resolve](#method_resolve)(array $options = array()) Merges options with the default values stored in the container and validates them. | | | mixed | [offsetGet](#method_offsetGet)(string $option) Returns the resolved value of an option. | | | bool | [offsetExists](#method_offsetExists)(string $option) Returns whether a resolved option with the given name exists. | | | | [offsetSet](#method_offsetSet)($option, $value) Not supported. | | | | [offsetUnset](#method_offsetUnset)($option) Not supported. | | | int | [count](#method_count)() Returns the number of set options. | | Details ------- ### $this setDefault(string $option, mixed $value) Sets the default value of a given option. If the default value should be set based on other options, you can pass a closure with the following signature: ``` function (Options $options) { // ... } ``` The closure will be evaluated when {@link resolve()} is called. The closure has access to the resolved values of other options through the passed {@link Options} instance: ``` function (Options $options) { if (isset($options['port'])) { // ... } } ``` If you want to access the previously set default value, add a second argument to the closure's signature: ``` $options->setDefault('name', 'Default Name'); $options->setDefault('name', function (Options $options, $previousValue) { // 'Default Name' === $previousValue }); ``` This is mostly useful if the configuration of the {@link Options} object is spread across different locations of your code, such as base and sub-classes. #### Parameters | | | | | --- | --- | --- | | string | $option | The name of the option | | mixed | $value | The default value of the option | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | If called from a lazy option or normalizer | ### $this setDefaults(array $defaults) Sets a list of default values. #### Parameters | | | | | --- | --- | --- | | array | $defaults | The default values to set | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | If called from a lazy option or normalizer | ### bool hasDefault(string $option) Returns whether a default value is set for an option. Returns true if {@link setDefault()} was called for this option. An option is also considered set if it was set to null. #### Parameters | | | | | --- | --- | --- | | string | $option | The option name | #### Return Value | | | | --- | --- | | bool | Whether a default value is set | ### $this setRequired(string|string[] $optionNames) Marks one or more options as required. #### Parameters | | | | | --- | --- | --- | | string|string[] | $optionNames | One or more option names | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | If called from a lazy option or normalizer | ### bool isRequired(string $option) Returns whether an option is required. An option is required if it was passed to {@link setRequired()}. #### Parameters | | | | | --- | --- | --- | | string | $option | The name of the option | #### Return Value | | | | --- | --- | | bool | Whether the option is required | ### string[] getRequiredOptions() Returns the names of all required options. #### Return Value | | | | --- | --- | | string[] | The names of the required options | #### See also | | | | --- | --- | | isRequired() | | ### bool isMissing(string $option) Returns whether an option is missing a default value. An option is missing if it was passed to {@link setRequired()}, but not to {@link setDefault()}. This option must be passed explicitly to {@link resolve()}, otherwise an exception will be thrown. #### Parameters | | | | | --- | --- | --- | | string | $option | The name of the option | #### Return Value | | | | --- | --- | | bool | Whether the option is missing | ### string[] getMissingOptions() Returns the names of all options missing a default value. #### Return Value | | | | --- | --- | | string[] | The names of the missing options | #### See also | | | | --- | --- | | isMissing() | | ### $this setDefined(string|string[] $optionNames) Defines a valid option name. Defines an option name without setting a default value. The option will be accepted when passed to {@link resolve()}. When not passed, the option will not be included in the resolved options. #### Parameters | | | | | --- | --- | --- | | string|string[] | $optionNames | One or more option names | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | If called from a lazy option or normalizer | ### bool isDefined(string $option) Returns whether an option is defined. Returns true for any option passed to {@link setDefault()}, {@link setRequired()} or {@link setDefined()}. #### Parameters | | | | | --- | --- | --- | | string | $option | The option name | #### Return Value | | | | --- | --- | | bool | Whether the option is defined | ### string[] getDefinedOptions() Returns the names of all defined options. #### Return Value | | | | --- | --- | | string[] | The names of the defined options | #### See also | | | | --- | --- | | isDefined() | | ### $this setNormalizer(string $option, [Closure](http://php.net/Closure) $normalizer) Sets the normalizer for an option. The normalizer should be a closure with the following signature: ``` function (Options $options, $value) { // ... } ``` The closure is invoked when {@link resolve()} is called. The closure has access to the resolved values of other options through the passed {@link Options} instance. The second parameter passed to the closure is the value of the option. The resolved option value is set to the return value of the closure. #### Parameters | | | | | --- | --- | --- | | string | $option | The option name | | [Closure](http://php.net/Closure) | $normalizer | The normalizer | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [UndefinedOptionsException](exception/undefinedoptionsexception "Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException") | If the option is undefined | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | If called from a lazy option or normalizer | ### $this setAllowedValues(string $option, mixed $allowedValues) Sets allowed values for an option. Instead of passing values, you may also pass a closures with the following signature: ``` function ($value) { // return true or false } ``` The closure receives the value as argument and should return true to accept the value and false to reject the value. #### Parameters | | | | | --- | --- | --- | | string | $option | The option name | | mixed | $allowedValues | One or more acceptable values/closures | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [UndefinedOptionsException](exception/undefinedoptionsexception "Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException") | If the option is undefined | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | If called from a lazy option or normalizer | ### $this addAllowedValues(string $option, mixed $allowedValues) Adds allowed values for an option. The values are merged with the allowed values defined previously. Instead of passing values, you may also pass a closures with the following signature: ``` function ($value) { // return true or false } ``` The closure receives the value as argument and should return true to accept the value and false to reject the value. #### Parameters | | | | | --- | --- | --- | | string | $option | The option name | | mixed | $allowedValues | One or more acceptable values/closures | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [UndefinedOptionsException](exception/undefinedoptionsexception "Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException") | If the option is undefined | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | If called from a lazy option or normalizer | ### $this setAllowedTypes(string $option, string|string[] $allowedTypes) Sets allowed types for an option. Any type for which a corresponding is\_() function exists is acceptable. Additionally, fully-qualified class or interface names may be passed. #### Parameters | | | | | --- | --- | --- | | string | $option | The option name | | string|string[] | $allowedTypes | One or more accepted types | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [UndefinedOptionsException](exception/undefinedoptionsexception "Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException") | If the option is undefined | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | If called from a lazy option or normalizer | ### $this addAllowedTypes(string $option, string|string[] $allowedTypes) Adds allowed types for an option. The types are merged with the allowed types defined previously. Any type for which a corresponding is\_() function exists is acceptable. Additionally, fully-qualified class or interface names may be passed. #### Parameters | | | | | --- | --- | --- | | string | $option | The option name | | string|string[] | $allowedTypes | One or more accepted types | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [UndefinedOptionsException](exception/undefinedoptionsexception "Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException") | If the option is undefined | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | If called from a lazy option or normalizer | ### $this remove(string|string[] $optionNames) Removes the option with the given name. Undefined options are ignored. #### Parameters | | | | | --- | --- | --- | | string|string[] | $optionNames | One or more option names | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | If called from a lazy option or normalizer | ### $this clear() Removes all options. #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | If called from a lazy option or normalizer | ### array resolve(array $options = array()) Merges options with the default values stored in the container and validates them. Exceptions are thrown if: * Undefined options are passed; * Required options are missing; * Options have invalid types; * Options have invalid values. #### Parameters | | | | | --- | --- | --- | | array | $options | A map of option names to values | #### Return Value | | | | --- | --- | | array | The merged and validated options | #### Exceptions | | | | --- | --- | | [UndefinedOptionsException](exception/undefinedoptionsexception "Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException") | If an option name is undefined | | [InvalidOptionsException](exception/invalidoptionsexception "Symfony\Component\OptionsResolver\Exception\InvalidOptionsException") | If an option doesn't fulfill the specified validation rules | | [MissingOptionsException](exception/missingoptionsexception "Symfony\Component\OptionsResolver\Exception\MissingOptionsException") | If a required option is missing | | [OptionDefinitionException](exception/optiondefinitionexception "Symfony\Component\OptionsResolver\Exception\OptionDefinitionException") | If there is a cyclic dependency between lazy options and/or normalizers | | [NoSuchOptionException](exception/nosuchoptionexception "Symfony\Component\OptionsResolver\Exception\NoSuchOptionException") | If a lazy option reads an unavailable option | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | If called from a lazy option or normalizer | ### mixed offsetGet(string $option) Returns the resolved value of an option. #### Parameters | | | | | --- | --- | --- | | string | $option | The option name | #### Return Value | | | | --- | --- | | mixed | The option value | #### Exceptions | | | | --- | --- | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | If accessing this method outside of {@link resolve()} | | [NoSuchOptionException](exception/nosuchoptionexception "Symfony\Component\OptionsResolver\Exception\NoSuchOptionException") | If the option is not set | | [InvalidOptionsException](exception/invalidoptionsexception "Symfony\Component\OptionsResolver\Exception\InvalidOptionsException") | If the option doesn't fulfill the specified validation rules | | [OptionDefinitionException](exception/optiondefinitionexception "Symfony\Component\OptionsResolver\Exception\OptionDefinitionException") | If there is a cyclic dependency between lazy options and/or normalizers | ### bool offsetExists(string $option) Returns whether a resolved option with the given name exists. #### Parameters | | | | | --- | --- | --- | | string | $option | The option name | #### Return Value | | | | --- | --- | | bool | Whether the option is set | #### Exceptions | | | | --- | --- | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | If accessing this method outside of {@link resolve()} | #### See also | | | | --- | --- | | \ArrayAccess::offsetExists() | | ### offsetSet($option, $value) Not supported. #### Parameters | | | | | --- | --- | --- | | | $option | | | | $value | | #### Exceptions | | | | --- | --- | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | | ### offsetUnset($option) Not supported. #### Parameters | | | | | --- | --- | --- | | | $option | | #### Exceptions | | | | --- | --- | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | | ### int count() Returns the number of set options. This may be only a subset of the defined options. #### Return Value | | | | --- | --- | | int | Number of options | #### Exceptions | | | | --- | --- | | [AccessException](exception/accessexception "Symfony\Component\OptionsResolver\Exception\AccessException") | If accessing this method outside of {@link resolve()} | #### See also | | | | --- | --- | | \Countable::count() | |
programming_docs
symfony InvalidArgumentException InvalidArgumentException ========================= class **InvalidArgumentException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\OptionsResolver\Exception\ExceptionInterface") Thrown when an argument is invalid. symfony ExceptionInterface ExceptionInterface =================== interface **ExceptionInterface** Marker interface for all exceptions thrown by the OptionsResolver component. symfony MissingOptionsException MissingOptionsException ======================== class **MissingOptionsException** extends [InvalidArgumentException](invalidargumentexception "Symfony\Component\OptionsResolver\Exception\InvalidArgumentException") Exception thrown when a required option is missing. Add the option to the passed options array. symfony NoConfigurationException NoConfigurationException ========================= class **NoConfigurationException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\OptionsResolver\Exception\ExceptionInterface") Thrown when trying to introspect an option definition property for which no value was configured inside the OptionsResolver instance. symfony UndefinedOptionsException UndefinedOptionsException ========================== class **UndefinedOptionsException** extends [InvalidArgumentException](invalidargumentexception "Symfony\Component\OptionsResolver\Exception\InvalidArgumentException") Exception thrown when an undefined option is passed. You should remove the options in question from your code or define them beforehand. symfony NoSuchOptionException NoSuchOptionException ====================== class **NoSuchOptionException** extends [OutOfBoundsException](http://php.net/OutOfBoundsException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\OptionsResolver\Exception\ExceptionInterface") Thrown when trying to read an option that has no value set. When accessing optional options from within a lazy option or normalizer you should first check whether the optional option is set. You can do this with `isset($options['optional'])`. In contrast to the {@link UndefinedOptionsException}, this is a runtime exception that can occur when evaluating lazy options. symfony AccessException AccessException ================ class **AccessException** extends [LogicException](http://php.net/LogicException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\OptionsResolver\Exception\ExceptionInterface") Thrown when trying to read an option outside of or write it inside of {@link \Symfony\Component\OptionsResolver\Options::resolve()}. symfony OptionDefinitionException OptionDefinitionException ========================== class **OptionDefinitionException** extends [LogicException](http://php.net/LogicException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\OptionsResolver\Exception\ExceptionInterface") Thrown when two lazy options have a cyclic dependency. symfony InvalidOptionsException InvalidOptionsException ======================== class **InvalidOptionsException** extends [InvalidArgumentException](invalidargumentexception "Symfony\Component\OptionsResolver\Exception\InvalidArgumentException") Thrown when the value of an option does not match its validation rules. You should make sure a valid value is passed to the option. symfony OptionsResolverIntrospector OptionsResolverIntrospector ============================ class **OptionsResolverIntrospector** Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([OptionsResolver](../optionsresolver "Symfony\Component\OptionsResolver\OptionsResolver") $optionsResolver) | | | mixed | [getDefault](#method_getDefault)(string $option) | | | array | [getLazyClosures](#method_getLazyClosures)(string $option) | | | array | [getAllowedTypes](#method_getAllowedTypes)(string $option) | | | array | [getAllowedValues](#method_getAllowedValues)(string $option) | | | [Closure](http://php.net/Closure) | [getNormalizer](#method_getNormalizer)(string $option) | | Details ------- ### \_\_construct([OptionsResolver](../optionsresolver "Symfony\Component\OptionsResolver\OptionsResolver") $optionsResolver) #### Parameters | | | | | --- | --- | --- | | [OptionsResolver](../optionsresolver "Symfony\Component\OptionsResolver\OptionsResolver") | $optionsResolver | | ### mixed getDefault(string $option) #### Parameters | | | | | --- | --- | --- | | string | $option | | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [NoConfigurationException](../exception/noconfigurationexception "Symfony\Component\OptionsResolver\Exception\NoConfigurationException") | on no configured value | ### array getLazyClosures(string $option) #### Parameters | | | | | --- | --- | --- | | string | $option | | #### Return Value | | | | --- | --- | | array | | #### Exceptions | | | | --- | --- | | [NoConfigurationException](../exception/noconfigurationexception "Symfony\Component\OptionsResolver\Exception\NoConfigurationException") | on no configured closures | ### array getAllowedTypes(string $option) #### Parameters | | | | | --- | --- | --- | | string | $option | | #### Return Value | | | | --- | --- | | array | | #### Exceptions | | | | --- | --- | | [NoConfigurationException](../exception/noconfigurationexception "Symfony\Component\OptionsResolver\Exception\NoConfigurationException") | on no configured types | ### array getAllowedValues(string $option) #### Parameters | | | | | --- | --- | --- | | string | $option | | #### Return Value | | | | --- | --- | | array | | #### Exceptions | | | | --- | --- | | [NoConfigurationException](../exception/noconfigurationexception "Symfony\Component\OptionsResolver\Exception\NoConfigurationException") | on no configured values | ### [Closure](http://php.net/Closure) getNormalizer(string $option) #### Parameters | | | | | --- | --- | --- | | string | $option | | #### Return Value | | | | --- | --- | | [Closure](http://php.net/Closure) | | #### Exceptions | | | | --- | --- | | [NoConfigurationException](../exception/noconfigurationexception "Symfony\Component\OptionsResolver\Exception\NoConfigurationException") | on no configured normalizer | symfony CompiledRoute CompiledRoute ============== class **CompiledRoute** implements [Serializable](http://php.net/Serializable) CompiledRoutes are returned by the RouteCompiler class. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $staticPrefix, string $regex, array $tokens, array $pathVariables, string $hostRegex = null, array $hostTokens = array(), array $hostVariables = array(), array $variables = array()) | | | | [serialize](#method_serialize)() {@inheritdoc} | | | | [unserialize](#method_unserialize)($serialized) {@inheritdoc} | | | string | [getStaticPrefix](#method_getStaticPrefix)() Returns the static prefix. | | | string | [getRegex](#method_getRegex)() Returns the regex. | | | string|null | [getHostRegex](#method_getHostRegex)() Returns the host regex. | | | array | [getTokens](#method_getTokens)() Returns the tokens. | | | array | [getHostTokens](#method_getHostTokens)() Returns the host tokens. | | | array | [getVariables](#method_getVariables)() Returns the variables. | | | array | [getPathVariables](#method_getPathVariables)() Returns the path variables. | | | array | [getHostVariables](#method_getHostVariables)() Returns the host variables. | | Details ------- ### \_\_construct(string $staticPrefix, string $regex, array $tokens, array $pathVariables, string $hostRegex = null, array $hostTokens = array(), array $hostVariables = array(), array $variables = array()) #### Parameters | | | | | --- | --- | --- | | string | $staticPrefix | The static prefix of the compiled route | | string | $regex | The regular expression to use to match this route | | array | $tokens | An array of tokens to use to generate URL for this route | | array | $pathVariables | An array of path variables | | string | $hostRegex | Host regex | | array | $hostTokens | Host tokens | | array | $hostVariables | An array of host variables | | array | $variables | An array of variables (variables defined in the path and in the host patterns) | ### serialize() {@inheritdoc} ### unserialize($serialized) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### string getStaticPrefix() Returns the static prefix. #### Return Value | | | | --- | --- | | string | The static prefix | ### string getRegex() Returns the regex. #### Return Value | | | | --- | --- | | string | The regex | ### string|null getHostRegex() Returns the host regex. #### Return Value | | | | --- | --- | | string|null | The host regex or null | ### array getTokens() Returns the tokens. #### Return Value | | | | --- | --- | | array | The tokens | ### array getHostTokens() Returns the host tokens. #### Return Value | | | | --- | --- | | array | The tokens | ### array getVariables() Returns the variables. #### Return Value | | | | --- | --- | | array | The variables | ### array getPathVariables() Returns the path variables. #### Return Value | | | | --- | --- | | array | The variables | ### array getHostVariables() Returns the host variables. #### Return Value | | | | --- | --- | | array | The variables | symfony Symfony\Component\Routing\Matcher Symfony\Component\Routing\Matcher ================================= Namespaces ---------- [Symfony\Component\Routing\Matcher\Dumper](matcher/dumper) Classes ------- | | | | --- | --- | | [RedirectableUrlMatcher](matcher/redirectableurlmatcher "Symfony\Component\Routing\Matcher\RedirectableUrlMatcher") | | | [TraceableUrlMatcher](matcher/traceableurlmatcher "Symfony\Component\Routing\Matcher\TraceableUrlMatcher") | TraceableUrlMatcher helps debug path info matching by tracing the match. | | [UrlMatcher](matcher/urlmatcher "Symfony\Component\Routing\Matcher\UrlMatcher") | UrlMatcher matches URL based on a set of routes. | Interfaces ---------- | | | | --- | --- | | *[RedirectableUrlMatcherInterface](matcher/redirectableurlmatcherinterface "Symfony\Component\Routing\Matcher\RedirectableUrlMatcherInterface")* | RedirectableUrlMatcherInterface knows how to redirect the user. | | *[RequestMatcherInterface](matcher/requestmatcherinterface "Symfony\Component\Routing\Matcher\RequestMatcherInterface")* | RequestMatcherInterface is the interface that all request matcher classes must implement. | | *[UrlMatcherInterface](matcher/urlmatcherinterface "Symfony\Component\Routing\Matcher\UrlMatcherInterface")* | UrlMatcherInterface is the interface that all URL matcher classes must implement. | symfony RequestContextAwareInterface RequestContextAwareInterface ============================= interface **RequestContextAwareInterface** Methods ------- | | | | | --- | --- | --- | | | [setContext](#method_setContext)([RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. | | | [RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") | [getContext](#method_getContext)() Gets the request context. | | Details ------- ### setContext([RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. #### Parameters | | | | | --- | --- | --- | | [RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") | $context | | ### [RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") getContext() Gets the request context. #### Return Value | | | | --- | --- | | [RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") | The context | symfony RouteCollection RouteCollection ================ class **RouteCollection** implements [IteratorAggregate](http://php.net/IteratorAggregate), [Countable](http://php.net/Countable) A RouteCollection represents a set of Route instances. When adding a route at the end of the collection, an existing route with the same name is removed first. So there can only be one route with a given name. Methods ------- | | | | | --- | --- | --- | | | [\_\_clone](#method___clone)() | | | [ArrayIterator](http://php.net/ArrayIterator)|[Route](route "Symfony\Component\Routing\Route")[] | [getIterator](#method_getIterator)() Gets the current RouteCollection as an Iterator that includes all routes. | | | int | [count](#method_count)() Gets the number of Routes in this collection. | | | | [add](#method_add)(string $name, [Route](route "Symfony\Component\Routing\Route") $route) Adds a route. | | | [Route](route "Symfony\Component\Routing\Route")[] | [all](#method_all)() Returns all routes in this collection. | | | [Route](route "Symfony\Component\Routing\Route")|null | [get](#method_get)(string $name) Gets a route by name. | | | | [remove](#method_remove)(string|string[] $name) Removes a route or an array of routes by name from the collection. | | | | [addCollection](#method_addCollection)([RouteCollection](routecollection "Symfony\Component\Routing\RouteCollection") $collection) Adds a route collection at the end of the current set by appending all routes of the added collection. | | | | [addPrefix](#method_addPrefix)(string $prefix, array $defaults = array(), array $requirements = array()) Adds a prefix to the path of all child routes. | | | | [addNamePrefix](#method_addNamePrefix)(string $prefix) Adds a prefix to the name of all the routes within in the collection. | | | | [setHost](#method_setHost)(string $pattern, array $defaults = array(), array $requirements = array()) Sets the host pattern on all routes. | | | | [setCondition](#method_setCondition)(string $condition) Sets a condition on all routes. | | | | [addDefaults](#method_addDefaults)(array $defaults) Adds defaults to all routes. | | | | [addRequirements](#method_addRequirements)(array $requirements) Adds requirements to all routes. | | | | [addOptions](#method_addOptions)(array $options) Adds options to all routes. | | | | [setSchemes](#method_setSchemes)(string|string[] $schemes) Sets the schemes (e.g. 'https') all child routes are restricted to. | | | | [setMethods](#method_setMethods)(string|string[] $methods) Sets the HTTP methods (e.g. 'POST') all child routes are restricted to. | | | [ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface")[] | [getResources](#method_getResources)() Returns an array of resources loaded to build this collection. | | | | [addResource](#method_addResource)([ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $resource) Adds a resource for this collection. If the resource already exists it is not added. | | Details ------- ### \_\_clone() ### [ArrayIterator](http://php.net/ArrayIterator)|[Route](route "Symfony\Component\Routing\Route")[] getIterator() Gets the current RouteCollection as an Iterator that includes all routes. It implements \IteratorAggregate. #### Return Value | | | | --- | --- | | [ArrayIterator](http://php.net/ArrayIterator)|[Route](route "Symfony\Component\Routing\Route")[] | An \ArrayIterator object for iterating over routes | #### See also | | | | --- | --- | | all() | | ### int count() Gets the number of Routes in this collection. #### Return Value | | | | --- | --- | | int | The number of routes | ### add(string $name, [Route](route "Symfony\Component\Routing\Route") $route) Adds a route. #### Parameters | | | | | --- | --- | --- | | string | $name | The route name | | [Route](route "Symfony\Component\Routing\Route") | $route | A Route instance | ### [Route](route "Symfony\Component\Routing\Route")[] all() Returns all routes in this collection. #### Return Value | | | | --- | --- | | [Route](route "Symfony\Component\Routing\Route")[] | An array of routes | ### [Route](route "Symfony\Component\Routing\Route")|null get(string $name) Gets a route by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The route name | #### Return Value | | | | --- | --- | | [Route](route "Symfony\Component\Routing\Route")|null | A Route instance or null when not found | ### remove(string|string[] $name) Removes a route or an array of routes by name from the collection. #### Parameters | | | | | --- | --- | --- | | string|string[] | $name | The route name or an array of route names | ### addCollection([RouteCollection](routecollection "Symfony\Component\Routing\RouteCollection") $collection) Adds a route collection at the end of the current set by appending all routes of the added collection. #### Parameters | | | | | --- | --- | --- | | [RouteCollection](routecollection "Symfony\Component\Routing\RouteCollection") | $collection | | ### addPrefix(string $prefix, array $defaults = array(), array $requirements = array()) Adds a prefix to the path of all child routes. #### Parameters | | | | | --- | --- | --- | | string | $prefix | An optional prefix to add before each pattern of the route collection | | array | $defaults | An array of default values | | array | $requirements | An array of requirements | ### addNamePrefix(string $prefix) Adds a prefix to the name of all the routes within in the collection. #### Parameters | | | | | --- | --- | --- | | string | $prefix | | ### setHost(string $pattern, array $defaults = array(), array $requirements = array()) Sets the host pattern on all routes. #### Parameters | | | | | --- | --- | --- | | string | $pattern | The pattern | | array | $defaults | An array of default values | | array | $requirements | An array of requirements | ### setCondition(string $condition) Sets a condition on all routes. Existing conditions will be overridden. #### Parameters | | | | | --- | --- | --- | | string | $condition | The condition | ### addDefaults(array $defaults) Adds defaults to all routes. An existing default value under the same name in a route will be overridden. #### Parameters | | | | | --- | --- | --- | | array | $defaults | An array of default values | ### addRequirements(array $requirements) Adds requirements to all routes. An existing requirement under the same name in a route will be overridden. #### Parameters | | | | | --- | --- | --- | | array | $requirements | An array of requirements | ### addOptions(array $options) Adds options to all routes. An existing option value under the same name in a route will be overridden. #### Parameters | | | | | --- | --- | --- | | array | $options | An array of options | ### setSchemes(string|string[] $schemes) Sets the schemes (e.g. 'https') all child routes are restricted to. #### Parameters | | | | | --- | --- | --- | | string|string[] | $schemes | The scheme or an array of schemes | ### setMethods(string|string[] $methods) Sets the HTTP methods (e.g. 'POST') all child routes are restricted to. #### Parameters | | | | | --- | --- | --- | | string|string[] | $methods | The method or an array of methods | ### [ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface")[] getResources() Returns an array of resources loaded to build this collection. #### Return Value | | | | --- | --- | | [ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface")[] | An array of resources | ### addResource([ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $resource) Adds a resource for this collection. If the resource already exists it is not added. #### Parameters | | | | | --- | --- | --- | | [ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") | $resource | |
programming_docs
symfony Router Router ======= class **Router** implements [RouterInterface](routerinterface "Symfony\Component\Routing\RouterInterface"), [RequestMatcherInterface](matcher/requestmatcherinterface "Symfony\Component\Routing\Matcher\RequestMatcherInterface") The Router class is an example of the integration of all pieces of the routing system for easier use. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [UrlMatcherInterface](matcher/urlmatcherinterface "Symfony\Component\Routing\Matcher\UrlMatcherInterface")|null | $matcher | | | | protected [UrlGeneratorInterface](generator/urlgeneratorinterface "Symfony\Component\Routing\Generator\UrlGeneratorInterface")|null | $generator | | | | protected [RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") | $context | | | | protected [LoaderInterface](../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | $loader | | | | protected [RouteCollection](routecollection "Symfony\Component\Routing\RouteCollection")|null | $collection | | | | protected mixed | $resource | | | | protected array | $options | | | | protected LoggerInterface|null | $logger | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([LoaderInterface](../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") $loader, mixed $resource, array $options = array(), [RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") $context = null, LoggerInterface $logger = null) | | | | [setOptions](#method_setOptions)(array $options) Sets options. | | | | [setOption](#method_setOption)(string $key, mixed $value) Sets an option. | | | mixed | [getOption](#method_getOption)(string $key) Gets an option value. | | | [RouteCollection](routecollection "Symfony\Component\Routing\RouteCollection") | [getRouteCollection](#method_getRouteCollection)() Gets the RouteCollection instance associated with this Router. | | | | [setContext](#method_setContext)([RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. | | | [RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") | [getContext](#method_getContext)() Gets the request context. | | | | [setConfigCacheFactory](#method_setConfigCacheFactory)([ConfigCacheFactoryInterface](../config/configcachefactoryinterface "Symfony\Component\Config\ConfigCacheFactoryInterface") $configCacheFactory) Sets the ConfigCache factory to use. | | | string | [generate](#method_generate)(string $name, mixed $parameters = array(), int $referenceType = self::ABSOLUTE\_PATH) Generates a URL or path for a specific route based on the given parameters. | | | array | [match](#method_match)(string $pathinfo) Tries to match a URL path with a set of routes. | | | array | [matchRequest](#method_matchRequest)([Request](../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Tries to match a request with a set of routes. | | | [UrlMatcherInterface](matcher/urlmatcherinterface "Symfony\Component\Routing\Matcher\UrlMatcherInterface") | [getMatcher](#method_getMatcher)() Gets the UrlMatcher instance associated with this Router. | | | [UrlGeneratorInterface](generator/urlgeneratorinterface "Symfony\Component\Routing\Generator\UrlGeneratorInterface") | [getGenerator](#method_getGenerator)() Gets the UrlGenerator instance associated with this Router. | | | | [addExpressionLanguageProvider](#method_addExpressionLanguageProvider)([ExpressionFunctionProviderInterface](../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) | | | [GeneratorDumperInterface](generator/dumper/generatordumperinterface "Symfony\Component\Routing\Generator\Dumper\GeneratorDumperInterface") | [getGeneratorDumperInstance](#method_getGeneratorDumperInstance)() | | | [MatcherDumperInterface](matcher/dumper/matcherdumperinterface "Symfony\Component\Routing\Matcher\Dumper\MatcherDumperInterface") | [getMatcherDumperInstance](#method_getMatcherDumperInstance)() | | Details ------- ### \_\_construct([LoaderInterface](../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") $loader, mixed $resource, array $options = array(), [RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") $context = null, LoggerInterface $logger = null) #### Parameters | | | | | --- | --- | --- | | [LoaderInterface](../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | $loader | A LoaderInterface instance | | mixed | $resource | The main resource to load | | array | $options | An array of options | | [RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") | $context | The context | | LoggerInterface | $logger | A logger instance | ### setOptions(array $options) Sets options. Available options: * cache\_dir: The cache directory (or null to disable caching) * debug: Whether to enable debugging or not (false by default) * generator\_class: The name of a UrlGeneratorInterface implementation * generator\_base\_class: The base class for the dumped generator class * generator\_cache\_class: The class name for the dumped generator class * generator\_dumper\_class: The name of a GeneratorDumperInterface implementation * matcher\_class: The name of a UrlMatcherInterface implementation * matcher\_base\_class: The base class for the dumped matcher class * matcher\_dumper\_class: The class name for the dumped matcher class * matcher\_cache\_class: The name of a MatcherDumperInterface implementation * resource\_type: Type hint for the main resource (optional) * strict\_requirements: Configure strict requirement checking for generators implementing ConfigurableRequirementsInterface (default is true) #### Parameters | | | | | --- | --- | --- | | array | $options | An array of options | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When unsupported option is provided | ### setOption(string $key, mixed $value) Sets an option. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | mixed | $value | The value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### mixed getOption(string $key) Gets an option value. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | #### Return Value | | | | --- | --- | | mixed | The value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### [RouteCollection](routecollection "Symfony\Component\Routing\RouteCollection") getRouteCollection() Gets the RouteCollection instance associated with this Router. #### Return Value | | | | --- | --- | | [RouteCollection](routecollection "Symfony\Component\Routing\RouteCollection") | A RouteCollection instance | ### setContext([RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. #### Parameters | | | | | --- | --- | --- | | [RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") | $context | | ### [RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") getContext() Gets the request context. #### Return Value | | | | --- | --- | | [RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") | The context | ### setConfigCacheFactory([ConfigCacheFactoryInterface](../config/configcachefactoryinterface "Symfony\Component\Config\ConfigCacheFactoryInterface") $configCacheFactory) Sets the ConfigCache factory to use. #### Parameters | | | | | --- | --- | --- | | [ConfigCacheFactoryInterface](../config/configcachefactoryinterface "Symfony\Component\Config\ConfigCacheFactoryInterface") | $configCacheFactory | | ### string generate(string $name, mixed $parameters = array(), int $referenceType = self::ABSOLUTE\_PATH) Generates a URL or path for a specific route based on the given parameters. Parameters that reference placeholders in the route pattern will substitute them in the path or host. Extra params are added as query string to the URL. When the passed reference type cannot be generated for the route because it requires a different host or scheme than the current one, the method will return a more comprehensive reference that includes the required params. For example, when you call this method with $referenceType = ABSOLUTE\_PATH but the route requires the https scheme whereas the current scheme is http, it will instead return an ABSOLUTE\_URL with the https scheme and the current host. This makes sure the generated URL matches the route in any case. If there is no route with the given name, the generator must throw the RouteNotFoundException. The special parameter \_fragment will be used as the document fragment suffixed to the final URL. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the route | | mixed | $parameters | An array of parameters | | int | $referenceType | The type of reference to be generated (one of the constants) | #### Return Value | | | | --- | --- | | string | The generated URL | #### Exceptions | | | | --- | --- | | [RouteNotFoundException](exception/routenotfoundexception "Symfony\Component\Routing\Exception\RouteNotFoundException") | If the named route doesn't exist | | [MissingMandatoryParametersException](exception/missingmandatoryparametersexception "Symfony\Component\Routing\Exception\MissingMandatoryParametersException") | When some parameters are missing that are mandatory for the route | | [InvalidParameterException](exception/invalidparameterexception "Symfony\Component\Routing\Exception\InvalidParameterException") | When a parameter value for a placeholder is not correct because it does not match the requirement | ### array match(string $pathinfo) Tries to match a URL path with a set of routes. If the matcher can not find information, it must throw one of the exceptions documented below. #### Parameters | | | | | --- | --- | --- | | string | $pathinfo | The path info to be parsed (raw format, i.e. not urldecoded) | #### Return Value | | | | --- | --- | | array | An array of parameters | #### Exceptions | | | | --- | --- | | [NoConfigurationException](exception/noconfigurationexception "Symfony\Component\Routing\Exception\NoConfigurationException") | If no routing configuration could be found | | [ResourceNotFoundException](exception/resourcenotfoundexception "Symfony\Component\Routing\Exception\ResourceNotFoundException") | If the resource could not be found | | [MethodNotAllowedException](exception/methodnotallowedexception "Symfony\Component\Routing\Exception\MethodNotAllowedException") | If the resource was found but the request method is not allowed | ### array matchRequest([Request](../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Tries to match a request with a set of routes. If the matcher can not find information, it must throw one of the exceptions documented below. #### Parameters | | | | | --- | --- | --- | | [Request](../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | array | An array of parameters | #### Exceptions | | | | --- | --- | | [NoConfigurationException](exception/noconfigurationexception "Symfony\Component\Routing\Exception\NoConfigurationException") | If no routing configuration could be found | | [ResourceNotFoundException](exception/resourcenotfoundexception "Symfony\Component\Routing\Exception\ResourceNotFoundException") | If no matching resource could be found | | [MethodNotAllowedException](exception/methodnotallowedexception "Symfony\Component\Routing\Exception\MethodNotAllowedException") | If a matching resource was found but the request method is not allowed | ### [UrlMatcherInterface](matcher/urlmatcherinterface "Symfony\Component\Routing\Matcher\UrlMatcherInterface") getMatcher() Gets the UrlMatcher instance associated with this Router. #### Return Value | | | | --- | --- | | [UrlMatcherInterface](matcher/urlmatcherinterface "Symfony\Component\Routing\Matcher\UrlMatcherInterface") | A UrlMatcherInterface instance | ### [UrlGeneratorInterface](generator/urlgeneratorinterface "Symfony\Component\Routing\Generator\UrlGeneratorInterface") getGenerator() Gets the UrlGenerator instance associated with this Router. #### Return Value | | | | --- | --- | | [UrlGeneratorInterface](generator/urlgeneratorinterface "Symfony\Component\Routing\Generator\UrlGeneratorInterface") | A UrlGeneratorInterface instance | ### addExpressionLanguageProvider([ExpressionFunctionProviderInterface](../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) #### Parameters | | | | | --- | --- | --- | | [ExpressionFunctionProviderInterface](../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") | $provider | | ### protected [GeneratorDumperInterface](generator/dumper/generatordumperinterface "Symfony\Component\Routing\Generator\Dumper\GeneratorDumperInterface") getGeneratorDumperInstance() #### Return Value | | | | --- | --- | | [GeneratorDumperInterface](generator/dumper/generatordumperinterface "Symfony\Component\Routing\Generator\Dumper\GeneratorDumperInterface") | | ### protected [MatcherDumperInterface](matcher/dumper/matcherdumperinterface "Symfony\Component\Routing\Matcher\Dumper\MatcherDumperInterface") getMatcherDumperInstance() #### Return Value | | | | --- | --- | | [MatcherDumperInterface](matcher/dumper/matcherdumperinterface "Symfony\Component\Routing\Matcher\Dumper\MatcherDumperInterface") | | symfony Symfony\Component\Routing\Exception Symfony\Component\Routing\Exception =================================== Classes ------- | | | | --- | --- | | [InvalidParameterException](exception/invalidparameterexception "Symfony\Component\Routing\Exception\InvalidParameterException") | Exception thrown when a parameter is not valid. | | [MethodNotAllowedException](exception/methodnotallowedexception "Symfony\Component\Routing\Exception\MethodNotAllowedException") | The resource was found but the request method is not allowed. | | [MissingMandatoryParametersException](exception/missingmandatoryparametersexception "Symfony\Component\Routing\Exception\MissingMandatoryParametersException") | Exception thrown when a route cannot be generated because of missing mandatory parameters. | | [NoConfigurationException](exception/noconfigurationexception "Symfony\Component\Routing\Exception\NoConfigurationException") | Exception thrown when no routes are configured. | | [ResourceNotFoundException](exception/resourcenotfoundexception "Symfony\Component\Routing\Exception\ResourceNotFoundException") | The resource was not found. | | [RouteNotFoundException](exception/routenotfoundexception "Symfony\Component\Routing\Exception\RouteNotFoundException") | Exception thrown when a route does not exist. | Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\Routing\Exception\ExceptionInterface")* | ExceptionInterface. | symfony RouteCollectionBuilder RouteCollectionBuilder ======================= class **RouteCollectionBuilder** Helps add and import routes into a RouteCollection. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([LoaderInterface](../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") $loader = null) | | | [RouteCollectionBuilder](routecollectionbuilder "Symfony\Component\Routing\RouteCollectionBuilder") | [import](#method_import)(mixed $resource, string|null $prefix = '/', string $type = null) Import an external routing resource and returns the RouteCollectionBuilder. | | | [Route](route "Symfony\Component\Routing\Route") | [add](#method_add)(string $path, string $controller, string|null $name = null) Adds a route and returns it for future modification. | | | [RouteCollectionBuilder](routecollectionbuilder "Symfony\Component\Routing\RouteCollectionBuilder") | [createBuilder](#method_createBuilder)() Returns a RouteCollectionBuilder that can be configured and then added with mount(). | | | | [mount](#method_mount)(string $prefix, [RouteCollectionBuilder](routecollectionbuilder "Symfony\Component\Routing\RouteCollectionBuilder") $builder) Add a RouteCollectionBuilder. | | | $this | [addRoute](#method_addRoute)([Route](route "Symfony\Component\Routing\Route") $route, string|null $name = null) Adds a Route object to the builder. | | | $this | [setHost](#method_setHost)(string $pattern) Sets the host on all embedded routes (unless already set). | | | $this | [setCondition](#method_setCondition)(string $condition) Sets a condition on all embedded routes (unless already set). | | | $this | [setDefault](#method_setDefault)(string $key, mixed $value) Sets a default value that will be added to all embedded routes (unless that default value is already set). | | | $this | [setRequirement](#method_setRequirement)(string $key, mixed $regex) Sets a requirement that will be added to all embedded routes (unless that requirement is already set). | | | $this | [setOption](#method_setOption)(string $key, mixed $value) Sets an option that will be added to all embedded routes (unless that option is already set). | | | $this | [setSchemes](#method_setSchemes)(array|string $schemes) Sets the schemes on all embedded routes (unless already set). | | | $this | [setMethods](#method_setMethods)(array|string $methods) Sets the methods on all embedded routes (unless already set). | | | [RouteCollection](routecollection "Symfony\Component\Routing\RouteCollection") | [build](#method_build)() Creates the final RouteCollection and returns it. | | Details ------- ### \_\_construct([LoaderInterface](../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") $loader = null) #### Parameters | | | | | --- | --- | --- | | [LoaderInterface](../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | $loader | | ### [RouteCollectionBuilder](routecollectionbuilder "Symfony\Component\Routing\RouteCollectionBuilder") import(mixed $resource, string|null $prefix = '/', string $type = null) Import an external routing resource and returns the RouteCollectionBuilder. $routes->import('blog.yml', '/blog'); #### Parameters | | | | | --- | --- | --- | | mixed | $resource | | | string|null | $prefix | | | string | $type | | #### Return Value | | | | --- | --- | | [RouteCollectionBuilder](routecollectionbuilder "Symfony\Component\Routing\RouteCollectionBuilder") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | ### [Route](route "Symfony\Component\Routing\Route") add(string $path, string $controller, string|null $name = null) Adds a route and returns it for future modification. #### Parameters | | | | | --- | --- | --- | | string | $path | The route path | | string | $controller | The route's controller | | string|null | $name | The name to give this route | #### Return Value | | | | --- | --- | | [Route](route "Symfony\Component\Routing\Route") | | ### [RouteCollectionBuilder](routecollectionbuilder "Symfony\Component\Routing\RouteCollectionBuilder") createBuilder() Returns a RouteCollectionBuilder that can be configured and then added with mount(). #### Return Value | | | | --- | --- | | [RouteCollectionBuilder](routecollectionbuilder "Symfony\Component\Routing\RouteCollectionBuilder") | | ### mount(string $prefix, [RouteCollectionBuilder](routecollectionbuilder "Symfony\Component\Routing\RouteCollectionBuilder") $builder) Add a RouteCollectionBuilder. #### Parameters | | | | | --- | --- | --- | | string | $prefix | | | [RouteCollectionBuilder](routecollectionbuilder "Symfony\Component\Routing\RouteCollectionBuilder") | $builder | | ### $this addRoute([Route](route "Symfony\Component\Routing\Route") $route, string|null $name = null) Adds a Route object to the builder. #### Parameters | | | | | --- | --- | --- | | [Route](route "Symfony\Component\Routing\Route") | $route | | | string|null | $name | | #### Return Value | | | | --- | --- | | $this | | ### $this setHost(string $pattern) Sets the host on all embedded routes (unless already set). #### Parameters | | | | | --- | --- | --- | | string | $pattern | | #### Return Value | | | | --- | --- | | $this | | ### $this setCondition(string $condition) Sets a condition on all embedded routes (unless already set). #### Parameters | | | | | --- | --- | --- | | string | $condition | | #### Return Value | | | | --- | --- | | $this | | ### $this setDefault(string $key, mixed $value) Sets a default value that will be added to all embedded routes (unless that default value is already set). #### Parameters | | | | | --- | --- | --- | | string | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this setRequirement(string $key, mixed $regex) Sets a requirement that will be added to all embedded routes (unless that requirement is already set). #### Parameters | | | | | --- | --- | --- | | string | $key | | | mixed | $regex | | #### Return Value | | | | --- | --- | | $this | | ### $this setOption(string $key, mixed $value) Sets an option that will be added to all embedded routes (unless that option is already set). #### Parameters | | | | | --- | --- | --- | | string | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this setSchemes(array|string $schemes) Sets the schemes on all embedded routes (unless already set). #### Parameters | | | | | --- | --- | --- | | array|string | $schemes | | #### Return Value | | | | --- | --- | | $this | | ### $this setMethods(array|string $methods) Sets the methods on all embedded routes (unless already set). #### Parameters | | | | | --- | --- | --- | | array|string | $methods | | #### Return Value | | | | --- | --- | | $this | | ### [RouteCollection](routecollection "Symfony\Component\Routing\RouteCollection") build() Creates the final RouteCollection and returns it. #### Return Value | | | | --- | --- | | [RouteCollection](routecollection "Symfony\Component\Routing\RouteCollection") | |
programming_docs
symfony Symfony\Component\Routing\Loader Symfony\Component\Routing\Loader ================================ Namespaces ---------- [Symfony\Component\Routing\Loader\Configurator](loader/configurator)[Symfony\Component\Routing\Loader\DependencyInjection](loader/dependencyinjection) Classes ------- | | | | --- | --- | | [AnnotationClassLoader](loader/annotationclassloader "Symfony\Component\Routing\Loader\AnnotationClassLoader") | AnnotationClassLoader loads routing information from a PHP class and its methods. | | [AnnotationDirectoryLoader](loader/annotationdirectoryloader "Symfony\Component\Routing\Loader\AnnotationDirectoryLoader") | AnnotationDirectoryLoader loads routing information from annotations set on PHP classes and methods. | | [AnnotationFileLoader](loader/annotationfileloader "Symfony\Component\Routing\Loader\AnnotationFileLoader") | AnnotationFileLoader loads routing information from annotations set on a PHP class and its methods. | | [ClosureLoader](loader/closureloader "Symfony\Component\Routing\Loader\ClosureLoader") | ClosureLoader loads routes from a PHP closure. | | [DirectoryLoader](loader/directoryloader "Symfony\Component\Routing\Loader\DirectoryLoader") | | | [GlobFileLoader](loader/globfileloader "Symfony\Component\Routing\Loader\GlobFileLoader") | GlobFileLoader loads files from a glob pattern. | | [ObjectRouteLoader](loader/objectrouteloader "Symfony\Component\Routing\Loader\ObjectRouteLoader") | A route loader that calls a method on an object to load the routes. | | [PhpFileLoader](loader/phpfileloader "Symfony\Component\Routing\Loader\PhpFileLoader") | PhpFileLoader loads routes from a PHP file. | | [ProtectedPhpFileLoader](loader/protectedphpfileloader "Symfony\Component\Routing\Loader\ProtectedPhpFileLoader") | | | [XmlFileLoader](loader/xmlfileloader "Symfony\Component\Routing\Loader\XmlFileLoader") | XmlFileLoader loads XML routing files. | | [YamlFileLoader](loader/yamlfileloader "Symfony\Component\Routing\Loader\YamlFileLoader") | YamlFileLoader loads Yaml routing files. | symfony RequestContext RequestContext =============== class **RequestContext** Holds information about the current request. This class implements a fluent interface. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $baseUrl = '', string $method = 'GET', string $host = 'localhost', string $scheme = 'http', int $httpPort = 80, int $httpsPort = 443, string $path = '/', string $queryString = '') | | | $this | [fromRequest](#method_fromRequest)([Request](../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Updates the RequestContext information based on a HttpFoundation Request. | | | string | [getBaseUrl](#method_getBaseUrl)() Gets the base URL. | | | $this | [setBaseUrl](#method_setBaseUrl)(string $baseUrl) Sets the base URL. | | | string | [getPathInfo](#method_getPathInfo)() Gets the path info. | | | $this | [setPathInfo](#method_setPathInfo)(string $pathInfo) Sets the path info. | | | string | [getMethod](#method_getMethod)() Gets the HTTP method. | | | $this | [setMethod](#method_setMethod)(string $method) Sets the HTTP method. | | | string | [getHost](#method_getHost)() Gets the HTTP host. | | | $this | [setHost](#method_setHost)(string $host) Sets the HTTP host. | | | string | [getScheme](#method_getScheme)() Gets the HTTP scheme. | | | $this | [setScheme](#method_setScheme)(string $scheme) Sets the HTTP scheme. | | | int | [getHttpPort](#method_getHttpPort)() Gets the HTTP port. | | | $this | [setHttpPort](#method_setHttpPort)(int $httpPort) Sets the HTTP port. | | | int | [getHttpsPort](#method_getHttpsPort)() Gets the HTTPS port. | | | $this | [setHttpsPort](#method_setHttpsPort)(int $httpsPort) Sets the HTTPS port. | | | string | [getQueryString](#method_getQueryString)() Gets the query string. | | | $this | [setQueryString](#method_setQueryString)(string $queryString) Sets the query string. | | | array | [getParameters](#method_getParameters)() Returns the parameters. | | | $this | [setParameters](#method_setParameters)(array $parameters) Sets the parameters. | | | mixed | [getParameter](#method_getParameter)(string $name) Gets a parameter value. | | | bool | [hasParameter](#method_hasParameter)(string $name) Checks if a parameter value is set for the given parameter. | | | $this | [setParameter](#method_setParameter)(string $name, mixed $parameter) Sets a parameter value. | | Details ------- ### \_\_construct(string $baseUrl = '', string $method = 'GET', string $host = 'localhost', string $scheme = 'http', int $httpPort = 80, int $httpsPort = 443, string $path = '/', string $queryString = '') #### Parameters | | | | | --- | --- | --- | | string | $baseUrl | | | string | $method | | | string | $host | | | string | $scheme | | | int | $httpPort | | | int | $httpsPort | | | string | $path | | | string | $queryString | | ### $this fromRequest([Request](../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Updates the RequestContext information based on a HttpFoundation Request. #### Parameters | | | | | --- | --- | --- | | [Request](../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | $this | | ### string getBaseUrl() Gets the base URL. #### Return Value | | | | --- | --- | | string | The base URL | ### $this setBaseUrl(string $baseUrl) Sets the base URL. #### Parameters | | | | | --- | --- | --- | | string | $baseUrl | The base URL | #### Return Value | | | | --- | --- | | $this | | ### string getPathInfo() Gets the path info. #### Return Value | | | | --- | --- | | string | The path info | ### $this setPathInfo(string $pathInfo) Sets the path info. #### Parameters | | | | | --- | --- | --- | | string | $pathInfo | The path info | #### Return Value | | | | --- | --- | | $this | | ### string getMethod() Gets the HTTP method. The method is always an uppercased string. #### Return Value | | | | --- | --- | | string | The HTTP method | ### $this setMethod(string $method) Sets the HTTP method. #### Parameters | | | | | --- | --- | --- | | string | $method | The HTTP method | #### Return Value | | | | --- | --- | | $this | | ### string getHost() Gets the HTTP host. The host is always lowercased because it must be treated case-insensitive. #### Return Value | | | | --- | --- | | string | The HTTP host | ### $this setHost(string $host) Sets the HTTP host. #### Parameters | | | | | --- | --- | --- | | string | $host | The HTTP host | #### Return Value | | | | --- | --- | | $this | | ### string getScheme() Gets the HTTP scheme. #### Return Value | | | | --- | --- | | string | The HTTP scheme | ### $this setScheme(string $scheme) Sets the HTTP scheme. #### Parameters | | | | | --- | --- | --- | | string | $scheme | The HTTP scheme | #### Return Value | | | | --- | --- | | $this | | ### int getHttpPort() Gets the HTTP port. #### Return Value | | | | --- | --- | | int | The HTTP port | ### $this setHttpPort(int $httpPort) Sets the HTTP port. #### Parameters | | | | | --- | --- | --- | | int | $httpPort | The HTTP port | #### Return Value | | | | --- | --- | | $this | | ### int getHttpsPort() Gets the HTTPS port. #### Return Value | | | | --- | --- | | int | The HTTPS port | ### $this setHttpsPort(int $httpsPort) Sets the HTTPS port. #### Parameters | | | | | --- | --- | --- | | int | $httpsPort | The HTTPS port | #### Return Value | | | | --- | --- | | $this | | ### string getQueryString() Gets the query string. #### Return Value | | | | --- | --- | | string | The query string without the "?" | ### $this setQueryString(string $queryString) Sets the query string. #### Parameters | | | | | --- | --- | --- | | string | $queryString | The query string (after "?") | #### Return Value | | | | --- | --- | | $this | | ### array getParameters() Returns the parameters. #### Return Value | | | | --- | --- | | array | The parameters | ### $this setParameters(array $parameters) Sets the parameters. #### Parameters | | | | | --- | --- | --- | | array | $parameters | The parameters | #### Return Value | | | | --- | --- | | $this | | ### mixed getParameter(string $name) Gets a parameter value. #### Parameters | | | | | --- | --- | --- | | string | $name | A parameter name | #### Return Value | | | | --- | --- | | mixed | The parameter value or null if nonexistent | ### bool hasParameter(string $name) Checks if a parameter value is set for the given parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | A parameter name | #### Return Value | | | | --- | --- | | bool | True if the parameter value is set, false otherwise | ### $this setParameter(string $name, mixed $parameter) Sets a parameter value. #### Parameters | | | | | --- | --- | --- | | string | $name | A parameter name | | mixed | $parameter | The parameter value | #### Return Value | | | | --- | --- | | $this | | symfony Route Route ====== class **Route** implements [Serializable](http://php.net/Serializable) A Route describes a route and its parameters. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path, array $defaults = array(), array $requirements = array(), array $options = array(), string|null $host = '', string|string[] $schemes = array(), string|string[] $methods = array(), string|null $condition = '') Constructor. | | | | [serialize](#method_serialize)() {@inheritdoc} | | | | [unserialize](#method_unserialize)($serialized) {@inheritdoc} | | | string | [getPath](#method_getPath)() Returns the pattern for the path. | | | $this | [setPath](#method_setPath)(string $pattern) Sets the pattern for the path. | | | string | [getHost](#method_getHost)() Returns the pattern for the host. | | | $this | [setHost](#method_setHost)(string $pattern) Sets the pattern for the host. | | | string[] | [getSchemes](#method_getSchemes)() Returns the lowercased schemes this route is restricted to. | | | $this | [setSchemes](#method_setSchemes)(string|string[] $schemes) Sets the schemes (e.g. 'https') this route is restricted to. | | | bool | [hasScheme](#method_hasScheme)(string $scheme) Checks if a scheme requirement has been set. | | | string[] | [getMethods](#method_getMethods)() Returns the uppercased HTTP methods this route is restricted to. | | | $this | [setMethods](#method_setMethods)(string|string[] $methods) Sets the HTTP methods (e.g. 'POST') this route is restricted to. | | | array | [getOptions](#method_getOptions)() Returns the options. | | | $this | [setOptions](#method_setOptions)(array $options) Sets the options. | | | $this | [addOptions](#method_addOptions)(array $options) Adds options. | | | $this | [setOption](#method_setOption)(string $name, mixed $value) Sets an option value. | | | mixed | [getOption](#method_getOption)(string $name) Get an option value. | | | bool | [hasOption](#method_hasOption)(string $name) Checks if an option has been set. | | | array | [getDefaults](#method_getDefaults)() Returns the defaults. | | | $this | [setDefaults](#method_setDefaults)(array $defaults) Sets the defaults. | | | $this | [addDefaults](#method_addDefaults)(array $defaults) Adds defaults. | | | mixed | [getDefault](#method_getDefault)(string $name) Gets a default value. | | | bool | [hasDefault](#method_hasDefault)(string $name) Checks if a default value is set for the given variable. | | | $this | [setDefault](#method_setDefault)(string $name, mixed $default) Sets a default value. | | | array | [getRequirements](#method_getRequirements)() Returns the requirements. | | | $this | [setRequirements](#method_setRequirements)(array $requirements) Sets the requirements. | | | $this | [addRequirements](#method_addRequirements)(array $requirements) Adds requirements. | | | string|null | [getRequirement](#method_getRequirement)(string $key) Returns the requirement for the given key. | | | bool | [hasRequirement](#method_hasRequirement)(string $key) Checks if a requirement is set for the given key. | | | $this | [setRequirement](#method_setRequirement)(string $key, string $regex) Sets a requirement for the given key. | | | string | [getCondition](#method_getCondition)() Returns the condition. | | | $this | [setCondition](#method_setCondition)(string $condition) Sets the condition. | | | [CompiledRoute](compiledroute "Symfony\Component\Routing\CompiledRoute") | [compile](#method_compile)() Compiles the route. | | Details ------- ### \_\_construct(string $path, array $defaults = array(), array $requirements = array(), array $options = array(), string|null $host = '', string|string[] $schemes = array(), string|string[] $methods = array(), string|null $condition = '') Constructor. Available options: * compiler\_class: A class name able to compile this route instance (RouteCompiler by default) * utf8: Whether UTF-8 matching is enforced ot not #### Parameters | | | | | --- | --- | --- | | string | $path | The path pattern to match | | array | $defaults | An array of default parameter values | | array | $requirements | An array of requirements for parameters (regexes) | | array | $options | An array of options | | string|null | $host | The host pattern to match | | string|string[] | $schemes | A required URI scheme or an array of restricted schemes | | string|string[] | $methods | A required HTTP method or an array of restricted methods | | string|null | $condition | A condition that should evaluate to true for the route to match | ### serialize() {@inheritdoc} ### unserialize($serialized) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### string getPath() Returns the pattern for the path. #### Return Value | | | | --- | --- | | string | The path pattern | ### $this setPath(string $pattern) Sets the pattern for the path. This method implements a fluent interface. #### Parameters | | | | | --- | --- | --- | | string | $pattern | The path pattern | #### Return Value | | | | --- | --- | | $this | | ### string getHost() Returns the pattern for the host. #### Return Value | | | | --- | --- | | string | The host pattern | ### $this setHost(string $pattern) Sets the pattern for the host. This method implements a fluent interface. #### Parameters | | | | | --- | --- | --- | | string | $pattern | The host pattern | #### Return Value | | | | --- | --- | | $this | | ### string[] getSchemes() Returns the lowercased schemes this route is restricted to. So an empty array means that any scheme is allowed. #### Return Value | | | | --- | --- | | string[] | The schemes | ### $this setSchemes(string|string[] $schemes) Sets the schemes (e.g. 'https') this route is restricted to. So an empty array means that any scheme is allowed. This method implements a fluent interface. #### Parameters | | | | | --- | --- | --- | | string|string[] | $schemes | The scheme or an array of schemes | #### Return Value | | | | --- | --- | | $this | | ### bool hasScheme(string $scheme) Checks if a scheme requirement has been set. #### Parameters | | | | | --- | --- | --- | | string | $scheme | | #### Return Value | | | | --- | --- | | bool | true if the scheme requirement exists, otherwise false | ### string[] getMethods() Returns the uppercased HTTP methods this route is restricted to. So an empty array means that any method is allowed. #### Return Value | | | | --- | --- | | string[] | The methods | ### $this setMethods(string|string[] $methods) Sets the HTTP methods (e.g. 'POST') this route is restricted to. So an empty array means that any method is allowed. This method implements a fluent interface. #### Parameters | | | | | --- | --- | --- | | string|string[] | $methods | The method or an array of methods | #### Return Value | | | | --- | --- | | $this | | ### array getOptions() Returns the options. #### Return Value | | | | --- | --- | | array | The options | ### $this setOptions(array $options) Sets the options. This method implements a fluent interface. #### Parameters | | | | | --- | --- | --- | | array | $options | The options | #### Return Value | | | | --- | --- | | $this | | ### $this addOptions(array $options) Adds options. This method implements a fluent interface. #### Parameters | | | | | --- | --- | --- | | array | $options | The options | #### Return Value | | | | --- | --- | | $this | | ### $this setOption(string $name, mixed $value) Sets an option value. This method implements a fluent interface. #### Parameters | | | | | --- | --- | --- | | string | $name | An option name | | mixed | $value | The option value | #### Return Value | | | | --- | --- | | $this | | ### mixed getOption(string $name) Get an option value. #### Parameters | | | | | --- | --- | --- | | string | $name | An option name | #### Return Value | | | | --- | --- | | mixed | The option value or null when not given | ### bool hasOption(string $name) Checks if an option has been set. #### Parameters | | | | | --- | --- | --- | | string | $name | An option name | #### Return Value | | | | --- | --- | | bool | true if the option is set, false otherwise | ### array getDefaults() Returns the defaults. #### Return Value | | | | --- | --- | | array | The defaults | ### $this setDefaults(array $defaults) Sets the defaults. This method implements a fluent interface. #### Parameters | | | | | --- | --- | --- | | array | $defaults | The defaults | #### Return Value | | | | --- | --- | | $this | | ### $this addDefaults(array $defaults) Adds defaults. This method implements a fluent interface. #### Parameters | | | | | --- | --- | --- | | array | $defaults | The defaults | #### Return Value | | | | --- | --- | | $this | | ### mixed getDefault(string $name) Gets a default value. #### Parameters | | | | | --- | --- | --- | | string | $name | A variable name | #### Return Value | | | | --- | --- | | mixed | The default value or null when not given | ### bool hasDefault(string $name) Checks if a default value is set for the given variable. #### Parameters | | | | | --- | --- | --- | | string | $name | A variable name | #### Return Value | | | | --- | --- | | bool | true if the default value is set, false otherwise | ### $this setDefault(string $name, mixed $default) Sets a default value. #### Parameters | | | | | --- | --- | --- | | string | $name | A variable name | | mixed | $default | The default value | #### Return Value | | | | --- | --- | | $this | | ### array getRequirements() Returns the requirements. #### Return Value | | | | --- | --- | | array | The requirements | ### $this setRequirements(array $requirements) Sets the requirements. This method implements a fluent interface. #### Parameters | | | | | --- | --- | --- | | array | $requirements | The requirements | #### Return Value | | | | --- | --- | | $this | | ### $this addRequirements(array $requirements) Adds requirements. This method implements a fluent interface. #### Parameters | | | | | --- | --- | --- | | array | $requirements | The requirements | #### Return Value | | | | --- | --- | | $this | | ### string|null getRequirement(string $key) Returns the requirement for the given key. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | #### Return Value | | | | --- | --- | | string|null | The regex or null when not given | ### bool hasRequirement(string $key) Checks if a requirement is set for the given key. #### Parameters | | | | | --- | --- | --- | | string | $key | A variable name | #### Return Value | | | | --- | --- | | bool | true if a requirement is specified, false otherwise | ### $this setRequirement(string $key, string $regex) Sets a requirement for the given key. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | string | $regex | The regex | #### Return Value | | | | --- | --- | | $this | | ### string getCondition() Returns the condition. #### Return Value | | | | --- | --- | | string | The condition | ### $this setCondition(string $condition) Sets the condition. This method implements a fluent interface. #### Parameters | | | | | --- | --- | --- | | string | $condition | The condition | #### Return Value | | | | --- | --- | | $this | | ### [CompiledRoute](compiledroute "Symfony\Component\Routing\CompiledRoute") compile() Compiles the route. #### Return Value | | | | --- | --- | | [CompiledRoute](compiledroute "Symfony\Component\Routing\CompiledRoute") | A CompiledRoute instance | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | If the Route cannot be compiled because the path or host pattern is invalid | #### See also | | | | --- | --- | | [RouteCompiler](routecompiler "Symfony\Component\Routing\RouteCompiler") | which is responsible for the compilation process |
programming_docs
symfony RouterInterface RouterInterface ================ interface **RouterInterface** implements [UrlMatcherInterface](matcher/urlmatcherinterface "Symfony\Component\Routing\Matcher\UrlMatcherInterface"), [UrlGeneratorInterface](generator/urlgeneratorinterface "Symfony\Component\Routing\Generator\UrlGeneratorInterface") RouterInterface is the interface that all Router classes must implement. This interface is the concatenation of UrlMatcherInterface and UrlGeneratorInterface. Methods ------- | | | | | --- | --- | --- | | | [setContext](#method_setContext)([RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. | from [RequestContextAwareInterface](requestcontextawareinterface#method_setContext "Symfony\Component\Routing\RequestContextAwareInterface") | | [RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") | [getContext](#method_getContext)() Gets the request context. | from [RequestContextAwareInterface](requestcontextawareinterface#method_getContext "Symfony\Component\Routing\RequestContextAwareInterface") | | array | [match](#method_match)(string $pathinfo) Tries to match a URL path with a set of routes. | from [UrlMatcherInterface](matcher/urlmatcherinterface#method_match "Symfony\Component\Routing\Matcher\UrlMatcherInterface") | | string | [generate](#method_generate)(string $name, mixed $parameters = array(), int $referenceType = self::ABSOLUTE\_PATH) Generates a URL or path for a specific route based on the given parameters. | from [UrlGeneratorInterface](generator/urlgeneratorinterface#method_generate "Symfony\Component\Routing\Generator\UrlGeneratorInterface") | | [RouteCollection](routecollection "Symfony\Component\Routing\RouteCollection") | [getRouteCollection](#method_getRouteCollection)() Gets the RouteCollection instance associated with this Router. | | Details ------- ### setContext([RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. #### Parameters | | | | | --- | --- | --- | | [RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") | $context | | ### [RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") getContext() Gets the request context. #### Return Value | | | | --- | --- | | [RequestContext](requestcontext "Symfony\Component\Routing\RequestContext") | The context | ### array match(string $pathinfo) Tries to match a URL path with a set of routes. If the matcher can not find information, it must throw one of the exceptions documented below. #### Parameters | | | | | --- | --- | --- | | string | $pathinfo | The path info to be parsed (raw format, i.e. not urldecoded) | #### Return Value | | | | --- | --- | | array | An array of parameters | #### Exceptions | | | | --- | --- | | [NoConfigurationException](exception/noconfigurationexception "Symfony\Component\Routing\Exception\NoConfigurationException") | If no routing configuration could be found | | [ResourceNotFoundException](exception/resourcenotfoundexception "Symfony\Component\Routing\Exception\ResourceNotFoundException") | If the resource could not be found | | [MethodNotAllowedException](exception/methodnotallowedexception "Symfony\Component\Routing\Exception\MethodNotAllowedException") | If the resource was found but the request method is not allowed | ### string generate(string $name, mixed $parameters = array(), int $referenceType = self::ABSOLUTE\_PATH) Generates a URL or path for a specific route based on the given parameters. Parameters that reference placeholders in the route pattern will substitute them in the path or host. Extra params are added as query string to the URL. When the passed reference type cannot be generated for the route because it requires a different host or scheme than the current one, the method will return a more comprehensive reference that includes the required params. For example, when you call this method with $referenceType = ABSOLUTE\_PATH but the route requires the https scheme whereas the current scheme is http, it will instead return an ABSOLUTE\_URL with the https scheme and the current host. This makes sure the generated URL matches the route in any case. If there is no route with the given name, the generator must throw the RouteNotFoundException. The special parameter \_fragment will be used as the document fragment suffixed to the final URL. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the route | | mixed | $parameters | An array of parameters | | int | $referenceType | The type of reference to be generated (one of the constants) | #### Return Value | | | | --- | --- | | string | The generated URL | #### Exceptions | | | | --- | --- | | [RouteNotFoundException](exception/routenotfoundexception "Symfony\Component\Routing\Exception\RouteNotFoundException") | If the named route doesn't exist | | [MissingMandatoryParametersException](exception/missingmandatoryparametersexception "Symfony\Component\Routing\Exception\MissingMandatoryParametersException") | When some parameters are missing that are mandatory for the route | | [InvalidParameterException](exception/invalidparameterexception "Symfony\Component\Routing\Exception\InvalidParameterException") | When a parameter value for a placeholder is not correct because it does not match the requirement | ### [RouteCollection](routecollection "Symfony\Component\Routing\RouteCollection") getRouteCollection() Gets the RouteCollection instance associated with this Router. #### Return Value | | | | --- | --- | | [RouteCollection](routecollection "Symfony\Component\Routing\RouteCollection") | A RouteCollection instance | symfony RouteCompiler RouteCompiler ============== class **RouteCompiler** implements [RouteCompilerInterface](routecompilerinterface "Symfony\Component\Routing\RouteCompilerInterface") RouteCompiler compiles Route instances to CompiledRoute instances. Constants --------- | | | | --- | --- | | REGEX\_DELIMITER | | | SEPARATORS | *This string defines the characters that are automatically considered separators in front of optional placeholders (with default and no static text following). Such a single separator can be left out together with the optional placeholder from matching and generating URLs.* | | VARIABLE\_MAXIMUM\_LENGTH | *The maximum supported length of a PCRE subpattern name http://pcre.org/current/doc/html/pcre2pattern.html#SEC16.* | Methods ------- | | | | | --- | --- | --- | | static [CompiledRoute](compiledroute "Symfony\Component\Routing\CompiledRoute") | [compile](#method_compile)([Route](route "Symfony\Component\Routing\Route") $route) Compiles the current route instance. | | Details ------- ### static [CompiledRoute](compiledroute "Symfony\Component\Routing\CompiledRoute") compile([Route](route "Symfony\Component\Routing\Route") $route) Compiles the current route instance. #### Parameters | | | | | --- | --- | --- | | [Route](route "Symfony\Component\Routing\Route") | $route | | #### Return Value | | | | --- | --- | | [CompiledRoute](compiledroute "Symfony\Component\Routing\CompiledRoute") | A CompiledRoute instance | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | If the Route cannot be compiled because the path or host pattern is invalid | symfony Symfony\Component\Routing\DependencyInjection Symfony\Component\Routing\DependencyInjection ============================================= Classes ------- | | | | --- | --- | | [RoutingResolverPass](dependencyinjection/routingresolverpass "Symfony\Component\Routing\DependencyInjection\RoutingResolverPass") | Adds tagged routing.loader services to routing.resolver service. | symfony RouteCompilerInterface RouteCompilerInterface ======================= interface **RouteCompilerInterface** RouteCompilerInterface is the interface that all RouteCompiler classes must implement. Methods ------- | | | | | --- | --- | --- | | static [CompiledRoute](compiledroute "Symfony\Component\Routing\CompiledRoute") | [compile](#method_compile)([Route](route "Symfony\Component\Routing\Route") $route) Compiles the current route instance. | | Details ------- ### static [CompiledRoute](compiledroute "Symfony\Component\Routing\CompiledRoute") compile([Route](route "Symfony\Component\Routing\Route") $route) Compiles the current route instance. #### Parameters | | | | | --- | --- | --- | | [Route](route "Symfony\Component\Routing\Route") | $route | | #### Return Value | | | | --- | --- | | [CompiledRoute](compiledroute "Symfony\Component\Routing\CompiledRoute") | A CompiledRoute instance | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | If the Route cannot be compiled because the path or host pattern is invalid | symfony Symfony\Component\Routing\Generator Symfony\Component\Routing\Generator =================================== Namespaces ---------- [Symfony\Component\Routing\Generator\Dumper](generator/dumper) Classes ------- | | | | --- | --- | | [UrlGenerator](generator/urlgenerator "Symfony\Component\Routing\Generator\UrlGenerator") | UrlGenerator can generate a URL or a path for any route in the RouteCollection based on the passed parameters. | Interfaces ---------- | | | | --- | --- | | *[ConfigurableRequirementsInterface](generator/configurablerequirementsinterface "Symfony\Component\Routing\Generator\ConfigurableRequirementsInterface")* | ConfigurableRequirementsInterface must be implemented by URL generators that can be configured whether an exception should be generated when the parameters do not match the requirements. It is also possible to disable the requirements check for URL generation completely. | | *[UrlGeneratorInterface](generator/urlgeneratorinterface "Symfony\Component\Routing\Generator\UrlGeneratorInterface")* | UrlGeneratorInterface is the interface that all URL generator classes must implement. | symfony Symfony\Component\Routing\Annotation Symfony\Component\Routing\Annotation ==================================== Classes ------- | | | | --- | --- | | [Route](annotation/route "Symfony\Component\Routing\Annotation\Route") | Annotation class for @Route(). | symfony Route Route ====== class **Route** Annotation class for @Route(). Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $data) | | | | [setPath](#method_setPath)($path) | | | | [getPath](#method_getPath)() | | | | [setLocalizedPaths](#method_setLocalizedPaths)(array $localizedPaths) | | | array | [getLocalizedPaths](#method_getLocalizedPaths)() | | | | [setHost](#method_setHost)($pattern) | | | | [getHost](#method_getHost)() | | | | [setName](#method_setName)($name) | | | | [getName](#method_getName)() | | | | [setRequirements](#method_setRequirements)($requirements) | | | | [getRequirements](#method_getRequirements)() | | | | [setOptions](#method_setOptions)($options) | | | | [getOptions](#method_getOptions)() | | | | [setDefaults](#method_setDefaults)($defaults) | | | | [getDefaults](#method_getDefaults)() | | | | [setSchemes](#method_setSchemes)($schemes) | | | | [getSchemes](#method_getSchemes)() | | | | [setMethods](#method_setMethods)($methods) | | | | [getMethods](#method_getMethods)() | | | | [setCondition](#method_setCondition)($condition) | | | | [getCondition](#method_getCondition)() | | Details ------- ### \_\_construct(array $data) #### Parameters | | | | | --- | --- | --- | | array | $data | An array of key/value parameters | #### Exceptions | | | | --- | --- | | [BadMethodCallException](http://php.net/BadMethodCallException) | | ### setPath($path) #### Parameters | | | | | --- | --- | --- | | | $path | | ### getPath() ### setLocalizedPaths(array $localizedPaths) #### Parameters | | | | | --- | --- | --- | | array | $localizedPaths | | ### array getLocalizedPaths() #### Return Value | | | | --- | --- | | array | | ### setHost($pattern) #### Parameters | | | | | --- | --- | --- | | | $pattern | | ### getHost() ### setName($name) #### Parameters | | | | | --- | --- | --- | | | $name | | ### getName() ### setRequirements($requirements) #### Parameters | | | | | --- | --- | --- | | | $requirements | | ### getRequirements() ### setOptions($options) #### Parameters | | | | | --- | --- | --- | | | $options | | ### getOptions() ### setDefaults($defaults) #### Parameters | | | | | --- | --- | --- | | | $defaults | | ### getDefaults() ### setSchemes($schemes) #### Parameters | | | | | --- | --- | --- | | | $schemes | | ### getSchemes() ### setMethods($methods) #### Parameters | | | | | --- | --- | --- | | | $methods | | ### getMethods() ### setCondition($condition) #### Parameters | | | | | --- | --- | --- | | | $condition | | ### getCondition() symfony TraceableUrlMatcher TraceableUrlMatcher ==================== class **TraceableUrlMatcher** extends [UrlMatcher](urlmatcher "Symfony\Component\Routing\Matcher\UrlMatcher") TraceableUrlMatcher helps debug path info matching by tracing the match. Constants --------- | | | | --- | --- | | REQUIREMENT\_MATCH | | | REQUIREMENT\_MISMATCH | | | ROUTE\_MATCH | | | ROUTE\_DOES\_NOT\_MATCH | | | ROUTE\_ALMOST\_MATCHES | | | ROUTE\_MATCHES | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $context | | from [UrlMatcher](urlmatcher#property_context "Symfony\Component\Routing\Matcher\UrlMatcher") | | protected | $allow | Collects HTTP methods that would be allowed for the request. | from [UrlMatcher](urlmatcher#property_allow "Symfony\Component\Routing\Matcher\UrlMatcher") | | protected | $allowSchemes | Collects URI schemes that would be allowed for the request. | from [UrlMatcher](urlmatcher#property_allowSchemes "Symfony\Component\Routing\Matcher\UrlMatcher") | | protected | $routes | | from [UrlMatcher](urlmatcher#property_routes "Symfony\Component\Routing\Matcher\UrlMatcher") | | protected | $request | | from [UrlMatcher](urlmatcher#property_request "Symfony\Component\Routing\Matcher\UrlMatcher") | | protected | $expressionLanguage | | from [UrlMatcher](urlmatcher#property_expressionLanguage "Symfony\Component\Routing\Matcher\UrlMatcher") | | protected [ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface")[] | $expressionLanguageProviders | | from [UrlMatcher](urlmatcher#property_expressionLanguageProviders "Symfony\Component\Routing\Matcher\UrlMatcher") | | protected | $traces | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $routes, [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) | from [UrlMatcher](urlmatcher#method___construct "Symfony\Component\Routing\Matcher\UrlMatcher") | | | [setContext](#method_setContext)([RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. | from [UrlMatcher](urlmatcher#method_setContext "Symfony\Component\Routing\Matcher\UrlMatcher") | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | [getContext](#method_getContext)() Gets the request context. | from [UrlMatcher](urlmatcher#method_getContext "Symfony\Component\Routing\Matcher\UrlMatcher") | | array | [match](#method_match)(string $pathinfo) Tries to match a URL path with a set of routes. | from [UrlMatcher](urlmatcher#method_match "Symfony\Component\Routing\Matcher\UrlMatcher") | | array | [matchRequest](#method_matchRequest)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Tries to match a request with a set of routes. | from [UrlMatcher](urlmatcher#method_matchRequest "Symfony\Component\Routing\Matcher\UrlMatcher") | | | [addExpressionLanguageProvider](#method_addExpressionLanguageProvider)([ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) | from [UrlMatcher](urlmatcher#method_addExpressionLanguageProvider "Symfony\Component\Routing\Matcher\UrlMatcher") | | array | [matchCollection](#method_matchCollection)(string $pathinfo, [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $routes) Tries to match a URL with a set of routes. | | | array | [getAttributes](#method_getAttributes)([Route](../route "Symfony\Component\Routing\Route") $route, string $name, array $attributes) Returns an array of values to use as request attributes. | from [UrlMatcher](urlmatcher#method_getAttributes "Symfony\Component\Routing\Matcher\UrlMatcher") | | array | [handleRouteRequirements](#method_handleRouteRequirements)(string $pathinfo, string $name, [Route](../route "Symfony\Component\Routing\Route") $route) Handles specific route requirements. | from [UrlMatcher](urlmatcher#method_handleRouteRequirements "Symfony\Component\Routing\Matcher\UrlMatcher") | | array | [mergeDefaults](#method_mergeDefaults)(array $params, array $defaults) Get merged default parameters. | from [UrlMatcher](urlmatcher#method_mergeDefaults "Symfony\Component\Routing\Matcher\UrlMatcher") | | | [getExpressionLanguage](#method_getExpressionLanguage)() | from [UrlMatcher](urlmatcher#method_getExpressionLanguage "Symfony\Component\Routing\Matcher\UrlMatcher") | | | [createRequest](#method_createRequest)($pathinfo) | from [UrlMatcher](urlmatcher#method_createRequest "Symfony\Component\Routing\Matcher\UrlMatcher") | | | [getTraces](#method_getTraces)($pathinfo) | | | | [getTracesForRequest](#method_getTracesForRequest)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) | | Details ------- ### \_\_construct([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $routes, [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") | $routes | | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | $context | | ### setContext([RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. #### Parameters | | | | | --- | --- | --- | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | $context | | ### [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") getContext() Gets the request context. #### Return Value | | | | --- | --- | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | The context | ### array match(string $pathinfo) Tries to match a URL path with a set of routes. If the matcher can not find information, it must throw one of the exceptions documented below. #### Parameters | | | | | --- | --- | --- | | string | $pathinfo | The path info to be parsed (raw format, i.e. not urldecoded) | #### Return Value | | | | --- | --- | | array | An array of parameters | #### Exceptions | | | | --- | --- | | [NoConfigurationException](../exception/noconfigurationexception "Symfony\Component\Routing\Exception\NoConfigurationException") | If no routing configuration could be found | | [ResourceNotFoundException](../exception/resourcenotfoundexception "Symfony\Component\Routing\Exception\ResourceNotFoundException") | If the resource could not be found | | [MethodNotAllowedException](../exception/methodnotallowedexception "Symfony\Component\Routing\Exception\MethodNotAllowedException") | If the resource was found but the request method is not allowed | ### array matchRequest([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Tries to match a request with a set of routes. If the matcher can not find information, it must throw one of the exceptions documented below. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | array | An array of parameters | #### Exceptions | | | | --- | --- | | [NoConfigurationException](../exception/noconfigurationexception "Symfony\Component\Routing\Exception\NoConfigurationException") | If no routing configuration could be found | | [ResourceNotFoundException](../exception/resourcenotfoundexception "Symfony\Component\Routing\Exception\ResourceNotFoundException") | If no matching resource could be found | | [MethodNotAllowedException](../exception/methodnotallowedexception "Symfony\Component\Routing\Exception\MethodNotAllowedException") | If a matching resource was found but the request method is not allowed | ### addExpressionLanguageProvider([ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) #### Parameters | | | | | --- | --- | --- | | [ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") | $provider | | ### protected array matchCollection(string $pathinfo, [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $routes) Tries to match a URL with a set of routes. #### Parameters | | | | | --- | --- | --- | | string | $pathinfo | The path info to be parsed | | [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") | $routes | The set of routes | #### Return Value | | | | --- | --- | | array | An array of parameters | #### Exceptions | | | | --- | --- | | [NoConfigurationException](../exception/noconfigurationexception "Symfony\Component\Routing\Exception\NoConfigurationException") | If no routing configuration could be found | | [ResourceNotFoundException](../exception/resourcenotfoundexception "Symfony\Component\Routing\Exception\ResourceNotFoundException") | If the resource could not be found | | [MethodNotAllowedException](../exception/methodnotallowedexception "Symfony\Component\Routing\Exception\MethodNotAllowedException") | If the resource was found but the request method is not allowed | ### protected array getAttributes([Route](../route "Symfony\Component\Routing\Route") $route, string $name, array $attributes) Returns an array of values to use as request attributes. As this method requires the Route object, it is not available in matchers that do not have access to the matched Route instance (like the PHP and Apache matcher dumpers). #### Parameters | | | | | --- | --- | --- | | [Route](../route "Symfony\Component\Routing\Route") | $route | The route we are matching against | | string | $name | The name of the route | | array | $attributes | An array of attributes from the matcher | #### Return Value | | | | --- | --- | | array | An array of parameters | ### protected array handleRouteRequirements(string $pathinfo, string $name, [Route](../route "Symfony\Component\Routing\Route") $route) Handles specific route requirements. #### Parameters | | | | | --- | --- | --- | | string | $pathinfo | The path | | string | $name | The route name | | [Route](../route "Symfony\Component\Routing\Route") | $route | The route | #### Return Value | | | | --- | --- | | array | The first element represents the status, the second contains additional information | ### protected array mergeDefaults(array $params, array $defaults) Get merged default parameters. #### Parameters | | | | | --- | --- | --- | | array | $params | The parameters | | array | $defaults | The defaults | #### Return Value | | | | --- | --- | | array | Merged default parameters | ### protected getExpressionLanguage() ### protected createRequest($pathinfo) #### Parameters | | | | | --- | --- | --- | | | $pathinfo | | ### getTraces($pathinfo) #### Parameters | | | | | --- | --- | --- | | | $pathinfo | | ### getTracesForRequest([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | |
programming_docs
symfony UrlMatcherInterface UrlMatcherInterface ==================== interface **UrlMatcherInterface** implements [RequestContextAwareInterface](../requestcontextawareinterface "Symfony\Component\Routing\RequestContextAwareInterface") UrlMatcherInterface is the interface that all URL matcher classes must implement. Methods ------- | | | | | --- | --- | --- | | | [setContext](#method_setContext)([RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. | from [RequestContextAwareInterface](../requestcontextawareinterface#method_setContext "Symfony\Component\Routing\RequestContextAwareInterface") | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | [getContext](#method_getContext)() Gets the request context. | from [RequestContextAwareInterface](../requestcontextawareinterface#method_getContext "Symfony\Component\Routing\RequestContextAwareInterface") | | array | [match](#method_match)(string $pathinfo) Tries to match a URL path with a set of routes. | | Details ------- ### setContext([RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. #### Parameters | | | | | --- | --- | --- | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | $context | | ### [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") getContext() Gets the request context. #### Return Value | | | | --- | --- | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | The context | ### array match(string $pathinfo) Tries to match a URL path with a set of routes. If the matcher can not find information, it must throw one of the exceptions documented below. #### Parameters | | | | | --- | --- | --- | | string | $pathinfo | The path info to be parsed (raw format, i.e. not urldecoded) | #### Return Value | | | | --- | --- | | array | An array of parameters | #### Exceptions | | | | --- | --- | | [NoConfigurationException](../exception/noconfigurationexception "Symfony\Component\Routing\Exception\NoConfigurationException") | If no routing configuration could be found | | [ResourceNotFoundException](../exception/resourcenotfoundexception "Symfony\Component\Routing\Exception\ResourceNotFoundException") | If the resource could not be found | | [MethodNotAllowedException](../exception/methodnotallowedexception "Symfony\Component\Routing\Exception\MethodNotAllowedException") | If the resource was found but the request method is not allowed | symfony RequestMatcherInterface RequestMatcherInterface ======================== interface **RequestMatcherInterface** RequestMatcherInterface is the interface that all request matcher classes must implement. Methods ------- | | | | | --- | --- | --- | | array | [matchRequest](#method_matchRequest)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Tries to match a request with a set of routes. | | Details ------- ### array matchRequest([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Tries to match a request with a set of routes. If the matcher can not find information, it must throw one of the exceptions documented below. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | array | An array of parameters | #### Exceptions | | | | --- | --- | | [NoConfigurationException](../exception/noconfigurationexception "Symfony\Component\Routing\Exception\NoConfigurationException") | If no routing configuration could be found | | [ResourceNotFoundException](../exception/resourcenotfoundexception "Symfony\Component\Routing\Exception\ResourceNotFoundException") | If no matching resource could be found | | [MethodNotAllowedException](../exception/methodnotallowedexception "Symfony\Component\Routing\Exception\MethodNotAllowedException") | If a matching resource was found but the request method is not allowed | symfony RedirectableUrlMatcher RedirectableUrlMatcher ======================= abstract class **RedirectableUrlMatcher** extends [UrlMatcher](urlmatcher "Symfony\Component\Routing\Matcher\UrlMatcher") implements [RedirectableUrlMatcherInterface](redirectableurlmatcherinterface "Symfony\Component\Routing\Matcher\RedirectableUrlMatcherInterface") Constants --------- | | | | --- | --- | | REQUIREMENT\_MATCH | | | REQUIREMENT\_MISMATCH | | | ROUTE\_MATCH | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $context | | from [UrlMatcher](urlmatcher#property_context "Symfony\Component\Routing\Matcher\UrlMatcher") | | protected | $allow | Collects HTTP methods that would be allowed for the request. | from [UrlMatcher](urlmatcher#property_allow "Symfony\Component\Routing\Matcher\UrlMatcher") | | protected | $allowSchemes | Collects URI schemes that would be allowed for the request. | from [UrlMatcher](urlmatcher#property_allowSchemes "Symfony\Component\Routing\Matcher\UrlMatcher") | | protected | $routes | | from [UrlMatcher](urlmatcher#property_routes "Symfony\Component\Routing\Matcher\UrlMatcher") | | protected | $request | | from [UrlMatcher](urlmatcher#property_request "Symfony\Component\Routing\Matcher\UrlMatcher") | | protected | $expressionLanguage | | from [UrlMatcher](urlmatcher#property_expressionLanguage "Symfony\Component\Routing\Matcher\UrlMatcher") | | protected [ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface")[] | $expressionLanguageProviders | | from [UrlMatcher](urlmatcher#property_expressionLanguageProviders "Symfony\Component\Routing\Matcher\UrlMatcher") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $routes, [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) | from [UrlMatcher](urlmatcher#method___construct "Symfony\Component\Routing\Matcher\UrlMatcher") | | | [setContext](#method_setContext)([RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. | from [UrlMatcher](urlmatcher#method_setContext "Symfony\Component\Routing\Matcher\UrlMatcher") | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | [getContext](#method_getContext)() Gets the request context. | from [UrlMatcher](urlmatcher#method_getContext "Symfony\Component\Routing\Matcher\UrlMatcher") | | array | [match](#method_match)(string $pathinfo) Tries to match a URL path with a set of routes. | | | array | [matchRequest](#method_matchRequest)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Tries to match a request with a set of routes. | from [UrlMatcher](urlmatcher#method_matchRequest "Symfony\Component\Routing\Matcher\UrlMatcher") | | | [addExpressionLanguageProvider](#method_addExpressionLanguageProvider)([ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) | from [UrlMatcher](urlmatcher#method_addExpressionLanguageProvider "Symfony\Component\Routing\Matcher\UrlMatcher") | | array | [matchCollection](#method_matchCollection)(string $pathinfo, [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $routes) Tries to match a URL with a set of routes. | from [UrlMatcher](urlmatcher#method_matchCollection "Symfony\Component\Routing\Matcher\UrlMatcher") | | array | [getAttributes](#method_getAttributes)([Route](../route "Symfony\Component\Routing\Route") $route, string $name, array $attributes) Returns an array of values to use as request attributes. | from [UrlMatcher](urlmatcher#method_getAttributes "Symfony\Component\Routing\Matcher\UrlMatcher") | | array | [handleRouteRequirements](#method_handleRouteRequirements)(string $pathinfo, string $name, [Route](../route "Symfony\Component\Routing\Route") $route) Handles specific route requirements. | from [UrlMatcher](urlmatcher#method_handleRouteRequirements "Symfony\Component\Routing\Matcher\UrlMatcher") | | array | [mergeDefaults](#method_mergeDefaults)(array $params, array $defaults) Get merged default parameters. | from [UrlMatcher](urlmatcher#method_mergeDefaults "Symfony\Component\Routing\Matcher\UrlMatcher") | | | [getExpressionLanguage](#method_getExpressionLanguage)() | from [UrlMatcher](urlmatcher#method_getExpressionLanguage "Symfony\Component\Routing\Matcher\UrlMatcher") | | | [createRequest](#method_createRequest)($pathinfo) | from [UrlMatcher](urlmatcher#method_createRequest "Symfony\Component\Routing\Matcher\UrlMatcher") | Details ------- ### \_\_construct([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $routes, [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") | $routes | | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | $context | | ### setContext([RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. #### Parameters | | | | | --- | --- | --- | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | $context | | ### [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") getContext() Gets the request context. #### Return Value | | | | --- | --- | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | The context | ### array match(string $pathinfo) Tries to match a URL path with a set of routes. If the matcher can not find information, it must throw one of the exceptions documented below. #### Parameters | | | | | --- | --- | --- | | string | $pathinfo | The path info to be parsed (raw format, i.e. not urldecoded) | #### Return Value | | | | --- | --- | | array | An array of parameters | #### Exceptions | | | | --- | --- | | [NoConfigurationException](../exception/noconfigurationexception "Symfony\Component\Routing\Exception\NoConfigurationException") | If no routing configuration could be found | | [ResourceNotFoundException](../exception/resourcenotfoundexception "Symfony\Component\Routing\Exception\ResourceNotFoundException") | If the resource could not be found | | [MethodNotAllowedException](../exception/methodnotallowedexception "Symfony\Component\Routing\Exception\MethodNotAllowedException") | If the resource was found but the request method is not allowed | ### array matchRequest([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Tries to match a request with a set of routes. If the matcher can not find information, it must throw one of the exceptions documented below. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | array | An array of parameters | #### Exceptions | | | | --- | --- | | [NoConfigurationException](../exception/noconfigurationexception "Symfony\Component\Routing\Exception\NoConfigurationException") | If no routing configuration could be found | | [ResourceNotFoundException](../exception/resourcenotfoundexception "Symfony\Component\Routing\Exception\ResourceNotFoundException") | If no matching resource could be found | | [MethodNotAllowedException](../exception/methodnotallowedexception "Symfony\Component\Routing\Exception\MethodNotAllowedException") | If a matching resource was found but the request method is not allowed | ### addExpressionLanguageProvider([ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) #### Parameters | | | | | --- | --- | --- | | [ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") | $provider | | ### protected array matchCollection(string $pathinfo, [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $routes) Tries to match a URL with a set of routes. #### Parameters | | | | | --- | --- | --- | | string | $pathinfo | The path info to be parsed | | [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") | $routes | The set of routes | #### Return Value | | | | --- | --- | | array | An array of parameters | #### Exceptions | | | | --- | --- | | [NoConfigurationException](../exception/noconfigurationexception "Symfony\Component\Routing\Exception\NoConfigurationException") | If no routing configuration could be found | | [ResourceNotFoundException](../exception/resourcenotfoundexception "Symfony\Component\Routing\Exception\ResourceNotFoundException") | If the resource could not be found | | [MethodNotAllowedException](../exception/methodnotallowedexception "Symfony\Component\Routing\Exception\MethodNotAllowedException") | If the resource was found but the request method is not allowed | ### protected array getAttributes([Route](../route "Symfony\Component\Routing\Route") $route, string $name, array $attributes) Returns an array of values to use as request attributes. As this method requires the Route object, it is not available in matchers that do not have access to the matched Route instance (like the PHP and Apache matcher dumpers). #### Parameters | | | | | --- | --- | --- | | [Route](../route "Symfony\Component\Routing\Route") | $route | The route we are matching against | | string | $name | The name of the route | | array | $attributes | An array of attributes from the matcher | #### Return Value | | | | --- | --- | | array | An array of parameters | ### protected array handleRouteRequirements(string $pathinfo, string $name, [Route](../route "Symfony\Component\Routing\Route") $route) Handles specific route requirements. #### Parameters | | | | | --- | --- | --- | | string | $pathinfo | The path | | string | $name | The route name | | [Route](../route "Symfony\Component\Routing\Route") | $route | The route | #### Return Value | | | | --- | --- | | array | The first element represents the status, the second contains additional information | ### protected array mergeDefaults(array $params, array $defaults) Get merged default parameters. #### Parameters | | | | | --- | --- | --- | | array | $params | The parameters | | array | $defaults | The defaults | #### Return Value | | | | --- | --- | | array | Merged default parameters | ### protected getExpressionLanguage() ### protected createRequest($pathinfo) #### Parameters | | | | | --- | --- | --- | | | $pathinfo | | symfony Symfony\Component\Routing\Matcher\Dumper Symfony\Component\Routing\Matcher\Dumper ======================================== Classes ------- | | | | --- | --- | | [MatcherDumper](dumper/matcherdumper "Symfony\Component\Routing\Matcher\Dumper\MatcherDumper") | MatcherDumper is the abstract class for all built-in matcher dumpers. | | [PhpMatcherDumper](dumper/phpmatcherdumper "Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper") | PhpMatcherDumper creates a PHP class able to match URLs for a given set of routes. | | [StaticPrefixCollection](dumper/staticprefixcollection "Symfony\Component\Routing\Matcher\Dumper\StaticPrefixCollection") | Prefix tree of routes preserving routes order. | Interfaces ---------- | | | | --- | --- | | *[MatcherDumperInterface](dumper/matcherdumperinterface "Symfony\Component\Routing\Matcher\Dumper\MatcherDumperInterface")* | MatcherDumperInterface is the interface that all matcher dumper classes must implement. | symfony RedirectableUrlMatcherInterface RedirectableUrlMatcherInterface ================================ interface **RedirectableUrlMatcherInterface** RedirectableUrlMatcherInterface knows how to redirect the user. Methods ------- | | | | | --- | --- | --- | | array | [redirect](#method_redirect)(string $path, string $route, string|null $scheme = null) Redirects the user to another URL. | | Details ------- ### array redirect(string $path, string $route, string|null $scheme = null) Redirects the user to another URL. #### Parameters | | | | | --- | --- | --- | | string | $path | The path info to redirect to | | string | $route | The route name that matched | | string|null | $scheme | The URL scheme (null to keep the current one) | #### Return Value | | | | --- | --- | | array | An array of parameters | symfony UrlMatcher UrlMatcher =========== class **UrlMatcher** implements [UrlMatcherInterface](urlmatcherinterface "Symfony\Component\Routing\Matcher\UrlMatcherInterface"), [RequestMatcherInterface](requestmatcherinterface "Symfony\Component\Routing\Matcher\RequestMatcherInterface") UrlMatcher matches URL based on a set of routes. Constants --------- | | | | --- | --- | | REQUIREMENT\_MATCH | | | REQUIREMENT\_MISMATCH | | | ROUTE\_MATCH | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $context | | | | protected | $allow | Collects HTTP methods that would be allowed for the request. | | | protected | $allowSchemes | Collects URI schemes that would be allowed for the request. | | | protected | $routes | | | | protected | $request | | | | protected | $expressionLanguage | | | | protected [ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface")[] | $expressionLanguageProviders | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $routes, [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) | | | | [setContext](#method_setContext)([RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. | | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | [getContext](#method_getContext)() Gets the request context. | | | array | [match](#method_match)(string $pathinfo) Tries to match a URL path with a set of routes. | | | array | [matchRequest](#method_matchRequest)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Tries to match a request with a set of routes. | | | | [addExpressionLanguageProvider](#method_addExpressionLanguageProvider)([ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) | | | array | [matchCollection](#method_matchCollection)(string $pathinfo, [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $routes) Tries to match a URL with a set of routes. | | | array | [getAttributes](#method_getAttributes)([Route](../route "Symfony\Component\Routing\Route") $route, string $name, array $attributes) Returns an array of values to use as request attributes. | | | array | [handleRouteRequirements](#method_handleRouteRequirements)(string $pathinfo, string $name, [Route](../route "Symfony\Component\Routing\Route") $route) Handles specific route requirements. | | | array | [mergeDefaults](#method_mergeDefaults)(array $params, array $defaults) Get merged default parameters. | | | | [getExpressionLanguage](#method_getExpressionLanguage)() | | | | [createRequest](#method_createRequest)($pathinfo) | | Details ------- ### \_\_construct([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $routes, [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") | $routes | | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | $context | | ### setContext([RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. #### Parameters | | | | | --- | --- | --- | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | $context | | ### [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") getContext() Gets the request context. #### Return Value | | | | --- | --- | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | The context | ### array match(string $pathinfo) Tries to match a URL path with a set of routes. If the matcher can not find information, it must throw one of the exceptions documented below. #### Parameters | | | | | --- | --- | --- | | string | $pathinfo | The path info to be parsed (raw format, i.e. not urldecoded) | #### Return Value | | | | --- | --- | | array | An array of parameters | #### Exceptions | | | | --- | --- | | [NoConfigurationException](../exception/noconfigurationexception "Symfony\Component\Routing\Exception\NoConfigurationException") | If no routing configuration could be found | | [ResourceNotFoundException](../exception/resourcenotfoundexception "Symfony\Component\Routing\Exception\ResourceNotFoundException") | If the resource could not be found | | [MethodNotAllowedException](../exception/methodnotallowedexception "Symfony\Component\Routing\Exception\MethodNotAllowedException") | If the resource was found but the request method is not allowed | ### array matchRequest([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Tries to match a request with a set of routes. If the matcher can not find information, it must throw one of the exceptions documented below. #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | array | An array of parameters | #### Exceptions | | | | --- | --- | | [NoConfigurationException](../exception/noconfigurationexception "Symfony\Component\Routing\Exception\NoConfigurationException") | If no routing configuration could be found | | [ResourceNotFoundException](../exception/resourcenotfoundexception "Symfony\Component\Routing\Exception\ResourceNotFoundException") | If no matching resource could be found | | [MethodNotAllowedException](../exception/methodnotallowedexception "Symfony\Component\Routing\Exception\MethodNotAllowedException") | If a matching resource was found but the request method is not allowed | ### addExpressionLanguageProvider([ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) #### Parameters | | | | | --- | --- | --- | | [ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") | $provider | | ### protected array matchCollection(string $pathinfo, [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $routes) Tries to match a URL with a set of routes. #### Parameters | | | | | --- | --- | --- | | string | $pathinfo | The path info to be parsed | | [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") | $routes | The set of routes | #### Return Value | | | | --- | --- | | array | An array of parameters | #### Exceptions | | | | --- | --- | | [NoConfigurationException](../exception/noconfigurationexception "Symfony\Component\Routing\Exception\NoConfigurationException") | If no routing configuration could be found | | [ResourceNotFoundException](../exception/resourcenotfoundexception "Symfony\Component\Routing\Exception\ResourceNotFoundException") | If the resource could not be found | | [MethodNotAllowedException](../exception/methodnotallowedexception "Symfony\Component\Routing\Exception\MethodNotAllowedException") | If the resource was found but the request method is not allowed | ### protected array getAttributes([Route](../route "Symfony\Component\Routing\Route") $route, string $name, array $attributes) Returns an array of values to use as request attributes. As this method requires the Route object, it is not available in matchers that do not have access to the matched Route instance (like the PHP and Apache matcher dumpers). #### Parameters | | | | | --- | --- | --- | | [Route](../route "Symfony\Component\Routing\Route") | $route | The route we are matching against | | string | $name | The name of the route | | array | $attributes | An array of attributes from the matcher | #### Return Value | | | | --- | --- | | array | An array of parameters | ### protected array handleRouteRequirements(string $pathinfo, string $name, [Route](../route "Symfony\Component\Routing\Route") $route) Handles specific route requirements. #### Parameters | | | | | --- | --- | --- | | string | $pathinfo | The path | | string | $name | The route name | | [Route](../route "Symfony\Component\Routing\Route") | $route | The route | #### Return Value | | | | --- | --- | | array | The first element represents the status, the second contains additional information | ### protected array mergeDefaults(array $params, array $defaults) Get merged default parameters. #### Parameters | | | | | --- | --- | --- | | array | $params | The parameters | | array | $defaults | The defaults | #### Return Value | | | | --- | --- | | array | Merged default parameters | ### protected getExpressionLanguage() ### protected createRequest($pathinfo) #### Parameters | | | | | --- | --- | --- | | | $pathinfo | |
programming_docs
symfony MatcherDumper MatcherDumper ============== abstract class **MatcherDumper** implements [MatcherDumperInterface](matcherdumperinterface "Symfony\Component\Routing\Matcher\Dumper\MatcherDumperInterface") MatcherDumper is the abstract class for all built-in matcher dumpers. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $routes) | | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | [getRoutes](#method_getRoutes)() Gets the routes to dump. | | Details ------- ### \_\_construct([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $routes) #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | $routes | | ### [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") getRoutes() Gets the routes to dump. #### Return Value | | | | --- | --- | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | A RouteCollection instance | symfony MatcherDumperInterface MatcherDumperInterface ======================= interface **MatcherDumperInterface** MatcherDumperInterface is the interface that all matcher dumper classes must implement. Methods ------- | | | | | --- | --- | --- | | string | [dump](#method_dump)(array $options = array()) Dumps a set of routes to a string representation of executable code that can then be used to match a request against these routes. | | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | [getRoutes](#method_getRoutes)() Gets the routes to dump. | | Details ------- ### string dump(array $options = array()) Dumps a set of routes to a string representation of executable code that can then be used to match a request against these routes. #### Parameters | | | | | --- | --- | --- | | array | $options | An array of options | #### Return Value | | | | --- | --- | | string | Executable code | ### [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") getRoutes() Gets the routes to dump. #### Return Value | | | | --- | --- | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | A RouteCollection instance | symfony PhpMatcherDumper PhpMatcherDumper ================= class **PhpMatcherDumper** extends [MatcherDumper](matcherdumper "Symfony\Component\Routing\Matcher\Dumper\MatcherDumper") PhpMatcherDumper creates a PHP class able to match URLs for a given set of routes. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $routes) | from [MatcherDumper](matcherdumper#method___construct "Symfony\Component\Routing\Matcher\Dumper\MatcherDumper") | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | [getRoutes](#method_getRoutes)() Gets the routes to dump. | from [MatcherDumper](matcherdumper#method_getRoutes "Symfony\Component\Routing\Matcher\Dumper\MatcherDumper") | | string | [dump](#method_dump)(array $options = array()) Dumps a set of routes to a PHP class. | | | | [addExpressionLanguageProvider](#method_addExpressionLanguageProvider)([ExpressionFunctionProviderInterface](../../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) | | | static string | [export](#method_export)($value) | | Details ------- ### \_\_construct([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $routes) #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | $routes | | ### [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") getRoutes() Gets the routes to dump. #### Return Value | | | | --- | --- | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | A RouteCollection instance | ### string dump(array $options = array()) Dumps a set of routes to a PHP class. Available options: * class: The class name * base\_class: The base class name #### Parameters | | | | | --- | --- | --- | | array | $options | An array of options | #### Return Value | | | | --- | --- | | string | Executable code | ### addExpressionLanguageProvider([ExpressionFunctionProviderInterface](../../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) #### Parameters | | | | | --- | --- | --- | | [ExpressionFunctionProviderInterface](../../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") | $provider | | ### static string export($value) #### Parameters | | | | | --- | --- | --- | | | $value | | #### Return Value | | | | --- | --- | | string | | symfony StaticPrefixCollection StaticPrefixCollection ======================= class **StaticPrefixCollection** Prefix tree of routes preserving routes order. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $prefix = '/') | | | string | [getPrefix](#method_getPrefix)() | | | array | [getRoutes](#method_getRoutes)() | | | | [addRoute](#method_addRoute)(string $prefix, $route) Adds a route to a group. | | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | [populateCollection](#method_populateCollection)([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $routes) Linearizes back a set of nested routes into a collection. | | | static | [handleError](#method_handleError)($type, $msg) | | Details ------- ### \_\_construct(string $prefix = '/') #### Parameters | | | | | --- | --- | --- | | string | $prefix | | ### string getPrefix() #### Return Value | | | | --- | --- | | string | | ### array getRoutes() #### Return Value | | | | --- | --- | | array | | ### addRoute(string $prefix, $route) Adds a route to a group. #### Parameters | | | | | --- | --- | --- | | string | $prefix | | | | $route | | ### [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") populateCollection([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $routes) Linearizes back a set of nested routes into a collection. #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | $routes | | #### Return Value | | | | --- | --- | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | | ### static handleError($type, $msg) #### Parameters | | | | | --- | --- | --- | | | $type | | | | $msg | | symfony UrlGeneratorInterface UrlGeneratorInterface ====================== interface **UrlGeneratorInterface** implements [RequestContextAwareInterface](../requestcontextawareinterface "Symfony\Component\Routing\RequestContextAwareInterface") UrlGeneratorInterface is the interface that all URL generator classes must implement. The constants in this interface define the different types of resource references that are declared in RFC 3986: http://tools.ietf.org/html/rfc3986 We are using the term "URL" instead of "URI" as this is more common in web applications and we do not need to distinguish them as the difference is mostly semantical and less technical. Generating URIs, i.e. representation-independent resource identifiers, is also possible. Constants --------- | | | | --- | --- | | ABSOLUTE\_URL | *Generates an absolute URL, e.g. "http://example.com/dir/file".* | | ABSOLUTE\_PATH | *Generates an absolute path, e.g. "/dir/file".* | | RELATIVE\_PATH | *Generates a relative path based on the current request path, e.g. ".* ./parent-file". | | NETWORK\_PATH | *Generates a network path, e.g. "//example.com/dir/file".* Such reference reuses the current scheme but specifies the host. | Methods ------- | | | | | --- | --- | --- | | | [setContext](#method_setContext)([RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. | from [RequestContextAwareInterface](../requestcontextawareinterface#method_setContext "Symfony\Component\Routing\RequestContextAwareInterface") | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | [getContext](#method_getContext)() Gets the request context. | from [RequestContextAwareInterface](../requestcontextawareinterface#method_getContext "Symfony\Component\Routing\RequestContextAwareInterface") | | string | [generate](#method_generate)(string $name, mixed $parameters = array(), int $referenceType = self::ABSOLUTE\_PATH) Generates a URL or path for a specific route based on the given parameters. | | Details ------- ### setContext([RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. #### Parameters | | | | | --- | --- | --- | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | $context | | ### [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") getContext() Gets the request context. #### Return Value | | | | --- | --- | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | The context | ### string generate(string $name, mixed $parameters = array(), int $referenceType = self::ABSOLUTE\_PATH) Generates a URL or path for a specific route based on the given parameters. Parameters that reference placeholders in the route pattern will substitute them in the path or host. Extra params are added as query string to the URL. When the passed reference type cannot be generated for the route because it requires a different host or scheme than the current one, the method will return a more comprehensive reference that includes the required params. For example, when you call this method with $referenceType = ABSOLUTE\_PATH but the route requires the https scheme whereas the current scheme is http, it will instead return an ABSOLUTE\_URL with the https scheme and the current host. This makes sure the generated URL matches the route in any case. If there is no route with the given name, the generator must throw the RouteNotFoundException. The special parameter \_fragment will be used as the document fragment suffixed to the final URL. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the route | | mixed | $parameters | An array of parameters | | int | $referenceType | The type of reference to be generated (one of the constants) | #### Return Value | | | | --- | --- | | string | The generated URL | #### Exceptions | | | | --- | --- | | [RouteNotFoundException](../exception/routenotfoundexception "Symfony\Component\Routing\Exception\RouteNotFoundException") | If the named route doesn't exist | | [MissingMandatoryParametersException](../exception/missingmandatoryparametersexception "Symfony\Component\Routing\Exception\MissingMandatoryParametersException") | When some parameters are missing that are mandatory for the route | | [InvalidParameterException](../exception/invalidparameterexception "Symfony\Component\Routing\Exception\InvalidParameterException") | When a parameter value for a placeholder is not correct because it does not match the requirement | symfony UrlGenerator UrlGenerator ============= class **UrlGenerator** implements [UrlGeneratorInterface](urlgeneratorinterface "Symfony\Component\Routing\Generator\UrlGeneratorInterface"), [ConfigurableRequirementsInterface](configurablerequirementsinterface "Symfony\Component\Routing\Generator\ConfigurableRequirementsInterface") UrlGenerator can generate a URL or a path for any route in the RouteCollection based on the passed parameters. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $routes | | | | protected | $context | | | | protected bool|null | $strictRequirements | | | | protected | $logger | | | | protected | $decodedChars | This array defines the characters (besides alphanumeric ones) that will not be percent-encoded in the path segment of the generated URL. | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $routes, [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context, LoggerInterface $logger = null, string $defaultLocale = null) | | | | [setContext](#method_setContext)([RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. | | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | [getContext](#method_getContext)() Gets the request context. | | | | [setStrictRequirements](#method_setStrictRequirements)(bool|null $enabled) Enables or disables the exception on incorrect parameters. | | | bool|null | [isStrictRequirements](#method_isStrictRequirements)() Returns whether to throw an exception on incorrect parameters. | | | string | [generate](#method_generate)(string $name, mixed $parameters = array(), int $referenceType = self::ABSOLUTE\_PATH) Generates a URL or path for a specific route based on the given parameters. | | | | [doGenerate](#method_doGenerate)($variables, $defaults, $requirements, $tokens, $parameters, $name, $referenceType, $hostTokens, array $requiredSchemes = array()) | | | static string | [getRelativePath](#method_getRelativePath)(string $basePath, string $targetPath) Returns the target path as relative reference from the base path. | | Details ------- ### \_\_construct([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $routes, [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context, LoggerInterface $logger = null, string $defaultLocale = null) #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") | $routes | | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | $context | | | LoggerInterface | $logger | | | string | $defaultLocale | | ### setContext([RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") $context) Sets the request context. #### Parameters | | | | | --- | --- | --- | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | $context | | ### [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") getContext() Gets the request context. #### Return Value | | | | --- | --- | | [RequestContext](../requestcontext "Symfony\Component\Routing\RequestContext") | The context | ### setStrictRequirements(bool|null $enabled) Enables or disables the exception on incorrect parameters. Passing null will deactivate the requirements check completely. #### Parameters | | | | | --- | --- | --- | | bool|null | $enabled | | ### bool|null isStrictRequirements() Returns whether to throw an exception on incorrect parameters. Null means the requirements check is deactivated completely. #### Return Value | | | | --- | --- | | bool|null | | ### string generate(string $name, mixed $parameters = array(), int $referenceType = self::ABSOLUTE\_PATH) Generates a URL or path for a specific route based on the given parameters. Parameters that reference placeholders in the route pattern will substitute them in the path or host. Extra params are added as query string to the URL. When the passed reference type cannot be generated for the route because it requires a different host or scheme than the current one, the method will return a more comprehensive reference that includes the required params. For example, when you call this method with $referenceType = ABSOLUTE\_PATH but the route requires the https scheme whereas the current scheme is http, it will instead return an ABSOLUTE\_URL with the https scheme and the current host. This makes sure the generated URL matches the route in any case. If there is no route with the given name, the generator must throw the RouteNotFoundException. The special parameter \_fragment will be used as the document fragment suffixed to the final URL. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the route | | mixed | $parameters | An array of parameters | | int | $referenceType | The type of reference to be generated (one of the constants) | #### Return Value | | | | --- | --- | | string | The generated URL | #### Exceptions | | | | --- | --- | | [RouteNotFoundException](../exception/routenotfoundexception "Symfony\Component\Routing\Exception\RouteNotFoundException") | If the named route doesn't exist | | [MissingMandatoryParametersException](../exception/missingmandatoryparametersexception "Symfony\Component\Routing\Exception\MissingMandatoryParametersException") | When some parameters are missing that are mandatory for the route | | [InvalidParameterException](../exception/invalidparameterexception "Symfony\Component\Routing\Exception\InvalidParameterException") | When a parameter value for a placeholder is not correct because it does not match the requirement | ### protected doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $referenceType, $hostTokens, array $requiredSchemes = array()) #### Parameters | | | | | --- | --- | --- | | | $variables | | | | $defaults | | | | $requirements | | | | $tokens | | | | $parameters | | | | $name | | | | $referenceType | | | | $hostTokens | | | array | $requiredSchemes | | #### Exceptions | | | | --- | --- | | [MissingMandatoryParametersException](../exception/missingmandatoryparametersexception "Symfony\Component\Routing\Exception\MissingMandatoryParametersException") | When some parameters are missing that are mandatory for the route | | [InvalidParameterException](../exception/invalidparameterexception "Symfony\Component\Routing\Exception\InvalidParameterException") | When a parameter value for a placeholder is not correct because it does not match the requirement | ### static string getRelativePath(string $basePath, string $targetPath) Returns the target path as relative reference from the base path. Only the URIs path component (no schema, host etc.) is relevant and must be given, starting with a slash. Both paths must be absolute and not contain relative parts. Relative URLs from one resource to another are useful when generating self-contained downloadable document archives. Furthermore, they can be used to reduce the link size in documents. Example target paths, given a base path of "/a/b/c/d": - "/a/b/c/d" -> "" - "/a/b/c/" -> "./" - "/a/b/" -> "../" - "/a/b/c/other" -> "other" - "/a/x/y" -> "../../x/y" #### Parameters | | | | | --- | --- | --- | | string | $basePath | The base path | | string | $targetPath | The target path | #### Return Value | | | | --- | --- | | string | The relative target path | symfony Symfony\Component\Routing\Generator\Dumper Symfony\Component\Routing\Generator\Dumper ========================================== Classes ------- | | | | --- | --- | | [GeneratorDumper](dumper/generatordumper "Symfony\Component\Routing\Generator\Dumper\GeneratorDumper") | GeneratorDumper is the base class for all built-in generator dumpers. | | [PhpGeneratorDumper](dumper/phpgeneratordumper "Symfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper") | PhpGeneratorDumper creates a PHP class able to generate URLs for a given set of routes. | Interfaces ---------- | | | | --- | --- | | *[GeneratorDumperInterface](dumper/generatordumperinterface "Symfony\Component\Routing\Generator\Dumper\GeneratorDumperInterface")* | GeneratorDumperInterface is the interface that all generator dumper classes must implement. |
programming_docs
symfony ConfigurableRequirementsInterface ConfigurableRequirementsInterface ================================== interface **ConfigurableRequirementsInterface** ConfigurableRequirementsInterface must be implemented by URL generators that can be configured whether an exception should be generated when the parameters do not match the requirements. It is also possible to disable the requirements check for URL generation completely. The possible configurations and use-cases: - setStrictRequirements(true): Throw an exception for mismatching requirements. This is mostly useful in development environment. - setStrictRequirements(false): Don't throw an exception but return null as URL for mismatching requirements and log the problem. Useful when you cannot control all params because they come from third party libs but don't want to have a 404 in production environment. It should log the mismatch so one can review it. - setStrictRequirements(null): Return the URL with the given parameters without checking the requirements at all. When generating a URL you should either trust your params or you validated them beforehand because otherwise it would break your link anyway. So in production environment you should know that params always pass the requirements. Thus this option allows to disable the check on URL generation for performance reasons (saving a preg\_match for each requirement every time a URL is generated). Methods ------- | | | | | --- | --- | --- | | | [setStrictRequirements](#method_setStrictRequirements)(bool|null $enabled) Enables or disables the exception on incorrect parameters. | | | bool|null | [isStrictRequirements](#method_isStrictRequirements)() Returns whether to throw an exception on incorrect parameters. | | Details ------- ### setStrictRequirements(bool|null $enabled) Enables or disables the exception on incorrect parameters. Passing null will deactivate the requirements check completely. #### Parameters | | | | | --- | --- | --- | | bool|null | $enabled | | ### bool|null isStrictRequirements() Returns whether to throw an exception on incorrect parameters. Null means the requirements check is deactivated completely. #### Return Value | | | | --- | --- | | bool|null | | symfony PhpGeneratorDumper PhpGeneratorDumper =================== class **PhpGeneratorDumper** extends [GeneratorDumper](generatordumper "Symfony\Component\Routing\Generator\Dumper\GeneratorDumper") PhpGeneratorDumper creates a PHP class able to generate URLs for a given set of routes. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $routes) | from [GeneratorDumper](generatordumper#method___construct "Symfony\Component\Routing\Generator\Dumper\GeneratorDumper") | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | [getRoutes](#method_getRoutes)() Gets the routes to dump. | from [GeneratorDumper](generatordumper#method_getRoutes "Symfony\Component\Routing\Generator\Dumper\GeneratorDumper") | | string | [dump](#method_dump)(array $options = array()) Dumps a set of routes to a PHP class. | | Details ------- ### \_\_construct([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $routes) #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | $routes | | ### [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") getRoutes() Gets the routes to dump. #### Return Value | | | | --- | --- | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | A RouteCollection instance | ### string dump(array $options = array()) Dumps a set of routes to a PHP class. Available options: * class: The class name * base\_class: The base class name #### Parameters | | | | | --- | --- | --- | | array | $options | An array of options | #### Return Value | | | | --- | --- | | string | Executable code | symfony GeneratorDumper GeneratorDumper ================ abstract class **GeneratorDumper** implements [GeneratorDumperInterface](generatordumperinterface "Symfony\Component\Routing\Generator\Dumper\GeneratorDumperInterface") GeneratorDumper is the base class for all built-in generator dumpers. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $routes) | | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | [getRoutes](#method_getRoutes)() Gets the routes to dump. | | Details ------- ### \_\_construct([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $routes) #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | $routes | | ### [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") getRoutes() Gets the routes to dump. #### Return Value | | | | --- | --- | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | A RouteCollection instance | symfony GeneratorDumperInterface GeneratorDumperInterface ========================= interface **GeneratorDumperInterface** GeneratorDumperInterface is the interface that all generator dumper classes must implement. Methods ------- | | | | | --- | --- | --- | | string | [dump](#method_dump)(array $options = array()) Dumps a set of routes to a string representation of executable code that can then be used to generate a URL of such a route. | | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | [getRoutes](#method_getRoutes)() Gets the routes to dump. | | Details ------- ### string dump(array $options = array()) Dumps a set of routes to a string representation of executable code that can then be used to generate a URL of such a route. #### Parameters | | | | | --- | --- | --- | | array | $options | An array of options | #### Return Value | | | | --- | --- | | string | Executable code | ### [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") getRoutes() Gets the routes to dump. #### Return Value | | | | --- | --- | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | A RouteCollection instance | symfony PhpFileLoader PhpFileLoader ============== class **PhpFileLoader** extends [FileLoader](../../config/loader/fileloader "Symfony\Component\Config\Loader\FileLoader") PhpFileLoader loads routes from a PHP file. The file must return a RouteCollection instance. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](../../config/loader/fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](../../config/loader/fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](../../config/loader/fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) | from [FileLoader](../../config/loader/fileloader#method___construct "Symfony\Component\Config\Loader\FileLoader") | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](../../config/loader/fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](../../config/loader/fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](../../config/loader/fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [load](#method_load)(string $file, string|null $type = null) Loads a PHP file. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../../config/exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../../config/exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) #### Parameters | | | | | --- | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### load(string $file, string|null $type = null) Loads a PHP file. #### Parameters | | | | | --- | --- | --- | | string | $file | A PHP file path | | string|null | $type | The resource type or null if unknown | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | symfony ProtectedPhpFileLoader ProtectedPhpFileLoader ======================= class **ProtectedPhpFileLoader** extends [PhpFileLoader](phpfileloader "Symfony\Component\Routing\Loader\PhpFileLoader") Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](../../config/loader/fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](../../config/loader/fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](../../config/loader/fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) | from [FileLoader](../../config/loader/fileloader#method___construct "Symfony\Component\Config\Loader\FileLoader") | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](../../config/loader/fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](../../config/loader/fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](../../config/loader/fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [load](#method_load)(string $file, string|null $type = null) Loads a PHP file. | from [PhpFileLoader](phpfileloader#method_load "Symfony\Component\Routing\Loader\PhpFileLoader") | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | from [PhpFileLoader](phpfileloader#method_supports "Symfony\Component\Routing\Loader\PhpFileLoader") | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../../config/exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../../config/exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) #### Parameters | | | | | --- | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### load(string $file, string|null $type = null) Loads a PHP file. #### Parameters | | | | | --- | --- | --- | | string | $file | A PHP file path | | string|null | $type | The resource type or null if unknown | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise |
programming_docs
symfony AnnotationFileLoader AnnotationFileLoader ===================== class **AnnotationFileLoader** extends [FileLoader](../../config/loader/fileloader "Symfony\Component\Config\Loader\FileLoader") AnnotationFileLoader loads routing information from annotations set on a PHP class and its methods. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](../../config/loader/fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](../../config/loader/fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | | protected | $loader | | | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](../../config/loader/fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator, [AnnotationClassLoader](annotationclassloader "Symfony\Component\Routing\Loader\AnnotationClassLoader") $loader) | | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](../../config/loader/fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](../../config/loader/fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](../../config/loader/fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [load](#method_load)(string $file, string|null $type = null) Loads from annotations from a file. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | | string|false | [findClass](#method_findClass)(string $file) Returns the full class name for the first class in the file. | | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../../config/exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../../config/exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator, [AnnotationClassLoader](annotationclassloader "Symfony\Component\Routing\Loader\AnnotationClassLoader") $loader) #### Parameters | | | | | --- | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | | [AnnotationClassLoader](annotationclassloader "Symfony\Component\Routing\Loader\AnnotationClassLoader") | $loader | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### load(string $file, string|null $type = null) Loads from annotations from a file. #### Parameters | | | | | --- | --- | --- | | string | $file | A PHP file path | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When the file does not exist or its routes cannot be parsed | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | ### protected string|false findClass(string $file) Returns the full class name for the first class in the file. #### Parameters | | | | | --- | --- | --- | | string | $file | A PHP file path | #### Return Value | | | | --- | --- | | string|false | Full class name if found, false otherwise | symfony DirectoryLoader DirectoryLoader ================ class **DirectoryLoader** extends [FileLoader](../../config/loader/fileloader "Symfony\Component\Config\Loader\FileLoader") Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](../../config/loader/fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](../../config/loader/fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](../../config/loader/fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) | from [FileLoader](../../config/loader/fileloader#method___construct "Symfony\Component\Config\Loader\FileLoader") | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](../../config/loader/fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](../../config/loader/fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](../../config/loader/fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [load](#method_load)($file, string|null $type = null) Loads a resource. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../../config/exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../../config/exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) #### Parameters | | | | | --- | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### load($file, string|null $type = null) Loads a resource. #### Parameters | | | | | --- | --- | --- | | | $file | | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | If something went wrong | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | symfony AnnotationClassLoader AnnotationClassLoader ====================== abstract class **AnnotationClassLoader** implements [LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") AnnotationClassLoader loads routing information from a PHP class and its methods. You need to define an implementation for the getRouteDefaults() method. Most of the time, this method should define some PHP callable to be called for the route (a controller in MVC speak). The @Route annotation can be set on the class (for global parameters), and on each method. The @Route annotation main value is the route path. The annotation also recognizes several parameters: requirements, options, defaults, schemes, methods, host, and name. The name parameter is mandatory. Here is an example of how you should be able to use it: ``` /** * @Route("/Blog") * / class Blog { /** * @Route("/", name="blog_index") * / public function index() { } /** * @Route("/{id}", name="blog_post", requirements = {"id" = "\d+"}) * / public function show() { } } ``` Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $reader | | | | protected string | $routeAnnotationClass | | | | protected int | $defaultRouteIndex | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(Reader $reader) | | | | [setRouteAnnotationClass](#method_setRouteAnnotationClass)(string $class) Sets the annotation class to read route properties from. | | | | [load](#method_load)(string $class, string|null $type = null) Loads from annotations from a class. | | | | [addRoute](#method_addRoute)([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $collection, $annot, $globals, [ReflectionClass](http://php.net/ReflectionClass) $class, [ReflectionMethod](http://php.net/ReflectionMethod) $method) | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | | | string | [getDefaultRouteName](#method_getDefaultRouteName)([ReflectionClass](http://php.net/ReflectionClass) $class, [ReflectionMethod](http://php.net/ReflectionMethod) $method) Gets the default route name for a class method. | | | | [getGlobals](#method_getGlobals)([ReflectionClass](http://php.net/ReflectionClass) $class) | | | | [createRoute](#method_createRoute)($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition) | | | | [configureRoute](#method_configureRoute)([Route](../route "Symfony\Component\Routing\Route") $route, [ReflectionClass](http://php.net/ReflectionClass) $class, [ReflectionMethod](http://php.net/ReflectionMethod) $method, $annot) | | Details ------- ### \_\_construct(Reader $reader) #### Parameters | | | | | --- | --- | --- | | Reader | $reader | | ### setRouteAnnotationClass(string $class) Sets the annotation class to read route properties from. #### Parameters | | | | | --- | --- | --- | | string | $class | A fully-qualified class name | ### load(string $class, string|null $type = null) Loads from annotations from a class. #### Parameters | | | | | --- | --- | --- | | string | $class | A class name | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When route can't be parsed | ### protected addRoute([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $collection, $annot, $globals, [ReflectionClass](http://php.net/ReflectionClass) $class, [ReflectionMethod](http://php.net/ReflectionMethod) $method) #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") | $collection | | | | $annot | | | | $globals | | | [ReflectionClass](http://php.net/ReflectionClass) | $class | | | [ReflectionMethod](http://php.net/ReflectionMethod) | $method | | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### protected string getDefaultRouteName([ReflectionClass](http://php.net/ReflectionClass) $class, [ReflectionMethod](http://php.net/ReflectionMethod) $method) Gets the default route name for a class method. #### Parameters | | | | | --- | --- | --- | | [ReflectionClass](http://php.net/ReflectionClass) | $class | | | [ReflectionMethod](http://php.net/ReflectionMethod) | $method | | #### Return Value | | | | --- | --- | | string | | ### protected getGlobals([ReflectionClass](http://php.net/ReflectionClass) $class) #### Parameters | | | | | --- | --- | --- | | [ReflectionClass](http://php.net/ReflectionClass) | $class | | ### protected createRoute($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition) #### Parameters | | | | | --- | --- | --- | | | $path | | | | $defaults | | | | $requirements | | | | $options | | | | $host | | | | $schemes | | | | $methods | | | | $condition | | ### abstract protected configureRoute([Route](../route "Symfony\Component\Routing\Route") $route, [ReflectionClass](http://php.net/ReflectionClass) $class, [ReflectionMethod](http://php.net/ReflectionMethod) $method, $annot) #### Parameters | | | | | --- | --- | --- | | [Route](../route "Symfony\Component\Routing\Route") | $route | | | [ReflectionClass](http://php.net/ReflectionClass) | $class | | | [ReflectionMethod](http://php.net/ReflectionMethod) | $method | | | | $annot | |
programming_docs
symfony ClosureLoader ClosureLoader ============== class **ClosureLoader** extends [Loader](../../config/loader/loader "Symfony\Component\Config\Loader\Loader") ClosureLoader loads routes from a PHP closure. The Closure must return a RouteCollection instance. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null) Imports a resource. | from [Loader](../../config/loader/loader#method_import "Symfony\Component\Config\Loader\Loader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [load](#method_load)([Closure](http://php.net/Closure) $closure, string|null $type = null) Loads a Closure. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | mixed | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### load([Closure](http://php.net/Closure) $closure, string|null $type = null) Loads a Closure. #### Parameters | | | | | --- | --- | --- | | [Closure](http://php.net/Closure) | $closure | A Closure | | string|null | $type | The resource type or null if unknown | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | symfony GlobFileLoader GlobFileLoader =============== class **GlobFileLoader** extends [FileLoader](../../config/loader/fileloader "Symfony\Component\Config\Loader\FileLoader") GlobFileLoader loads files from a glob pattern. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](../../config/loader/fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](../../config/loader/fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](../../config/loader/fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) | from [FileLoader](../../config/loader/fileloader#method___construct "Symfony\Component\Config\Loader\FileLoader") | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](../../config/loader/fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](../../config/loader/fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](../../config/loader/fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [load](#method_load)(mixed $resource, string|null $type = null) Loads a resource. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../../config/exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../../config/exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) #### Parameters | | | | | --- | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### load(mixed $resource, string|null $type = null) Loads a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | The resource | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | If something went wrong | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | symfony Symfony\Component\Routing\Loader\DependencyInjection Symfony\Component\Routing\Loader\DependencyInjection ==================================================== Classes ------- | | | | --- | --- | | [ServiceRouterLoader](dependencyinjection/servicerouterloader "Symfony\Component\Routing\Loader\DependencyInjection\ServiceRouterLoader") | A route loader that executes a service to load the routes. | symfony ObjectRouteLoader ObjectRouteLoader ================== abstract class **ObjectRouteLoader** extends [Loader](../../config/loader/loader "Symfony\Component\Config\Loader\Loader") A route loader that calls a method on an object to load the routes. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null) Imports a resource. | from [Loader](../../config/loader/loader#method_import "Symfony\Component\Config\Loader\Loader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | object | [getServiceObject](#method_getServiceObject)(string $id) Returns the object that the method will be called on to load routes. | | | | [load](#method_load)(mixed $resource, string|null $type = null) Calls the service that will load the routes. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | mixed | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### abstract protected object getServiceObject(string $id) Returns the object that the method will be called on to load routes. For example, if your application uses a service container, the $id may be a service id. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | object | | ### load(mixed $resource, string|null $type = null) Calls the service that will load the routes. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | The resource | | string|null | $type | The resource type or null if unknown | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | symfony YamlFileLoader YamlFileLoader =============== class **YamlFileLoader** extends [FileLoader](../../config/loader/fileloader "Symfony\Component\Config\Loader\FileLoader") YamlFileLoader loads Yaml routing files. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](../../config/loader/fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](../../config/loader/fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](../../config/loader/fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) | from [FileLoader](../../config/loader/fileloader#method___construct "Symfony\Component\Config\Loader\FileLoader") | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](../../config/loader/fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](../../config/loader/fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](../../config/loader/fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [load](#method_load)(string $file, string|null $type = null) Loads a Yaml file. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | | | [parseRoute](#method_parseRoute)([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $collection, string $name, array $config, string $path) Parses a route and adds it to the RouteCollection. | | | | [parseImport](#method_parseImport)([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $collection, array $config, string $path, string $file) Parses an import and adds the routes in the resource to the RouteCollection. | | | | [validate](#method_validate)(array $config, string $name, string $path) Validates the route configuration. | | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../../config/exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../../config/exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) #### Parameters | | | | | --- | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### load(string $file, string|null $type = null) Loads a Yaml file. #### Parameters | | | | | --- | --- | --- | | string | $file | A Yaml file path | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When a route can't be parsed because YAML is invalid | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | ### protected parseRoute([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $collection, string $name, array $config, string $path) Parses a route and adds it to the RouteCollection. #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") | $collection | A RouteCollection instance | | string | $name | Route name | | array | $config | Route definition | | string | $path | Full path of the YAML file being processed | ### protected parseImport([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $collection, array $config, string $path, string $file) Parses an import and adds the routes in the resource to the RouteCollection. #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") | $collection | A RouteCollection instance | | array | $config | Route definition | | string | $path | Full path of the YAML file being processed | | string | $file | Loaded file name | ### protected validate(array $config, string $name, string $path) Validates the route configuration. #### Parameters | | | | | --- | --- | --- | | array | $config | A resource config | | string | $name | The config key | | string | $path | The loaded file path | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | If one of the provided config keys is not supported, something is missing or the combination is nonsense |
programming_docs
symfony AnnotationDirectoryLoader AnnotationDirectoryLoader ========================== class **AnnotationDirectoryLoader** extends [AnnotationFileLoader](annotationfileloader "Symfony\Component\Routing\Loader\AnnotationFileLoader") AnnotationDirectoryLoader loads routing information from annotations set on PHP classes and methods. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](../../config/loader/fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](../../config/loader/fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | | protected | $loader | | from [AnnotationFileLoader](annotationfileloader#property_loader "Symfony\Component\Routing\Loader\AnnotationFileLoader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](../../config/loader/fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator, [AnnotationClassLoader](annotationclassloader "Symfony\Component\Routing\Loader\AnnotationClassLoader") $loader) | from [AnnotationFileLoader](annotationfileloader#method___construct "Symfony\Component\Routing\Loader\AnnotationFileLoader") | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](../../config/loader/fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](../../config/loader/fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](../../config/loader/fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [load](#method_load)(string $path, string|null $type = null) Loads from annotations from a directory. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | | string|false | [findClass](#method_findClass)(string $file) Returns the full class name for the first class in the file. | from [AnnotationFileLoader](annotationfileloader#method_findClass "Symfony\Component\Routing\Loader\AnnotationFileLoader") | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../../config/exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../../config/exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator, [AnnotationClassLoader](annotationclassloader "Symfony\Component\Routing\Loader\AnnotationClassLoader") $loader) #### Parameters | | | | | --- | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | | [AnnotationClassLoader](annotationclassloader "Symfony\Component\Routing\Loader\AnnotationClassLoader") | $loader | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### load(string $path, string|null $type = null) Loads from annotations from a directory. #### Parameters | | | | | --- | --- | --- | | string | $path | A directory path | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When the directory does not exist or its routes cannot be parsed | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | ### protected string|false findClass(string $file) Returns the full class name for the first class in the file. #### Parameters | | | | | --- | --- | --- | | string | $file | A PHP file path | #### Return Value | | | | --- | --- | | string|false | Full class name if found, false otherwise | symfony XmlFileLoader XmlFileLoader ============== class **XmlFileLoader** extends [FileLoader](../../config/loader/fileloader "Symfony\Component\Config\Loader\FileLoader") XmlFileLoader loads XML routing files. Constants --------- | | | | --- | --- | | NAMESPACE\_URI | | | SCHEME\_PATH | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](../../config/loader/fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](../../config/loader/fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](../../config/loader/fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) | from [FileLoader](../../config/loader/fileloader#method___construct "Symfony\Component\Config\Loader\FileLoader") | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](../../config/loader/fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](../../config/loader/fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](../../config/loader/fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [load](#method_load)(string $file, string|null $type = null) Loads an XML file. | | | | [parseNode](#method_parseNode)([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $collection, [DOMElement](http://php.net/DOMElement) $node, string $path, string $file) Parses a node from a loaded XML file. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | | | [parseRoute](#method_parseRoute)([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $collection, [DOMElement](http://php.net/DOMElement) $node, string $path) Parses a route and adds it to the RouteCollection. | | | | [parseImport](#method_parseImport)([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $collection, [DOMElement](http://php.net/DOMElement) $node, string $path, string $file) Parses an import and adds the routes in the resource to the RouteCollection. | | | [DOMDocument](http://php.net/DOMDocument) | [loadFile](#method_loadFile)(string $file) Loads an XML file. | | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../../config/exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../../config/exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) #### Parameters | | | | | --- | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### load(string $file, string|null $type = null) Loads an XML file. #### Parameters | | | | | --- | --- | --- | | string | $file | An XML file path | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | when the file cannot be loaded or when the XML cannot be parsed because it does not validate against the scheme | ### protected parseNode([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $collection, [DOMElement](http://php.net/DOMElement) $node, string $path, string $file) Parses a node from a loaded XML file. #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") | $collection | Collection to associate with the node | | [DOMElement](http://php.net/DOMElement) | $node | Element to parse | | string | $path | Full path of the XML file being processed | | string | $file | Loaded file name | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When the XML is invalid | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | ### protected parseRoute([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $collection, [DOMElement](http://php.net/DOMElement) $node, string $path) Parses a route and adds it to the RouteCollection. #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") | $collection | RouteCollection instance | | [DOMElement](http://php.net/DOMElement) | $node | Element to parse that represents a Route | | string | $path | Full path of the XML file being processed | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When the XML is invalid | ### protected parseImport([RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") $collection, [DOMElement](http://php.net/DOMElement) $node, string $path, string $file) Parses an import and adds the routes in the resource to the RouteCollection. #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../routecollection "Symfony\Component\Routing\RouteCollection") | $collection | RouteCollection instance | | [DOMElement](http://php.net/DOMElement) | $node | Element to parse that represents a Route | | string | $path | Full path of the XML file being processed | | string | $file | Loaded file name | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When the XML is invalid | ### protected [DOMDocument](http://php.net/DOMDocument) loadFile(string $file) Loads an XML file. #### Parameters | | | | | --- | --- | --- | | string | $file | An XML file path | #### Return Value | | | | --- | --- | | [DOMDocument](http://php.net/DOMDocument) | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When loading of XML file fails because of syntax errors or when the XML structure is not as expected by the scheme - see validate() |
programming_docs
symfony Symfony\Component\Routing\Loader\Configurator Symfony\Component\Routing\Loader\Configurator ============================================= Namespaces ---------- [Symfony\Component\Routing\Loader\Configurator\Traits](configurator/traits) Classes ------- | | | | --- | --- | | [CollectionConfigurator](configurator/collectionconfigurator "Symfony\Component\Routing\Loader\Configurator\CollectionConfigurator") | | | [ImportConfigurator](configurator/importconfigurator "Symfony\Component\Routing\Loader\Configurator\ImportConfigurator") | | | [RouteConfigurator](configurator/routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | | | [RoutingConfigurator](configurator/routingconfigurator "Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator") | | symfony RouteConfigurator RouteConfigurator ================== class **RouteConfigurator** Traits ------ | | | | --- | --- | | [AddTrait](traits/addtrait "Symfony\Component\Routing\Loader\Configurator\Traits\AddTrait") | | | [RouteTrait](traits/routetrait "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | Methods ------- | | | | | --- | --- | --- | | [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | [add](#method_add)(string $name, $path) Adds a route. | from [AddTrait](traits/addtrait#method_add "Symfony\Component\Routing\Loader\Configurator\Traits\AddTrait") | | [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | [\_\_invoke](#method___invoke)(string $name, $path) Adds a route. | from [AddTrait](traits/addtrait#method___invoke "Symfony\Component\Routing\Loader\Configurator\Traits\AddTrait") | | $this | [defaults](#method_defaults)(array $defaults) Adds defaults. | from [RouteTrait](traits/routetrait#method_defaults "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [requirements](#method_requirements)(array $requirements) Adds requirements. | from [RouteTrait](traits/routetrait#method_requirements "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [options](#method_options)(array $options) Adds options. | from [RouteTrait](traits/routetrait#method_options "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [condition](#method_condition)(string $condition) Sets the condition. | from [RouteTrait](traits/routetrait#method_condition "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [host](#method_host)(string $pattern) Sets the pattern for the host. | from [RouteTrait](traits/routetrait#method_host "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [schemes](#method_schemes)(array $schemes) Sets the schemes (e.g. 'https') this route is restricted to. | from [RouteTrait](traits/routetrait#method_schemes "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [methods](#method_methods)(array $methods) Sets the HTTP methods (e.g. 'POST') this route is restricted to. | from [RouteTrait](traits/routetrait#method_methods "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [controller](#method_controller)(callable|string $controller) Adds the "\_controller" entry to defaults. | from [RouteTrait](traits/routetrait#method_controller "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | | [\_\_construct](#method___construct)([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $collection, $route, string $name = '', [CollectionConfigurator](collectionconfigurator "Symfony\Component\Routing\Loader\Configurator\CollectionConfigurator") $parentConfigurator = null, array $prefixes = null) | | Details ------- ### final [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") add(string $name, $path) Adds a route. #### Parameters | | | | | --- | --- | --- | | string | $name | | | | $path | | #### Return Value | | | | --- | --- | | [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | | ### final [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") \_\_invoke(string $name, $path) Adds a route. #### Parameters | | | | | --- | --- | --- | | string | $name | | | | $path | | #### Return Value | | | | --- | --- | | [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | | ### final $this defaults(array $defaults) Adds defaults. #### Parameters | | | | | --- | --- | --- | | array | $defaults | | #### Return Value | | | | --- | --- | | $this | | ### final $this requirements(array $requirements) Adds requirements. #### Parameters | | | | | --- | --- | --- | | array | $requirements | | #### Return Value | | | | --- | --- | | $this | | ### final $this options(array $options) Adds options. #### Parameters | | | | | --- | --- | --- | | array | $options | | #### Return Value | | | | --- | --- | | $this | | ### final $this condition(string $condition) Sets the condition. #### Parameters | | | | | --- | --- | --- | | string | $condition | | #### Return Value | | | | --- | --- | | $this | | ### final $this host(string $pattern) Sets the pattern for the host. #### Parameters | | | | | --- | --- | --- | | string | $pattern | | #### Return Value | | | | --- | --- | | $this | | ### final $this schemes(array $schemes) Sets the schemes (e.g. 'https') this route is restricted to. So an empty array means that any scheme is allowed. #### Parameters | | | | | --- | --- | --- | | array | $schemes | | #### Return Value | | | | --- | --- | | $this | | ### final $this methods(array $methods) Sets the HTTP methods (e.g. 'POST') this route is restricted to. So an empty array means that any method is allowed. #### Parameters | | | | | --- | --- | --- | | array | $methods | | #### Return Value | | | | --- | --- | | $this | | ### final $this controller(callable|string $controller) Adds the "\_controller" entry to defaults. #### Parameters | | | | | --- | --- | --- | | callable|string | $controller | a callable or parseable pseudo-callable | #### Return Value | | | | --- | --- | | $this | | ### \_\_construct([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $collection, $route, string $name = '', [CollectionConfigurator](collectionconfigurator "Symfony\Component\Routing\Loader\Configurator\CollectionConfigurator") $parentConfigurator = null, array $prefixes = null) #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | $collection | | | | $route | | | string | $name | | | [CollectionConfigurator](collectionconfigurator "Symfony\Component\Routing\Loader\Configurator\CollectionConfigurator") | $parentConfigurator | | | array | $prefixes | | symfony ImportConfigurator ImportConfigurator =================== class **ImportConfigurator** Traits ------ | | | | --- | --- | | [RouteTrait](traits/routetrait "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | Methods ------- | | | | | --- | --- | --- | | $this | [defaults](#method_defaults)(array $defaults) Adds defaults. | from [RouteTrait](traits/routetrait#method_defaults "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [requirements](#method_requirements)(array $requirements) Adds requirements. | from [RouteTrait](traits/routetrait#method_requirements "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [options](#method_options)(array $options) Adds options. | from [RouteTrait](traits/routetrait#method_options "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [condition](#method_condition)(string $condition) Sets the condition. | from [RouteTrait](traits/routetrait#method_condition "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [host](#method_host)(string $pattern) Sets the pattern for the host. | from [RouteTrait](traits/routetrait#method_host "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [schemes](#method_schemes)(array $schemes) Sets the schemes (e.g. 'https') this route is restricted to. | from [RouteTrait](traits/routetrait#method_schemes "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [methods](#method_methods)(array $methods) Sets the HTTP methods (e.g. 'POST') this route is restricted to. | from [RouteTrait](traits/routetrait#method_methods "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [controller](#method_controller)(callable|string $controller) Adds the "\_controller" entry to defaults. | from [RouteTrait](traits/routetrait#method_controller "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | | [\_\_construct](#method___construct)([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $parent, [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $route) | | | | [\_\_destruct](#method___destruct)() | | | $this | [prefix](#method_prefix)($prefix, bool $trailingSlashOnRoot = true) Sets the prefix to add to the path of all child routes. | | | $this | [namePrefix](#method_namePrefix)(string $namePrefix) Sets the prefix to add to the name of all child routes. | | Details ------- ### final $this defaults(array $defaults) Adds defaults. #### Parameters | | | | | --- | --- | --- | | array | $defaults | | #### Return Value | | | | --- | --- | | $this | | ### final $this requirements(array $requirements) Adds requirements. #### Parameters | | | | | --- | --- | --- | | array | $requirements | | #### Return Value | | | | --- | --- | | $this | | ### final $this options(array $options) Adds options. #### Parameters | | | | | --- | --- | --- | | array | $options | | #### Return Value | | | | --- | --- | | $this | | ### final $this condition(string $condition) Sets the condition. #### Parameters | | | | | --- | --- | --- | | string | $condition | | #### Return Value | | | | --- | --- | | $this | | ### final $this host(string $pattern) Sets the pattern for the host. #### Parameters | | | | | --- | --- | --- | | string | $pattern | | #### Return Value | | | | --- | --- | | $this | | ### final $this schemes(array $schemes) Sets the schemes (e.g. 'https') this route is restricted to. So an empty array means that any scheme is allowed. #### Parameters | | | | | --- | --- | --- | | array | $schemes | | #### Return Value | | | | --- | --- | | $this | | ### final $this methods(array $methods) Sets the HTTP methods (e.g. 'POST') this route is restricted to. So an empty array means that any method is allowed. #### Parameters | | | | | --- | --- | --- | | array | $methods | | #### Return Value | | | | --- | --- | | $this | | ### final $this controller(callable|string $controller) Adds the "\_controller" entry to defaults. #### Parameters | | | | | --- | --- | --- | | callable|string | $controller | a callable or parseable pseudo-callable | #### Return Value | | | | --- | --- | | $this | | ### \_\_construct([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $parent, [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $route) #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | $parent | | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | $route | | ### \_\_destruct() ### final $this prefix($prefix, bool $trailingSlashOnRoot = true) Sets the prefix to add to the path of all child routes. #### Parameters | | | | | --- | --- | --- | | | $prefix | | | bool | $trailingSlashOnRoot | | #### Return Value | | | | --- | --- | | $this | | ### final $this namePrefix(string $namePrefix) Sets the prefix to add to the name of all child routes. #### Parameters | | | | | --- | --- | --- | | string | $namePrefix | | #### Return Value | | | | --- | --- | | $this | | symfony RoutingConfigurator RoutingConfigurator ==================== class **RoutingConfigurator** Traits ------ | | | | --- | --- | | [AddTrait](traits/addtrait "Symfony\Component\Routing\Loader\Configurator\Traits\AddTrait") | | Methods ------- | | | | | --- | --- | --- | | [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | [add](#method_add)(string $name, $path) Adds a route. | from [AddTrait](traits/addtrait#method_add "Symfony\Component\Routing\Loader\Configurator\Traits\AddTrait") | | [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | [\_\_invoke](#method___invoke)(string $name, $path) Adds a route. | from [AddTrait](traits/addtrait#method___invoke "Symfony\Component\Routing\Loader\Configurator\Traits\AddTrait") | | | [\_\_construct](#method___construct)([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $collection, [PhpFileLoader](../phpfileloader "Symfony\Component\Routing\Loader\PhpFileLoader") $loader, string $path, string $file) | | | [ImportConfigurator](importconfigurator "Symfony\Component\Routing\Loader\Configurator\ImportConfigurator") | [import](#method_import)($resource, $type = null, $ignoreErrors = false) | | | [CollectionConfigurator](collectionconfigurator "Symfony\Component\Routing\Loader\Configurator\CollectionConfigurator") | [collection](#method_collection)($name = '') | | Details ------- ### final [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") add(string $name, $path) Adds a route. #### Parameters | | | | | --- | --- | --- | | string | $name | | | | $path | | #### Return Value | | | | --- | --- | | [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | | ### final [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") \_\_invoke(string $name, $path) Adds a route. #### Parameters | | | | | --- | --- | --- | | string | $name | | | | $path | | #### Return Value | | | | --- | --- | | [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | | ### \_\_construct([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $collection, [PhpFileLoader](../phpfileloader "Symfony\Component\Routing\Loader\PhpFileLoader") $loader, string $path, string $file) #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | $collection | | | [PhpFileLoader](../phpfileloader "Symfony\Component\Routing\Loader\PhpFileLoader") | $loader | | | string | $path | | | string | $file | | ### final [ImportConfigurator](importconfigurator "Symfony\Component\Routing\Loader\Configurator\ImportConfigurator") import($resource, $type = null, $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | | $resource | | | | $type | | | | $ignoreErrors | | #### Return Value | | | | --- | --- | | [ImportConfigurator](importconfigurator "Symfony\Component\Routing\Loader\Configurator\ImportConfigurator") | | ### final [CollectionConfigurator](collectionconfigurator "Symfony\Component\Routing\Loader\Configurator\CollectionConfigurator") collection($name = '') #### Parameters | | | | | --- | --- | --- | | | $name | | #### Return Value | | | | --- | --- | | [CollectionConfigurator](collectionconfigurator "Symfony\Component\Routing\Loader\Configurator\CollectionConfigurator") | | symfony CollectionConfigurator CollectionConfigurator ======================= class **CollectionConfigurator** Traits ------ | | | | --- | --- | | [AddTrait](traits/addtrait "Symfony\Component\Routing\Loader\Configurator\Traits\AddTrait") | | | [RouteTrait](traits/routetrait "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | Methods ------- | | | | | --- | --- | --- | | [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | [add](#method_add)(string $name, $path) Adds a route. | from [AddTrait](traits/addtrait#method_add "Symfony\Component\Routing\Loader\Configurator\Traits\AddTrait") | | [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | [\_\_invoke](#method___invoke)(string $name, $path) Adds a route. | from [AddTrait](traits/addtrait#method___invoke "Symfony\Component\Routing\Loader\Configurator\Traits\AddTrait") | | $this | [defaults](#method_defaults)(array $defaults) Adds defaults. | from [RouteTrait](traits/routetrait#method_defaults "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [requirements](#method_requirements)(array $requirements) Adds requirements. | from [RouteTrait](traits/routetrait#method_requirements "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [options](#method_options)(array $options) Adds options. | from [RouteTrait](traits/routetrait#method_options "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [condition](#method_condition)(string $condition) Sets the condition. | from [RouteTrait](traits/routetrait#method_condition "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [host](#method_host)(string $pattern) Sets the pattern for the host. | from [RouteTrait](traits/routetrait#method_host "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [schemes](#method_schemes)(array $schemes) Sets the schemes (e.g. 'https') this route is restricted to. | from [RouteTrait](traits/routetrait#method_schemes "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [methods](#method_methods)(array $methods) Sets the HTTP methods (e.g. 'POST') this route is restricted to. | from [RouteTrait](traits/routetrait#method_methods "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | $this | [controller](#method_controller)(callable|string $controller) Adds the "\_controller" entry to defaults. | from [RouteTrait](traits/routetrait#method_controller "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | | [\_\_construct](#method___construct)([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $parent, string $name, [CollectionConfigurator](collectionconfigurator "Symfony\Component\Routing\Loader\Configurator\CollectionConfigurator") $parentConfigurator = null, array $parentPrefixes = null) | | | | [\_\_destruct](#method___destruct)() | | | [CollectionConfigurator](collectionconfigurator "Symfony\Component\Routing\Loader\Configurator\CollectionConfigurator") | [collection](#method_collection)($name = '') Creates a sub-collection. | | | $this | [prefix](#method_prefix)(string|array $prefix) Sets the prefix to add to the path of all child routes. | | Details ------- ### final [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") add(string $name, $path) Adds a route. #### Parameters | | | | | --- | --- | --- | | string | $name | | | | $path | | #### Return Value | | | | --- | --- | | [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | | ### final [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") \_\_invoke(string $name, $path) Adds a route. #### Parameters | | | | | --- | --- | --- | | string | $name | | | | $path | | #### Return Value | | | | --- | --- | | [RouteConfigurator](routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | | ### final $this defaults(array $defaults) Adds defaults. #### Parameters | | | | | --- | --- | --- | | array | $defaults | | #### Return Value | | | | --- | --- | | $this | | ### final $this requirements(array $requirements) Adds requirements. #### Parameters | | | | | --- | --- | --- | | array | $requirements | | #### Return Value | | | | --- | --- | | $this | | ### final $this options(array $options) Adds options. #### Parameters | | | | | --- | --- | --- | | array | $options | | #### Return Value | | | | --- | --- | | $this | | ### final $this condition(string $condition) Sets the condition. #### Parameters | | | | | --- | --- | --- | | string | $condition | | #### Return Value | | | | --- | --- | | $this | | ### final $this host(string $pattern) Sets the pattern for the host. #### Parameters | | | | | --- | --- | --- | | string | $pattern | | #### Return Value | | | | --- | --- | | $this | | ### final $this schemes(array $schemes) Sets the schemes (e.g. 'https') this route is restricted to. So an empty array means that any scheme is allowed. #### Parameters | | | | | --- | --- | --- | | array | $schemes | | #### Return Value | | | | --- | --- | | $this | | ### final $this methods(array $methods) Sets the HTTP methods (e.g. 'POST') this route is restricted to. So an empty array means that any method is allowed. #### Parameters | | | | | --- | --- | --- | | array | $methods | | #### Return Value | | | | --- | --- | | $this | | ### final $this controller(callable|string $controller) Adds the "\_controller" entry to defaults. #### Parameters | | | | | --- | --- | --- | | callable|string | $controller | a callable or parseable pseudo-callable | #### Return Value | | | | --- | --- | | $this | | ### \_\_construct([RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") $parent, string $name, [CollectionConfigurator](collectionconfigurator "Symfony\Component\Routing\Loader\Configurator\CollectionConfigurator") $parentConfigurator = null, array $parentPrefixes = null) #### Parameters | | | | | --- | --- | --- | | [RouteCollection](../../routecollection "Symfony\Component\Routing\RouteCollection") | $parent | | | string | $name | | | [CollectionConfigurator](collectionconfigurator "Symfony\Component\Routing\Loader\Configurator\CollectionConfigurator") | $parentConfigurator | | | array | $parentPrefixes | | ### \_\_destruct() ### final [CollectionConfigurator](collectionconfigurator "Symfony\Component\Routing\Loader\Configurator\CollectionConfigurator") collection($name = '') Creates a sub-collection. #### Parameters | | | | | --- | --- | --- | | | $name | | #### Return Value | | | | --- | --- | | [CollectionConfigurator](collectionconfigurator "Symfony\Component\Routing\Loader\Configurator\CollectionConfigurator") | | ### final $this prefix(string|array $prefix) Sets the prefix to add to the path of all child routes. #### Parameters | | | | | --- | --- | --- | | string|array | $prefix | the prefix, or the localized prefixes | #### Return Value | | | | --- | --- | | $this | |
programming_docs
symfony Symfony\Component\Routing\Loader\Configurator\Traits Symfony\Component\Routing\Loader\Configurator\Traits ==================================================== Classes ------- | | | | --- | --- | | [AddTrait](traits/addtrait "Symfony\Component\Routing\Loader\Configurator\Traits\AddTrait") | | | [RouteTrait](traits/routetrait "Symfony\Component\Routing\Loader\Configurator\Traits\RouteTrait") | | symfony RouteTrait RouteTrait =========== trait **RouteTrait** Methods ------- | | | | | --- | --- | --- | | $this | [defaults](#method_defaults)(array $defaults) Adds defaults. | | | $this | [requirements](#method_requirements)(array $requirements) Adds requirements. | | | $this | [options](#method_options)(array $options) Adds options. | | | $this | [condition](#method_condition)(string $condition) Sets the condition. | | | $this | [host](#method_host)(string $pattern) Sets the pattern for the host. | | | $this | [schemes](#method_schemes)(array $schemes) Sets the schemes (e.g. 'https') this route is restricted to. | | | $this | [methods](#method_methods)(array $methods) Sets the HTTP methods (e.g. 'POST') this route is restricted to. | | | $this | [controller](#method_controller)(callable|string $controller) Adds the "\_controller" entry to defaults. | | Details ------- ### final $this defaults(array $defaults) Adds defaults. #### Parameters | | | | | --- | --- | --- | | array | $defaults | | #### Return Value | | | | --- | --- | | $this | | ### final $this requirements(array $requirements) Adds requirements. #### Parameters | | | | | --- | --- | --- | | array | $requirements | | #### Return Value | | | | --- | --- | | $this | | ### final $this options(array $options) Adds options. #### Parameters | | | | | --- | --- | --- | | array | $options | | #### Return Value | | | | --- | --- | | $this | | ### final $this condition(string $condition) Sets the condition. #### Parameters | | | | | --- | --- | --- | | string | $condition | | #### Return Value | | | | --- | --- | | $this | | ### final $this host(string $pattern) Sets the pattern for the host. #### Parameters | | | | | --- | --- | --- | | string | $pattern | | #### Return Value | | | | --- | --- | | $this | | ### final $this schemes(array $schemes) Sets the schemes (e.g. 'https') this route is restricted to. So an empty array means that any scheme is allowed. #### Parameters | | | | | --- | --- | --- | | array | $schemes | | #### Return Value | | | | --- | --- | | $this | | ### final $this methods(array $methods) Sets the HTTP methods (e.g. 'POST') this route is restricted to. So an empty array means that any method is allowed. #### Parameters | | | | | --- | --- | --- | | array | $methods | | #### Return Value | | | | --- | --- | | $this | | ### final $this controller(callable|string $controller) Adds the "\_controller" entry to defaults. #### Parameters | | | | | --- | --- | --- | | callable|string | $controller | a callable or parseable pseudo-callable | #### Return Value | | | | --- | --- | | $this | | symfony AddTrait AddTrait ========= trait **AddTrait** Methods ------- | | | | | --- | --- | --- | | [RouteConfigurator](../routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | [add](#method_add)(string $name, $path) Adds a route. | | | [RouteConfigurator](../routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | [\_\_invoke](#method___invoke)(string $name, $path) Adds a route. | | Details ------- ### final [RouteConfigurator](../routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") add(string $name, $path) Adds a route. #### Parameters | | | | | --- | --- | --- | | string | $name | | | | $path | | #### Return Value | | | | --- | --- | | [RouteConfigurator](../routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | | ### final [RouteConfigurator](../routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") \_\_invoke(string $name, $path) Adds a route. #### Parameters | | | | | --- | --- | --- | | string | $name | | | | $path | | #### Return Value | | | | --- | --- | | [RouteConfigurator](../routeconfigurator "Symfony\Component\Routing\Loader\Configurator\RouteConfigurator") | | symfony ServiceRouterLoader ServiceRouterLoader ==================== class **ServiceRouterLoader** extends [ObjectRouteLoader](../objectrouteloader "Symfony\Component\Routing\Loader\ObjectRouteLoader") A route loader that executes a service to load the routes. This depends on the DependencyInjection component. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null) Imports a resource. | from [Loader](../../../config/loader/loader#method_import "Symfony\Component\Config\Loader\Loader") | | $this|[LoaderInterface](../../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | object | [getServiceObject](#method_getServiceObject)(string $id) Returns the object that the method will be called on to load routes. | | | | [load](#method_load)(mixed $resource, string|null $type = null) Calls the service that will load the routes. | from [ObjectRouteLoader](../objectrouteloader#method_load "Symfony\Component\Routing\Loader\ObjectRouteLoader") | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | from [ObjectRouteLoader](../objectrouteloader#method_supports "Symfony\Component\Routing\Loader\ObjectRouteLoader") | | | [\_\_construct](#method___construct)(ContainerInterface $container) | | Details ------- ### [LoaderResolverInterface](../../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | mixed | | ### $this|[LoaderInterface](../../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### protected object getServiceObject(string $id) Returns the object that the method will be called on to load routes. For example, if your application uses a service container, the $id may be a service id. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | object | | ### load(mixed $resource, string|null $type = null) Calls the service that will load the routes. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | The resource | | string|null | $type | The resource type or null if unknown | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | ### \_\_construct(ContainerInterface $container) #### Parameters | | | | | --- | --- | --- | | ContainerInterface | $container | | symfony RoutingResolverPass RoutingResolverPass ==================== class **RoutingResolverPass** implements [CompilerPassInterface](../../dependencyinjection/compiler/compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Adds tagged routing.loader services to routing.resolver service. Traits ------ | | | | --- | --- | | [PriorityTaggedServiceTrait](../../dependencyinjection/compiler/prioritytaggedservicetrait "Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait") | Trait that allows a generic method to find and sort service by priority option in the tag. | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $resolverServiceId = 'routing.resolver', string $loaderTag = 'routing.loader') | | | | [process](#method_process)([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### \_\_construct(string $resolverServiceId = 'routing.resolver', string $loaderTag = 'routing.loader') #### Parameters | | | | | --- | --- | --- | | string | $resolverServiceId | | | string | $loaderTag | | ### process([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony ResourceNotFoundException ResourceNotFoundException ========================== class **ResourceNotFoundException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Routing\Exception\ExceptionInterface") The resource was not found. This exception should trigger an HTTP 404 response in your application code. symfony InvalidParameterException InvalidParameterException ========================== class **InvalidParameterException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Routing\Exception\ExceptionInterface") Exception thrown when a parameter is not valid. symfony MissingMandatoryParametersException MissingMandatoryParametersException ==================================== class **MissingMandatoryParametersException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Routing\Exception\ExceptionInterface") Exception thrown when a route cannot be generated because of missing mandatory parameters. symfony ExceptionInterface ExceptionInterface =================== interface **ExceptionInterface** ExceptionInterface. symfony MethodNotAllowedException MethodNotAllowedException ========================== class **MethodNotAllowedException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Routing\Exception\ExceptionInterface") The resource was found but the request method is not allowed. This exception should trigger an HTTP 405 response in your application code. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $allowedMethods | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $allowedMethods, string $message = null, int $code = 0, [Exception](http://php.net/Exception) $previous = null) | | | array | [getAllowedMethods](#method_getAllowedMethods)() Gets the allowed HTTP methods. | | Details ------- ### \_\_construct(array $allowedMethods, string $message = null, int $code = 0, [Exception](http://php.net/Exception) $previous = null) #### Parameters | | | | | --- | --- | --- | | array | $allowedMethods | | | string | $message | | | int | $code | | | [Exception](http://php.net/Exception) | $previous | | ### array getAllowedMethods() Gets the allowed HTTP methods. #### Return Value | | | | --- | --- | | array | | symfony NoConfigurationException NoConfigurationException ========================= class **NoConfigurationException** extends [ResourceNotFoundException](resourcenotfoundexception "Symfony\Component\Routing\Exception\ResourceNotFoundException") Exception thrown when no routes are configured. symfony RouteNotFoundException RouteNotFoundException ======================= class **RouteNotFoundException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Routing\Exception\ExceptionInterface") Exception thrown when a route does not exist. symfony Symfony\Component\CssSelector\Node Symfony\Component\CssSelector\Node ================================== Classes ------- | | | | --- | --- | | [AbstractNode](node/abstractnode "Symfony\Component\CssSelector\Node\AbstractNode") | Abstract base node class. | [AttributeNode](node/attributenode "Symfony\Component\CssSelector\Node\AttributeNode") | Represents a "[| ]" node. [ClassNode](node/classnode "Symfony\Component\CssSelector\Node\ClassNode") | Represents a "." node. | [CombinedSelectorNode](node/combinedselectornode "Symfony\Component\CssSelector\Node\CombinedSelectorNode") | Represents a combined node. | [ElementNode](node/elementnode "Symfony\Component\CssSelector\Node\ElementNode") | Represents a "|" node. [FunctionNode](node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") | Represents a ":()" node. [HashNode](node/hashnode "Symfony\Component\CssSelector\Node\HashNode") | Represents a "#" node. [NegationNode](node/negationnode "Symfony\Component\CssSelector\Node\NegationNode") | Represents a ":not()" node. [PseudoNode](node/pseudonode "Symfony\Component\CssSelector\Node\PseudoNode") | Represents a ":" node. [SelectorNode](node/selectornode "Symfony\Component\CssSelector\Node\SelectorNode") | Represents a "(::|:)" node. | [Specificity](node/specificity "Symfony\Component\CssSelector\Node\Specificity") | Represents a node specificity. | Interfaces ---------- | | | | --- | --- | | *[NodeInterface](node/nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface")* | Interface for nodes. | symfony CssSelectorConverter CssSelectorConverter ===================== class **CssSelectorConverter** CssSelectorConverter is the main entry point of the component and can convert CSS selectors to XPath expressions. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(bool $html = true) | | | string | [toXPath](#method_toXPath)(string $cssExpr, string $prefix = 'descendant-or-self::') Translates a CSS expression to its XPath equivalent. | | Details ------- ### \_\_construct(bool $html = true) #### Parameters | | | | | --- | --- | --- | | bool | $html | Whether HTML support should be enabled. Disable it for XML documents | ### string toXPath(string $cssExpr, string $prefix = 'descendant-or-self::') Translates a CSS expression to its XPath equivalent. Optionally, a prefix can be added to the resulting XPath expression with the $prefix parameter. #### Parameters | | | | | --- | --- | --- | | string | $cssExpr | The CSS expression | | string | $prefix | An optional prefix for the XPath expression | #### Return Value | | | | --- | --- | | string | | symfony Symfony\Component\CssSelector\Parser Symfony\Component\CssSelector\Parser ==================================== Namespaces ---------- [Symfony\Component\CssSelector\Parser\Handler](parser/handler)[Symfony\Component\CssSelector\Parser\Shortcut](parser/shortcut)[Symfony\Component\CssSelector\Parser\Tokenizer](parser/tokenizer) Classes ------- | | | | --- | --- | | [Parser](parser/parser "Symfony\Component\CssSelector\Parser\Parser") | CSS selector parser. | | [Reader](parser/reader "Symfony\Component\CssSelector\Parser\Reader") | CSS selector reader. | | [Token](parser/token "Symfony\Component\CssSelector\Parser\Token") | CSS selector token. | | [TokenStream](parser/tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") | CSS selector token stream. | Interfaces ---------- | | | | --- | --- | | *[ParserInterface](parser/parserinterface "Symfony\Component\CssSelector\Parser\ParserInterface")* | CSS selector parser interface. | symfony Symfony\Component\CssSelector\XPath Symfony\Component\CssSelector\XPath =================================== Namespaces ---------- [Symfony\Component\CssSelector\XPath\Extension](xpath/extension) Classes ------- | | | | --- | --- | | [Translator](xpath/translator "Symfony\Component\CssSelector\XPath\Translator") | XPath expression translator interface. | | [XPathExpr](xpath/xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | XPath expression translator interface. | Interfaces ---------- | | | | --- | --- | | *[TranslatorInterface](xpath/translatorinterface "Symfony\Component\CssSelector\XPath\TranslatorInterface")* | XPath expression translator interface. | symfony Symfony\Component\CssSelector\Exception Symfony\Component\CssSelector\Exception ======================================= Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\CssSelector\Exception\ExceptionInterface")* | Interface for exceptions. | Exceptions ---------- | | | | --- | --- | | [ExpressionErrorException](exception/expressionerrorexception "Symfony\Component\CssSelector\Exception\ExpressionErrorException") | ParseException is thrown when a CSS selector syntax is not valid. | | [InternalErrorException](exception/internalerrorexception "Symfony\Component\CssSelector\Exception\InternalErrorException") | ParseException is thrown when a CSS selector syntax is not valid. | | [ParseException](exception/parseexception "Symfony\Component\CssSelector\Exception\ParseException") | ParseException is thrown when a CSS selector syntax is not valid. | | [SyntaxErrorException](exception/syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") | ParseException is thrown when a CSS selector syntax is not valid. |
programming_docs
symfony Symfony\Component\CssSelector\XPath\Extension Symfony\Component\CssSelector\XPath\Extension ============================================= Classes ------- | | | | --- | --- | | [AbstractExtension](extension/abstractextension "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | XPath expression translator abstract extension. | | [AttributeMatchingExtension](extension/attributematchingextension "Symfony\Component\CssSelector\XPath\Extension\AttributeMatchingExtension") | XPath expression translator attribute extension. | | [CombinationExtension](extension/combinationextension "Symfony\Component\CssSelector\XPath\Extension\CombinationExtension") | XPath expression translator combination extension. | | [FunctionExtension](extension/functionextension "Symfony\Component\CssSelector\XPath\Extension\FunctionExtension") | XPath expression translator function extension. | | [HtmlExtension](extension/htmlextension "Symfony\Component\CssSelector\XPath\Extension\HtmlExtension") | XPath expression translator HTML extension. | | [NodeExtension](extension/nodeextension "Symfony\Component\CssSelector\XPath\Extension\NodeExtension") | XPath expression translator node extension. | | [PseudoClassExtension](extension/pseudoclassextension "Symfony\Component\CssSelector\XPath\Extension\PseudoClassExtension") | XPath expression translator pseudo-class extension. | Interfaces ---------- | | | | --- | --- | | *[ExtensionInterface](extension/extensioninterface "Symfony\Component\CssSelector\XPath\Extension\ExtensionInterface")* | XPath expression translator extension interface. | symfony TranslatorInterface TranslatorInterface ==================== interface **TranslatorInterface** XPath expression translator interface. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | string | [cssToXPath](#method_cssToXPath)(string $cssExpr, string $prefix = 'descendant-or-self::') Translates a CSS selector to an XPath expression. | | | string | [selectorToXPath](#method_selectorToXPath)([SelectorNode](../node/selectornode "Symfony\Component\CssSelector\Node\SelectorNode") $selector, string $prefix = 'descendant-or-self::') Translates a parsed selector node to an XPath expression. | | Details ------- ### string cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::') Translates a CSS selector to an XPath expression. #### Parameters | | | | | --- | --- | --- | | string | $cssExpr | | | string | $prefix | | #### Return Value | | | | --- | --- | | string | | ### string selectorToXPath([SelectorNode](../node/selectornode "Symfony\Component\CssSelector\Node\SelectorNode") $selector, string $prefix = 'descendant-or-self::') Translates a parsed selector node to an XPath expression. #### Parameters | | | | | --- | --- | --- | | [SelectorNode](../node/selectornode "Symfony\Component\CssSelector\Node\SelectorNode") | $selector | | | string | $prefix | | #### Return Value | | | | --- | --- | | string | | symfony XPathExpr XPathExpr ========== class **XPathExpr** XPath expression translator interface. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path = '', string $element = '\*', string $condition = '', bool $starPrefix = false) | | | string | [getElement](#method_getElement)() | | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [addCondition](#method_addCondition)(string $condition) | | | string | [getCondition](#method_getCondition)() | | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [addNameTest](#method_addNameTest)() | | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [addStarPrefix](#method_addStarPrefix)() | | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [join](#method_join)(string $combiner, [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $expr) Joins another XPathExpr with a combiner. | | | string | [\_\_toString](#method___toString)() | | Details ------- ### \_\_construct(string $path = '', string $element = '\*', string $condition = '', bool $starPrefix = false) #### Parameters | | | | | --- | --- | --- | | string | $path | | | string | $element | | | string | $condition | | | bool | $starPrefix | | ### string getElement() #### Return Value | | | | --- | --- | | string | | ### [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") addCondition(string $condition) #### Parameters | | | | | --- | --- | --- | | string | $condition | | #### Return Value | | | | --- | --- | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### string getCondition() #### Return Value | | | | --- | --- | | string | | ### [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") addNameTest() #### Return Value | | | | --- | --- | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") addStarPrefix() #### Return Value | | | | --- | --- | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") join(string $combiner, [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $expr) Joins another XPathExpr with a combiner. #### Parameters | | | | | --- | --- | --- | | string | $combiner | | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $expr | | #### Return Value | | | | --- | --- | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### string \_\_toString() #### Return Value | | | | --- | --- | | string | | symfony Translator Translator =========== class **Translator** implements [TranslatorInterface](translatorinterface "Symfony\Component\CssSelector\XPath\TranslatorInterface") XPath expression translator interface. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ParserInterface](../parser/parserinterface "Symfony\Component\CssSelector\Parser\ParserInterface") $parser = null) | | | static string | [getXpathLiteral](#method_getXpathLiteral)(string $element) | | | string | [cssToXPath](#method_cssToXPath)(string $cssExpr, string $prefix = 'descendant-or-self::') Translates a CSS selector to an XPath expression. | | | string | [selectorToXPath](#method_selectorToXPath)([SelectorNode](../node/selectornode "Symfony\Component\CssSelector\Node\SelectorNode") $selector, string $prefix = 'descendant-or-self::') Translates a parsed selector node to an XPath expression. | | | [Translator](translator "Symfony\Component\CssSelector\XPath\Translator") | [registerExtension](#method_registerExtension)([ExtensionInterface](extension/extensioninterface "Symfony\Component\CssSelector\XPath\Extension\ExtensionInterface") $extension) | | | [ExtensionInterface](extension/extensioninterface "Symfony\Component\CssSelector\XPath\Extension\ExtensionInterface") | [getExtension](#method_getExtension)(string $name) | | | [Translator](translator "Symfony\Component\CssSelector\XPath\Translator") | [registerParserShortcut](#method_registerParserShortcut)([ParserInterface](../parser/parserinterface "Symfony\Component\CssSelector\Parser\ParserInterface") $shortcut) | | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [nodeToXPath](#method_nodeToXPath)([NodeInterface](../node/nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $node) | | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [addCombination](#method_addCombination)(string $combiner, [NodeInterface](../node/nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $xpath, [NodeInterface](../node/nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $combinedXpath) | | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [addFunction](#method_addFunction)([XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [FunctionNode](../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $function) | | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [addPseudoClass](#method_addPseudoClass)([XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $pseudoClass) | | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [addAttributeMatching](#method_addAttributeMatching)([XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $operator, string $attribute, $value) | | Details ------- ### \_\_construct([ParserInterface](../parser/parserinterface "Symfony\Component\CssSelector\Parser\ParserInterface") $parser = null) #### Parameters | | | | | --- | --- | --- | | [ParserInterface](../parser/parserinterface "Symfony\Component\CssSelector\Parser\ParserInterface") | $parser | | ### static string getXpathLiteral(string $element) #### Parameters | | | | | --- | --- | --- | | string | $element | | #### Return Value | | | | --- | --- | | string | | ### string cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::') Translates a CSS selector to an XPath expression. #### Parameters | | | | | --- | --- | --- | | string | $cssExpr | | | string | $prefix | | #### Return Value | | | | --- | --- | | string | | ### string selectorToXPath([SelectorNode](../node/selectornode "Symfony\Component\CssSelector\Node\SelectorNode") $selector, string $prefix = 'descendant-or-self::') Translates a parsed selector node to an XPath expression. #### Parameters | | | | | --- | --- | --- | | [SelectorNode](../node/selectornode "Symfony\Component\CssSelector\Node\SelectorNode") | $selector | | | string | $prefix | | #### Return Value | | | | --- | --- | | string | | ### [Translator](translator "Symfony\Component\CssSelector\XPath\Translator") registerExtension([ExtensionInterface](extension/extensioninterface "Symfony\Component\CssSelector\XPath\Extension\ExtensionInterface") $extension) #### Parameters | | | | | --- | --- | --- | | [ExtensionInterface](extension/extensioninterface "Symfony\Component\CssSelector\XPath\Extension\ExtensionInterface") | $extension | | #### Return Value | | | | --- | --- | | [Translator](translator "Symfony\Component\CssSelector\XPath\Translator") | | ### [ExtensionInterface](extension/extensioninterface "Symfony\Component\CssSelector\XPath\Extension\ExtensionInterface") getExtension(string $name) #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | [ExtensionInterface](extension/extensioninterface "Symfony\Component\CssSelector\XPath\Extension\ExtensionInterface") | | #### Exceptions | | | | --- | --- | | [ExpressionErrorException](../exception/expressionerrorexception "Symfony\Component\CssSelector\Exception\ExpressionErrorException") | | ### [Translator](translator "Symfony\Component\CssSelector\XPath\Translator") registerParserShortcut([ParserInterface](../parser/parserinterface "Symfony\Component\CssSelector\Parser\ParserInterface") $shortcut) #### Parameters | | | | | --- | --- | --- | | [ParserInterface](../parser/parserinterface "Symfony\Component\CssSelector\Parser\ParserInterface") | $shortcut | | #### Return Value | | | | --- | --- | | [Translator](translator "Symfony\Component\CssSelector\XPath\Translator") | | ### [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") nodeToXPath([NodeInterface](../node/nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $node) #### Parameters | | | | | --- | --- | --- | | [NodeInterface](../node/nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | $node | | #### Return Value | | | | --- | --- | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | #### Exceptions | | | | --- | --- | | [ExpressionErrorException](../exception/expressionerrorexception "Symfony\Component\CssSelector\Exception\ExpressionErrorException") | | ### [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") addCombination(string $combiner, [NodeInterface](../node/nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $xpath, [NodeInterface](../node/nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $combinedXpath) #### Parameters | | | | | --- | --- | --- | | string | $combiner | | | [NodeInterface](../node/nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | $xpath | | | [NodeInterface](../node/nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | $combinedXpath | | #### Return Value | | | | --- | --- | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | #### Exceptions | | | | --- | --- | | [ExpressionErrorException](../exception/expressionerrorexception "Symfony\Component\CssSelector\Exception\ExpressionErrorException") | | ### [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") addFunction([XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [FunctionNode](../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $function) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | [FunctionNode](../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") | $function | | #### Return Value | | | | --- | --- | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | #### Exceptions | | | | --- | --- | | [ExpressionErrorException](../exception/expressionerrorexception "Symfony\Component\CssSelector\Exception\ExpressionErrorException") | | ### [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") addPseudoClass([XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $pseudoClass) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | string | $pseudoClass | | #### Return Value | | | | --- | --- | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | #### Exceptions | | | | --- | --- | | [ExpressionErrorException](../exception/expressionerrorexception "Symfony\Component\CssSelector\Exception\ExpressionErrorException") | | ### [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") addAttributeMatching([XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $operator, string $attribute, $value) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | string | $operator | | | string | $attribute | | | | $value | | #### Return Value | | | | --- | --- | | [XPathExpr](xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | #### Exceptions | | | | --- | --- | | [ExpressionErrorException](../exception/expressionerrorexception "Symfony\Component\CssSelector\Exception\ExpressionErrorException") | | symfony PseudoClassExtension PseudoClassExtension ===================== class **PseudoClassExtension** extends [AbstractExtension](abstractextension "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") XPath expression translator pseudo-class extension. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | callable[] | [getNodeTranslators](#method_getNodeTranslators)() Returns node translators. | from [AbstractExtension](abstractextension#method_getNodeTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getCombinationTranslators](#method_getCombinationTranslators)() Returns combination translators. | from [AbstractExtension](abstractextension#method_getCombinationTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getFunctionTranslators](#method_getFunctionTranslators)() Returns function translators. | from [AbstractExtension](abstractextension#method_getFunctionTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getPseudoClassTranslators](#method_getPseudoClassTranslators)() Returns pseudo-class translators. | | | callable[] | [getAttributeMatchingTranslators](#method_getAttributeMatchingTranslators)() Returns attribute operation translators. | from [AbstractExtension](abstractextension#method_getAttributeMatchingTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateRoot](#method_translateRoot)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateFirstChild](#method_translateFirstChild)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateLastChild](#method_translateLastChild)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateFirstOfType](#method_translateFirstOfType)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateLastOfType](#method_translateLastOfType)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateOnlyChild](#method_translateOnlyChild)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateOnlyOfType](#method_translateOnlyOfType)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateEmpty](#method_translateEmpty)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) | | | string | [getName](#method_getName)() Returns extension name. | | Details ------- ### callable[] getNodeTranslators() Returns node translators. These callables will receive the node as first argument and the translator as second argument. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getCombinationTranslators() Returns combination translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getFunctionTranslators() Returns function translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getPseudoClassTranslators() Returns pseudo-class translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getAttributeMatchingTranslators() Returns attribute operation translators. #### Return Value | | | | --- | --- | | callable[] | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateRoot([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateFirstChild([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateLastChild([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateFirstOfType([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | #### Exceptions | | | | --- | --- | | [ExpressionErrorException](../../exception/expressionerrorexception "Symfony\Component\CssSelector\Exception\ExpressionErrorException") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateLastOfType([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | #### Exceptions | | | | --- | --- | | [ExpressionErrorException](../../exception/expressionerrorexception "Symfony\Component\CssSelector\Exception\ExpressionErrorException") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateOnlyChild([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateOnlyOfType([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | #### Exceptions | | | | --- | --- | | [ExpressionErrorException](../../exception/expressionerrorexception "Symfony\Component\CssSelector\Exception\ExpressionErrorException") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateEmpty([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### string getName() Returns extension name. #### Return Value | | | | --- | --- | | string | |
programming_docs
symfony HtmlExtension HtmlExtension ============== class **HtmlExtension** extends [AbstractExtension](abstractextension "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") XPath expression translator HTML extension. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | callable[] | [getNodeTranslators](#method_getNodeTranslators)() Returns node translators. | from [AbstractExtension](abstractextension#method_getNodeTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getCombinationTranslators](#method_getCombinationTranslators)() Returns combination translators. | from [AbstractExtension](abstractextension#method_getCombinationTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getFunctionTranslators](#method_getFunctionTranslators)() Returns function translators. | | | callable[] | [getPseudoClassTranslators](#method_getPseudoClassTranslators)() Returns pseudo-class translators. | | | callable[] | [getAttributeMatchingTranslators](#method_getAttributeMatchingTranslators)() Returns attribute operation translators. | from [AbstractExtension](abstractextension#method_getAttributeMatchingTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | | [\_\_construct](#method___construct)([Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateChecked](#method_translateChecked)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateLink](#method_translateLink)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateDisabled](#method_translateDisabled)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateEnabled](#method_translateEnabled)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateLang](#method_translateLang)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $function) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateSelected](#method_translateSelected)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateInvalid](#method_translateInvalid)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateHover](#method_translateHover)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateVisited](#method_translateVisited)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) | | | string | [getName](#method_getName)() Returns extension name. | | Details ------- ### callable[] getNodeTranslators() Returns node translators. These callables will receive the node as first argument and the translator as second argument. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getCombinationTranslators() Returns combination translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getFunctionTranslators() Returns function translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getPseudoClassTranslators() Returns pseudo-class translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getAttributeMatchingTranslators() Returns attribute operation translators. #### Return Value | | | | --- | --- | | callable[] | | ### \_\_construct([Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) #### Parameters | | | | | --- | --- | --- | | [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") | $translator | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateChecked([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateLink([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateDisabled([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateEnabled([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateLang([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $function) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") | $function | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | #### Exceptions | | | | --- | --- | | [ExpressionErrorException](../../exception/expressionerrorexception "Symfony\Component\CssSelector\Exception\ExpressionErrorException") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateSelected([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateInvalid([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateHover([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateVisited([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### string getName() Returns extension name. #### Return Value | | | | --- | --- | | string | | symfony FunctionExtension FunctionExtension ================== class **FunctionExtension** extends [AbstractExtension](abstractextension "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") XPath expression translator function extension. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | callable[] | [getNodeTranslators](#method_getNodeTranslators)() Returns node translators. | from [AbstractExtension](abstractextension#method_getNodeTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getCombinationTranslators](#method_getCombinationTranslators)() Returns combination translators. | from [AbstractExtension](abstractextension#method_getCombinationTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getFunctionTranslators](#method_getFunctionTranslators)() Returns function translators. | | | callable[] | [getPseudoClassTranslators](#method_getPseudoClassTranslators)() Returns pseudo-class translators. | from [AbstractExtension](abstractextension#method_getPseudoClassTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getAttributeMatchingTranslators](#method_getAttributeMatchingTranslators)() Returns attribute operation translators. | from [AbstractExtension](abstractextension#method_getAttributeMatchingTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateNthChild](#method_translateNthChild)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $function, bool $last = false, bool $addNameTest = true) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateNthLastChild](#method_translateNthLastChild)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $function) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateNthOfType](#method_translateNthOfType)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $function) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateNthLastOfType](#method_translateNthLastOfType)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $function) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateContains](#method_translateContains)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $function) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateLang](#method_translateLang)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $function) | | | string | [getName](#method_getName)() Returns extension name. | | Details ------- ### callable[] getNodeTranslators() Returns node translators. These callables will receive the node as first argument and the translator as second argument. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getCombinationTranslators() Returns combination translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getFunctionTranslators() Returns function translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getPseudoClassTranslators() Returns pseudo-class translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getAttributeMatchingTranslators() Returns attribute operation translators. #### Return Value | | | | --- | --- | | callable[] | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateNthChild([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $function, bool $last = false, bool $addNameTest = true) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") | $function | | | bool | $last | | | bool | $addNameTest | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | #### Exceptions | | | | --- | --- | | [ExpressionErrorException](../../exception/expressionerrorexception "Symfony\Component\CssSelector\Exception\ExpressionErrorException") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateNthLastChild([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $function) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") | $function | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateNthOfType([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $function) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") | $function | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateNthLastOfType([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $function) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") | $function | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | #### Exceptions | | | | --- | --- | | [ExpressionErrorException](../../exception/expressionerrorexception "Symfony\Component\CssSelector\Exception\ExpressionErrorException") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateContains([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $function) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") | $function | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | #### Exceptions | | | | --- | --- | | [ExpressionErrorException](../../exception/expressionerrorexception "Symfony\Component\CssSelector\Exception\ExpressionErrorException") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateLang([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $function) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") | $function | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | #### Exceptions | | | | --- | --- | | [ExpressionErrorException](../../exception/expressionerrorexception "Symfony\Component\CssSelector\Exception\ExpressionErrorException") | | ### string getName() Returns extension name. #### Return Value | | | | --- | --- | | string | | symfony AttributeMatchingExtension AttributeMatchingExtension =========================== class **AttributeMatchingExtension** extends [AbstractExtension](abstractextension "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") XPath expression translator attribute extension. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | callable[] | [getNodeTranslators](#method_getNodeTranslators)() Returns node translators. | from [AbstractExtension](abstractextension#method_getNodeTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getCombinationTranslators](#method_getCombinationTranslators)() Returns combination translators. | from [AbstractExtension](abstractextension#method_getCombinationTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getFunctionTranslators](#method_getFunctionTranslators)() Returns function translators. | from [AbstractExtension](abstractextension#method_getFunctionTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getPseudoClassTranslators](#method_getPseudoClassTranslators)() Returns pseudo-class translators. | from [AbstractExtension](abstractextension#method_getPseudoClassTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getAttributeMatchingTranslators](#method_getAttributeMatchingTranslators)() Returns attribute operation translators. | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateExists](#method_translateExists)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $attribute, string|null $value) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateEquals](#method_translateEquals)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $attribute, string|null $value) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateIncludes](#method_translateIncludes)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $attribute, string|null $value) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateDashMatch](#method_translateDashMatch)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $attribute, string|null $value) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translatePrefixMatch](#method_translatePrefixMatch)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $attribute, string|null $value) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateSuffixMatch](#method_translateSuffixMatch)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $attribute, string|null $value) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateSubstringMatch](#method_translateSubstringMatch)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $attribute, string|null $value) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateDifferent](#method_translateDifferent)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $attribute, string|null $value) | | | string | [getName](#method_getName)() Returns extension name. | | Details ------- ### callable[] getNodeTranslators() Returns node translators. These callables will receive the node as first argument and the translator as second argument. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getCombinationTranslators() Returns combination translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getFunctionTranslators() Returns function translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getPseudoClassTranslators() Returns pseudo-class translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getAttributeMatchingTranslators() Returns attribute operation translators. #### Return Value | | | | --- | --- | | callable[] | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateExists([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $attribute, string|null $value) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | string | $attribute | | | string|null | $value | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateEquals([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $attribute, string|null $value) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | string | $attribute | | | string|null | $value | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateIncludes([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $attribute, string|null $value) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | string | $attribute | | | string|null | $value | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateDashMatch([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $attribute, string|null $value) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | string | $attribute | | | string|null | $value | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translatePrefixMatch([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $attribute, string|null $value) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | string | $attribute | | | string|null | $value | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateSuffixMatch([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $attribute, string|null $value) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | string | $attribute | | | string|null | $value | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateSubstringMatch([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $attribute, string|null $value) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | string | $attribute | | | string|null | $value | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateDifferent([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, string $attribute, string|null $value) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | string | $attribute | | | string|null | $value | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### string getName() Returns extension name. #### Return Value | | | | --- | --- | | string | |
programming_docs
symfony NodeExtension NodeExtension ============== class **NodeExtension** extends [AbstractExtension](abstractextension "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") XPath expression translator node extension. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Constants --------- | | | | --- | --- | | ELEMENT\_NAME\_IN\_LOWER\_CASE | | | ATTRIBUTE\_NAME\_IN\_LOWER\_CASE | | | ATTRIBUTE\_VALUE\_IN\_LOWER\_CASE | | Methods ------- | | | | | --- | --- | --- | | callable[] | [getNodeTranslators](#method_getNodeTranslators)() Returns node translators. | | | callable[] | [getCombinationTranslators](#method_getCombinationTranslators)() Returns combination translators. | from [AbstractExtension](abstractextension#method_getCombinationTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getFunctionTranslators](#method_getFunctionTranslators)() Returns function translators. | from [AbstractExtension](abstractextension#method_getFunctionTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getPseudoClassTranslators](#method_getPseudoClassTranslators)() Returns pseudo-class translators. | from [AbstractExtension](abstractextension#method_getPseudoClassTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getAttributeMatchingTranslators](#method_getAttributeMatchingTranslators)() Returns attribute operation translators. | from [AbstractExtension](abstractextension#method_getAttributeMatchingTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | | [\_\_construct](#method___construct)(int $flags = 0) | | | $this | [setFlag](#method_setFlag)(int $flag, bool $on) | | | bool | [hasFlag](#method_hasFlag)(int $flag) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateSelector](#method_translateSelector)([SelectorNode](../../node/selectornode "Symfony\Component\CssSelector\Node\SelectorNode") $node, [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateCombinedSelector](#method_translateCombinedSelector)([CombinedSelectorNode](../../node/combinedselectornode "Symfony\Component\CssSelector\Node\CombinedSelectorNode") $node, [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateNegation](#method_translateNegation)([NegationNode](../../node/negationnode "Symfony\Component\CssSelector\Node\NegationNode") $node, [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateFunction](#method_translateFunction)([FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $node, [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translatePseudo](#method_translatePseudo)([PseudoNode](../../node/pseudonode "Symfony\Component\CssSelector\Node\PseudoNode") $node, [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateAttribute](#method_translateAttribute)([AttributeNode](../../node/attributenode "Symfony\Component\CssSelector\Node\AttributeNode") $node, [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateClass](#method_translateClass)([ClassNode](../../node/classnode "Symfony\Component\CssSelector\Node\ClassNode") $node, [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateHash](#method_translateHash)([HashNode](../../node/hashnode "Symfony\Component\CssSelector\Node\HashNode") $node, [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateElement](#method_translateElement)([ElementNode](../../node/elementnode "Symfony\Component\CssSelector\Node\ElementNode") $node) | | | string | [getName](#method_getName)() Returns extension name. | | Details ------- ### callable[] getNodeTranslators() Returns node translators. These callables will receive the node as first argument and the translator as second argument. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getCombinationTranslators() Returns combination translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getFunctionTranslators() Returns function translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getPseudoClassTranslators() Returns pseudo-class translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getAttributeMatchingTranslators() Returns attribute operation translators. #### Return Value | | | | --- | --- | | callable[] | | ### \_\_construct(int $flags = 0) #### Parameters | | | | | --- | --- | --- | | int | $flags | | ### $this setFlag(int $flag, bool $on) #### Parameters | | | | | --- | --- | --- | | int | $flag | | | bool | $on | | #### Return Value | | | | --- | --- | | $this | | ### bool hasFlag(int $flag) #### Parameters | | | | | --- | --- | --- | | int | $flag | | #### Return Value | | | | --- | --- | | bool | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateSelector([SelectorNode](../../node/selectornode "Symfony\Component\CssSelector\Node\SelectorNode") $node, [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) #### Parameters | | | | | --- | --- | --- | | [SelectorNode](../../node/selectornode "Symfony\Component\CssSelector\Node\SelectorNode") | $node | | | [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") | $translator | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateCombinedSelector([CombinedSelectorNode](../../node/combinedselectornode "Symfony\Component\CssSelector\Node\CombinedSelectorNode") $node, [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) #### Parameters | | | | | --- | --- | --- | | [CombinedSelectorNode](../../node/combinedselectornode "Symfony\Component\CssSelector\Node\CombinedSelectorNode") | $node | | | [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") | $translator | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateNegation([NegationNode](../../node/negationnode "Symfony\Component\CssSelector\Node\NegationNode") $node, [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) #### Parameters | | | | | --- | --- | --- | | [NegationNode](../../node/negationnode "Symfony\Component\CssSelector\Node\NegationNode") | $node | | | [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") | $translator | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateFunction([FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") $node, [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) #### Parameters | | | | | --- | --- | --- | | [FunctionNode](../../node/functionnode "Symfony\Component\CssSelector\Node\FunctionNode") | $node | | | [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") | $translator | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translatePseudo([PseudoNode](../../node/pseudonode "Symfony\Component\CssSelector\Node\PseudoNode") $node, [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) #### Parameters | | | | | --- | --- | --- | | [PseudoNode](../../node/pseudonode "Symfony\Component\CssSelector\Node\PseudoNode") | $node | | | [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") | $translator | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateAttribute([AttributeNode](../../node/attributenode "Symfony\Component\CssSelector\Node\AttributeNode") $node, [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) #### Parameters | | | | | --- | --- | --- | | [AttributeNode](../../node/attributenode "Symfony\Component\CssSelector\Node\AttributeNode") | $node | | | [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") | $translator | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateClass([ClassNode](../../node/classnode "Symfony\Component\CssSelector\Node\ClassNode") $node, [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) #### Parameters | | | | | --- | --- | --- | | [ClassNode](../../node/classnode "Symfony\Component\CssSelector\Node\ClassNode") | $node | | | [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") | $translator | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateHash([HashNode](../../node/hashnode "Symfony\Component\CssSelector\Node\HashNode") $node, [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") $translator) #### Parameters | | | | | --- | --- | --- | | [HashNode](../../node/hashnode "Symfony\Component\CssSelector\Node\HashNode") | $node | | | [Translator](../translator "Symfony\Component\CssSelector\XPath\Translator") | $translator | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateElement([ElementNode](../../node/elementnode "Symfony\Component\CssSelector\Node\ElementNode") $node) #### Parameters | | | | | --- | --- | --- | | [ElementNode](../../node/elementnode "Symfony\Component\CssSelector\Node\ElementNode") | $node | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### string getName() Returns extension name. #### Return Value | | | | --- | --- | | string | | symfony AbstractExtension AbstractExtension ================== abstract class **AbstractExtension** implements [ExtensionInterface](extensioninterface "Symfony\Component\CssSelector\XPath\Extension\ExtensionInterface") XPath expression translator abstract extension. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | callable[] | [getNodeTranslators](#method_getNodeTranslators)() Returns node translators. | | | callable[] | [getCombinationTranslators](#method_getCombinationTranslators)() Returns combination translators. | | | callable[] | [getFunctionTranslators](#method_getFunctionTranslators)() Returns function translators. | | | callable[] | [getPseudoClassTranslators](#method_getPseudoClassTranslators)() Returns pseudo-class translators. | | | callable[] | [getAttributeMatchingTranslators](#method_getAttributeMatchingTranslators)() Returns attribute operation translators. | | Details ------- ### callable[] getNodeTranslators() Returns node translators. These callables will receive the node as first argument and the translator as second argument. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getCombinationTranslators() Returns combination translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getFunctionTranslators() Returns function translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getPseudoClassTranslators() Returns pseudo-class translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getAttributeMatchingTranslators() Returns attribute operation translators. #### Return Value | | | | --- | --- | | callable[] | | symfony CombinationExtension CombinationExtension ===================== class **CombinationExtension** extends [AbstractExtension](abstractextension "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") XPath expression translator combination extension. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | callable[] | [getNodeTranslators](#method_getNodeTranslators)() Returns node translators. | from [AbstractExtension](abstractextension#method_getNodeTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getCombinationTranslators](#method_getCombinationTranslators)() Returns combination translators. | | | callable[] | [getFunctionTranslators](#method_getFunctionTranslators)() Returns function translators. | from [AbstractExtension](abstractextension#method_getFunctionTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getPseudoClassTranslators](#method_getPseudoClassTranslators)() Returns pseudo-class translators. | from [AbstractExtension](abstractextension#method_getPseudoClassTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | callable[] | [getAttributeMatchingTranslators](#method_getAttributeMatchingTranslators)() Returns attribute operation translators. | from [AbstractExtension](abstractextension#method_getAttributeMatchingTranslators "Symfony\Component\CssSelector\XPath\Extension\AbstractExtension") | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateDescendant](#method_translateDescendant)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $combinedXpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateChild](#method_translateChild)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $combinedXpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateDirectAdjacent](#method_translateDirectAdjacent)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $combinedXpath) | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | [translateIndirectAdjacent](#method_translateIndirectAdjacent)([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $combinedXpath) | | | string | [getName](#method_getName)() Returns extension name. | | Details ------- ### callable[] getNodeTranslators() Returns node translators. These callables will receive the node as first argument and the translator as second argument. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getCombinationTranslators() Returns combination translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getFunctionTranslators() Returns function translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getPseudoClassTranslators() Returns pseudo-class translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getAttributeMatchingTranslators() Returns attribute operation translators. #### Return Value | | | | --- | --- | | callable[] | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateDescendant([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $combinedXpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $combinedXpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateChild([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $combinedXpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $combinedXpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateDirectAdjacent([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $combinedXpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $combinedXpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") translateIndirectAdjacent([XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $xpath, [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") $combinedXpath) #### Parameters | | | | | --- | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $xpath | | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | $combinedXpath | | #### Return Value | | | | --- | --- | | [XPathExpr](../xpathexpr "Symfony\Component\CssSelector\XPath\XPathExpr") | | ### string getName() Returns extension name. #### Return Value | | | | --- | --- | | string | |
programming_docs
symfony ExtensionInterface ExtensionInterface =================== interface **ExtensionInterface** XPath expression translator extension interface. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | callable[] | [getNodeTranslators](#method_getNodeTranslators)() Returns node translators. | | | callable[] | [getCombinationTranslators](#method_getCombinationTranslators)() Returns combination translators. | | | callable[] | [getFunctionTranslators](#method_getFunctionTranslators)() Returns function translators. | | | callable[] | [getPseudoClassTranslators](#method_getPseudoClassTranslators)() Returns pseudo-class translators. | | | callable[] | [getAttributeMatchingTranslators](#method_getAttributeMatchingTranslators)() Returns attribute operation translators. | | | string | [getName](#method_getName)() Returns extension name. | | Details ------- ### callable[] getNodeTranslators() Returns node translators. These callables will receive the node as first argument and the translator as second argument. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getCombinationTranslators() Returns combination translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getFunctionTranslators() Returns function translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getPseudoClassTranslators() Returns pseudo-class translators. #### Return Value | | | | --- | --- | | callable[] | | ### callable[] getAttributeMatchingTranslators() Returns attribute operation translators. #### Return Value | | | | --- | --- | | callable[] | | ### string getName() Returns extension name. #### Return Value | | | | --- | --- | | string | | symfony Parser Parser ======= class **Parser** implements [ParserInterface](parserinterface "Symfony\Component\CssSelector\Parser\ParserInterface") CSS selector parser. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Tokenizer](tokenizer/tokenizer "Symfony\Component\CssSelector\Parser\Tokenizer\Tokenizer") $tokenizer = null) | | | array | [parse](#method_parse)(string $source) Parses given selector source into an array of tokens. | | | static array | [parseSeries](#method_parseSeries)(array $tokens) Parses the arguments for ":nth-child()" and friends. | | Details ------- ### \_\_construct([Tokenizer](tokenizer/tokenizer "Symfony\Component\CssSelector\Parser\Tokenizer\Tokenizer") $tokenizer = null) #### Parameters | | | | | --- | --- | --- | | [Tokenizer](tokenizer/tokenizer "Symfony\Component\CssSelector\Parser\Tokenizer\Tokenizer") | $tokenizer | | ### array parse(string $source) Parses given selector source into an array of tokens. #### Parameters | | | | | --- | --- | --- | | string | $source | | #### Return Value | | | | --- | --- | | array | | ### static array parseSeries(array $tokens) Parses the arguments for ":nth-child()" and friends. #### Parameters | | | | | --- | --- | --- | | array | $tokens | | #### Return Value | | | | --- | --- | | array | | #### Exceptions | | | | --- | --- | | [SyntaxErrorException](../exception/syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") | | symfony ParserInterface ParserInterface ================ interface **ParserInterface** CSS selector parser interface. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | array | [parse](#method_parse)(string $source) Parses given selector source into an array of tokens. | | Details ------- ### array parse(string $source) Parses given selector source into an array of tokens. #### Parameters | | | | | --- | --- | --- | | string | $source | | #### Return Value | | | | --- | --- | | array | | symfony Symfony\Component\CssSelector\Parser\Shortcut Symfony\Component\CssSelector\Parser\Shortcut ============================================= Classes ------- | | | | --- | --- | | [ClassParser](shortcut/classparser "Symfony\Component\CssSelector\Parser\Shortcut\ClassParser") | CSS selector class parser shortcut. | | [ElementParser](shortcut/elementparser "Symfony\Component\CssSelector\Parser\Shortcut\ElementParser") | CSS selector element parser shortcut. | | [EmptyStringParser](shortcut/emptystringparser "Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser") | CSS selector class parser shortcut. | | [HashParser](shortcut/hashparser "Symfony\Component\CssSelector\Parser\Shortcut\HashParser") | CSS selector hash parser shortcut. | symfony Symfony\Component\CssSelector\Parser\Handler Symfony\Component\CssSelector\Parser\Handler ============================================ Classes ------- | | | | --- | --- | | [CommentHandler](handler/commenthandler "Symfony\Component\CssSelector\Parser\Handler\CommentHandler") | CSS selector comment handler. | | [HashHandler](handler/hashhandler "Symfony\Component\CssSelector\Parser\Handler\HashHandler") | CSS selector comment handler. | | [IdentifierHandler](handler/identifierhandler "Symfony\Component\CssSelector\Parser\Handler\IdentifierHandler") | CSS selector comment handler. | | [NumberHandler](handler/numberhandler "Symfony\Component\CssSelector\Parser\Handler\NumberHandler") | CSS selector comment handler. | | [StringHandler](handler/stringhandler "Symfony\Component\CssSelector\Parser\Handler\StringHandler") | CSS selector comment handler. | | [WhitespaceHandler](handler/whitespacehandler "Symfony\Component\CssSelector\Parser\Handler\WhitespaceHandler") | CSS selector whitespace handler. | Interfaces ---------- | | | | --- | --- | | *[HandlerInterface](handler/handlerinterface "Symfony\Component\CssSelector\Parser\Handler\HandlerInterface")* | CSS selector handler interface. | symfony TokenStream TokenStream ============ class **TokenStream** CSS selector token stream. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | $this | [push](#method_push)([Token](token "Symfony\Component\CssSelector\Parser\Token") $token) Pushes a token. | | | $this | [freeze](#method_freeze)() Freezes stream. | | | [Token](token "Symfony\Component\CssSelector\Parser\Token") | [getNext](#method_getNext)() Returns next token. | | | [Token](token "Symfony\Component\CssSelector\Parser\Token") | [getPeek](#method_getPeek)() Returns peeked token. | | | [Token](token "Symfony\Component\CssSelector\Parser\Token")[] | [getUsed](#method_getUsed)() Returns used tokens. | | | string | [getNextIdentifier](#method_getNextIdentifier)() Returns nex identifier token. | | | string|null | [getNextIdentifierOrStar](#method_getNextIdentifierOrStar)() Returns nex identifier or star delimiter token. | | | | [skipWhitespace](#method_skipWhitespace)() Skips next whitespace if any. | | Details ------- ### $this push([Token](token "Symfony\Component\CssSelector\Parser\Token") $token) Pushes a token. #### Parameters | | | | | --- | --- | --- | | [Token](token "Symfony\Component\CssSelector\Parser\Token") | $token | | #### Return Value | | | | --- | --- | | $this | | ### $this freeze() Freezes stream. #### Return Value | | | | --- | --- | | $this | | ### [Token](token "Symfony\Component\CssSelector\Parser\Token") getNext() Returns next token. #### Return Value | | | | --- | --- | | [Token](token "Symfony\Component\CssSelector\Parser\Token") | | #### Exceptions | | | | --- | --- | | [InternalErrorException](../exception/internalerrorexception "Symfony\Component\CssSelector\Exception\InternalErrorException") | If there is no more token | ### [Token](token "Symfony\Component\CssSelector\Parser\Token") getPeek() Returns peeked token. #### Return Value | | | | --- | --- | | [Token](token "Symfony\Component\CssSelector\Parser\Token") | | ### [Token](token "Symfony\Component\CssSelector\Parser\Token")[] getUsed() Returns used tokens. #### Return Value | | | | --- | --- | | [Token](token "Symfony\Component\CssSelector\Parser\Token")[] | | ### string getNextIdentifier() Returns nex identifier token. #### Return Value | | | | --- | --- | | string | The identifier token value | #### Exceptions | | | | --- | --- | | [SyntaxErrorException](../exception/syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") | If next token is not an identifier | ### string|null getNextIdentifierOrStar() Returns nex identifier or star delimiter token. #### Return Value | | | | --- | --- | | string|null | The identifier token value or null if star found | #### Exceptions | | | | --- | --- | | [SyntaxErrorException](../exception/syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") | If next token is not an identifier or a star delimiter | ### skipWhitespace() Skips next whitespace if any. symfony Reader Reader ======= class **Reader** CSS selector reader. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $source) | | | bool | [isEOF](#method_isEOF)() | | | int | [getPosition](#method_getPosition)() | | | int | [getRemainingLength](#method_getRemainingLength)() | | | string | [getSubstring](#method_getSubstring)(int $length, int $offset = 0) | | | | [getOffset](#method_getOffset)(string $string) | | | array|false | [findPattern](#method_findPattern)(string $pattern) | | | | [moveForward](#method_moveForward)(int $length) | | | | [moveToEnd](#method_moveToEnd)() | | Details ------- ### \_\_construct(string $source) #### Parameters | | | | | --- | --- | --- | | string | $source | | ### bool isEOF() #### Return Value | | | | --- | --- | | bool | | ### int getPosition() #### Return Value | | | | --- | --- | | int | | ### int getRemainingLength() #### Return Value | | | | --- | --- | | int | | ### string getSubstring(int $length, int $offset = 0) #### Parameters | | | | | --- | --- | --- | | int | $length | | | int | $offset | | #### Return Value | | | | --- | --- | | string | | ### getOffset(string $string) #### Parameters | | | | | --- | --- | --- | | string | $string | | ### array|false findPattern(string $pattern) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | #### Return Value | | | | --- | --- | | array|false | | ### moveForward(int $length) #### Parameters | | | | | --- | --- | --- | | int | $length | | ### moveToEnd() symfony Symfony\Component\CssSelector\Parser\Tokenizer Symfony\Component\CssSelector\Parser\Tokenizer ============================================== Classes ------- | | | | --- | --- | | [Tokenizer](tokenizer/tokenizer "Symfony\Component\CssSelector\Parser\Tokenizer\Tokenizer") | CSS selector tokenizer. | | [TokenizerEscaping](tokenizer/tokenizerescaping "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping") | CSS selector tokenizer escaping applier. | | [TokenizerPatterns](tokenizer/tokenizerpatterns "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns") | CSS selector tokenizer patterns builder. | symfony Token Token ====== class **Token** CSS selector token. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Constants --------- | | | | --- | --- | | TYPE\_FILE\_END | | | TYPE\_DELIMITER | | | TYPE\_WHITESPACE | | | TYPE\_IDENTIFIER | | | TYPE\_HASH | | | TYPE\_NUMBER | | | TYPE\_STRING | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $type, string|null $value, int|null $position) | | | int|null | [getType](#method_getType)() | | | string|null | [getValue](#method_getValue)() | | | int|null | [getPosition](#method_getPosition)() | | | bool | [isFileEnd](#method_isFileEnd)() | | | bool | [isDelimiter](#method_isDelimiter)(array $values = array()) | | | bool | [isWhitespace](#method_isWhitespace)() | | | bool | [isIdentifier](#method_isIdentifier)() | | | bool | [isHash](#method_isHash)() | | | bool | [isNumber](#method_isNumber)() | | | bool | [isString](#method_isString)() | | | string | [\_\_toString](#method___toString)() | | Details ------- ### \_\_construct(string|null $type, string|null $value, int|null $position) #### Parameters | | | | | --- | --- | --- | | string|null | $type | | | string|null | $value | | | int|null | $position | | ### int|null getType() #### Return Value | | | | --- | --- | | int|null | | ### string|null getValue() #### Return Value | | | | --- | --- | | string|null | | ### int|null getPosition() #### Return Value | | | | --- | --- | | int|null | | ### bool isFileEnd() #### Return Value | | | | --- | --- | | bool | | ### bool isDelimiter(array $values = array()) #### Parameters | | | | | --- | --- | --- | | array | $values | | #### Return Value | | | | --- | --- | | bool | | ### bool isWhitespace() #### Return Value | | | | --- | --- | | bool | | ### bool isIdentifier() #### Return Value | | | | --- | --- | | bool | | ### bool isHash() #### Return Value | | | | --- | --- | | bool | | ### bool isNumber() #### Return Value | | | | --- | --- | | bool | | ### bool isString() #### Return Value | | | | --- | --- | | bool | | ### string \_\_toString() #### Return Value | | | | --- | --- | | string | | symfony HandlerInterface HandlerInterface ================= interface **HandlerInterface** CSS selector handler interface. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | bool | [handle](#method_handle)([Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") $reader, [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") $stream) | | Details ------- ### bool handle([Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") $reader, [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") $stream) #### Parameters | | | | | --- | --- | --- | | [Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") | $reader | | | [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") | $stream | | #### Return Value | | | | --- | --- | | bool | | symfony StringHandler StringHandler ============== class **StringHandler** implements [HandlerInterface](handlerinterface "Symfony\Component\CssSelector\Parser\Handler\HandlerInterface") CSS selector comment handler. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenizerPatterns](../tokenizer/tokenizerpatterns "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns") $patterns, [TokenizerEscaping](../tokenizer/tokenizerescaping "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping") $escaping) | | | bool | [handle](#method_handle)([Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") $reader, [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") $stream) | | Details ------- ### \_\_construct([TokenizerPatterns](../tokenizer/tokenizerpatterns "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns") $patterns, [TokenizerEscaping](../tokenizer/tokenizerescaping "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping") $escaping) #### Parameters | | | | | --- | --- | --- | | [TokenizerPatterns](../tokenizer/tokenizerpatterns "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns") | $patterns | | | [TokenizerEscaping](../tokenizer/tokenizerescaping "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping") | $escaping | | ### bool handle([Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") $reader, [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") $stream) #### Parameters | | | | | --- | --- | --- | | [Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") | $reader | | | [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") | $stream | | #### Return Value | | | | --- | --- | | bool | | symfony WhitespaceHandler WhitespaceHandler ================== class **WhitespaceHandler** implements [HandlerInterface](handlerinterface "Symfony\Component\CssSelector\Parser\Handler\HandlerInterface") CSS selector whitespace handler. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | bool | [handle](#method_handle)([Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") $reader, [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") $stream) | | Details ------- ### bool handle([Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") $reader, [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") $stream) #### Parameters | | | | | --- | --- | --- | | [Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") | $reader | | | [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") | $stream | | #### Return Value | | | | --- | --- | | bool | | symfony HashHandler HashHandler ============ class **HashHandler** implements [HandlerInterface](handlerinterface "Symfony\Component\CssSelector\Parser\Handler\HandlerInterface") CSS selector comment handler. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenizerPatterns](../tokenizer/tokenizerpatterns "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns") $patterns, [TokenizerEscaping](../tokenizer/tokenizerescaping "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping") $escaping) | | | bool | [handle](#method_handle)([Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") $reader, [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") $stream) | | Details ------- ### \_\_construct([TokenizerPatterns](../tokenizer/tokenizerpatterns "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns") $patterns, [TokenizerEscaping](../tokenizer/tokenizerescaping "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping") $escaping) #### Parameters | | | | | --- | --- | --- | | [TokenizerPatterns](../tokenizer/tokenizerpatterns "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns") | $patterns | | | [TokenizerEscaping](../tokenizer/tokenizerescaping "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping") | $escaping | | ### bool handle([Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") $reader, [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") $stream) #### Parameters | | | | | --- | --- | --- | | [Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") | $reader | | | [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") | $stream | | #### Return Value | | | | --- | --- | | bool | |
programming_docs
symfony NumberHandler NumberHandler ============== class **NumberHandler** implements [HandlerInterface](handlerinterface "Symfony\Component\CssSelector\Parser\Handler\HandlerInterface") CSS selector comment handler. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenizerPatterns](../tokenizer/tokenizerpatterns "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns") $patterns) | | | bool | [handle](#method_handle)([Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") $reader, [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") $stream) | | Details ------- ### \_\_construct([TokenizerPatterns](../tokenizer/tokenizerpatterns "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns") $patterns) #### Parameters | | | | | --- | --- | --- | | [TokenizerPatterns](../tokenizer/tokenizerpatterns "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns") | $patterns | | ### bool handle([Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") $reader, [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") $stream) #### Parameters | | | | | --- | --- | --- | | [Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") | $reader | | | [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") | $stream | | #### Return Value | | | | --- | --- | | bool | | symfony IdentifierHandler IdentifierHandler ================== class **IdentifierHandler** implements [HandlerInterface](handlerinterface "Symfony\Component\CssSelector\Parser\Handler\HandlerInterface") CSS selector comment handler. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenizerPatterns](../tokenizer/tokenizerpatterns "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns") $patterns, [TokenizerEscaping](../tokenizer/tokenizerescaping "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping") $escaping) | | | bool | [handle](#method_handle)([Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") $reader, [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") $stream) | | Details ------- ### \_\_construct([TokenizerPatterns](../tokenizer/tokenizerpatterns "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns") $patterns, [TokenizerEscaping](../tokenizer/tokenizerescaping "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping") $escaping) #### Parameters | | | | | --- | --- | --- | | [TokenizerPatterns](../tokenizer/tokenizerpatterns "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns") | $patterns | | | [TokenizerEscaping](../tokenizer/tokenizerescaping "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping") | $escaping | | ### bool handle([Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") $reader, [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") $stream) #### Parameters | | | | | --- | --- | --- | | [Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") | $reader | | | [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") | $stream | | #### Return Value | | | | --- | --- | | bool | | symfony CommentHandler CommentHandler =============== class **CommentHandler** implements [HandlerInterface](handlerinterface "Symfony\Component\CssSelector\Parser\Handler\HandlerInterface") CSS selector comment handler. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | bool | [handle](#method_handle)([Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") $reader, [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") $stream) | | Details ------- ### bool handle([Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") $reader, [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") $stream) #### Parameters | | | | | --- | --- | --- | | [Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") | $reader | | | [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") | $stream | | #### Return Value | | | | --- | --- | | bool | | symfony ElementParser ElementParser ============== class **ElementParser** implements [ParserInterface](../parserinterface "Symfony\Component\CssSelector\Parser\ParserInterface") CSS selector element parser shortcut. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | array | [parse](#method_parse)(string $source) Parses given selector source into an array of tokens. | | Details ------- ### array parse(string $source) Parses given selector source into an array of tokens. #### Parameters | | | | | --- | --- | --- | | string | $source | | #### Return Value | | | | --- | --- | | array | | symfony EmptyStringParser EmptyStringParser ================== class **EmptyStringParser** implements [ParserInterface](../parserinterface "Symfony\Component\CssSelector\Parser\ParserInterface") CSS selector class parser shortcut. This shortcut ensure compatibility with previous version. - The parser fails to parse an empty string. - In the previous version, an empty string matches each tags. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | array | [parse](#method_parse)(string $source) Parses given selector source into an array of tokens. | | Details ------- ### array parse(string $source) Parses given selector source into an array of tokens. #### Parameters | | | | | --- | --- | --- | | string | $source | | #### Return Value | | | | --- | --- | | array | | symfony HashParser HashParser =========== class **HashParser** implements [ParserInterface](../parserinterface "Symfony\Component\CssSelector\Parser\ParserInterface") CSS selector hash parser shortcut. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | array | [parse](#method_parse)(string $source) Parses given selector source into an array of tokens. | | Details ------- ### array parse(string $source) Parses given selector source into an array of tokens. #### Parameters | | | | | --- | --- | --- | | string | $source | | #### Return Value | | | | --- | --- | | array | | symfony ClassParser ClassParser ============ class **ClassParser** implements [ParserInterface](../parserinterface "Symfony\Component\CssSelector\Parser\ParserInterface") CSS selector class parser shortcut. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | array | [parse](#method_parse)(string $source) Parses given selector source into an array of tokens. | | Details ------- ### array parse(string $source) Parses given selector source into an array of tokens. #### Parameters | | | | | --- | --- | --- | | string | $source | | #### Return Value | | | | --- | --- | | array | | symfony TokenizerPatterns TokenizerPatterns ================== class **TokenizerPatterns** CSS selector tokenizer patterns builder. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)() | | | string | [getNewLineEscapePattern](#method_getNewLineEscapePattern)() | | | string | [getSimpleEscapePattern](#method_getSimpleEscapePattern)() | | | string | [getUnicodeEscapePattern](#method_getUnicodeEscapePattern)() | | | string | [getIdentifierPattern](#method_getIdentifierPattern)() | | | string | [getHashPattern](#method_getHashPattern)() | | | string | [getNumberPattern](#method_getNumberPattern)() | | | string | [getQuotedStringPattern](#method_getQuotedStringPattern)(string $quote) | | Details ------- ### \_\_construct() ### string getNewLineEscapePattern() #### Return Value | | | | --- | --- | | string | | ### string getSimpleEscapePattern() #### Return Value | | | | --- | --- | | string | | ### string getUnicodeEscapePattern() #### Return Value | | | | --- | --- | | string | | ### string getIdentifierPattern() #### Return Value | | | | --- | --- | | string | | ### string getHashPattern() #### Return Value | | | | --- | --- | | string | | ### string getNumberPattern() #### Return Value | | | | --- | --- | | string | | ### string getQuotedStringPattern(string $quote) #### Parameters | | | | | --- | --- | --- | | string | $quote | | #### Return Value | | | | --- | --- | | string | | symfony Tokenizer Tokenizer ========== class **Tokenizer** CSS selector tokenizer. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)() | | | [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") | [tokenize](#method_tokenize)([Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") $reader) Tokenize selector source code. | | Details ------- ### \_\_construct() ### [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") tokenize([Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") $reader) Tokenize selector source code. #### Parameters | | | | | --- | --- | --- | | [Reader](../reader "Symfony\Component\CssSelector\Parser\Reader") | $reader | | #### Return Value | | | | --- | --- | | [TokenStream](../tokenstream "Symfony\Component\CssSelector\Parser\TokenStream") | | symfony TokenizerEscaping TokenizerEscaping ================== class **TokenizerEscaping** CSS selector tokenizer escaping applier. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenizerPatterns](tokenizerpatterns "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns") $patterns) | | | string | [escapeUnicode](#method_escapeUnicode)(string $value) | | | string | [escapeUnicodeAndNewLine](#method_escapeUnicodeAndNewLine)(string $value) | | Details ------- ### \_\_construct([TokenizerPatterns](tokenizerpatterns "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns") $patterns) #### Parameters | | | | | --- | --- | --- | | [TokenizerPatterns](tokenizerpatterns "Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns") | $patterns | | ### string escapeUnicode(string $value) #### Parameters | | | | | --- | --- | --- | | string | $value | | #### Return Value | | | | --- | --- | | string | | ### string escapeUnicodeAndNewLine(string $value) #### Parameters | | | | | --- | --- | --- | | string | $value | | #### Return Value | | | | --- | --- | | string | | symfony Specificity Specificity ============ class **Specificity** Represents a node specificity. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Constants --------- | | | | --- | --- | | A\_FACTOR | | | B\_FACTOR | | | C\_FACTOR | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(int $a, int $b, int $c) | | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | [plus](#method_plus)([Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") $specificity) | | | int | [getValue](#method_getValue)() | | | int | [compareTo](#method_compareTo)([Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") $specificity) Returns -1 if the object specificity is lower than the argument, 0 if they are equal, and 1 if the argument is lower. | | Details ------- ### \_\_construct(int $a, int $b, int $c) #### Parameters | | | | | --- | --- | --- | | int | $a | | | int | $b | | | int | $c | | ### [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") plus([Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") $specificity) #### Parameters | | | | | --- | --- | --- | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | $specificity | | #### Return Value | | | | --- | --- | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | | ### int getValue() #### Return Value | | | | --- | --- | | int | | ### int compareTo([Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") $specificity) Returns -1 if the object specificity is lower than the argument, 0 if they are equal, and 1 if the argument is lower. #### Parameters | | | | | --- | --- | --- | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | $specificity | | #### Return Value | | | | --- | --- | | int | | symfony AbstractNode AbstractNode ============= abstract class **AbstractNode** implements [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") Abstract base node class. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | string | [getNodeName](#method_getNodeName)() | | Details ------- ### string getNodeName() #### Return Value | | | | --- | --- | | string | | symfony AttributeNode AttributeNode ============== class **AttributeNode** extends [AbstractNode](abstractnode "Symfony\Component\CssSelector\Node\AbstractNode") Represents a "[| ]" node. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | string | [getNodeName](#method_getNodeName)() | from [AbstractNode](abstractnode#method_getNodeName "Symfony\Component\CssSelector\Node\AbstractNode") | | | [\_\_construct](#method___construct)([NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $selector, string|null $namespace, string $attribute, string $operator, string|null $value) | | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | [getSelector](#method_getSelector)() | | | string|null | [getNamespace](#method_getNamespace)() | | | string | [getAttribute](#method_getAttribute)() | | | string | [getOperator](#method_getOperator)() | | | string|null | [getValue](#method_getValue)() | | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | [getSpecificity](#method_getSpecificity)() | | | string | [\_\_toString](#method___toString)() | | Details ------- ### string getNodeName() #### Return Value | | | | --- | --- | | string | | ### \_\_construct([NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $selector, string|null $namespace, string $attribute, string $operator, string|null $value) #### Parameters | | | | | --- | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | $selector | | | string|null | $namespace | | | string | $attribute | | | string | $operator | | | string|null | $value | | ### [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") getSelector() #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | | ### string|null getNamespace() #### Return Value | | | | --- | --- | | string|null | | ### string getAttribute() #### Return Value | | | | --- | --- | | string | | ### string getOperator() #### Return Value | | | | --- | --- | | string | | ### string|null getValue() #### Return Value | | | | --- | --- | | string|null | | ### [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") getSpecificity() #### Return Value | | | | --- | --- | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | | ### string \_\_toString() #### Return Value | | | | --- | --- | | string | | symfony FunctionNode FunctionNode ============= class **FunctionNode** extends [AbstractNode](abstractnode "Symfony\Component\CssSelector\Node\AbstractNode") Represents a ":()" node. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | string | [getNodeName](#method_getNodeName)() | from [AbstractNode](abstractnode#method_getNodeName "Symfony\Component\CssSelector\Node\AbstractNode") | | | [\_\_construct](#method___construct)([NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $selector, string $name, array $arguments = array()) | | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | [getSelector](#method_getSelector)() | | | string | [getName](#method_getName)() | | | [Token](../parser/token "Symfony\Component\CssSelector\Parser\Token")[] | [getArguments](#method_getArguments)() | | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | [getSpecificity](#method_getSpecificity)() | | | string | [\_\_toString](#method___toString)() | | Details ------- ### string getNodeName() #### Return Value | | | | --- | --- | | string | | ### \_\_construct([NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $selector, string $name, array $arguments = array()) #### Parameters | | | | | --- | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | $selector | | | string | $name | | | array | $arguments | | ### [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") getSelector() #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | | ### string getName() #### Return Value | | | | --- | --- | | string | | ### [Token](../parser/token "Symfony\Component\CssSelector\Parser\Token")[] getArguments() #### Return Value | | | | --- | --- | | [Token](../parser/token "Symfony\Component\CssSelector\Parser\Token")[] | | ### [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") getSpecificity() #### Return Value | | | | --- | --- | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | | ### string \_\_toString() #### Return Value | | | | --- | --- | | string | |
programming_docs
symfony PseudoNode PseudoNode =========== class **PseudoNode** extends [AbstractNode](abstractnode "Symfony\Component\CssSelector\Node\AbstractNode") Represents a ":" node. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | string | [getNodeName](#method_getNodeName)() | from [AbstractNode](abstractnode#method_getNodeName "Symfony\Component\CssSelector\Node\AbstractNode") | | | [\_\_construct](#method___construct)([NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $selector, string $identifier) | | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | [getSelector](#method_getSelector)() | | | string | [getIdentifier](#method_getIdentifier)() | | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | [getSpecificity](#method_getSpecificity)() | | | string | [\_\_toString](#method___toString)() | | Details ------- ### string getNodeName() #### Return Value | | | | --- | --- | | string | | ### \_\_construct([NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $selector, string $identifier) #### Parameters | | | | | --- | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | $selector | | | string | $identifier | | ### [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") getSelector() #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | | ### string getIdentifier() #### Return Value | | | | --- | --- | | string | | ### [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") getSpecificity() #### Return Value | | | | --- | --- | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | | ### string \_\_toString() #### Return Value | | | | --- | --- | | string | | symfony ElementNode ElementNode ============ class **ElementNode** extends [AbstractNode](abstractnode "Symfony\Component\CssSelector\Node\AbstractNode") Represents a "|" node. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | string | [getNodeName](#method_getNodeName)() | from [AbstractNode](abstractnode#method_getNodeName "Symfony\Component\CssSelector\Node\AbstractNode") | | | [\_\_construct](#method___construct)(string $namespace = null, string $element = null) | | | string|null | [getNamespace](#method_getNamespace)() | | | string|null | [getElement](#method_getElement)() | | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | [getSpecificity](#method_getSpecificity)() | | | string | [\_\_toString](#method___toString)() | | Details ------- ### string getNodeName() #### Return Value | | | | --- | --- | | string | | ### \_\_construct(string $namespace = null, string $element = null) #### Parameters | | | | | --- | --- | --- | | string | $namespace | | | string | $element | | ### string|null getNamespace() #### Return Value | | | | --- | --- | | string|null | | ### string|null getElement() #### Return Value | | | | --- | --- | | string|null | | ### [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") getSpecificity() #### Return Value | | | | --- | --- | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | | ### string \_\_toString() #### Return Value | | | | --- | --- | | string | | symfony NegationNode NegationNode ============= class **NegationNode** extends [AbstractNode](abstractnode "Symfony\Component\CssSelector\Node\AbstractNode") Represents a ":not()" node. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | string | [getNodeName](#method_getNodeName)() | from [AbstractNode](abstractnode#method_getNodeName "Symfony\Component\CssSelector\Node\AbstractNode") | | | [\_\_construct](#method___construct)([NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $selector, [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $subSelector) | | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | [getSelector](#method_getSelector)() | | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | [getSubSelector](#method_getSubSelector)() | | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | [getSpecificity](#method_getSpecificity)() | | | string | [\_\_toString](#method___toString)() | | Details ------- ### string getNodeName() #### Return Value | | | | --- | --- | | string | | ### \_\_construct([NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $selector, [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $subSelector) #### Parameters | | | | | --- | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | $selector | | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | $subSelector | | ### [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") getSelector() #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | | ### [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") getSubSelector() #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | | ### [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") getSpecificity() #### Return Value | | | | --- | --- | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | | ### string \_\_toString() #### Return Value | | | | --- | --- | | string | | symfony HashNode HashNode ========= class **HashNode** extends [AbstractNode](abstractnode "Symfony\Component\CssSelector\Node\AbstractNode") Represents a "#" node. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | string | [getNodeName](#method_getNodeName)() | from [AbstractNode](abstractnode#method_getNodeName "Symfony\Component\CssSelector\Node\AbstractNode") | | | [\_\_construct](#method___construct)([NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $selector, string $id) | | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | [getSelector](#method_getSelector)() | | | string | [getId](#method_getId)() | | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | [getSpecificity](#method_getSpecificity)() | | | string | [\_\_toString](#method___toString)() | | Details ------- ### string getNodeName() #### Return Value | | | | --- | --- | | string | | ### \_\_construct([NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $selector, string $id) #### Parameters | | | | | --- | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | $selector | | | string | $id | | ### [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") getSelector() #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | | ### string getId() #### Return Value | | | | --- | --- | | string | | ### [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") getSpecificity() #### Return Value | | | | --- | --- | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | | ### string \_\_toString() #### Return Value | | | | --- | --- | | string | | symfony NodeInterface NodeInterface ============== interface **NodeInterface** Interface for nodes. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | string | [getNodeName](#method_getNodeName)() | | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | [getSpecificity](#method_getSpecificity)() | | | string | [\_\_toString](#method___toString)() | | Details ------- ### string getNodeName() #### Return Value | | | | --- | --- | | string | | ### [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") getSpecificity() #### Return Value | | | | --- | --- | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | | ### string \_\_toString() #### Return Value | | | | --- | --- | | string | | symfony SelectorNode SelectorNode ============= class **SelectorNode** extends [AbstractNode](abstractnode "Symfony\Component\CssSelector\Node\AbstractNode") Represents a "(::|:)" node. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | string | [getNodeName](#method_getNodeName)() | from [AbstractNode](abstractnode#method_getNodeName "Symfony\Component\CssSelector\Node\AbstractNode") | | | [\_\_construct](#method___construct)([NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $tree, string $pseudoElement = null) | | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | [getTree](#method_getTree)() | | | string|null | [getPseudoElement](#method_getPseudoElement)() | | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | [getSpecificity](#method_getSpecificity)() | | | string | [\_\_toString](#method___toString)() | | Details ------- ### string getNodeName() #### Return Value | | | | --- | --- | | string | | ### \_\_construct([NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $tree, string $pseudoElement = null) #### Parameters | | | | | --- | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | $tree | | | string | $pseudoElement | | ### [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") getTree() #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | | ### string|null getPseudoElement() #### Return Value | | | | --- | --- | | string|null | | ### [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") getSpecificity() #### Return Value | | | | --- | --- | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | | ### string \_\_toString() #### Return Value | | | | --- | --- | | string | | symfony ClassNode ClassNode ========== class **ClassNode** extends [AbstractNode](abstractnode "Symfony\Component\CssSelector\Node\AbstractNode") Represents a "." node. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | string | [getNodeName](#method_getNodeName)() | from [AbstractNode](abstractnode#method_getNodeName "Symfony\Component\CssSelector\Node\AbstractNode") | | | [\_\_construct](#method___construct)([NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $selector, string $name) | | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | [getSelector](#method_getSelector)() | | | string | [getName](#method_getName)() | | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | [getSpecificity](#method_getSpecificity)() | | | string | [\_\_toString](#method___toString)() | | Details ------- ### string getNodeName() #### Return Value | | | | --- | --- | | string | | ### \_\_construct([NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $selector, string $name) #### Parameters | | | | | --- | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | $selector | | | string | $name | | ### [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") getSelector() #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | | ### string getName() #### Return Value | | | | --- | --- | | string | | ### [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") getSpecificity() #### Return Value | | | | --- | --- | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | | ### string \_\_toString() #### Return Value | | | | --- | --- | | string | | symfony CombinedSelectorNode CombinedSelectorNode ===================== class **CombinedSelectorNode** extends [AbstractNode](abstractnode "Symfony\Component\CssSelector\Node\AbstractNode") Represents a combined node. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | string | [getNodeName](#method_getNodeName)() | from [AbstractNode](abstractnode#method_getNodeName "Symfony\Component\CssSelector\Node\AbstractNode") | | | [\_\_construct](#method___construct)([NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $selector, string $combinator, [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $subSelector) | | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | [getSelector](#method_getSelector)() | | | string | [getCombinator](#method_getCombinator)() | | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | [getSubSelector](#method_getSubSelector)() | | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | [getSpecificity](#method_getSpecificity)() | | | string | [\_\_toString](#method___toString)() | | Details ------- ### string getNodeName() #### Return Value | | | | --- | --- | | string | | ### \_\_construct([NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $selector, string $combinator, [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") $subSelector) #### Parameters | | | | | --- | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | $selector | | | string | $combinator | | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | $subSelector | | ### [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") getSelector() #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | | ### string getCombinator() #### Return Value | | | | --- | --- | | string | | ### [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") getSubSelector() #### Return Value | | | | --- | --- | | [NodeInterface](nodeinterface "Symfony\Component\CssSelector\Node\NodeInterface") | | ### [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") getSpecificity() #### Return Value | | | | --- | --- | | [Specificity](specificity "Symfony\Component\CssSelector\Node\Specificity") | | ### string \_\_toString() #### Return Value | | | | --- | --- | | string | | symfony ExpressionErrorException ExpressionErrorException ========================= class **ExpressionErrorException** extends [ParseException](parseexception "Symfony\Component\CssSelector\Exception\ParseException") ParseException is thrown when a CSS selector syntax is not valid. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. symfony ExceptionInterface ExceptionInterface =================== interface **ExceptionInterface** Interface for exceptions. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. symfony ParseException ParseException =============== class **ParseException** extends [Exception](http://php.net/Exception) implements [ExceptionInterface](exceptioninterface "Symfony\Component\CssSelector\Exception\ExceptionInterface") ParseException is thrown when a CSS selector syntax is not valid. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. symfony InternalErrorException InternalErrorException ======================= class **InternalErrorException** extends [ParseException](parseexception "Symfony\Component\CssSelector\Exception\ParseException") ParseException is thrown when a CSS selector syntax is not valid. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. symfony SyntaxErrorException SyntaxErrorException ===================== class **SyntaxErrorException** extends [ParseException](parseexception "Symfony\Component\CssSelector\Exception\ParseException") ParseException is thrown when a CSS selector syntax is not valid. This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect. Methods ------- | | | | | --- | --- | --- | | static [SyntaxErrorException](syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") | [unexpectedToken](#method_unexpectedToken)(string $expectedValue, [Token](../parser/token "Symfony\Component\CssSelector\Parser\Token") $foundToken) | | | static [SyntaxErrorException](syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") | [pseudoElementFound](#method_pseudoElementFound)(string $pseudoElement, string $unexpectedLocation) | | | static [SyntaxErrorException](syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") | [unclosedString](#method_unclosedString)(int $position) | | | static [SyntaxErrorException](syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") | [nestedNot](#method_nestedNot)() | | | static [SyntaxErrorException](syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") | [stringAsFunctionArgument](#method_stringAsFunctionArgument)() | | Details ------- ### static [SyntaxErrorException](syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") unexpectedToken(string $expectedValue, [Token](../parser/token "Symfony\Component\CssSelector\Parser\Token") $foundToken) #### Parameters | | | | | --- | --- | --- | | string | $expectedValue | | | [Token](../parser/token "Symfony\Component\CssSelector\Parser\Token") | $foundToken | | #### Return Value | | | | --- | --- | | [SyntaxErrorException](syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") | | ### static [SyntaxErrorException](syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") pseudoElementFound(string $pseudoElement, string $unexpectedLocation) #### Parameters | | | | | --- | --- | --- | | string | $pseudoElement | | | string | $unexpectedLocation | | #### Return Value | | | | --- | --- | | [SyntaxErrorException](syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") | | ### static [SyntaxErrorException](syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") unclosedString(int $position) #### Parameters | | | | | --- | --- | --- | | int | $position | | #### Return Value | | | | --- | --- | | [SyntaxErrorException](syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") | | ### static [SyntaxErrorException](syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") nestedNot() #### Return Value | | | | --- | --- | | [SyntaxErrorException](syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") | | ### static [SyntaxErrorException](syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") stringAsFunctionArgument() #### Return Value | | | | --- | --- | | [SyntaxErrorException](syntaxerrorexception "Symfony\Component\CssSelector\Exception\SyntaxErrorException") | |
programming_docs
symfony Symfony\Component\VarDumper\Exception Symfony\Component\VarDumper\Exception ===================================== Exceptions ---------- | | | | --- | --- | | [ThrowingCasterException](exception/throwingcasterexception "Symfony\Component\VarDumper\Exception\ThrowingCasterException") | | symfony Symfony\Component\VarDumper\Command Symfony\Component\VarDumper\Command =================================== Namespaces ---------- [Symfony\Component\VarDumper\Command\Descriptor](command/descriptor) Classes ------- | | | | --- | --- | | [ServerDumpCommand](command/serverdumpcommand "Symfony\Component\VarDumper\Command\ServerDumpCommand") | Starts a dump server to collect and output dumps on a single place with multiple formats support. | symfony Symfony\Component\VarDumper\Test Symfony\Component\VarDumper\Test ================================ Classes ------- | | | | --- | --- | | [VarDumperTestTrait](test/vardumpertesttrait "Symfony\Component\VarDumper\Test\VarDumperTestTrait") | | symfony Symfony\Component\VarDumper\Cloner Symfony\Component\VarDumper\Cloner ================================== Classes ------- | | | | --- | --- | | [AbstractCloner](cloner/abstractcloner "Symfony\Component\VarDumper\Cloner\AbstractCloner") | AbstractCloner implements a generic caster mechanism for objects and resources. | | [Cursor](cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") | Represents the current state of a dumper while dumping. | | [Data](cloner/data "Symfony\Component\VarDumper\Cloner\Data") | | | [Stub](cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | Represents the main properties of a PHP variable. | | [VarCloner](cloner/varcloner "Symfony\Component\VarDumper\Cloner\VarCloner") | | Interfaces ---------- | | | | --- | --- | | *[ClonerInterface](cloner/clonerinterface "Symfony\Component\VarDumper\Cloner\ClonerInterface")* | | | *[DumperInterface](cloner/dumperinterface "Symfony\Component\VarDumper\Cloner\DumperInterface")* | DumperInterface used by Data objects. | symfony Symfony\Component\VarDumper\Dumper Symfony\Component\VarDumper\Dumper ================================== Namespaces ---------- [Symfony\Component\VarDumper\Dumper\ContextProvider](dumper/contextprovider) Classes ------- | | | | --- | --- | | [AbstractDumper](dumper/abstractdumper "Symfony\Component\VarDumper\Dumper\AbstractDumper") | Abstract mechanism for dumping a Data object. | | [CliDumper](dumper/clidumper "Symfony\Component\VarDumper\Dumper\CliDumper") | CliDumper dumps variables for command line output. | | [HtmlDumper](dumper/htmldumper "Symfony\Component\VarDumper\Dumper\HtmlDumper") | HtmlDumper dumps variables as HTML. | | [ServerDumper](dumper/serverdumper "Symfony\Component\VarDumper\Dumper\ServerDumper") | ServerDumper forwards serialized Data clones to a server. | Interfaces ---------- | | | | --- | --- | | *[DataDumperInterface](dumper/datadumperinterface "Symfony\Component\VarDumper\Dumper\DataDumperInterface")* | DataDumperInterface for dumping Data objects. | symfony Symfony\Component\VarDumper\Server Symfony\Component\VarDumper\Server ================================== Classes ------- | | | | --- | --- | | [Connection](server/connection "Symfony\Component\VarDumper\Server\Connection") | Forwards serialized Data clones to a server. | | [DumpServer](server/dumpserver "Symfony\Component\VarDumper\Server\DumpServer") | A server collecting Data clones sent by a ServerDumper. | symfony VarDumper VarDumper ========== class **VarDumper** Methods ------- | | | | | --- | --- | --- | | static | [dump](#method_dump)($var) | | | static | [setHandler](#method_setHandler)(callable $callable = null) | | Details ------- ### static dump($var) #### Parameters | | | | | --- | --- | --- | | | $var | | ### static setHandler(callable $callable = null) #### Parameters | | | | | --- | --- | --- | | callable | $callable | | symfony Symfony\Component\VarDumper\Caster Symfony\Component\VarDumper\Caster ================================== Classes ------- | | | | --- | --- | | [AmqpCaster](caster/amqpcaster "Symfony\Component\VarDumper\Caster\AmqpCaster") | Casts Amqp related classes to array representation. | | [ArgsStub](caster/argsstub "Symfony\Component\VarDumper\Caster\ArgsStub") | Represents a list of function arguments. | | [Caster](caster/caster "Symfony\Component\VarDumper\Caster\Caster") | Helper for filtering out properties in casters. | | [ClassStub](caster/classstub "Symfony\Component\VarDumper\Caster\ClassStub") | Represents a PHP class identifier. | | [ConstStub](caster/conststub "Symfony\Component\VarDumper\Caster\ConstStub") | Represents a PHP constant and its value. | | [CutArrayStub](caster/cutarraystub "Symfony\Component\VarDumper\Caster\CutArrayStub") | Represents a cut array. | | [CutStub](caster/cutstub "Symfony\Component\VarDumper\Caster\CutStub") | Represents the main properties of a PHP variable, pre-casted by a caster. | | [DOMCaster](caster/domcaster "Symfony\Component\VarDumper\Caster\DOMCaster") | Casts DOM related classes to array representation. | | [DateCaster](caster/datecaster "Symfony\Component\VarDumper\Caster\DateCaster") | Casts DateTimeInterface related classes to array representation. | | [DoctrineCaster](caster/doctrinecaster "Symfony\Component\VarDumper\Caster\DoctrineCaster") | Casts Doctrine related classes to array representation. | | [EnumStub](caster/enumstub "Symfony\Component\VarDumper\Caster\EnumStub") | Represents an enumeration of values. | | [ExceptionCaster](caster/exceptioncaster "Symfony\Component\VarDumper\Caster\ExceptionCaster") | Casts common Exception classes to array representation. | | [FrameStub](caster/framestub "Symfony\Component\VarDumper\Caster\FrameStub") | Represents a single backtrace frame as returned by debug\_backtrace() or Exception->getTrace(). | | [GmpCaster](caster/gmpcaster "Symfony\Component\VarDumper\Caster\GmpCaster") | Casts GMP objects to array representation. | | [LinkStub](caster/linkstub "Symfony\Component\VarDumper\Caster\LinkStub") | Represents a file or a URL. | | [PdoCaster](caster/pdocaster "Symfony\Component\VarDumper\Caster\PdoCaster") | Casts PDO related classes to array representation. | | [PgSqlCaster](caster/pgsqlcaster "Symfony\Component\VarDumper\Caster\PgSqlCaster") | Casts pqsql resources to array representation. | | [RedisCaster](caster/rediscaster "Symfony\Component\VarDumper\Caster\RedisCaster") | Casts Redis class from ext-redis to array representation. | | [ReflectionCaster](caster/reflectioncaster "Symfony\Component\VarDumper\Caster\ReflectionCaster") | Casts Reflector related classes to array representation. | | [ResourceCaster](caster/resourcecaster "Symfony\Component\VarDumper\Caster\ResourceCaster") | Casts common resource types to array representation. | | [SplCaster](caster/splcaster "Symfony\Component\VarDumper\Caster\SplCaster") | Casts SPL related classes to array representation. | | [StubCaster](caster/stubcaster "Symfony\Component\VarDumper\Caster\StubCaster") | Casts a caster's Stub. | | [SymfonyCaster](caster/symfonycaster "Symfony\Component\VarDumper\Caster\SymfonyCaster") | | | [TraceStub](caster/tracestub "Symfony\Component\VarDumper\Caster\TraceStub") | Represents a backtrace as returned by debug\_backtrace() or Exception->getTrace(). | | [XmlReaderCaster](caster/xmlreadercaster "Symfony\Component\VarDumper\Caster\XmlReaderCaster") | Casts XmlReader class to array representation. | | [XmlResourceCaster](caster/xmlresourcecaster "Symfony\Component\VarDumper\Caster\XmlResourceCaster") | Casts XML resources to array representation. | symfony Stub Stub ===== class **Stub** implements [Serializable](http://php.net/Serializable) Represents the main properties of a PHP variable. Constants --------- | | | | --- | --- | | TYPE\_REF | | | TYPE\_STRING | | | TYPE\_ARRAY | | | TYPE\_OBJECT | | | TYPE\_RESOURCE | | | STRING\_BINARY | | | STRING\_UTF8 | | | ARRAY\_ASSOC | | | ARRAY\_INDEXED | | Properties ---------- | | | | | | --- | --- | --- | --- | | | $type | | | | | $class | | | | | $value | | | | | $cut | | | | | $handle | | | | | $refCount | | | | | $position | | | | | $attr | | | Methods ------- | | | | | --- | --- | --- | | | [serialize](#method_serialize)() | | | | [unserialize](#method_unserialize)($serialized) | | Details ------- ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | symfony DumperInterface DumperInterface ================ interface **DumperInterface** DumperInterface used by Data objects. Methods ------- | | | | | --- | --- | --- | | | [dumpScalar](#method_dumpScalar)([Cursor](cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, string $type, string|int|float|bool $value) Dumps a scalar value. | | | | [dumpString](#method_dumpString)([Cursor](cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, string $str, bool $bin, int $cut) Dumps a string. | | | | [enterHash](#method_enterHash)([Cursor](cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, int $type, string $class, bool $hasChild) Dumps while entering an hash. | | | | [leaveHash](#method_leaveHash)([Cursor](cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, int $type, string $class, bool $hasChild, int $cut) Dumps while leaving an hash. | | Details ------- ### dumpScalar([Cursor](cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, string $type, string|int|float|bool $value) Dumps a scalar value. #### Parameters | | | | | --- | --- | --- | | [Cursor](cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | The Cursor position in the dump | | string | $type | The PHP type of the value being dumped | | string|int|float|bool | $value | The scalar value being dumped | ### dumpString([Cursor](cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, string $str, bool $bin, int $cut) Dumps a string. #### Parameters | | | | | --- | --- | --- | | [Cursor](cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | The Cursor position in the dump | | string | $str | The string being dumped | | bool | $bin | Whether $str is UTF-8 or binary encoded | | int | $cut | The number of characters $str has been cut by | ### enterHash([Cursor](cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, int $type, string $class, bool $hasChild) Dumps while entering an hash. #### Parameters | | | | | --- | --- | --- | | [Cursor](cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | The Cursor position in the dump | | int | $type | A Cursor::HASH\_\* const for the type of hash | | string | $class | The object class, resource type or array count | | bool | $hasChild | When the dump of the hash has child item | ### leaveHash([Cursor](cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, int $type, string $class, bool $hasChild, int $cut) Dumps while leaving an hash. #### Parameters | | | | | --- | --- | --- | | [Cursor](cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | The Cursor position in the dump | | int | $type | A Cursor::HASH\_\* const for the type of hash | | string | $class | The object class, resource type or array count | | bool | $hasChild | When the dump of the hash has child item | | int | $cut | The number of items the hash has been cut by | symfony Data Data ===== class **Data** implements [ArrayAccess](http://php.net/ArrayAccess), [Countable](http://php.net/Countable), [IteratorAggregate](http://php.net/IteratorAggregate) Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $data) | | | string | [getType](#method_getType)() | | | string|int|float|bool|array|[Data](data "Symfony\Component\VarDumper\Cloner\Data")[]|null | [getValue](#method_getValue)(bool $recursive = false) | | | | [count](#method_count)() | | | | [getIterator](#method_getIterator)() | | | | [\_\_get](#method___get)($key) | | | | [\_\_isset](#method___isset)($key) | | | | [offsetExists](#method_offsetExists)($key) | | | | [offsetGet](#method_offsetGet)($key) | | | | [offsetSet](#method_offsetSet)($key, $value) | | | | [offsetUnset](#method_offsetUnset)($key) | | | | [\_\_toString](#method___toString)() | | | [Data](data "Symfony\Component\VarDumper\Cloner\Data") | [withMaxDepth](#method_withMaxDepth)(int $maxDepth) Returns a depth limited clone of $this. | | | [Data](data "Symfony\Component\VarDumper\Cloner\Data") | [withMaxItemsPerDepth](#method_withMaxItemsPerDepth)(int $maxItemsPerDepth) Limits the number of elements per depth level. | | | [Data](data "Symfony\Component\VarDumper\Cloner\Data") | [withRefHandles](#method_withRefHandles)(bool $useRefHandles) Enables/disables objects' identifiers tracking. | | | [Data](data "Symfony\Component\VarDumper\Cloner\Data")|null | [seek](#method_seek)(string|int $key) Seeks to a specific key in nested data structures. | | | | [dump](#method_dump)([DumperInterface](dumperinterface "Symfony\Component\VarDumper\Cloner\DumperInterface") $dumper) Dumps data with a DumperInterface dumper. | | Details ------- ### \_\_construct(array $data) #### Parameters | | | | | --- | --- | --- | | array | $data | An array as returned by ClonerInterface::cloneVar() | ### string getType() #### Return Value | | | | --- | --- | | string | The type of the value | ### string|int|float|bool|array|[Data](data "Symfony\Component\VarDumper\Cloner\Data")[]|null getValue(bool $recursive = false) #### Parameters | | | | | --- | --- | --- | | bool | $recursive | Whether values should be resolved recursively or not | #### Return Value | | | | --- | --- | | string|int|float|bool|array|[Data](data "Symfony\Component\VarDumper\Cloner\Data")[]|null | A native representation of the original value | ### count() ### getIterator() ### \_\_get($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### \_\_isset($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### offsetExists($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### offsetGet($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### offsetSet($key, $value) #### Parameters | | | | | --- | --- | --- | | | $key | | | | $value | | ### offsetUnset($key) #### Parameters | | | | | --- | --- | --- | | | $key | | ### \_\_toString() ### [Data](data "Symfony\Component\VarDumper\Cloner\Data") withMaxDepth(int $maxDepth) Returns a depth limited clone of $this. #### Parameters | | | | | --- | --- | --- | | int | $maxDepth | The max dumped depth level | #### Return Value | | | | --- | --- | | [Data](data "Symfony\Component\VarDumper\Cloner\Data") | A clone of $this | ### [Data](data "Symfony\Component\VarDumper\Cloner\Data") withMaxItemsPerDepth(int $maxItemsPerDepth) Limits the number of elements per depth level. #### Parameters | | | | | --- | --- | --- | | int | $maxItemsPerDepth | The max number of items dumped per depth level | #### Return Value | | | | --- | --- | | [Data](data "Symfony\Component\VarDumper\Cloner\Data") | A clone of $this | ### [Data](data "Symfony\Component\VarDumper\Cloner\Data") withRefHandles(bool $useRefHandles) Enables/disables objects' identifiers tracking. #### Parameters | | | | | --- | --- | --- | | bool | $useRefHandles | False to hide global ref. handles | #### Return Value | | | | --- | --- | | [Data](data "Symfony\Component\VarDumper\Cloner\Data") | A clone of $this | ### [Data](data "Symfony\Component\VarDumper\Cloner\Data")|null seek(string|int $key) Seeks to a specific key in nested data structures. #### Parameters | | | | | --- | --- | --- | | string|int | $key | The key to seek to | #### Return Value | | | | --- | --- | | [Data](data "Symfony\Component\VarDumper\Cloner\Data")|null | A clone of $this or null if the key is not set | ### dump([DumperInterface](dumperinterface "Symfony\Component\VarDumper\Cloner\DumperInterface") $dumper) Dumps data with a DumperInterface dumper. #### Parameters | | | | | --- | --- | --- | | [DumperInterface](dumperinterface "Symfony\Component\VarDumper\Cloner\DumperInterface") | $dumper | | symfony AbstractCloner AbstractCloner =============== abstract class **AbstractCloner** implements [ClonerInterface](clonerinterface "Symfony\Component\VarDumper\Cloner\ClonerInterface") AbstractCloner implements a generic caster mechanism for objects and resources. Properties ---------- | | | | | | --- | --- | --- | --- | | static | $defaultCasters | | | | protected | $maxItems | | | | protected | $maxString | | | | protected | $minDepth | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $casters = null) | | | | [addCasters](#method_addCasters)(array $casters) Adds casters for resources and objects. | | | | [setMaxItems](#method_setMaxItems)(int $maxItems) Sets the maximum number of items to clone past the minimum depth in nested structures. | | | | [setMaxString](#method_setMaxString)(int $maxString) Sets the maximum cloned length for strings. | | | | [setMinDepth](#method_setMinDepth)(int $minDepth) Sets the minimum tree depth where we are guaranteed to clone all the items. After this depth is reached, only setMaxItems items will be cloned. | | | [Data](data "Symfony\Component\VarDumper\Cloner\Data") | [cloneVar](#method_cloneVar)(mixed $var, int $filter = 0) Clones a PHP variable. | | | array | [doClone](#method_doClone)(mixed $var) Effectively clones the PHP variable. | | | array | [castObject](#method_castObject)([Stub](stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, bool $isNested) Casts an object to an array representation. | | | array | [castResource](#method_castResource)([Stub](stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, bool $isNested) Casts a resource to an array representation. | | Details ------- ### \_\_construct(array $casters = null) #### Parameters | | | | | --- | --- | --- | | array | $casters | A map of casters | #### See also | | | | --- | --- | | addCasters | | ### addCasters(array $casters) Adds casters for resources and objects. Maps resources or objects types to a callback. Types are in the key, with a callable caster for value. Resource types are to be prefixed with a `:`, see e.g. static::$defaultCasters. #### Parameters | | | | | --- | --- | --- | | array | $casters | A map of casters | ### setMaxItems(int $maxItems) Sets the maximum number of items to clone past the minimum depth in nested structures. #### Parameters | | | | | --- | --- | --- | | int | $maxItems | | ### setMaxString(int $maxString) Sets the maximum cloned length for strings. #### Parameters | | | | | --- | --- | --- | | int | $maxString | | ### setMinDepth(int $minDepth) Sets the minimum tree depth where we are guaranteed to clone all the items. After this depth is reached, only setMaxItems items will be cloned. #### Parameters | | | | | --- | --- | --- | | int | $minDepth | | ### [Data](data "Symfony\Component\VarDumper\Cloner\Data") cloneVar(mixed $var, int $filter = 0) Clones a PHP variable. #### Parameters | | | | | --- | --- | --- | | mixed | $var | Any PHP variable | | int | $filter | A bit field of Caster::EXCLUDE\_\* constants | #### Return Value | | | | --- | --- | | [Data](data "Symfony\Component\VarDumper\Cloner\Data") | The cloned variable represented by a Data object | ### abstract protected array doClone(mixed $var) Effectively clones the PHP variable. #### Parameters | | | | | --- | --- | --- | | mixed | $var | Any PHP variable | #### Return Value | | | | --- | --- | | array | The cloned variable represented in an array | ### protected array castObject([Stub](stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, bool $isNested) Casts an object to an array representation. #### Parameters | | | | | --- | --- | --- | | [Stub](stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | The Stub for the casted object | | bool | $isNested | True if the object is nested in the dumped structure | #### Return Value | | | | --- | --- | | array | The object casted as array | ### protected array castResource([Stub](stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, bool $isNested) Casts a resource to an array representation. #### Parameters | | | | | --- | --- | --- | | [Stub](stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | The Stub for the casted resource | | bool | $isNested | True if the object is nested in the dumped structure | #### Return Value | | | | --- | --- | | array | The resource casted as array |
programming_docs
symfony VarCloner VarCloner ========== class **VarCloner** extends [AbstractCloner](abstractcloner "Symfony\Component\VarDumper\Cloner\AbstractCloner") Properties ---------- | | | | | | --- | --- | --- | --- | | static | $defaultCasters | | from [AbstractCloner](abstractcloner#property_defaultCasters "Symfony\Component\VarDumper\Cloner\AbstractCloner") | | protected | $maxItems | | from [AbstractCloner](abstractcloner#property_maxItems "Symfony\Component\VarDumper\Cloner\AbstractCloner") | | protected | $maxString | | from [AbstractCloner](abstractcloner#property_maxString "Symfony\Component\VarDumper\Cloner\AbstractCloner") | | protected | $minDepth | | from [AbstractCloner](abstractcloner#property_minDepth "Symfony\Component\VarDumper\Cloner\AbstractCloner") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $casters = null) | from [AbstractCloner](abstractcloner#method___construct "Symfony\Component\VarDumper\Cloner\AbstractCloner") | | | [addCasters](#method_addCasters)(array $casters) Adds casters for resources and objects. | from [AbstractCloner](abstractcloner#method_addCasters "Symfony\Component\VarDumper\Cloner\AbstractCloner") | | | [setMaxItems](#method_setMaxItems)(int $maxItems) Sets the maximum number of items to clone past the minimum depth in nested structures. | from [AbstractCloner](abstractcloner#method_setMaxItems "Symfony\Component\VarDumper\Cloner\AbstractCloner") | | | [setMaxString](#method_setMaxString)(int $maxString) Sets the maximum cloned length for strings. | from [AbstractCloner](abstractcloner#method_setMaxString "Symfony\Component\VarDumper\Cloner\AbstractCloner") | | | [setMinDepth](#method_setMinDepth)(int $minDepth) Sets the minimum tree depth where we are guaranteed to clone all the items. After this depth is reached, only setMaxItems items will be cloned. | from [AbstractCloner](abstractcloner#method_setMinDepth "Symfony\Component\VarDumper\Cloner\AbstractCloner") | | [Data](data "Symfony\Component\VarDumper\Cloner\Data") | [cloneVar](#method_cloneVar)(mixed $var, int $filter = 0) Clones a PHP variable. | from [AbstractCloner](abstractcloner#method_cloneVar "Symfony\Component\VarDumper\Cloner\AbstractCloner") | | array | [doClone](#method_doClone)(mixed $var) Effectively clones the PHP variable. | | | array | [castObject](#method_castObject)([Stub](stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, bool $isNested) Casts an object to an array representation. | from [AbstractCloner](abstractcloner#method_castObject "Symfony\Component\VarDumper\Cloner\AbstractCloner") | | array | [castResource](#method_castResource)([Stub](stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, bool $isNested) Casts a resource to an array representation. | from [AbstractCloner](abstractcloner#method_castResource "Symfony\Component\VarDumper\Cloner\AbstractCloner") | Details ------- ### \_\_construct(array $casters = null) #### Parameters | | | | | --- | --- | --- | | array | $casters | A map of casters | #### See also | | | | --- | --- | | addCasters | | ### addCasters(array $casters) Adds casters for resources and objects. Maps resources or objects types to a callback. Types are in the key, with a callable caster for value. Resource types are to be prefixed with a `:`, see e.g. static::$defaultCasters. #### Parameters | | | | | --- | --- | --- | | array | $casters | A map of casters | ### setMaxItems(int $maxItems) Sets the maximum number of items to clone past the minimum depth in nested structures. #### Parameters | | | | | --- | --- | --- | | int | $maxItems | | ### setMaxString(int $maxString) Sets the maximum cloned length for strings. #### Parameters | | | | | --- | --- | --- | | int | $maxString | | ### setMinDepth(int $minDepth) Sets the minimum tree depth where we are guaranteed to clone all the items. After this depth is reached, only setMaxItems items will be cloned. #### Parameters | | | | | --- | --- | --- | | int | $minDepth | | ### [Data](data "Symfony\Component\VarDumper\Cloner\Data") cloneVar(mixed $var, int $filter = 0) Clones a PHP variable. #### Parameters | | | | | --- | --- | --- | | mixed | $var | Any PHP variable | | int | $filter | A bit field of Caster::EXCLUDE\_\* constants | #### Return Value | | | | --- | --- | | [Data](data "Symfony\Component\VarDumper\Cloner\Data") | The cloned variable represented by a Data object | ### protected array doClone(mixed $var) Effectively clones the PHP variable. #### Parameters | | | | | --- | --- | --- | | mixed | $var | Any PHP variable | #### Return Value | | | | --- | --- | | array | The cloned variable represented in an array | ### protected array castObject([Stub](stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, bool $isNested) Casts an object to an array representation. #### Parameters | | | | | --- | --- | --- | | [Stub](stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | The Stub for the casted object | | bool | $isNested | True if the object is nested in the dumped structure | #### Return Value | | | | --- | --- | | array | The object casted as array | ### protected array castResource([Stub](stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, bool $isNested) Casts a resource to an array representation. #### Parameters | | | | | --- | --- | --- | | [Stub](stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | The Stub for the casted resource | | bool | $isNested | True if the object is nested in the dumped structure | #### Return Value | | | | --- | --- | | array | The resource casted as array | symfony ClonerInterface ClonerInterface ================ interface **ClonerInterface** Methods ------- | | | | | --- | --- | --- | | [Data](data "Symfony\Component\VarDumper\Cloner\Data") | [cloneVar](#method_cloneVar)(mixed $var) Clones a PHP variable. | | Details ------- ### [Data](data "Symfony\Component\VarDumper\Cloner\Data") cloneVar(mixed $var) Clones a PHP variable. #### Parameters | | | | | --- | --- | --- | | mixed | $var | Any PHP variable | #### Return Value | | | | --- | --- | | [Data](data "Symfony\Component\VarDumper\Cloner\Data") | The cloned variable represented by a Data object | symfony Cursor Cursor ======= class **Cursor** Represents the current state of a dumper while dumping. Constants --------- | | | | --- | --- | | HASH\_INDEXED | | | HASH\_ASSOC | | | HASH\_OBJECT | | | HASH\_RESOURCE | | Properties ---------- | | | | | | --- | --- | --- | --- | | | $depth | | | | | $refIndex | | | | | $softRefTo | | | | | $softRefCount | | | | | $softRefHandle | | | | | $hardRefTo | | | | | $hardRefCount | | | | | $hardRefHandle | | | | | $hashType | | | | | $hashKey | | | | | $hashKeyIsBinary | | | | | $hashIndex | | | | | $hashLength | | | | | $hashCut | | | | | $stop | | | | | $attr | | | | | $skipChildren | | | symfony VarDumperTestTrait VarDumperTestTrait =================== trait **VarDumperTestTrait** Methods ------- | | | | | --- | --- | --- | | | [assertDumpEquals](#method_assertDumpEquals)($expected, $data, $filter = 0, $message = '') | | | | [assertDumpMatchesFormat](#method_assertDumpMatchesFormat)($expected, $data, $filter = 0, $message = '') | | | | [getDump](#method_getDump)($data, $key = null, $filter = 0) | | Details ------- ### assertDumpEquals($expected, $data, $filter = 0, $message = '') #### Parameters | | | | | --- | --- | --- | | | $expected | | | | $data | | | | $filter | | | | $message | | ### assertDumpMatchesFormat($expected, $data, $filter = 0, $message = '') #### Parameters | | | | | --- | --- | --- | | | $expected | | | | $data | | | | $filter | | | | $message | | ### protected getDump($data, $key = null, $filter = 0) #### Parameters | | | | | --- | --- | --- | | | $data | | | | $key | | | | $filter | | symfony ArgsStub ArgsStub ========= class **ArgsStub** extends [EnumStub](enumstub "Symfony\Component\VarDumper\Caster\EnumStub") Represents a list of function arguments. Constants --------- | | | | --- | --- | | TYPE\_REF | | | TYPE\_STRING | | | TYPE\_ARRAY | | | TYPE\_OBJECT | | | TYPE\_RESOURCE | | | STRING\_BINARY | | | STRING\_UTF8 | | | ARRAY\_ASSOC | | | ARRAY\_INDEXED | | Properties ---------- | | | | | | --- | --- | --- | --- | | | $type | | from [Stub](../cloner/stub#property_type "Symfony\Component\VarDumper\Cloner\Stub") | | | $class | | from [Stub](../cloner/stub#property_class "Symfony\Component\VarDumper\Cloner\Stub") | | | $value | | from [Stub](../cloner/stub#property_value "Symfony\Component\VarDumper\Cloner\Stub") | | | $cut | | from [Stub](../cloner/stub#property_cut "Symfony\Component\VarDumper\Cloner\Stub") | | | $handle | | from [Stub](../cloner/stub#property_handle "Symfony\Component\VarDumper\Cloner\Stub") | | | $refCount | | from [Stub](../cloner/stub#property_refCount "Symfony\Component\VarDumper\Cloner\Stub") | | | $position | | from [Stub](../cloner/stub#property_position "Symfony\Component\VarDumper\Cloner\Stub") | | | $attr | | from [Stub](../cloner/stub#property_attr "Symfony\Component\VarDumper\Cloner\Stub") | | | $dumpKeys | | from [EnumStub](enumstub#property_dumpKeys "Symfony\Component\VarDumper\Caster\EnumStub") | Methods ------- | | | | | --- | --- | --- | | | [serialize](#method_serialize)() | from [Stub](../cloner/stub#method_serialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [unserialize](#method_unserialize)($serialized) | from [Stub](../cloner/stub#method_unserialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [\_\_construct](#method___construct)(array $args, string $function, string|null $class) | | Details ------- ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### \_\_construct(array $args, string $function, string|null $class) #### Parameters | | | | | --- | --- | --- | | array | $args | | | string | $function | | | string|null | $class | | symfony XmlReaderCaster XmlReaderCaster ================ class **XmlReaderCaster** Casts XmlReader class to array representation. Methods ------- | | | | | --- | --- | --- | | static | [castXmlReader](#method_castXmlReader)([XMLReader](http://php.net/XMLReader) $reader, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | Details ------- ### static castXmlReader([XMLReader](http://php.net/XMLReader) $reader, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [XMLReader](http://php.net/XMLReader) | $reader | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | symfony AmqpCaster AmqpCaster =========== class **AmqpCaster** Casts Amqp related classes to array representation. Methods ------- | | | | | --- | --- | --- | | static | [castConnection](#method_castConnection)(AMQPConnection $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castChannel](#method_castChannel)(AMQPChannel $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castQueue](#method_castQueue)(AMQPQueue $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castExchange](#method_castExchange)(AMQPExchange $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castEnvelope](#method_castEnvelope)(AMQPEnvelope $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter = 0) | | Details ------- ### static castConnection(AMQPConnection $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | AMQPConnection | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castChannel(AMQPChannel $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | AMQPChannel | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castQueue(AMQPQueue $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | AMQPQueue | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castExchange(AMQPExchange $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | AMQPExchange | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castEnvelope(AMQPEnvelope $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter = 0) #### Parameters | | | | | --- | --- | --- | | AMQPEnvelope | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | | | $filter | | symfony CutStub CutStub ======== class **CutStub** extends [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") Represents the main properties of a PHP variable, pre-casted by a caster. Constants --------- | | | | --- | --- | | TYPE\_REF | | | TYPE\_STRING | | | TYPE\_ARRAY | | | TYPE\_OBJECT | | | TYPE\_RESOURCE | | | STRING\_BINARY | | | STRING\_UTF8 | | | ARRAY\_ASSOC | | | ARRAY\_INDEXED | | Properties ---------- | | | | | | --- | --- | --- | --- | | | $type | | from [Stub](../cloner/stub#property_type "Symfony\Component\VarDumper\Cloner\Stub") | | | $class | | from [Stub](../cloner/stub#property_class "Symfony\Component\VarDumper\Cloner\Stub") | | | $value | | from [Stub](../cloner/stub#property_value "Symfony\Component\VarDumper\Cloner\Stub") | | | $cut | | from [Stub](../cloner/stub#property_cut "Symfony\Component\VarDumper\Cloner\Stub") | | | $handle | | from [Stub](../cloner/stub#property_handle "Symfony\Component\VarDumper\Cloner\Stub") | | | $refCount | | from [Stub](../cloner/stub#property_refCount "Symfony\Component\VarDumper\Cloner\Stub") | | | $position | | from [Stub](../cloner/stub#property_position "Symfony\Component\VarDumper\Cloner\Stub") | | | $attr | | from [Stub](../cloner/stub#property_attr "Symfony\Component\VarDumper\Cloner\Stub") | Methods ------- | | | | | --- | --- | --- | | | [serialize](#method_serialize)() | from [Stub](../cloner/stub#method_serialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [unserialize](#method_unserialize)($serialized) | from [Stub](../cloner/stub#method_unserialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [\_\_construct](#method___construct)($value) | | Details ------- ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### \_\_construct($value) #### Parameters | | | | | --- | --- | --- | | | $value | | symfony FrameStub FrameStub ========== class **FrameStub** extends [EnumStub](enumstub "Symfony\Component\VarDumper\Caster\EnumStub") Represents a single backtrace frame as returned by debug\_backtrace() or Exception->getTrace(). Constants --------- | | | | --- | --- | | TYPE\_REF | | | TYPE\_STRING | | | TYPE\_ARRAY | | | TYPE\_OBJECT | | | TYPE\_RESOURCE | | | STRING\_BINARY | | | STRING\_UTF8 | | | ARRAY\_ASSOC | | | ARRAY\_INDEXED | | Properties ---------- | | | | | | --- | --- | --- | --- | | | $type | | from [Stub](../cloner/stub#property_type "Symfony\Component\VarDumper\Cloner\Stub") | | | $class | | from [Stub](../cloner/stub#property_class "Symfony\Component\VarDumper\Cloner\Stub") | | | $value | | from [Stub](../cloner/stub#property_value "Symfony\Component\VarDumper\Cloner\Stub") | | | $cut | | from [Stub](../cloner/stub#property_cut "Symfony\Component\VarDumper\Cloner\Stub") | | | $handle | | from [Stub](../cloner/stub#property_handle "Symfony\Component\VarDumper\Cloner\Stub") | | | $refCount | | from [Stub](../cloner/stub#property_refCount "Symfony\Component\VarDumper\Cloner\Stub") | | | $position | | from [Stub](../cloner/stub#property_position "Symfony\Component\VarDumper\Cloner\Stub") | | | $attr | | from [Stub](../cloner/stub#property_attr "Symfony\Component\VarDumper\Cloner\Stub") | | | $dumpKeys | | from [EnumStub](enumstub#property_dumpKeys "Symfony\Component\VarDumper\Caster\EnumStub") | | | $keepArgs | | | | | $inTraceStub | | | Methods ------- | | | | | --- | --- | --- | | | [serialize](#method_serialize)() | from [Stub](../cloner/stub#method_serialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [unserialize](#method_unserialize)($serialized) | from [Stub](../cloner/stub#method_unserialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [\_\_construct](#method___construct)(array $frame, bool $keepArgs = true, bool $inTraceStub = false) | | Details ------- ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### \_\_construct(array $frame, bool $keepArgs = true, bool $inTraceStub = false) #### Parameters | | | | | --- | --- | --- | | array | $frame | | | bool | $keepArgs | | | bool | $inTraceStub | | symfony XmlResourceCaster XmlResourceCaster ================== class **XmlResourceCaster** Casts XML resources to array representation. Methods ------- | | | | | --- | --- | --- | | static | [castXml](#method_castXml)($h, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | Details ------- ### static castXml($h, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | | $h | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | symfony RedisCaster RedisCaster ============ class **RedisCaster** Casts Redis class from ext-redis to array representation. Methods ------- | | | | | --- | --- | --- | | static | [castRedis](#method_castRedis)(Redis $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castRedisArray](#method_castRedisArray)(RedisArray $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | Details ------- ### static castRedis(Redis $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | Redis | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castRedisArray(RedisArray $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | RedisArray | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | |
programming_docs
symfony StubCaster StubCaster =========== class **StubCaster** Casts a caster's Stub. Methods ------- | | | | | --- | --- | --- | | static | [castStub](#method_castStub)([Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castCutArray](#method_castCutArray)([CutArrayStub](cutarraystub "Symfony\Component\VarDumper\Caster\CutArrayStub") $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [cutInternals](#method_cutInternals)($obj, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castEnum](#method_castEnum)([EnumStub](enumstub "Symfony\Component\VarDumper\Caster\EnumStub") $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | Details ------- ### static castStub([Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castCutArray([CutArrayStub](cutarraystub "Symfony\Component\VarDumper\Caster\CutArrayStub") $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [CutArrayStub](cutarraystub "Symfony\Component\VarDumper\Caster\CutArrayStub") | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static cutInternals($obj, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | | $obj | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castEnum([EnumStub](enumstub "Symfony\Component\VarDumper\Caster\EnumStub") $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [EnumStub](enumstub "Symfony\Component\VarDumper\Caster\EnumStub") | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | symfony LinkStub LinkStub ========= class **LinkStub** extends [ConstStub](conststub "Symfony\Component\VarDumper\Caster\ConstStub") Represents a file or a URL. Constants --------- | | | | --- | --- | | TYPE\_REF | | | TYPE\_STRING | | | TYPE\_ARRAY | | | TYPE\_OBJECT | | | TYPE\_RESOURCE | | | STRING\_BINARY | | | STRING\_UTF8 | | | ARRAY\_ASSOC | | | ARRAY\_INDEXED | | Properties ---------- | | | | | | --- | --- | --- | --- | | | $type | | from [Stub](../cloner/stub#property_type "Symfony\Component\VarDumper\Cloner\Stub") | | | $class | | from [Stub](../cloner/stub#property_class "Symfony\Component\VarDumper\Cloner\Stub") | | | $value | | from [Stub](../cloner/stub#property_value "Symfony\Component\VarDumper\Cloner\Stub") | | | $cut | | from [Stub](../cloner/stub#property_cut "Symfony\Component\VarDumper\Cloner\Stub") | | | $handle | | from [Stub](../cloner/stub#property_handle "Symfony\Component\VarDumper\Cloner\Stub") | | | $refCount | | from [Stub](../cloner/stub#property_refCount "Symfony\Component\VarDumper\Cloner\Stub") | | | $position | | from [Stub](../cloner/stub#property_position "Symfony\Component\VarDumper\Cloner\Stub") | | | $attr | | from [Stub](../cloner/stub#property_attr "Symfony\Component\VarDumper\Cloner\Stub") | | | $inVendor | | | Methods ------- | | | | | --- | --- | --- | | | [serialize](#method_serialize)() | from [Stub](../cloner/stub#method_serialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [unserialize](#method_unserialize)($serialized) | from [Stub](../cloner/stub#method_unserialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [\_\_construct](#method___construct)($label, int $line = 0, $href = null) | | | | [\_\_toString](#method___toString)() | from [ConstStub](conststub#method___toString "Symfony\Component\VarDumper\Caster\ConstStub") | Details ------- ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### \_\_construct($label, int $line = 0, $href = null) #### Parameters | | | | | --- | --- | --- | | | $label | | | int | $line | | | | $href | | ### \_\_toString() symfony PgSqlCaster PgSqlCaster ============ class **PgSqlCaster** Casts pqsql resources to array representation. Methods ------- | | | | | --- | --- | --- | | static | [castLargeObject](#method_castLargeObject)($lo, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castLink](#method_castLink)($link, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castResult](#method_castResult)($result, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | Details ------- ### static castLargeObject($lo, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | | $lo | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castLink($link, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | | $link | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castResult($result, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | | $result | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | symfony PdoCaster PdoCaster ========== class **PdoCaster** Casts PDO related classes to array representation. Methods ------- | | | | | --- | --- | --- | | static | [castPdo](#method_castPdo)([PDO](http://php.net/PDO) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castPdoStatement](#method_castPdoStatement)([PDOStatement](http://php.net/PDOStatement) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | Details ------- ### static castPdo([PDO](http://php.net/PDO) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [PDO](http://php.net/PDO) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castPdoStatement([PDOStatement](http://php.net/PDOStatement) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [PDOStatement](http://php.net/PDOStatement) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | symfony DateCaster DateCaster =========== class **DateCaster** Casts DateTimeInterface related classes to array representation. Constants --------- | | | | --- | --- | | PERIOD\_LIMIT | | Methods ------- | | | | | --- | --- | --- | | static | [castDateTime](#method_castDateTime)([DateTimeInterface](http://php.net/DateTimeInterface) $d, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter) | | | static | [castInterval](#method_castInterval)([DateInterval](http://php.net/DateInterval) $interval, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter) | | | static | [castTimeZone](#method_castTimeZone)([DateTimeZone](http://php.net/DateTimeZone) $timeZone, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter) | | | static | [castPeriod](#method_castPeriod)([DatePeriod](http://php.net/DatePeriod) $p, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter) | | Details ------- ### static castDateTime([DateTimeInterface](http://php.net/DateTimeInterface) $d, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter) #### Parameters | | | | | --- | --- | --- | | [DateTimeInterface](http://php.net/DateTimeInterface) | $d | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | | | $filter | | ### static castInterval([DateInterval](http://php.net/DateInterval) $interval, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter) #### Parameters | | | | | --- | --- | --- | | [DateInterval](http://php.net/DateInterval) | $interval | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | | | $filter | | ### static castTimeZone([DateTimeZone](http://php.net/DateTimeZone) $timeZone, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter) #### Parameters | | | | | --- | --- | --- | | [DateTimeZone](http://php.net/DateTimeZone) | $timeZone | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | | | $filter | | ### static castPeriod([DatePeriod](http://php.net/DatePeriod) $p, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter) #### Parameters | | | | | --- | --- | --- | | [DatePeriod](http://php.net/DatePeriod) | $p | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | | | $filter | | symfony ExceptionCaster ExceptionCaster ================ class **ExceptionCaster** Casts common Exception classes to array representation. Properties ---------- | | | | | | --- | --- | --- | --- | | static | $srcContext | | | | static | $traceArgs | | | | static | $errorTypes | | | Methods ------- | | | | | --- | --- | --- | | static | [castError](#method_castError)([Error](http://php.net/Error) $e, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter = 0) | | | static | [castException](#method_castException)([Exception](http://php.net/Exception) $e, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter = 0) | | | static | [castErrorException](#method_castErrorException)([ErrorException](http://php.net/ErrorException) $e, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castThrowingCasterException](#method_castThrowingCasterException)([ThrowingCasterException](../exception/throwingcasterexception "Symfony\Component\VarDumper\Exception\ThrowingCasterException") $e, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castSilencedErrorContext](#method_castSilencedErrorContext)([SilencedErrorContext](../../debug/exception/silencederrorcontext "Symfony\Component\Debug\Exception\SilencedErrorContext") $e, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castTraceStub](#method_castTraceStub)([TraceStub](tracestub "Symfony\Component\VarDumper\Caster\TraceStub") $trace, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castFrameStub](#method_castFrameStub)([FrameStub](framestub "Symfony\Component\VarDumper\Caster\FrameStub") $frame, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | Details ------- ### static castError([Error](http://php.net/Error) $e, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter = 0) #### Parameters | | | | | --- | --- | --- | | [Error](http://php.net/Error) | $e | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | | | $filter | | ### static castException([Exception](http://php.net/Exception) $e, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter = 0) #### Parameters | | | | | --- | --- | --- | | [Exception](http://php.net/Exception) | $e | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | | | $filter | | ### static castErrorException([ErrorException](http://php.net/ErrorException) $e, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [ErrorException](http://php.net/ErrorException) | $e | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castThrowingCasterException([ThrowingCasterException](../exception/throwingcasterexception "Symfony\Component\VarDumper\Exception\ThrowingCasterException") $e, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [ThrowingCasterException](../exception/throwingcasterexception "Symfony\Component\VarDumper\Exception\ThrowingCasterException") | $e | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castSilencedErrorContext([SilencedErrorContext](../../debug/exception/silencederrorcontext "Symfony\Component\Debug\Exception\SilencedErrorContext") $e, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [SilencedErrorContext](../../debug/exception/silencederrorcontext "Symfony\Component\Debug\Exception\SilencedErrorContext") | $e | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castTraceStub([TraceStub](tracestub "Symfony\Component\VarDumper\Caster\TraceStub") $trace, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [TraceStub](tracestub "Symfony\Component\VarDumper\Caster\TraceStub") | $trace | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castFrameStub([FrameStub](framestub "Symfony\Component\VarDumper\Caster\FrameStub") $frame, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [FrameStub](framestub "Symfony\Component\VarDumper\Caster\FrameStub") | $frame | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | symfony ResourceCaster ResourceCaster =============== class **ResourceCaster** Casts common resource types to array representation. Methods ------- | | | | | --- | --- | --- | | static | [castCurl](#method_castCurl)($h, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castDba](#method_castDba)($dba, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castProcess](#method_castProcess)($process, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castStream](#method_castStream)($stream, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castStreamContext](#method_castStreamContext)($stream, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castGd](#method_castGd)($gd, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castMysqlLink](#method_castMysqlLink)($h, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | Details ------- ### static castCurl($h, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | | $h | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castDba($dba, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | | $dba | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castProcess($process, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | | $process | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castStream($stream, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | | $stream | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castStreamContext($stream, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | | $stream | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castGd($gd, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | | $gd | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castMysqlLink($h, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | | $h | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | symfony ReflectionCaster ReflectionCaster ================= class **ReflectionCaster** Casts Reflector related classes to array representation. Methods ------- | | | | | --- | --- | --- | | static | [castClosure](#method_castClosure)([Closure](http://php.net/Closure) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter = 0) | | | static | [castGenerator](#method_castGenerator)([Generator](http://php.net/Generator) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castType](#method_castType)([ReflectionType](http://php.net/ReflectionType) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castReflectionGenerator](#method_castReflectionGenerator)([ReflectionGenerator](http://php.net/ReflectionGenerator) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castClass](#method_castClass)([ReflectionClass](http://php.net/ReflectionClass) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter = 0) | | | static | [castFunctionAbstract](#method_castFunctionAbstract)([ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter = 0) | | | static | [castMethod](#method_castMethod)([ReflectionMethod](http://php.net/ReflectionMethod) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castParameter](#method_castParameter)([ReflectionParameter](http://php.net/ReflectionParameter) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castProperty](#method_castProperty)([ReflectionProperty](http://php.net/ReflectionProperty) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castExtension](#method_castExtension)([ReflectionExtension](http://php.net/ReflectionExtension) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castZendExtension](#method_castZendExtension)([ReflectionZendExtension](http://php.net/ReflectionZendExtension) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | Details ------- ### static castClosure([Closure](http://php.net/Closure) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter = 0) #### Parameters | | | | | --- | --- | --- | | [Closure](http://php.net/Closure) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | | | $filter | | ### static castGenerator([Generator](http://php.net/Generator) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [Generator](http://php.net/Generator) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castType([ReflectionType](http://php.net/ReflectionType) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [ReflectionType](http://php.net/ReflectionType) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castReflectionGenerator([ReflectionGenerator](http://php.net/ReflectionGenerator) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [ReflectionGenerator](http://php.net/ReflectionGenerator) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castClass([ReflectionClass](http://php.net/ReflectionClass) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter = 0) #### Parameters | | | | | --- | --- | --- | | [ReflectionClass](http://php.net/ReflectionClass) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | | | $filter | | ### static castFunctionAbstract([ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter = 0) #### Parameters | | | | | --- | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | | | $filter | | ### static castMethod([ReflectionMethod](http://php.net/ReflectionMethod) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [ReflectionMethod](http://php.net/ReflectionMethod) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castParameter([ReflectionParameter](http://php.net/ReflectionParameter) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [ReflectionParameter](http://php.net/ReflectionParameter) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castProperty([ReflectionProperty](http://php.net/ReflectionProperty) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [ReflectionProperty](http://php.net/ReflectionProperty) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castExtension([ReflectionExtension](http://php.net/ReflectionExtension) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [ReflectionExtension](http://php.net/ReflectionExtension) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castZendExtension([ReflectionZendExtension](http://php.net/ReflectionZendExtension) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [ReflectionZendExtension](http://php.net/ReflectionZendExtension) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | |
programming_docs
symfony GmpCaster GmpCaster ========== class **GmpCaster** Casts GMP objects to array representation. Methods ------- | | | | | --- | --- | --- | | static array | [castGmp](#method_castGmp)(GMP $gmp, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter) | | Details ------- ### static array castGmp(GMP $gmp, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter) #### Parameters | | | | | --- | --- | --- | | GMP | $gmp | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | | | $filter | | #### Return Value | | | | --- | --- | | array | | symfony DoctrineCaster DoctrineCaster =============== class **DoctrineCaster** Casts Doctrine related classes to array representation. Methods ------- | | | | | --- | --- | --- | | static | [castCommonProxy](#method_castCommonProxy)(Proxy $proxy, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castOrmProxy](#method_castOrmProxy)(Proxy $proxy, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castPersistentCollection](#method_castPersistentCollection)(PersistentCollection $coll, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | Details ------- ### static castCommonProxy(Proxy $proxy, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | Proxy | $proxy | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castOrmProxy(Proxy $proxy, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | Proxy | $proxy | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castPersistentCollection(PersistentCollection $coll, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | PersistentCollection | $coll | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | symfony DOMCaster DOMCaster ========== class **DOMCaster** Casts DOM related classes to array representation. Methods ------- | | | | | --- | --- | --- | | static | [castException](#method_castException)([DOMException](http://php.net/DOMException) $e, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castLength](#method_castLength)($dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castImplementation](#method_castImplementation)($dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castNode](#method_castNode)([DOMNode](http://php.net/DOMNode) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castNameSpaceNode](#method_castNameSpaceNode)([DOMNameSpaceNode](http://php.net/DOMNameSpaceNode) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castDocument](#method_castDocument)([DOMDocument](http://php.net/DOMDocument) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter = 0) | | | static | [castCharacterData](#method_castCharacterData)([DOMCharacterData](http://php.net/DOMCharacterData) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castAttr](#method_castAttr)([DOMAttr](http://php.net/DOMAttr) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castElement](#method_castElement)([DOMElement](http://php.net/DOMElement) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castText](#method_castText)([DOMText](http://php.net/DOMText) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castTypeinfo](#method_castTypeinfo)([DOMTypeinfo](http://php.net/DOMTypeinfo) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castDomError](#method_castDomError)([DOMDomError](http://php.net/DOMDomError) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castLocator](#method_castLocator)([DOMLocator](http://php.net/DOMLocator) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castDocumentType](#method_castDocumentType)([DOMDocumentType](http://php.net/DOMDocumentType) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castNotation](#method_castNotation)([DOMNotation](http://php.net/DOMNotation) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castEntity](#method_castEntity)([DOMEntity](http://php.net/DOMEntity) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castProcessingInstruction](#method_castProcessingInstruction)([DOMProcessingInstruction](http://php.net/DOMProcessingInstruction) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castXPath](#method_castXPath)([DOMXPath](http://php.net/DOMXPath) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | Details ------- ### static castException([DOMException](http://php.net/DOMException) $e, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [DOMException](http://php.net/DOMException) | $e | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castLength($dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castImplementation($dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castNode([DOMNode](http://php.net/DOMNode) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [DOMNode](http://php.net/DOMNode) | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castNameSpaceNode([DOMNameSpaceNode](http://php.net/DOMNameSpaceNode) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [DOMNameSpaceNode](http://php.net/DOMNameSpaceNode) | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castDocument([DOMDocument](http://php.net/DOMDocument) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested, $filter = 0) #### Parameters | | | | | --- | --- | --- | | [DOMDocument](http://php.net/DOMDocument) | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | | | $filter | | ### static castCharacterData([DOMCharacterData](http://php.net/DOMCharacterData) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [DOMCharacterData](http://php.net/DOMCharacterData) | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castAttr([DOMAttr](http://php.net/DOMAttr) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [DOMAttr](http://php.net/DOMAttr) | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castElement([DOMElement](http://php.net/DOMElement) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castText([DOMText](http://php.net/DOMText) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [DOMText](http://php.net/DOMText) | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castTypeinfo([DOMTypeinfo](http://php.net/DOMTypeinfo) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [DOMTypeinfo](http://php.net/DOMTypeinfo) | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castDomError([DOMDomError](http://php.net/DOMDomError) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [DOMDomError](http://php.net/DOMDomError) | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castLocator([DOMLocator](http://php.net/DOMLocator) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [DOMLocator](http://php.net/DOMLocator) | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castDocumentType([DOMDocumentType](http://php.net/DOMDocumentType) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [DOMDocumentType](http://php.net/DOMDocumentType) | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castNotation([DOMNotation](http://php.net/DOMNotation) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [DOMNotation](http://php.net/DOMNotation) | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castEntity([DOMEntity](http://php.net/DOMEntity) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [DOMEntity](http://php.net/DOMEntity) | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castProcessingInstruction([DOMProcessingInstruction](http://php.net/DOMProcessingInstruction) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [DOMProcessingInstruction](http://php.net/DOMProcessingInstruction) | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castXPath([DOMXPath](http://php.net/DOMXPath) $dom, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [DOMXPath](http://php.net/DOMXPath) | $dom | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | symfony TraceStub TraceStub ========== class **TraceStub** extends [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") Represents a backtrace as returned by debug\_backtrace() or Exception->getTrace(). Constants --------- | | | | --- | --- | | TYPE\_REF | | | TYPE\_STRING | | | TYPE\_ARRAY | | | TYPE\_OBJECT | | | TYPE\_RESOURCE | | | STRING\_BINARY | | | STRING\_UTF8 | | | ARRAY\_ASSOC | | | ARRAY\_INDEXED | | Properties ---------- | | | | | | --- | --- | --- | --- | | | $type | | from [Stub](../cloner/stub#property_type "Symfony\Component\VarDumper\Cloner\Stub") | | | $class | | from [Stub](../cloner/stub#property_class "Symfony\Component\VarDumper\Cloner\Stub") | | | $value | | from [Stub](../cloner/stub#property_value "Symfony\Component\VarDumper\Cloner\Stub") | | | $cut | | from [Stub](../cloner/stub#property_cut "Symfony\Component\VarDumper\Cloner\Stub") | | | $handle | | from [Stub](../cloner/stub#property_handle "Symfony\Component\VarDumper\Cloner\Stub") | | | $refCount | | from [Stub](../cloner/stub#property_refCount "Symfony\Component\VarDumper\Cloner\Stub") | | | $position | | from [Stub](../cloner/stub#property_position "Symfony\Component\VarDumper\Cloner\Stub") | | | $attr | | from [Stub](../cloner/stub#property_attr "Symfony\Component\VarDumper\Cloner\Stub") | | | $keepArgs | | | | | $sliceOffset | | | | | $sliceLength | | | | | $numberingOffset | | | Methods ------- | | | | | --- | --- | --- | | | [serialize](#method_serialize)() | from [Stub](../cloner/stub#method_serialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [unserialize](#method_unserialize)($serialized) | from [Stub](../cloner/stub#method_unserialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [\_\_construct](#method___construct)(array $trace, bool $keepArgs = true, int $sliceOffset = 0, int $sliceLength = null, int $numberingOffset = 0) | | Details ------- ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### \_\_construct(array $trace, bool $keepArgs = true, int $sliceOffset = 0, int $sliceLength = null, int $numberingOffset = 0) #### Parameters | | | | | --- | --- | --- | | array | $trace | | | bool | $keepArgs | | | int | $sliceOffset | | | int | $sliceLength | | | int | $numberingOffset | | symfony EnumStub EnumStub ========= class **EnumStub** extends [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") Represents an enumeration of values. Constants --------- | | | | --- | --- | | TYPE\_REF | | | TYPE\_STRING | | | TYPE\_ARRAY | | | TYPE\_OBJECT | | | TYPE\_RESOURCE | | | STRING\_BINARY | | | STRING\_UTF8 | | | ARRAY\_ASSOC | | | ARRAY\_INDEXED | | Properties ---------- | | | | | | --- | --- | --- | --- | | | $type | | from [Stub](../cloner/stub#property_type "Symfony\Component\VarDumper\Cloner\Stub") | | | $class | | from [Stub](../cloner/stub#property_class "Symfony\Component\VarDumper\Cloner\Stub") | | | $value | | from [Stub](../cloner/stub#property_value "Symfony\Component\VarDumper\Cloner\Stub") | | | $cut | | from [Stub](../cloner/stub#property_cut "Symfony\Component\VarDumper\Cloner\Stub") | | | $handle | | from [Stub](../cloner/stub#property_handle "Symfony\Component\VarDumper\Cloner\Stub") | | | $refCount | | from [Stub](../cloner/stub#property_refCount "Symfony\Component\VarDumper\Cloner\Stub") | | | $position | | from [Stub](../cloner/stub#property_position "Symfony\Component\VarDumper\Cloner\Stub") | | | $attr | | from [Stub](../cloner/stub#property_attr "Symfony\Component\VarDumper\Cloner\Stub") | | | $dumpKeys | | | Methods ------- | | | | | --- | --- | --- | | | [serialize](#method_serialize)() | from [Stub](../cloner/stub#method_serialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [unserialize](#method_unserialize)($serialized) | from [Stub](../cloner/stub#method_unserialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [\_\_construct](#method___construct)(array $values, bool $dumpKeys = true) | | Details ------- ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### \_\_construct(array $values, bool $dumpKeys = true) #### Parameters | | | | | --- | --- | --- | | array | $values | | | bool | $dumpKeys | | symfony ConstStub ConstStub ========== class **ConstStub** extends [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") Represents a PHP constant and its value. Constants --------- | | | | --- | --- | | TYPE\_REF | | | TYPE\_STRING | | | TYPE\_ARRAY | | | TYPE\_OBJECT | | | TYPE\_RESOURCE | | | STRING\_BINARY | | | STRING\_UTF8 | | | ARRAY\_ASSOC | | | ARRAY\_INDEXED | | Properties ---------- | | | | | | --- | --- | --- | --- | | | $type | | from [Stub](../cloner/stub#property_type "Symfony\Component\VarDumper\Cloner\Stub") | | | $class | | from [Stub](../cloner/stub#property_class "Symfony\Component\VarDumper\Cloner\Stub") | | | $value | | from [Stub](../cloner/stub#property_value "Symfony\Component\VarDumper\Cloner\Stub") | | | $cut | | from [Stub](../cloner/stub#property_cut "Symfony\Component\VarDumper\Cloner\Stub") | | | $handle | | from [Stub](../cloner/stub#property_handle "Symfony\Component\VarDumper\Cloner\Stub") | | | $refCount | | from [Stub](../cloner/stub#property_refCount "Symfony\Component\VarDumper\Cloner\Stub") | | | $position | | from [Stub](../cloner/stub#property_position "Symfony\Component\VarDumper\Cloner\Stub") | | | $attr | | from [Stub](../cloner/stub#property_attr "Symfony\Component\VarDumper\Cloner\Stub") | Methods ------- | | | | | --- | --- | --- | | | [serialize](#method_serialize)() | from [Stub](../cloner/stub#method_serialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [unserialize](#method_unserialize)($serialized) | from [Stub](../cloner/stub#method_unserialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [\_\_construct](#method___construct)(string $name, $value) | | | | [\_\_toString](#method___toString)() | | Details ------- ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### \_\_construct(string $name, $value) #### Parameters | | | | | --- | --- | --- | | string | $name | | | | $value | | ### \_\_toString() symfony SymfonyCaster SymfonyCaster ============== class **SymfonyCaster** Methods ------- | | | | | --- | --- | --- | | static | [castRequest](#method_castRequest)([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | Details ------- ### static castRequest([Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [Request](../../httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | |
programming_docs
symfony SplCaster SplCaster ========== class **SplCaster** Casts SPL related classes to array representation. Methods ------- | | | | | --- | --- | --- | | static | [castArrayObject](#method_castArrayObject)([ArrayObject](http://php.net/ArrayObject) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castArrayIterator](#method_castArrayIterator)([ArrayIterator](http://php.net/ArrayIterator) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castHeap](#method_castHeap)([Iterator](http://php.net/Iterator) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castDoublyLinkedList](#method_castDoublyLinkedList)([SplDoublyLinkedList](http://php.net/SplDoublyLinkedList) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castFileInfo](#method_castFileInfo)([SplFileInfo](http://php.net/SplFileInfo) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castFileObject](#method_castFileObject)([SplFileObject](http://php.net/SplFileObject) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castFixedArray](#method_castFixedArray)([SplFixedArray](http://php.net/SplFixedArray) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castObjectStorage](#method_castObjectStorage)([SplObjectStorage](http://php.net/SplObjectStorage) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | | static | [castOuterIterator](#method_castOuterIterator)([OuterIterator](http://php.net/OuterIterator) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | Details ------- ### static castArrayObject([ArrayObject](http://php.net/ArrayObject) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [ArrayObject](http://php.net/ArrayObject) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castArrayIterator([ArrayIterator](http://php.net/ArrayIterator) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [ArrayIterator](http://php.net/ArrayIterator) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castHeap([Iterator](http://php.net/Iterator) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [Iterator](http://php.net/Iterator) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castDoublyLinkedList([SplDoublyLinkedList](http://php.net/SplDoublyLinkedList) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [SplDoublyLinkedList](http://php.net/SplDoublyLinkedList) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castFileInfo([SplFileInfo](http://php.net/SplFileInfo) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [SplFileInfo](http://php.net/SplFileInfo) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castFileObject([SplFileObject](http://php.net/SplFileObject) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [SplFileObject](http://php.net/SplFileObject) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castFixedArray([SplFixedArray](http://php.net/SplFixedArray) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [SplFixedArray](http://php.net/SplFixedArray) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castObjectStorage([SplObjectStorage](http://php.net/SplObjectStorage) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [SplObjectStorage](http://php.net/SplObjectStorage) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | ### static castOuterIterator([OuterIterator](http://php.net/OuterIterator) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [OuterIterator](http://php.net/OuterIterator) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | symfony CutArrayStub CutArrayStub ============= class **CutArrayStub** extends [CutStub](cutstub "Symfony\Component\VarDumper\Caster\CutStub") Represents a cut array. Constants --------- | | | | --- | --- | | TYPE\_REF | | | TYPE\_STRING | | | TYPE\_ARRAY | | | TYPE\_OBJECT | | | TYPE\_RESOURCE | | | STRING\_BINARY | | | STRING\_UTF8 | | | ARRAY\_ASSOC | | | ARRAY\_INDEXED | | Properties ---------- | | | | | | --- | --- | --- | --- | | | $type | | from [Stub](../cloner/stub#property_type "Symfony\Component\VarDumper\Cloner\Stub") | | | $class | | from [Stub](../cloner/stub#property_class "Symfony\Component\VarDumper\Cloner\Stub") | | | $value | | from [Stub](../cloner/stub#property_value "Symfony\Component\VarDumper\Cloner\Stub") | | | $cut | | from [Stub](../cloner/stub#property_cut "Symfony\Component\VarDumper\Cloner\Stub") | | | $handle | | from [Stub](../cloner/stub#property_handle "Symfony\Component\VarDumper\Cloner\Stub") | | | $refCount | | from [Stub](../cloner/stub#property_refCount "Symfony\Component\VarDumper\Cloner\Stub") | | | $position | | from [Stub](../cloner/stub#property_position "Symfony\Component\VarDumper\Cloner\Stub") | | | $attr | | from [Stub](../cloner/stub#property_attr "Symfony\Component\VarDumper\Cloner\Stub") | | | $preservedSubset | | | Methods ------- | | | | | --- | --- | --- | | | [serialize](#method_serialize)() | from [Stub](../cloner/stub#method_serialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [unserialize](#method_unserialize)($serialized) | from [Stub](../cloner/stub#method_unserialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [\_\_construct](#method___construct)($value, array $preservedKeys) | | Details ------- ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### \_\_construct($value, array $preservedKeys) #### Parameters | | | | | --- | --- | --- | | | $value | | | array | $preservedKeys | | symfony ClassStub ClassStub ========== class **ClassStub** extends [ConstStub](conststub "Symfony\Component\VarDumper\Caster\ConstStub") Represents a PHP class identifier. Constants --------- | | | | --- | --- | | TYPE\_REF | | | TYPE\_STRING | | | TYPE\_ARRAY | | | TYPE\_OBJECT | | | TYPE\_RESOURCE | | | STRING\_BINARY | | | STRING\_UTF8 | | | ARRAY\_ASSOC | | | ARRAY\_INDEXED | | Properties ---------- | | | | | | --- | --- | --- | --- | | | $type | | from [Stub](../cloner/stub#property_type "Symfony\Component\VarDumper\Cloner\Stub") | | | $class | | from [Stub](../cloner/stub#property_class "Symfony\Component\VarDumper\Cloner\Stub") | | | $value | | from [Stub](../cloner/stub#property_value "Symfony\Component\VarDumper\Cloner\Stub") | | | $cut | | from [Stub](../cloner/stub#property_cut "Symfony\Component\VarDumper\Cloner\Stub") | | | $handle | | from [Stub](../cloner/stub#property_handle "Symfony\Component\VarDumper\Cloner\Stub") | | | $refCount | | from [Stub](../cloner/stub#property_refCount "Symfony\Component\VarDumper\Cloner\Stub") | | | $position | | from [Stub](../cloner/stub#property_position "Symfony\Component\VarDumper\Cloner\Stub") | | | $attr | | from [Stub](../cloner/stub#property_attr "Symfony\Component\VarDumper\Cloner\Stub") | Methods ------- | | | | | --- | --- | --- | | | [serialize](#method_serialize)() | from [Stub](../cloner/stub#method_serialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [unserialize](#method_unserialize)($serialized) | from [Stub](../cloner/stub#method_unserialize "Symfony\Component\VarDumper\Cloner\Stub") | | | [\_\_construct](#method___construct)(string $identifier, callable $callable = null) | | | | [\_\_toString](#method___toString)() | from [ConstStub](conststub#method___toString "Symfony\Component\VarDumper\Caster\ConstStub") | | static | [wrapCallable](#method_wrapCallable)($callable) | | Details ------- ### serialize() ### unserialize($serialized) #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### \_\_construct(string $identifier, callable $callable = null) #### Parameters | | | | | --- | --- | --- | | string | $identifier | A PHP identifier, e.g. a class, method, interface, etc. name | | callable | $callable | The callable targeted by the identifier when it is ambiguous or not a real PHP identifier | ### \_\_toString() ### static wrapCallable($callable) #### Parameters | | | | | --- | --- | --- | | | $callable | | symfony Caster Caster ======= class **Caster** Helper for filtering out properties in casters. Constants --------- | | | | --- | --- | | EXCLUDE\_VERBOSE | | | EXCLUDE\_VIRTUAL | | | EXCLUDE\_DYNAMIC | | | EXCLUDE\_PUBLIC | | | EXCLUDE\_PROTECTED | | | EXCLUDE\_PRIVATE | | | EXCLUDE\_NULL | | | EXCLUDE\_EMPTY | | | EXCLUDE\_NOT\_IMPORTANT | | | EXCLUDE\_STRICT | | | PREFIX\_VIRTUAL | | | PREFIX\_DYNAMIC | | | PREFIX\_PROTECTED | | Methods ------- | | | | | --- | --- | --- | | static array | [castObject](#method_castObject)(object $obj, string $class, bool $hasDebugInfo = false) Casts objects to arrays and adds the dynamic property prefix. | | | static array | [filter](#method_filter)(array $a, int $filter, array $listedProperties = array(), int $count = 0) Filters out the specified properties. | | | static | [castPhpIncompleteClass](#method_castPhpIncompleteClass)([\_\_PHP\_Incomplete\_Class](http://php.net/__PHP_Incomplete_Class) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) | | Details ------- ### static array castObject(object $obj, string $class, bool $hasDebugInfo = false) Casts objects to arrays and adds the dynamic property prefix. #### Parameters | | | | | --- | --- | --- | | object | $obj | The object to cast | | string | $class | The class of the object | | bool | $hasDebugInfo | Whether the \_\_debugInfo method exists on $obj or not | #### Return Value | | | | --- | --- | | array | The array-cast of the object, with prefixed dynamic properties | ### static array filter(array $a, int $filter, array $listedProperties = array(), int $count = 0) Filters out the specified properties. By default, a single match in the $filter bit field filters properties out, following an "or" logic. When EXCLUDE\_STRICT is set, an "and" logic is applied: all bits must match for a property to be removed. #### Parameters | | | | | --- | --- | --- | | array | $a | The array containing the properties to filter | | int | $filter | A bit field of Caster::EXCLUDE\_\* constants specifying which properties to filter out | | array | $listedProperties | List of properties to exclude when Caster::EXCLUDE\_VERBOSE is set, and to preserve when Caster::EXCLUDE\_NOT\_IMPORTANT is set | | int | $count | &$count Set to the number of removed properties | #### Return Value | | | | --- | --- | | array | The filtered array | ### static castPhpIncompleteClass([\_\_PHP\_Incomplete\_Class](http://php.net/__PHP_Incomplete_Class) $c, array $a, [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") $stub, $isNested) #### Parameters | | | | | --- | --- | --- | | [\_\_PHP\_Incomplete\_Class](http://php.net/__PHP_Incomplete_Class) | $c | | | array | $a | | | [Stub](../cloner/stub "Symfony\Component\VarDumper\Cloner\Stub") | $stub | | | | $isNested | | symfony DumpServer DumpServer =========== class **DumpServer** A server collecting Data clones sent by a ServerDumper. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $host, LoggerInterface $logger = null) | | | void | [start](#method_start)() | | | void | [listen](#method_listen)(callable $callback) | | | string | [getHost](#method_getHost)() | | Details ------- ### \_\_construct(string $host, LoggerInterface $logger = null) #### Parameters | | | | | --- | --- | --- | | string | $host | | | LoggerInterface | $logger | | ### void start() #### Return Value | | | | --- | --- | | void | | ### void listen(callable $callback) #### Parameters | | | | | --- | --- | --- | | callable | $callback | | #### Return Value | | | | --- | --- | | void | | ### string getHost() #### Return Value | | | | --- | --- | | string | | symfony Connection Connection =========== class **Connection** Forwards serialized Data clones to a server. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $host, array $contextProviders = array()) | | | array | [getContextProviders](#method_getContextProviders)() | | | bool | [write](#method_write)([Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data) | | Details ------- ### \_\_construct(string $host, array $contextProviders = array()) #### Parameters | | | | | --- | --- | --- | | string | $host | The server host | | array | $contextProviders | Context providers indexed by context name | ### array getContextProviders() #### Return Value | | | | --- | --- | | array | | ### bool write([Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data) #### Parameters | | | | | --- | --- | --- | | [Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") | $data | | #### Return Value | | | | --- | --- | | bool | | symfony Symfony\Component\VarDumper\Command\Descriptor Symfony\Component\VarDumper\Command\Descriptor ============================================== Classes ------- | | | | --- | --- | | [CliDescriptor](descriptor/clidescriptor "Symfony\Component\VarDumper\Command\Descriptor\CliDescriptor") | Describe collected data clones for cli output. | | [HtmlDescriptor](descriptor/htmldescriptor "Symfony\Component\VarDumper\Command\Descriptor\HtmlDescriptor") | Describe collected data clones for html output. | Interfaces ---------- | | | | --- | --- | | *[DumpDescriptorInterface](descriptor/dumpdescriptorinterface "Symfony\Component\VarDumper\Command\Descriptor\DumpDescriptorInterface")* | | symfony ServerDumpCommand ServerDumpCommand ================== class **ServerDumpCommand** extends [Command](../../console/command/command "Symfony\Component\Console\Command\Command") Starts a dump server to collect and output dumps on a single place with multiple formats support. Properties ---------- | | | | | | --- | --- | --- | --- | | static protected | $defaultName | | | Methods ------- | | | | | --- | --- | --- | | static string|null | [getDefaultName](#method_getDefaultName)() | from [Command](../../console/command/command#method_getDefaultName "Symfony\Component\Console\Command\Command") | | | [\_\_construct](#method___construct)([DumpServer](../server/dumpserver "Symfony\Component\VarDumper\Server\DumpServer") $server, array $descriptors = array()) | | | | [ignoreValidationErrors](#method_ignoreValidationErrors)() Ignores validation errors. | from [Command](../../console/command/command#method_ignoreValidationErrors "Symfony\Component\Console\Command\Command") | | | [setApplication](#method_setApplication)([Application](../../console/application "Symfony\Component\Console\Application") $application = null) | from [Command](../../console/command/command#method_setApplication "Symfony\Component\Console\Command\Command") | | | [setHelperSet](#method_setHelperSet)([HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) | from [Command](../../console/command/command#method_setHelperSet "Symfony\Component\Console\Command\Command") | | [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set. | from [Command](../../console/command/command#method_getHelperSet "Symfony\Component\Console\Command\Command") | | [Application](../../console/application "Symfony\Component\Console\Application") | [getApplication](#method_getApplication)() Gets the application instance for this command. | from [Command](../../console/command/command#method_getApplication "Symfony\Component\Console\Command\Command") | | bool | [isEnabled](#method_isEnabled)() Checks whether the command is enabled or not in the current environment. | from [Command](../../console/command/command#method_isEnabled "Symfony\Component\Console\Command\Command") | | | [configure](#method_configure)() Configures the current command. | | | int|null | [execute](#method_execute)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. | | | | [interact](#method_interact)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. | from [Command](../../console/command/command#method_interact "Symfony\Component\Console\Command\Command") | | | [initialize](#method_initialize)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. | from [Command](../../console/command/command#method_initialize "Symfony\Component\Console\Command\Command") | | int | [run](#method_run)([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. | from [Command](../../console/command/command#method_run "Symfony\Component\Console\Command\Command") | | $this | [setCode](#method_setCode)(callable $code) Sets the code to execute when running this command. | from [Command](../../console/command/command#method_setCode "Symfony\Component\Console\Command\Command") | | | [mergeApplicationDefinition](#method_mergeApplicationDefinition)(bool $mergeArgs = true) Merges the application definition with the command definition. | from [Command](../../console/command/command#method_mergeApplicationDefinition "Symfony\Component\Console\Command\Command") | | $this | [setDefinition](#method_setDefinition)(array|[InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. | from [Command](../../console/command/command#method_setDefinition "Symfony\Component\Console\Command\Command") | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getDefinition](#method_getDefinition)() Gets the InputDefinition attached to this Command. | from [Command](../../console/command/command#method_getDefinition "Symfony\Component\Console\Command\Command") | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getNativeDefinition](#method_getNativeDefinition)() Gets the InputDefinition to be used to create representations of this Command. | from [Command](../../console/command/command#method_getNativeDefinition "Symfony\Component\Console\Command\Command") | | $this | [addArgument](#method_addArgument)(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. | from [Command](../../console/command/command#method_addArgument "Symfony\Component\Console\Command\Command") | | $this | [addOption](#method_addOption)(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. | from [Command](../../console/command/command#method_addOption "Symfony\Component\Console\Command\Command") | | $this | [setName](#method_setName)(string $name) Sets the name of the command. | from [Command](../../console/command/command#method_setName "Symfony\Component\Console\Command\Command") | | $this | [setProcessTitle](#method_setProcessTitle)(string $title) Sets the process title of the command. | from [Command](../../console/command/command#method_setProcessTitle "Symfony\Component\Console\Command\Command") | | string | [getName](#method_getName)() Returns the command name. | from [Command](../../console/command/command#method_getName "Symfony\Component\Console\Command\Command") | | [Command](../../console/command/command "Symfony\Component\Console\Command\Command") | [setHidden](#method_setHidden)(bool $hidden) | from [Command](../../console/command/command#method_setHidden "Symfony\Component\Console\Command\Command") | | bool | [isHidden](#method_isHidden)() | from [Command](../../console/command/command#method_isHidden "Symfony\Component\Console\Command\Command") | | $this | [setDescription](#method_setDescription)(string $description) Sets the description for the command. | from [Command](../../console/command/command#method_setDescription "Symfony\Component\Console\Command\Command") | | string | [getDescription](#method_getDescription)() Returns the description for the command. | from [Command](../../console/command/command#method_getDescription "Symfony\Component\Console\Command\Command") | | $this | [setHelp](#method_setHelp)(string $help) Sets the help for the command. | from [Command](../../console/command/command#method_setHelp "Symfony\Component\Console\Command\Command") | | string | [getHelp](#method_getHelp)() Returns the help for the command. | from [Command](../../console/command/command#method_getHelp "Symfony\Component\Console\Command\Command") | | string | [getProcessedHelp](#method_getProcessedHelp)() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. | from [Command](../../console/command/command#method_getProcessedHelp "Symfony\Component\Console\Command\Command") | | $this | [setAliases](#method_setAliases)(string[] $aliases) Sets the aliases for the command. | from [Command](../../console/command/command#method_setAliases "Symfony\Component\Console\Command\Command") | | array | [getAliases](#method_getAliases)() Returns the aliases for the command. | from [Command](../../console/command/command#method_getAliases "Symfony\Component\Console\Command\Command") | | string | [getSynopsis](#method_getSynopsis)(bool $short = false) Returns the synopsis for the command. | from [Command](../../console/command/command#method_getSynopsis "Symfony\Component\Console\Command\Command") | | $this | [addUsage](#method_addUsage)(string $usage) Add a command usage example. | from [Command](../../console/command/command#method_addUsage "Symfony\Component\Console\Command\Command") | | array | [getUsages](#method_getUsages)() Returns alternative usages of the command. | from [Command](../../console/command/command#method_getUsages "Symfony\Component\Console\Command\Command") | | mixed | [getHelper](#method_getHelper)(string $name) Gets a helper instance by name. | from [Command](../../console/command/command#method_getHelper "Symfony\Component\Console\Command\Command") | Details ------- ### static string|null getDefaultName() #### Return Value | | | | --- | --- | | string|null | The default command name or null when no default name is set | ### \_\_construct([DumpServer](../server/dumpserver "Symfony\Component\VarDumper\Server\DumpServer") $server, array $descriptors = array()) #### Parameters | | | | | --- | --- | --- | | [DumpServer](../server/dumpserver "Symfony\Component\VarDumper\Server\DumpServer") | $server | | | array | $descriptors | | #### Exceptions | | | | --- | --- | | [LogicException](../../console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When the command name is empty | ### ignoreValidationErrors() Ignores validation errors. This is mainly useful for the help command. ### setApplication([Application](../../console/application "Symfony\Component\Console\Application") $application = null) #### Parameters | | | | | --- | --- | --- | | [Application](../../console/application "Symfony\Component\Console\Application") | $application | | ### setHelperSet([HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) #### Parameters | | | | | --- | --- | --- | | [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set. #### Return Value | | | | --- | --- | | [HelperSet](../../console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### [Application](../../console/application "Symfony\Component\Console\Application") getApplication() Gets the application instance for this command. #### Return Value | | | | --- | --- | | [Application](../../console/application "Symfony\Component\Console\Application") | An Application instance | ### bool isEnabled() Checks whether the command is enabled or not in the current environment. Override this to check for x or y and return false if the command can not run properly under the current conditions. #### Return Value | | | | --- | --- | | bool | | ### protected configure() Configures the current command. ### protected int|null execute([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. This method is not abstract because you can use this class as a concrete class. In this case, instead of defining the execute() method, you set the code to execute by passing a Closure to the setCode() method. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int|null | null or 0 if everything went fine, or an error code | #### Exceptions | | | | --- | --- | | [LogicException](../../console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When this abstract method is not implemented | ### protected interact([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. This method is executed before the InputDefinition is validated. This means that this is the only place where the command can interactively ask for values of missing required arguments. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### protected initialize([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. This is mainly useful when a lot of commands extends one main command where some things need to be initialized based on the input arguments and options. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### See also | | | | --- | --- | | [InputInterface::bind](../../console/input/inputinterface#method_bind "Symfony\Component\Console\Input\InputInterface") | | | [InputInterface::validate](../../console/input/inputinterface#method_validate "Symfony\Component\Console\Input\InputInterface") | | ### int run([InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. The code to execute is either defined directly with the setCode() method or by overriding the execute() method in a sub-class. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int | The command exit code | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | When binding input fails. Bypass this by calling {@link ignoreValidationErrors()}. | #### See also | | | | --- | --- | | setCode() | | | execute() | | ### $this setCode(callable $code) Sets the code to execute when running this command. If this method is used, it overrides the code defined in the execute() method. #### Parameters | | | | | --- | --- | --- | | callable | $code | A callable(InputInterface $input, OutputInterface $output) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | | #### See also | | | | --- | --- | | execute() | | ### mergeApplicationDefinition(bool $mergeArgs = true) Merges the application definition with the command definition. This method is not part of public API and should not be used directly. #### Parameters | | | | | --- | --- | --- | | bool | $mergeArgs | Whether to merge or not the Application definition arguments to Command definition arguments | ### $this setDefinition(array|[InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. #### Parameters | | | | | --- | --- | --- | | array|[InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | An array of argument and option instances or a definition instance | #### Return Value | | | | --- | --- | | $this | | ### [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getDefinition() Gets the InputDefinition attached to this Command. #### Return Value | | | | --- | --- | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getNativeDefinition() Gets the InputDefinition to be used to create representations of this Command. Can be overridden to provide the original command representation when it would otherwise be changed by merging with the application InputDefinition. This method is not part of public API and should not be used directly. #### Return Value | | | | --- | --- | | [InputDefinition](../../console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### $this addArgument(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | | int|null | $mode | The argument mode: self::REQUIRED or self::OPTIONAL | | string | $description | A description text | | string|string[]|null | $default | The default value (for self::OPTIONAL mode only) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument mode is not valid | ### $this addOption(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | | string|array | $shortcut | The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts | | int|null | $mode | The option mode: One of the VALUE\_\* constants | | string | $description | A description text | | string|string[]|bool|null | $default | The default value (must be null for self::VALUE\_NONE) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | If option mode is invalid or incompatible | ### $this setName(string $name) Sets the name of the command. This method can set both the namespace and the name if you separate them by a colon (:) ``` $command->setName('foo:bar'); ``` #### Parameters | | | | | --- | --- | --- | | string | $name | The command name | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When the name is invalid | ### $this setProcessTitle(string $title) Sets the process title of the command. This feature should be used only when creating a long process command, like a daemon. PHP 5.5+ or the proctitle PECL library is required #### Parameters | | | | | --- | --- | --- | | string | $title | The process title | #### Return Value | | | | --- | --- | | $this | | ### string getName() Returns the command name. #### Return Value | | | | --- | --- | | string | The command name | ### [Command](../../console/command/command "Symfony\Component\Console\Command\Command") setHidden(bool $hidden) #### Parameters | | | | | --- | --- | --- | | bool | $hidden | Whether or not the command should be hidden from the list of commands | #### Return Value | | | | --- | --- | | [Command](../../console/command/command "Symfony\Component\Console\Command\Command") | The current instance | ### bool isHidden() #### Return Value | | | | --- | --- | | bool | whether the command should be publicly shown or not | ### $this setDescription(string $description) Sets the description for the command. #### Parameters | | | | | --- | --- | --- | | string | $description | The description for the command | #### Return Value | | | | --- | --- | | $this | | ### string getDescription() Returns the description for the command. #### Return Value | | | | --- | --- | | string | The description for the command | ### $this setHelp(string $help) Sets the help for the command. #### Parameters | | | | | --- | --- | --- | | string | $help | The help for the command | #### Return Value | | | | --- | --- | | $this | | ### string getHelp() Returns the help for the command. #### Return Value | | | | --- | --- | | string | The help for the command | ### string getProcessedHelp() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. #### Return Value | | | | --- | --- | | string | The processed help for the command | ### $this setAliases(string[] $aliases) Sets the aliases for the command. #### Parameters | | | | | --- | --- | --- | | string[] | $aliases | An array of aliases for the command | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When an alias is invalid | ### array getAliases() Returns the aliases for the command. #### Return Value | | | | --- | --- | | array | An array of aliases for the command | ### string getSynopsis(bool $short = false) Returns the synopsis for the command. #### Parameters | | | | | --- | --- | --- | | bool | $short | Whether to show the short version of the synopsis (with options folded) or not | #### Return Value | | | | --- | --- | | string | The synopsis | ### $this addUsage(string $usage) Add a command usage example. #### Parameters | | | | | --- | --- | --- | | string | $usage | The usage, it'll be prefixed with the command name | #### Return Value | | | | --- | --- | | $this | | ### array getUsages() Returns alternative usages of the command. #### Return Value | | | | --- | --- | | array | | ### mixed getHelper(string $name) Gets a helper instance by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The helper name | #### Return Value | | | | --- | --- | | mixed | The helper value | #### Exceptions | | | | --- | --- | | [LogicException](../../console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | if no HelperSet is defined | | [InvalidArgumentException](../../console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | if the helper is not defined |
programming_docs
symfony DumpDescriptorInterface DumpDescriptorInterface ======================== interface **DumpDescriptorInterface** Methods ------- | | | | | --- | --- | --- | | void | [describe](#method_describe)([OutputInterface](../../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Data](../../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data, array $context, int $clientId) | | Details ------- ### void describe([OutputInterface](../../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Data](../../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data, array $context, int $clientId) #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | [Data](../../cloner/data "Symfony\Component\VarDumper\Cloner\Data") | $data | | | array | $context | | | int | $clientId | | #### Return Value | | | | --- | --- | | void | | symfony HtmlDescriptor HtmlDescriptor =============== class **HtmlDescriptor** implements [DumpDescriptorInterface](dumpdescriptorinterface "Symfony\Component\VarDumper\Command\Descriptor\DumpDescriptorInterface") Describe collected data clones for html output. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([HtmlDumper](../../dumper/htmldumper "Symfony\Component\VarDumper\Dumper\HtmlDumper") $dumper) | | | void | [describe](#method_describe)([OutputInterface](../../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Data](../../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data, array $context, int $clientId) | | Details ------- ### \_\_construct([HtmlDumper](../../dumper/htmldumper "Symfony\Component\VarDumper\Dumper\HtmlDumper") $dumper) #### Parameters | | | | | --- | --- | --- | | [HtmlDumper](../../dumper/htmldumper "Symfony\Component\VarDumper\Dumper\HtmlDumper") | $dumper | | ### void describe([OutputInterface](../../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Data](../../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data, array $context, int $clientId) #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | [Data](../../cloner/data "Symfony\Component\VarDumper\Cloner\Data") | $data | | | array | $context | | | int | $clientId | | #### Return Value | | | | --- | --- | | void | | symfony CliDescriptor CliDescriptor ============== class **CliDescriptor** implements [DumpDescriptorInterface](dumpdescriptorinterface "Symfony\Component\VarDumper\Command\Descriptor\DumpDescriptorInterface") Describe collected data clones for cli output. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([CliDumper](../../dumper/clidumper "Symfony\Component\VarDumper\Dumper\CliDumper") $dumper) | | | void | [describe](#method_describe)([OutputInterface](../../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Data](../../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data, array $context, int $clientId) | | Details ------- ### \_\_construct([CliDumper](../../dumper/clidumper "Symfony\Component\VarDumper\Dumper\CliDumper") $dumper) #### Parameters | | | | | --- | --- | --- | | [CliDumper](../../dumper/clidumper "Symfony\Component\VarDumper\Dumper\CliDumper") | $dumper | | ### void describe([OutputInterface](../../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Data](../../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data, array $context, int $clientId) #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../../../console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | [Data](../../cloner/data "Symfony\Component\VarDumper\Cloner\Data") | $data | | | array | $context | | | int | $clientId | | #### Return Value | | | | --- | --- | | void | | symfony ThrowingCasterException ThrowingCasterException ======================== class **ThrowingCasterException** extends [Exception](http://php.net/Exception) Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Exception](http://php.net/Exception) $prev) | | Details ------- ### \_\_construct([Exception](http://php.net/Exception) $prev) #### Parameters | | | | | --- | --- | --- | | [Exception](http://php.net/Exception) | $prev | The exception thrown from the caster | symfony HtmlDumper HtmlDumper =========== class **HtmlDumper** extends [CliDumper](clidumper "Symfony\Component\VarDumper\Dumper\CliDumper") HtmlDumper dumps variables as HTML. Constants --------- | | | | --- | --- | | DUMP\_LIGHT\_ARRAY | | | DUMP\_STRING\_LENGTH | | | DUMP\_COMMA\_SEPARATOR | | | DUMP\_TRAILING\_COMMA | | Properties ---------- | | | | | | --- | --- | --- | --- | | static | $defaultOutput | | | | protected | $line | | from [AbstractDumper](abstractdumper#property_line "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | protected | $lineDumper | | from [AbstractDumper](abstractdumper#property_lineDumper "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | protected | $outputStream | | from [AbstractDumper](abstractdumper#property_outputStream "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | protected | $decimalPoint | | from [AbstractDumper](abstractdumper#property_decimalPoint "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | protected | $indentPad | | from [AbstractDumper](abstractdumper#property_indentPad "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | protected | $flags | | from [AbstractDumper](abstractdumper#property_flags "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | static | $defaultColors | | from [CliDumper](clidumper#property_defaultColors "Symfony\Component\VarDumper\Dumper\CliDumper") | | protected | $colors | | | | protected | $maxStringWidth | | from [CliDumper](clidumper#property_maxStringWidth "Symfony\Component\VarDumper\Dumper\CliDumper") | | protected | $styles | | | | static protected | $controlCharsRx | | from [CliDumper](clidumper#property_controlCharsRx "Symfony\Component\VarDumper\Dumper\CliDumper") | | static protected | $controlCharsMap | | from [CliDumper](clidumper#property_controlCharsMap "Symfony\Component\VarDumper\Dumper\CliDumper") | | protected | $collapseNextHash | | from [CliDumper](clidumper#property_collapseNextHash "Symfony\Component\VarDumper\Dumper\CliDumper") | | protected | $expandNextHash | | from [CliDumper](clidumper#property_expandNextHash "Symfony\Component\VarDumper\Dumper\CliDumper") | | protected | $dumpHeader | | | | protected | $dumpPrefix | | | | protected | $dumpSuffix | | | | protected | $dumpId | | | | protected | $headerIsDumped | | | | protected | $lastDepth | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(callable|resource|string|null $output = null, string $charset = null, int $flags = 0) | | | callable|resource|string | [setOutput](#method_setOutput)(callable|resource|string $output) Sets the output destination of the dumps. | from [AbstractDumper](abstractdumper#method_setOutput "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | string | [setCharset](#method_setCharset)(string $charset) Sets the default character encoding to use for non-UTF8 strings. | from [AbstractDumper](abstractdumper#method_setCharset "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | string | [setIndentPad](#method_setIndentPad)(string $pad) Sets the indentation pad string. | from [AbstractDumper](abstractdumper#method_setIndentPad "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | | [dump](#method_dump)([Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data, callable|resource|string|true|null $output = null, array $extraDisplayOptions = array()) Dumps a Data object. | | | | [dumpLine](#method_dumpLine)(int $depth, $endOfValue = false) Dumps the current line. | | | | [echoLine](#method_echoLine)(string $line, int $depth, string $indentPad) Generic line dumper callback. | from [AbstractDumper](abstractdumper#method_echoLine "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | string | [utf8Encode](#method_utf8Encode)(string $s) Converts a non-UTF-8 string to UTF-8. | from [AbstractDumper](abstractdumper#method_utf8Encode "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | | [setColors](#method_setColors)(bool $colors) Enables/disables colored output. | from [CliDumper](clidumper#method_setColors "Symfony\Component\VarDumper\Dumper\CliDumper") | | | [setMaxStringWidth](#method_setMaxStringWidth)(int $maxStringWidth) Sets the maximum number of characters per line for dumped strings. | from [CliDumper](clidumper#method_setMaxStringWidth "Symfony\Component\VarDumper\Dumper\CliDumper") | | | [setStyles](#method_setStyles)(array $styles) Configures styles. | | | | [dumpScalar](#method_dumpScalar)([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, string $type, string|int|float|bool $value) Dumps a scalar value. | from [CliDumper](clidumper#method_dumpScalar "Symfony\Component\VarDumper\Dumper\CliDumper") | | | [dumpString](#method_dumpString)([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, string $str, bool $bin, int $cut) Dumps a string. | from [CliDumper](clidumper#method_dumpString "Symfony\Component\VarDumper\Dumper\CliDumper") | | | [enterHash](#method_enterHash)([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, int $type, string $class, bool $hasChild) Dumps while entering an hash. | | | | [leaveHash](#method_leaveHash)([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, int $type, string $class, bool $hasChild, int $cut) Dumps while leaving an hash. | | | | [dumpEllipsis](#method_dumpEllipsis)([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, bool $hasChild, int $cut) Dumps an ellipsis for cut children. | from [CliDumper](clidumper#method_dumpEllipsis "Symfony\Component\VarDumper\Dumper\CliDumper") | | | [dumpKey](#method_dumpKey)([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor) Dumps a key in a hash structure. | from [CliDumper](clidumper#method_dumpKey "Symfony\Component\VarDumper\Dumper\CliDumper") | | string | [style](#method_style)(string $style, string $value, array $attr = array()) Decorates a value with some style. | | | bool | [supportsColors](#method_supportsColors)() | from [CliDumper](clidumper#method_supportsColors "Symfony\Component\VarDumper\Dumper\CliDumper") | | | [endValue](#method_endValue)([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor) | from [CliDumper](clidumper#method_endValue "Symfony\Component\VarDumper\Dumper\CliDumper") | | | [setDisplayOptions](#method_setDisplayOptions)(array $displayOptions) Configures display options. | | | | [setDumpHeader](#method_setDumpHeader)(string $header) Sets an HTML header that will be dumped once in the output stream. | | | | [setDumpBoundaries](#method_setDumpBoundaries)(string $prefix, string $suffix) Sets an HTML prefix and suffix that will encapse every single dump. | | | | [getDumpHeader](#method_getDumpHeader)() Dumps the HTML header. | | Details ------- ### \_\_construct(callable|resource|string|null $output = null, string $charset = null, int $flags = 0) #### Parameters | | | | | --- | --- | --- | | callable|resource|string|null | $output | A line dumper callable, an opened stream or an output path, defaults to static::$defaultOutput | | string | $charset | The default character encoding to use for non-UTF8 strings | | int | $flags | A bit field of static::DUMP\_\* constants to fine tune dumps representation | ### callable|resource|string setOutput(callable|resource|string $output) Sets the output destination of the dumps. #### Parameters | | | | | --- | --- | --- | | callable|resource|string | $output | A line dumper callable, an opened stream or an output path | #### Return Value | | | | --- | --- | | callable|resource|string | The previous output destination | ### string setCharset(string $charset) Sets the default character encoding to use for non-UTF8 strings. #### Parameters | | | | | --- | --- | --- | | string | $charset | The default character encoding to use for non-UTF8 strings | #### Return Value | | | | --- | --- | | string | The previous charset | ### string setIndentPad(string $pad) Sets the indentation pad string. #### Parameters | | | | | --- | --- | --- | | string | $pad | A string that will be prepended to dumped lines, repeated by nesting level | #### Return Value | | | | --- | --- | | string | The previous indent pad | ### dump([Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data, callable|resource|string|true|null $output = null, array $extraDisplayOptions = array()) Dumps a Data object. #### Parameters | | | | | --- | --- | --- | | [Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") | $data | | | callable|resource|string|true|null | $output | A line dumper callable, an opened stream, an output path or true to return the dump | | array | $extraDisplayOptions | | ### protected dumpLine(int $depth, $endOfValue = false) Dumps the current line. #### Parameters | | | | | --- | --- | --- | | int | $depth | The recursive depth in the dumped structure for the line being dumped, or -1 to signal the end-of-dump to the line dumper callable | | | $endOfValue | | ### protected echoLine(string $line, int $depth, string $indentPad) Generic line dumper callback. #### Parameters | | | | | --- | --- | --- | | string | $line | The line to write | | int | $depth | The recursive depth in the dumped structure | | string | $indentPad | The line indent pad | ### protected string utf8Encode(string $s) Converts a non-UTF-8 string to UTF-8. #### Parameters | | | | | --- | --- | --- | | string | $s | The non-UTF-8 string to convert | #### Return Value | | | | --- | --- | | string | The string converted to UTF-8 | ### setColors(bool $colors) Enables/disables colored output. #### Parameters | | | | | --- | --- | --- | | bool | $colors | | ### setMaxStringWidth(int $maxStringWidth) Sets the maximum number of characters per line for dumped strings. #### Parameters | | | | | --- | --- | --- | | int | $maxStringWidth | | ### setStyles(array $styles) Configures styles. #### Parameters | | | | | --- | --- | --- | | array | $styles | A map of style names to style definitions | ### dumpScalar([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, string $type, string|int|float|bool $value) Dumps a scalar value. #### Parameters | | | | | --- | --- | --- | | [Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | The Cursor position in the dump | | string | $type | The PHP type of the value being dumped | | string|int|float|bool | $value | The scalar value being dumped | ### dumpString([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, string $str, bool $bin, int $cut) Dumps a string. #### Parameters | | | | | --- | --- | --- | | [Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | The Cursor position in the dump | | string | $str | The string being dumped | | bool | $bin | Whether $str is UTF-8 or binary encoded | | int | $cut | The number of characters $str has been cut by | ### enterHash([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, int $type, string $class, bool $hasChild) Dumps while entering an hash. #### Parameters | | | | | --- | --- | --- | | [Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | The Cursor position in the dump | | int | $type | A Cursor::HASH\_\* const for the type of hash | | string | $class | The object class, resource type or array count | | bool | $hasChild | When the dump of the hash has child item | ### leaveHash([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, int $type, string $class, bool $hasChild, int $cut) Dumps while leaving an hash. #### Parameters | | | | | --- | --- | --- | | [Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | The Cursor position in the dump | | int | $type | A Cursor::HASH\_\* const for the type of hash | | string | $class | The object class, resource type or array count | | bool | $hasChild | When the dump of the hash has child item | | int | $cut | The number of items the hash has been cut by | ### protected dumpEllipsis([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, bool $hasChild, int $cut) Dumps an ellipsis for cut children. #### Parameters | | | | | --- | --- | --- | | [Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | The Cursor position in the dump | | bool | $hasChild | When the dump of the hash has child item | | int | $cut | The number of items the hash has been cut by | ### protected dumpKey([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor) Dumps a key in a hash structure. #### Parameters | | | | | --- | --- | --- | | [Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | The Cursor position in the dump | ### protected string style(string $style, string $value, array $attr = array()) Decorates a value with some style. #### Parameters | | | | | --- | --- | --- | | string | $style | The type of style being applied | | string | $value | The value being styled | | array | $attr | Optional context information | #### Return Value | | | | --- | --- | | string | The value with style decoration | ### protected bool supportsColors() #### Return Value | | | | --- | --- | | bool | Tells if the current output stream supports ANSI colors or not | ### protected endValue([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor) #### Parameters | | | | | --- | --- | --- | | [Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | | ### setDisplayOptions(array $displayOptions) Configures display options. #### Parameters | | | | | --- | --- | --- | | array | $displayOptions | A map of display options to customize the behavior | ### setDumpHeader(string $header) Sets an HTML header that will be dumped once in the output stream. #### Parameters | | | | | --- | --- | --- | | string | $header | An HTML string | ### setDumpBoundaries(string $prefix, string $suffix) Sets an HTML prefix and suffix that will encapse every single dump. #### Parameters | | | | | --- | --- | --- | | string | $prefix | The prepended HTML string | | string | $suffix | The appended HTML string | ### protected getDumpHeader() Dumps the HTML header. symfony CliDumper CliDumper ========== class **CliDumper** extends [AbstractDumper](abstractdumper "Symfony\Component\VarDumper\Dumper\AbstractDumper") CliDumper dumps variables for command line output. Constants --------- | | | | --- | --- | | DUMP\_LIGHT\_ARRAY | | | DUMP\_STRING\_LENGTH | | | DUMP\_COMMA\_SEPARATOR | | | DUMP\_TRAILING\_COMMA | | Properties ---------- | | | | | | --- | --- | --- | --- | | static | $defaultOutput | | | | protected | $line | | from [AbstractDumper](abstractdumper#property_line "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | protected | $lineDumper | | from [AbstractDumper](abstractdumper#property_lineDumper "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | protected | $outputStream | | from [AbstractDumper](abstractdumper#property_outputStream "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | protected | $decimalPoint | | from [AbstractDumper](abstractdumper#property_decimalPoint "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | protected | $indentPad | | from [AbstractDumper](abstractdumper#property_indentPad "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | protected | $flags | | from [AbstractDumper](abstractdumper#property_flags "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | static | $defaultColors | | | | protected | $colors | | | | protected | $maxStringWidth | | | | protected | $styles | | | | static protected | $controlCharsRx | | | | static protected | $controlCharsMap | | | | protected | $collapseNextHash | | | | protected | $expandNextHash | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(callable|resource|string|null $output = null, string $charset = null, int $flags = 0) | | | callable|resource|string | [setOutput](#method_setOutput)(callable|resource|string $output) Sets the output destination of the dumps. | from [AbstractDumper](abstractdumper#method_setOutput "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | string | [setCharset](#method_setCharset)(string $charset) Sets the default character encoding to use for non-UTF8 strings. | from [AbstractDumper](abstractdumper#method_setCharset "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | string | [setIndentPad](#method_setIndentPad)(string $pad) Sets the indentation pad string. | from [AbstractDumper](abstractdumper#method_setIndentPad "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | | [dump](#method_dump)([Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data, callable|resource|string|true|null $output = null) Dumps a Data object. | from [AbstractDumper](abstractdumper#method_dump "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | | [dumpLine](#method_dumpLine)(int $depth, $endOfValue = false) Dumps the current line. | | | | [echoLine](#method_echoLine)(string $line, int $depth, string $indentPad) Generic line dumper callback. | from [AbstractDumper](abstractdumper#method_echoLine "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | string | [utf8Encode](#method_utf8Encode)(string $s) Converts a non-UTF-8 string to UTF-8. | from [AbstractDumper](abstractdumper#method_utf8Encode "Symfony\Component\VarDumper\Dumper\AbstractDumper") | | | [setColors](#method_setColors)(bool $colors) Enables/disables colored output. | | | | [setMaxStringWidth](#method_setMaxStringWidth)(int $maxStringWidth) Sets the maximum number of characters per line for dumped strings. | | | | [setStyles](#method_setStyles)(array $styles) Configures styles. | | | | [dumpScalar](#method_dumpScalar)([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, string $type, string|int|float|bool $value) Dumps a scalar value. | | | | [dumpString](#method_dumpString)([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, string $str, bool $bin, int $cut) Dumps a string. | | | | [enterHash](#method_enterHash)([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, int $type, string $class, bool $hasChild) Dumps while entering an hash. | | | | [leaveHash](#method_leaveHash)([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, int $type, string $class, bool $hasChild, int $cut) Dumps while leaving an hash. | | | | [dumpEllipsis](#method_dumpEllipsis)([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, bool $hasChild, int $cut) Dumps an ellipsis for cut children. | | | | [dumpKey](#method_dumpKey)([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor) Dumps a key in a hash structure. | | | string | [style](#method_style)(string $style, string $value, array $attr = array()) Decorates a value with some style. | | | bool | [supportsColors](#method_supportsColors)() | | | | [endValue](#method_endValue)([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor) | | Details ------- ### \_\_construct(callable|resource|string|null $output = null, string $charset = null, int $flags = 0) #### Parameters | | | | | --- | --- | --- | | callable|resource|string|null | $output | A line dumper callable, an opened stream or an output path, defaults to static::$defaultOutput | | string | $charset | The default character encoding to use for non-UTF8 strings | | int | $flags | A bit field of static::DUMP\_\* constants to fine tune dumps representation | ### callable|resource|string setOutput(callable|resource|string $output) Sets the output destination of the dumps. #### Parameters | | | | | --- | --- | --- | | callable|resource|string | $output | A line dumper callable, an opened stream or an output path | #### Return Value | | | | --- | --- | | callable|resource|string | The previous output destination | ### string setCharset(string $charset) Sets the default character encoding to use for non-UTF8 strings. #### Parameters | | | | | --- | --- | --- | | string | $charset | The default character encoding to use for non-UTF8 strings | #### Return Value | | | | --- | --- | | string | The previous charset | ### string setIndentPad(string $pad) Sets the indentation pad string. #### Parameters | | | | | --- | --- | --- | | string | $pad | A string that will be prepended to dumped lines, repeated by nesting level | #### Return Value | | | | --- | --- | | string | The previous indent pad | ### dump([Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data, callable|resource|string|true|null $output = null) Dumps a Data object. #### Parameters | | | | | --- | --- | --- | | [Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") | $data | | | callable|resource|string|true|null | $output | A line dumper callable, an opened stream, an output path or true to return the dump | ### protected dumpLine(int $depth, $endOfValue = false) Dumps the current line. #### Parameters | | | | | --- | --- | --- | | int | $depth | The recursive depth in the dumped structure for the line being dumped, or -1 to signal the end-of-dump to the line dumper callable | | | $endOfValue | | ### protected echoLine(string $line, int $depth, string $indentPad) Generic line dumper callback. #### Parameters | | | | | --- | --- | --- | | string | $line | The line to write | | int | $depth | The recursive depth in the dumped structure | | string | $indentPad | The line indent pad | ### protected string utf8Encode(string $s) Converts a non-UTF-8 string to UTF-8. #### Parameters | | | | | --- | --- | --- | | string | $s | The non-UTF-8 string to convert | #### Return Value | | | | --- | --- | | string | The string converted to UTF-8 | ### setColors(bool $colors) Enables/disables colored output. #### Parameters | | | | | --- | --- | --- | | bool | $colors | | ### setMaxStringWidth(int $maxStringWidth) Sets the maximum number of characters per line for dumped strings. #### Parameters | | | | | --- | --- | --- | | int | $maxStringWidth | | ### setStyles(array $styles) Configures styles. #### Parameters | | | | | --- | --- | --- | | array | $styles | A map of style names to style definitions | ### dumpScalar([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, string $type, string|int|float|bool $value) Dumps a scalar value. #### Parameters | | | | | --- | --- | --- | | [Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | The Cursor position in the dump | | string | $type | The PHP type of the value being dumped | | string|int|float|bool | $value | The scalar value being dumped | ### dumpString([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, string $str, bool $bin, int $cut) Dumps a string. #### Parameters | | | | | --- | --- | --- | | [Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | The Cursor position in the dump | | string | $str | The string being dumped | | bool | $bin | Whether $str is UTF-8 or binary encoded | | int | $cut | The number of characters $str has been cut by | ### enterHash([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, int $type, string $class, bool $hasChild) Dumps while entering an hash. #### Parameters | | | | | --- | --- | --- | | [Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | The Cursor position in the dump | | int | $type | A Cursor::HASH\_\* const for the type of hash | | string | $class | The object class, resource type or array count | | bool | $hasChild | When the dump of the hash has child item | ### leaveHash([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, int $type, string $class, bool $hasChild, int $cut) Dumps while leaving an hash. #### Parameters | | | | | --- | --- | --- | | [Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | The Cursor position in the dump | | int | $type | A Cursor::HASH\_\* const for the type of hash | | string | $class | The object class, resource type or array count | | bool | $hasChild | When the dump of the hash has child item | | int | $cut | The number of items the hash has been cut by | ### protected dumpEllipsis([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor, bool $hasChild, int $cut) Dumps an ellipsis for cut children. #### Parameters | | | | | --- | --- | --- | | [Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | The Cursor position in the dump | | bool | $hasChild | When the dump of the hash has child item | | int | $cut | The number of items the hash has been cut by | ### protected dumpKey([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor) Dumps a key in a hash structure. #### Parameters | | | | | --- | --- | --- | | [Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | The Cursor position in the dump | ### protected string style(string $style, string $value, array $attr = array()) Decorates a value with some style. #### Parameters | | | | | --- | --- | --- | | string | $style | The type of style being applied | | string | $value | The value being styled | | array | $attr | Optional context information | #### Return Value | | | | --- | --- | | string | The value with style decoration | ### protected bool supportsColors() #### Return Value | | | | --- | --- | | bool | Tells if the current output stream supports ANSI colors or not | ### protected endValue([Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") $cursor) #### Parameters | | | | | --- | --- | --- | | [Cursor](../cloner/cursor "Symfony\Component\VarDumper\Cloner\Cursor") | $cursor | |
programming_docs
symfony Symfony\Component\VarDumper\Dumper\ContextProvider Symfony\Component\VarDumper\Dumper\ContextProvider ================================================== Classes ------- | | | | --- | --- | | [CliContextProvider](contextprovider/clicontextprovider "Symfony\Component\VarDumper\Dumper\ContextProvider\CliContextProvider") | Tries to provide context on CLI. | | [RequestContextProvider](contextprovider/requestcontextprovider "Symfony\Component\VarDumper\Dumper\ContextProvider\RequestContextProvider") | Tries to provide context from a request. | | [SourceContextProvider](contextprovider/sourcecontextprovider "Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider") | Tries to provide context from sources (class name, file, line, code excerpt, . | Interfaces ---------- | | | | --- | --- | | *[ContextProviderInterface](contextprovider/contextproviderinterface "Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface")* | Interface to provide contextual data about dump data clones sent to a server. | symfony ServerDumper ServerDumper ============= class **ServerDumper** implements [DataDumperInterface](datadumperinterface "Symfony\Component\VarDumper\Dumper\DataDumperInterface") ServerDumper forwards serialized Data clones to a server. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $host, [DataDumperInterface](datadumperinterface "Symfony\Component\VarDumper\Dumper\DataDumperInterface") $wrappedDumper = null, array $contextProviders = array()) | | | array | [getContextProviders](#method_getContextProviders)() | | | | [dump](#method_dump)([Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data) | | Details ------- ### \_\_construct(string $host, [DataDumperInterface](datadumperinterface "Symfony\Component\VarDumper\Dumper\DataDumperInterface") $wrappedDumper = null, array $contextProviders = array()) #### Parameters | | | | | --- | --- | --- | | string | $host | The server host | | [DataDumperInterface](datadumperinterface "Symfony\Component\VarDumper\Dumper\DataDumperInterface") | $wrappedDumper | A wrapped instance used whenever we failed contacting the server | | array | $contextProviders | Context providers indexed by context name | ### array getContextProviders() #### Return Value | | | | --- | --- | | array | | ### dump([Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data) #### Parameters | | | | | --- | --- | --- | | [Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") | $data | | symfony AbstractDumper AbstractDumper =============== abstract class **AbstractDumper** implements [DataDumperInterface](datadumperinterface "Symfony\Component\VarDumper\Dumper\DataDumperInterface"), [DumperInterface](../cloner/dumperinterface "Symfony\Component\VarDumper\Cloner\DumperInterface") Abstract mechanism for dumping a Data object. Constants --------- | | | | --- | --- | | DUMP\_LIGHT\_ARRAY | | | DUMP\_STRING\_LENGTH | | | DUMP\_COMMA\_SEPARATOR | | | DUMP\_TRAILING\_COMMA | | Properties ---------- | | | | | | --- | --- | --- | --- | | static | $defaultOutput | | | | protected | $line | | | | protected | $lineDumper | | | | protected | $outputStream | | | | protected | $decimalPoint | | | | protected | $indentPad | | | | protected | $flags | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(callable|resource|string|null $output = null, string $charset = null, int $flags = 0) | | | callable|resource|string | [setOutput](#method_setOutput)(callable|resource|string $output) Sets the output destination of the dumps. | | | string | [setCharset](#method_setCharset)(string $charset) Sets the default character encoding to use for non-UTF8 strings. | | | string | [setIndentPad](#method_setIndentPad)(string $pad) Sets the indentation pad string. | | | | [dump](#method_dump)([Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data, callable|resource|string|true|null $output = null) Dumps a Data object. | | | | [dumpLine](#method_dumpLine)(int $depth) Dumps the current line. | | | | [echoLine](#method_echoLine)(string $line, int $depth, string $indentPad) Generic line dumper callback. | | | string | [utf8Encode](#method_utf8Encode)(string $s) Converts a non-UTF-8 string to UTF-8. | | Details ------- ### \_\_construct(callable|resource|string|null $output = null, string $charset = null, int $flags = 0) #### Parameters | | | | | --- | --- | --- | | callable|resource|string|null | $output | A line dumper callable, an opened stream or an output path, defaults to static::$defaultOutput | | string | $charset | The default character encoding to use for non-UTF8 strings | | int | $flags | A bit field of static::DUMP\_\* constants to fine tune dumps representation | ### callable|resource|string setOutput(callable|resource|string $output) Sets the output destination of the dumps. #### Parameters | | | | | --- | --- | --- | | callable|resource|string | $output | A line dumper callable, an opened stream or an output path | #### Return Value | | | | --- | --- | | callable|resource|string | The previous output destination | ### string setCharset(string $charset) Sets the default character encoding to use for non-UTF8 strings. #### Parameters | | | | | --- | --- | --- | | string | $charset | The default character encoding to use for non-UTF8 strings | #### Return Value | | | | --- | --- | | string | The previous charset | ### string setIndentPad(string $pad) Sets the indentation pad string. #### Parameters | | | | | --- | --- | --- | | string | $pad | A string that will be prepended to dumped lines, repeated by nesting level | #### Return Value | | | | --- | --- | | string | The previous indent pad | ### dump([Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data, callable|resource|string|true|null $output = null) Dumps a Data object. #### Parameters | | | | | --- | --- | --- | | [Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") | $data | | | callable|resource|string|true|null | $output | A line dumper callable, an opened stream, an output path or true to return the dump | ### protected dumpLine(int $depth) Dumps the current line. #### Parameters | | | | | --- | --- | --- | | int | $depth | The recursive depth in the dumped structure for the line being dumped, or -1 to signal the end-of-dump to the line dumper callable | ### protected echoLine(string $line, int $depth, string $indentPad) Generic line dumper callback. #### Parameters | | | | | --- | --- | --- | | string | $line | The line to write | | int | $depth | The recursive depth in the dumped structure | | string | $indentPad | The line indent pad | ### protected string utf8Encode(string $s) Converts a non-UTF-8 string to UTF-8. #### Parameters | | | | | --- | --- | --- | | string | $s | The non-UTF-8 string to convert | #### Return Value | | | | --- | --- | | string | The string converted to UTF-8 | symfony DataDumperInterface DataDumperInterface ==================== interface **DataDumperInterface** DataDumperInterface for dumping Data objects. Methods ------- | | | | | --- | --- | --- | | | [dump](#method_dump)([Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data) | | Details ------- ### dump([Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") $data) #### Parameters | | | | | --- | --- | --- | | [Data](../cloner/data "Symfony\Component\VarDumper\Cloner\Data") | $data | | symfony SourceContextProvider SourceContextProvider ====================== class **SourceContextProvider** implements [ContextProviderInterface](contextproviderinterface "Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface") Tries to provide context from sources (class name, file, line, code excerpt, . ..). Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $charset = null, string $projectDir = null, [FileLinkFormatter](../../../httpkernel/debug/filelinkformatter "Symfony\Component\HttpKernel\Debug\FileLinkFormatter") $fileLinkFormatter = null, int $limit = 9) | | | array|null | [getContext](#method_getContext)() | | Details ------- ### \_\_construct(string $charset = null, string $projectDir = null, [FileLinkFormatter](../../../httpkernel/debug/filelinkformatter "Symfony\Component\HttpKernel\Debug\FileLinkFormatter") $fileLinkFormatter = null, int $limit = 9) #### Parameters | | | | | --- | --- | --- | | string | $charset | | | string | $projectDir | | | [FileLinkFormatter](../../../httpkernel/debug/filelinkformatter "Symfony\Component\HttpKernel\Debug\FileLinkFormatter") | $fileLinkFormatter | | | int | $limit | | ### array|null getContext() #### Return Value | | | | --- | --- | | array|null | Context data or null if unable to provide any context | symfony RequestContextProvider RequestContextProvider ======================= class **RequestContextProvider** implements [ContextProviderInterface](contextproviderinterface "Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface") Tries to provide context from a request. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([RequestStack](../../../httpfoundation/requeststack "Symfony\Component\HttpFoundation\RequestStack") $requestStack) | | | array|null | [getContext](#method_getContext)() | | Details ------- ### \_\_construct([RequestStack](../../../httpfoundation/requeststack "Symfony\Component\HttpFoundation\RequestStack") $requestStack) #### Parameters | | | | | --- | --- | --- | | [RequestStack](../../../httpfoundation/requeststack "Symfony\Component\HttpFoundation\RequestStack") | $requestStack | | ### array|null getContext() #### Return Value | | | | --- | --- | | array|null | Context data or null if unable to provide any context | symfony ContextProviderInterface ContextProviderInterface ========================= interface **ContextProviderInterface** Interface to provide contextual data about dump data clones sent to a server. Methods ------- | | | | | --- | --- | --- | | array|null | [getContext](#method_getContext)() | | Details ------- ### array|null getContext() #### Return Value | | | | --- | --- | | array|null | Context data or null if unable to provide any context | symfony CliContextProvider CliContextProvider =================== class **CliContextProvider** implements [ContextProviderInterface](contextproviderinterface "Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface") Tries to provide context on CLI. Methods ------- | | | | | --- | --- | --- | | array|null | [getContext](#method_getContext)() | | Details ------- ### array|null getContext() #### Return Value | | | | --- | --- | | array|null | Context data or null if unable to provide any context | symfony ServiceSubscriberInterface ServiceSubscriberInterface =========================== interface **ServiceSubscriberInterface** A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method. The getSubscribedServices method returns an array of service types required by such instances, optionally keyed by the service names used internally. Service types that start with an interrogation mark "?" are optional, while the other ones are mandatory service dependencies. The injected service locators SHOULD NOT allow access to any other services not specified by the method. It is expected that ServiceSubscriber instances consume PSR-11-based service locators internally. This interface does not dictate any injection method for these service locators, although constructor injection is recommended. Methods ------- | | | | | --- | --- | --- | | static array | [getSubscribedServices](#method_getSubscribedServices)() Returns an array of service types required by such instances, optionally keyed by the service names used internally. | | Details ------- ### static array getSubscribedServices() Returns an array of service types required by such instances, optionally keyed by the service names used internally. For mandatory dependencies: * array('logger' => 'Psr\Log\LoggerInterface') means the objects use the "logger" name internally to fetch a service which must implement Psr\Log\LoggerInterface. * array('Psr\Log\LoggerInterface') is a shortcut for * array('Psr\Log\LoggerInterface' => 'Psr\Log\LoggerInterface') otherwise: * array('logger' => '?Psr\Log\LoggerInterface') denotes an optional dependency * array('?Psr\Log\LoggerInterface') is a shortcut for * array('Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface') #### Return Value | | | | --- | --- | | array | The required service types, optionally keyed by service names | symfony Definition Definition =========== class **Definition** Definition represents a service definition. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $arguments | | | | | $innerServiceId | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $class = null, array $arguments = array()) | | | array | [getChanges](#method_getChanges)() Returns all changes tracked for the Definition object. | | | $this | [setChanges](#method_setChanges)(array $changes) Sets the tracked changes for the Definition object. | | | $this | [setFactory](#method_setFactory)(string|array $factory) Sets a factory. | | | string|array|null | [getFactory](#method_getFactory)() Gets the factory. | | | $this | [setDecoratedService](#method_setDecoratedService)(string|null $id, string|null $renamedId = null, int $priority = 0) Sets the service that this service is decorating. | | | array|null | [getDecoratedService](#method_getDecoratedService)() Gets the service that this service is decorating. | | | $this | [setClass](#method_setClass)(string $class) Sets the service class. | | | string|null | [getClass](#method_getClass)() Gets the service class. | | | $this | [setArguments](#method_setArguments)(array $arguments) Sets the arguments to pass to the service constructor/factory method. | | | $this | [setProperties](#method_setProperties)(array $properties) Sets the properties to define when creating the service. | | | array | [getProperties](#method_getProperties)() Gets the properties to define when creating the service. | | | $this | [setProperty](#method_setProperty)(string $name, mixed $value) Sets a specific property. | | | $this | [addArgument](#method_addArgument)(mixed $argument) Adds an argument to pass to the service constructor/factory method. | | | $this | [replaceArgument](#method_replaceArgument)(int|string $index, mixed $argument) Replaces a specific argument. | | | $this | [setArgument](#method_setArgument)(int|string $key, mixed $value) Sets a specific argument. | | | array | [getArguments](#method_getArguments)() Gets the arguments to pass to the service constructor/factory method. | | | mixed | [getArgument](#method_getArgument)(int|string $index) Gets an argument to pass to the service constructor/factory method. | | | $this | [setMethodCalls](#method_setMethodCalls)(array $calls = array()) Sets the methods to call after service initialization. | | | $this | [addMethodCall](#method_addMethodCall)(string $method, array $arguments = array()) Adds a method to call after service initialization. | | | $this | [removeMethodCall](#method_removeMethodCall)(string $method) Removes a method to call after service initialization. | | | bool | [hasMethodCall](#method_hasMethodCall)(string $method) Check if the current definition has a given method to call after service initialization. | | | array | [getMethodCalls](#method_getMethodCalls)() Gets the methods to call after service initialization. | | | $this | [setInstanceofConditionals](#method_setInstanceofConditionals)(array $instanceof) Sets the definition templates to conditionally apply on the current definition, keyed by parent interface/class. | | | [ChildDefinition](childdefinition "Symfony\Component\DependencyInjection\ChildDefinition")[] | [getInstanceofConditionals](#method_getInstanceofConditionals)() Gets the definition templates to conditionally apply on the current definition, keyed by parent interface/class. | | | $this | [setAutoconfigured](#method_setAutoconfigured)(bool $autoconfigured) Sets whether or not instanceof conditionals should be prepended with a global set. | | | bool | [isAutoconfigured](#method_isAutoconfigured)() | | | $this | [setTags](#method_setTags)(array $tags) Sets tags for this definition. | | | array | [getTags](#method_getTags)() Returns all tags. | | | array | [getTag](#method_getTag)(string $name) Gets a tag by name. | | | $this | [addTag](#method_addTag)(string $name, array $attributes = array()) Adds a tag for this definition. | | | bool | [hasTag](#method_hasTag)(string $name) Whether this definition has a tag with the given name. | | | $this | [clearTag](#method_clearTag)(string $name) Clears all tags for a given name. | | | $this | [clearTags](#method_clearTags)() Clears the tags for this definition. | | | $this | [setFile](#method_setFile)(string $file) Sets a file to require before creating the service. | | | string|null | [getFile](#method_getFile)() Gets the file to require before creating the service. | | | $this | [setShared](#method_setShared)(bool $shared) Sets if the service must be shared or not. | | | bool | [isShared](#method_isShared)() Whether this service is shared. | | | $this | [setPublic](#method_setPublic)(bool $boolean) Sets the visibility of this service. | | | bool | [isPublic](#method_isPublic)() Whether this service is public facing. | | | $this | [setPrivate](#method_setPrivate)(bool $boolean) Sets if this service is private. | | | bool | [isPrivate](#method_isPrivate)() Whether this service is private. | | | $this | [setLazy](#method_setLazy)(bool $lazy) Sets the lazy flag of this service. | | | bool | [isLazy](#method_isLazy)() Whether this service is lazy. | | | $this | [setSynthetic](#method_setSynthetic)(bool $boolean) Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected. | | | bool | [isSynthetic](#method_isSynthetic)() Whether this definition is synthetic, that is not constructed by the container, but dynamically injected. | | | $this | [setAbstract](#method_setAbstract)(bool $boolean) Whether this definition is abstract, that means it merely serves as a template for other definitions. | | | bool | [isAbstract](#method_isAbstract)() Whether this definition is abstract, that means it merely serves as a template for other definitions. | | | $this | [setDeprecated](#method_setDeprecated)(bool $status = true, string $template = null) Whether this definition is deprecated, that means it should not be called anymore. | | | bool | [isDeprecated](#method_isDeprecated)() Whether this definition is deprecated, that means it should not be called anymore. | | | string | [getDeprecationMessage](#method_getDeprecationMessage)(string $id) Message to use if this definition is deprecated. | | | $this | [setConfigurator](#method_setConfigurator)(string|array $configurator) Sets a configurator to call after the service is fully initialized. | | | callable|null | [getConfigurator](#method_getConfigurator)() Gets the configurator to call after the service is fully initialized. | | | bool | [isAutowired](#method_isAutowired)() Is the definition autowired? | | | $this | [setAutowired](#method_setAutowired)(bool $autowired) Enables/disables autowiring. | | | array|[BoundArgument](argument/boundargument "Symfony\Component\DependencyInjection\Argument\BoundArgument")[] | [getBindings](#method_getBindings)() Gets bindings. | | | $this | [setBindings](#method_setBindings)(array $bindings) Sets bindings. | | | $this | [addError](#method_addError)(string $error) Add an error that occurred when building this Definition. | | | array | [getErrors](#method_getErrors)() Returns any errors that occurred while building this Definition. | | Details ------- ### \_\_construct(string|null $class = null, array $arguments = array()) #### Parameters | | | | | --- | --- | --- | | string|null | $class | The service class | | array | $arguments | An array of arguments to pass to the service constructor | ### array getChanges() Returns all changes tracked for the Definition object. #### Return Value | | | | --- | --- | | array | An array of changes for this Definition | ### $this setChanges(array $changes) Sets the tracked changes for the Definition object. #### Parameters | | | | | --- | --- | --- | | array | $changes | An array of changes for this Definition | #### Return Value | | | | --- | --- | | $this | | ### $this setFactory(string|array $factory) Sets a factory. #### Parameters | | | | | --- | --- | --- | | string|array | $factory | A PHP function or an array containing a class/Reference and a method to call | #### Return Value | | | | --- | --- | | $this | | ### string|array|null getFactory() Gets the factory. #### Return Value | | | | --- | --- | | string|array|null | The PHP function or an array containing a class/Reference and a method to call | ### $this setDecoratedService(string|null $id, string|null $renamedId = null, int $priority = 0) Sets the service that this service is decorating. #### Parameters | | | | | --- | --- | --- | | string|null | $id | The decorated service id, use null to remove decoration | | string|null | $renamedId | The new decorated service id | | int | $priority | The priority of decoration | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | in case the decorated service id and the new decorated service id are equals | ### array|null getDecoratedService() Gets the service that this service is decorating. #### Return Value | | | | --- | --- | | array|null | An array composed of the decorated service id, the new id for it and the priority of decoration, null if no service is decorated | ### $this setClass(string $class) Sets the service class. #### Parameters | | | | | --- | --- | --- | | string | $class | The service class | #### Return Value | | | | --- | --- | | $this | | ### string|null getClass() Gets the service class. #### Return Value | | | | --- | --- | | string|null | The service class | ### $this setArguments(array $arguments) Sets the arguments to pass to the service constructor/factory method. #### Parameters | | | | | --- | --- | --- | | array | $arguments | | #### Return Value | | | | --- | --- | | $this | | ### $this setProperties(array $properties) Sets the properties to define when creating the service. #### Parameters | | | | | --- | --- | --- | | array | $properties | | #### Return Value | | | | --- | --- | | $this | | ### array getProperties() Gets the properties to define when creating the service. #### Return Value | | | | --- | --- | | array | | ### $this setProperty(string $name, mixed $value) Sets a specific property. #### Parameters | | | | | --- | --- | --- | | string | $name | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this addArgument(mixed $argument) Adds an argument to pass to the service constructor/factory method. #### Parameters | | | | | --- | --- | --- | | mixed | $argument | An argument | #### Return Value | | | | --- | --- | | $this | | ### $this replaceArgument(int|string $index, mixed $argument) Replaces a specific argument. #### Parameters | | | | | --- | --- | --- | | int|string | $index | | | mixed | $argument | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [OutOfBoundsException](exception/outofboundsexception "Symfony\Component\DependencyInjection\Exception\OutOfBoundsException") | When the replaced argument does not exist | ### $this setArgument(int|string $key, mixed $value) Sets a specific argument. #### Parameters | | | | | --- | --- | --- | | int|string | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### array getArguments() Gets the arguments to pass to the service constructor/factory method. #### Return Value | | | | --- | --- | | array | The array of arguments | ### mixed getArgument(int|string $index) Gets an argument to pass to the service constructor/factory method. #### Parameters | | | | | --- | --- | --- | | int|string | $index | | #### Return Value | | | | --- | --- | | mixed | The argument value | #### Exceptions | | | | --- | --- | | [OutOfBoundsException](exception/outofboundsexception "Symfony\Component\DependencyInjection\Exception\OutOfBoundsException") | When the argument does not exist | ### $this setMethodCalls(array $calls = array()) Sets the methods to call after service initialization. #### Parameters | | | | | --- | --- | --- | | array | $calls | | #### Return Value | | | | --- | --- | | $this | | ### $this addMethodCall(string $method, array $arguments = array()) Adds a method to call after service initialization. #### Parameters | | | | | --- | --- | --- | | string | $method | The method name to call | | array | $arguments | An array of arguments to pass to the method call | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | on empty $method param | ### $this removeMethodCall(string $method) Removes a method to call after service initialization. #### Parameters | | | | | --- | --- | --- | | string | $method | The method name to remove | #### Return Value | | | | --- | --- | | $this | | ### bool hasMethodCall(string $method) Check if the current definition has a given method to call after service initialization. #### Parameters | | | | | --- | --- | --- | | string | $method | The method name to search for | #### Return Value | | | | --- | --- | | bool | | ### array getMethodCalls() Gets the methods to call after service initialization. #### Return Value | | | | --- | --- | | array | An array of method calls | ### $this setInstanceofConditionals(array $instanceof) Sets the definition templates to conditionally apply on the current definition, keyed by parent interface/class. #### Parameters | | | | | --- | --- | --- | | array | $instanceof | ChildDefinition[] | #### Return Value | | | | --- | --- | | $this | | ### [ChildDefinition](childdefinition "Symfony\Component\DependencyInjection\ChildDefinition")[] getInstanceofConditionals() Gets the definition templates to conditionally apply on the current definition, keyed by parent interface/class. #### Return Value | | | | --- | --- | | [ChildDefinition](childdefinition "Symfony\Component\DependencyInjection\ChildDefinition")[] | | ### $this setAutoconfigured(bool $autoconfigured) Sets whether or not instanceof conditionals should be prepended with a global set. #### Parameters | | | | | --- | --- | --- | | bool | $autoconfigured | | #### Return Value | | | | --- | --- | | $this | | ### bool isAutoconfigured() #### Return Value | | | | --- | --- | | bool | | ### $this setTags(array $tags) Sets tags for this definition. #### Parameters | | | | | --- | --- | --- | | array | $tags | | #### Return Value | | | | --- | --- | | $this | | ### array getTags() Returns all tags. #### Return Value | | | | --- | --- | | array | An array of tags | ### array getTag(string $name) Gets a tag by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The tag name | #### Return Value | | | | --- | --- | | array | An array of attributes | ### $this addTag(string $name, array $attributes = array()) Adds a tag for this definition. #### Parameters | | | | | --- | --- | --- | | string | $name | The tag name | | array | $attributes | An array of attributes | #### Return Value | | | | --- | --- | | $this | | ### bool hasTag(string $name) Whether this definition has a tag with the given name. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | bool | | ### $this clearTag(string $name) Clears all tags for a given name. #### Parameters | | | | | --- | --- | --- | | string | $name | The tag name | #### Return Value | | | | --- | --- | | $this | | ### $this clearTags() Clears the tags for this definition. #### Return Value | | | | --- | --- | | $this | | ### $this setFile(string $file) Sets a file to require before creating the service. #### Parameters | | | | | --- | --- | --- | | string | $file | A full pathname to include | #### Return Value | | | | --- | --- | | $this | | ### string|null getFile() Gets the file to require before creating the service. #### Return Value | | | | --- | --- | | string|null | The full pathname to include | ### $this setShared(bool $shared) Sets if the service must be shared or not. #### Parameters | | | | | --- | --- | --- | | bool | $shared | Whether the service must be shared or not | #### Return Value | | | | --- | --- | | $this | | ### bool isShared() Whether this service is shared. #### Return Value | | | | --- | --- | | bool | | ### $this setPublic(bool $boolean) Sets the visibility of this service. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | | #### Return Value | | | | --- | --- | | $this | | ### bool isPublic() Whether this service is public facing. #### Return Value | | | | --- | --- | | bool | | ### $this setPrivate(bool $boolean) Sets if this service is private. When set, the "private" state has a higher precedence than "public". In version 3.4, a "private" service always remains publicly accessible, but triggers a deprecation notice when accessed from the container, so that the service can be made really private in 4.0. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | | #### Return Value | | | | --- | --- | | $this | | ### bool isPrivate() Whether this service is private. #### Return Value | | | | --- | --- | | bool | | ### $this setLazy(bool $lazy) Sets the lazy flag of this service. #### Parameters | | | | | --- | --- | --- | | bool | $lazy | | #### Return Value | | | | --- | --- | | $this | | ### bool isLazy() Whether this service is lazy. #### Return Value | | | | --- | --- | | bool | | ### $this setSynthetic(bool $boolean) Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | | #### Return Value | | | | --- | --- | | $this | | ### bool isSynthetic() Whether this definition is synthetic, that is not constructed by the container, but dynamically injected. #### Return Value | | | | --- | --- | | bool | | ### $this setAbstract(bool $boolean) Whether this definition is abstract, that means it merely serves as a template for other definitions. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | | #### Return Value | | | | --- | --- | | $this | | ### bool isAbstract() Whether this definition is abstract, that means it merely serves as a template for other definitions. #### Return Value | | | | --- | --- | | bool | | ### $this setDeprecated(bool $status = true, string $template = null) Whether this definition is deprecated, that means it should not be called anymore. #### Parameters | | | | | --- | --- | --- | | bool | $status | | | string | $template | Template message to use if the definition is deprecated | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when the message template is invalid | ### bool isDeprecated() Whether this definition is deprecated, that means it should not be called anymore. #### Return Value | | | | --- | --- | | bool | | ### string getDeprecationMessage(string $id) Message to use if this definition is deprecated. #### Parameters | | | | | --- | --- | --- | | string | $id | Service id relying on this definition | #### Return Value | | | | --- | --- | | string | | ### $this setConfigurator(string|array $configurator) Sets a configurator to call after the service is fully initialized. #### Parameters | | | | | --- | --- | --- | | string|array | $configurator | A PHP callable | #### Return Value | | | | --- | --- | | $this | | ### callable|null getConfigurator() Gets the configurator to call after the service is fully initialized. #### Return Value | | | | --- | --- | | callable|null | The PHP callable to call | ### bool isAutowired() Is the definition autowired? #### Return Value | | | | --- | --- | | bool | | ### $this setAutowired(bool $autowired) Enables/disables autowiring. #### Parameters | | | | | --- | --- | --- | | bool | $autowired | | #### Return Value | | | | --- | --- | | $this | | ### array|[BoundArgument](argument/boundargument "Symfony\Component\DependencyInjection\Argument\BoundArgument")[] getBindings() Gets bindings. #### Return Value | | | | --- | --- | | array|[BoundArgument](argument/boundargument "Symfony\Component\DependencyInjection\Argument\BoundArgument")[] | | ### $this setBindings(array $bindings) Sets bindings. Bindings map $named or FQCN arguments to values that should be injected in the matching parameters (of the constructor, of methods called and of controller actions). #### Parameters | | | | | --- | --- | --- | | array | $bindings | | #### Return Value | | | | --- | --- | | $this | | ### $this addError(string $error) Add an error that occurred when building this Definition. #### Parameters | | | | | --- | --- | --- | | string | $error | | #### Return Value | | | | --- | --- | | $this | | ### array getErrors() Returns any errors that occurred while building this Definition. #### Return Value | | | | --- | --- | | array | |
programming_docs
symfony TaggedContainerInterface TaggedContainerInterface ========================= interface **TaggedContainerInterface** implements [ContainerInterface](containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") TaggedContainerInterface is the interface implemented when a container knows how to deals with tags. Methods ------- | | | | | --- | --- | --- | | | [set](#method_set)(string $id, object $service) Sets a service. | from [ContainerInterface](containerinterface#method_set "Symfony\Component\DependencyInjection\ContainerInterface") | | object | [get](#method_get)(string $id, int $invalidBehavior = self::EXCEPTION\_ON\_INVALID\_REFERENCE) Gets a service. | from [ContainerInterface](containerinterface#method_get "Symfony\Component\DependencyInjection\ContainerInterface") | | bool | [has](#method_has)(string $id) Returns true if the given service is defined. | from [ContainerInterface](containerinterface#method_has "Symfony\Component\DependencyInjection\ContainerInterface") | | bool | [initialized](#method_initialized)(string $id) Check for whether or not a service has been initialized. | from [ContainerInterface](containerinterface#method_initialized "Symfony\Component\DependencyInjection\ContainerInterface") | | mixed | [getParameter](#method_getParameter)(string $name) Gets a parameter. | from [ContainerInterface](containerinterface#method_getParameter "Symfony\Component\DependencyInjection\ContainerInterface") | | bool | [hasParameter](#method_hasParameter)(string $name) Checks if a parameter exists. | from [ContainerInterface](containerinterface#method_hasParameter "Symfony\Component\DependencyInjection\ContainerInterface") | | | [setParameter](#method_setParameter)(string $name, mixed $value) Sets a parameter. | from [ContainerInterface](containerinterface#method_setParameter "Symfony\Component\DependencyInjection\ContainerInterface") | | array | [findTaggedServiceIds](#method_findTaggedServiceIds)(string $name) Returns service ids for a given tag. | | Details ------- ### set(string $id, object $service) Sets a service. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | | object | $service | The service instance | ### object get(string $id, int $invalidBehavior = self::EXCEPTION\_ON\_INVALID\_REFERENCE) Gets a service. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | | int | $invalidBehavior | The behavior when the service does not exist | #### Return Value | | | | --- | --- | | object | The associated service | #### Exceptions | | | | --- | --- | | [ServiceCircularReferenceException](exception/servicecircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException") | When a circular reference is detected | | [ServiceNotFoundException](exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | When the service is not defined | #### See also | | | | --- | --- | | [Reference](reference "Symfony\Component\DependencyInjection\Reference") | | ### bool has(string $id) Returns true if the given service is defined. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | #### Return Value | | | | --- | --- | | bool | true if the service is defined, false otherwise | ### bool initialized(string $id) Check for whether or not a service has been initialized. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | bool | true if the service has been initialized, false otherwise | ### mixed getParameter(string $name) Gets a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | mixed | The parameter value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | if the parameter is not defined | ### bool hasParameter(string $name) Checks if a parameter exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | bool | The presence of parameter in container | ### setParameter(string $name, mixed $value) Sets a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | | mixed | $value | The parameter value | ### array findTaggedServiceIds(string $name) Returns service ids for a given tag. #### Parameters | | | | | --- | --- | --- | | string | $name | The tag name | #### Return Value | | | | --- | --- | | array | An array of tags | symfony Symfony\Component\DependencyInjection\Extension Symfony\Component\DependencyInjection\Extension =============================================== Classes ------- | | | | --- | --- | | [Extension](extension/extension "Symfony\Component\DependencyInjection\Extension\Extension") | Provides useful features shared by many extensions. | Interfaces ---------- | | | | --- | --- | | *[ConfigurationExtensionInterface](extension/configurationextensioninterface "Symfony\Component\DependencyInjection\Extension\ConfigurationExtensionInterface")* | ConfigurationExtensionInterface is the interface implemented by container extension classes. | | *[ExtensionInterface](extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface")* | ExtensionInterface is the interface implemented by container extension classes. | | *[PrependExtensionInterface](extension/prependextensioninterface "Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface")* | | symfony ChildDefinition ChildDefinition ================ class **ChildDefinition** extends [Definition](definition "Symfony\Component\DependencyInjection\Definition") This definition extends another definition. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $arguments | | from [Definition](definition#property_arguments "Symfony\Component\DependencyInjection\Definition") | | | $innerServiceId | | from [Definition](definition#property_innerServiceId "Symfony\Component\DependencyInjection\Definition") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $parent) | | | array | [getChanges](#method_getChanges)() Returns all changes tracked for the Definition object. | from [Definition](definition#method_getChanges "Symfony\Component\DependencyInjection\Definition") | | $this | [setChanges](#method_setChanges)(array $changes) Sets the tracked changes for the Definition object. | from [Definition](definition#method_setChanges "Symfony\Component\DependencyInjection\Definition") | | $this | [setFactory](#method_setFactory)(string|array $factory) Sets a factory. | from [Definition](definition#method_setFactory "Symfony\Component\DependencyInjection\Definition") | | string|array|null | [getFactory](#method_getFactory)() Gets the factory. | from [Definition](definition#method_getFactory "Symfony\Component\DependencyInjection\Definition") | | $this | [setDecoratedService](#method_setDecoratedService)(string|null $id, string|null $renamedId = null, int $priority = 0) Sets the service that this service is decorating. | from [Definition](definition#method_setDecoratedService "Symfony\Component\DependencyInjection\Definition") | | array|null | [getDecoratedService](#method_getDecoratedService)() Gets the service that this service is decorating. | from [Definition](definition#method_getDecoratedService "Symfony\Component\DependencyInjection\Definition") | | $this | [setClass](#method_setClass)(string $class) Sets the service class. | from [Definition](definition#method_setClass "Symfony\Component\DependencyInjection\Definition") | | string|null | [getClass](#method_getClass)() Gets the service class. | from [Definition](definition#method_getClass "Symfony\Component\DependencyInjection\Definition") | | $this | [setArguments](#method_setArguments)(array $arguments) Sets the arguments to pass to the service constructor/factory method. | from [Definition](definition#method_setArguments "Symfony\Component\DependencyInjection\Definition") | | $this | [setProperties](#method_setProperties)(array $properties) Sets the properties to define when creating the service. | from [Definition](definition#method_setProperties "Symfony\Component\DependencyInjection\Definition") | | array | [getProperties](#method_getProperties)() Gets the properties to define when creating the service. | from [Definition](definition#method_getProperties "Symfony\Component\DependencyInjection\Definition") | | $this | [setProperty](#method_setProperty)(string $name, mixed $value) Sets a specific property. | from [Definition](definition#method_setProperty "Symfony\Component\DependencyInjection\Definition") | | $this | [addArgument](#method_addArgument)(mixed $argument) Adds an argument to pass to the service constructor/factory method. | from [Definition](definition#method_addArgument "Symfony\Component\DependencyInjection\Definition") | | $this | [replaceArgument](#method_replaceArgument)(int|string $index, mixed $value) You should always use this method when overwriting existing arguments of the parent definition. | | | $this | [setArgument](#method_setArgument)(int|string $key, mixed $value) Sets a specific argument. | from [Definition](definition#method_setArgument "Symfony\Component\DependencyInjection\Definition") | | array | [getArguments](#method_getArguments)() Gets the arguments to pass to the service constructor/factory method. | from [Definition](definition#method_getArguments "Symfony\Component\DependencyInjection\Definition") | | mixed | [getArgument](#method_getArgument)(int|string $index) Gets an argument to pass to the service constructor/factory method. | | | $this | [setMethodCalls](#method_setMethodCalls)(array $calls = array()) Sets the methods to call after service initialization. | from [Definition](definition#method_setMethodCalls "Symfony\Component\DependencyInjection\Definition") | | $this | [addMethodCall](#method_addMethodCall)(string $method, array $arguments = array()) Adds a method to call after service initialization. | from [Definition](definition#method_addMethodCall "Symfony\Component\DependencyInjection\Definition") | | $this | [removeMethodCall](#method_removeMethodCall)(string $method) Removes a method to call after service initialization. | from [Definition](definition#method_removeMethodCall "Symfony\Component\DependencyInjection\Definition") | | bool | [hasMethodCall](#method_hasMethodCall)(string $method) Check if the current definition has a given method to call after service initialization. | from [Definition](definition#method_hasMethodCall "Symfony\Component\DependencyInjection\Definition") | | array | [getMethodCalls](#method_getMethodCalls)() Gets the methods to call after service initialization. | from [Definition](definition#method_getMethodCalls "Symfony\Component\DependencyInjection\Definition") | | $this | [setInstanceofConditionals](#method_setInstanceofConditionals)(array $instanceof) | | | [ChildDefinition](childdefinition "Symfony\Component\DependencyInjection\ChildDefinition")[] | [getInstanceofConditionals](#method_getInstanceofConditionals)() Gets the definition templates to conditionally apply on the current definition, keyed by parent interface/class. | from [Definition](definition#method_getInstanceofConditionals "Symfony\Component\DependencyInjection\Definition") | | $this | [setAutoconfigured](#method_setAutoconfigured)(bool $autoconfigured) | | | bool | [isAutoconfigured](#method_isAutoconfigured)() | from [Definition](definition#method_isAutoconfigured "Symfony\Component\DependencyInjection\Definition") | | $this | [setTags](#method_setTags)(array $tags) Sets tags for this definition. | from [Definition](definition#method_setTags "Symfony\Component\DependencyInjection\Definition") | | array | [getTags](#method_getTags)() Returns all tags. | from [Definition](definition#method_getTags "Symfony\Component\DependencyInjection\Definition") | | array | [getTag](#method_getTag)(string $name) Gets a tag by name. | from [Definition](definition#method_getTag "Symfony\Component\DependencyInjection\Definition") | | $this | [addTag](#method_addTag)(string $name, array $attributes = array()) Adds a tag for this definition. | from [Definition](definition#method_addTag "Symfony\Component\DependencyInjection\Definition") | | bool | [hasTag](#method_hasTag)(string $name) Whether this definition has a tag with the given name. | from [Definition](definition#method_hasTag "Symfony\Component\DependencyInjection\Definition") | | $this | [clearTag](#method_clearTag)(string $name) Clears all tags for a given name. | from [Definition](definition#method_clearTag "Symfony\Component\DependencyInjection\Definition") | | $this | [clearTags](#method_clearTags)() Clears the tags for this definition. | from [Definition](definition#method_clearTags "Symfony\Component\DependencyInjection\Definition") | | $this | [setFile](#method_setFile)(string $file) Sets a file to require before creating the service. | from [Definition](definition#method_setFile "Symfony\Component\DependencyInjection\Definition") | | string|null | [getFile](#method_getFile)() Gets the file to require before creating the service. | from [Definition](definition#method_getFile "Symfony\Component\DependencyInjection\Definition") | | $this | [setShared](#method_setShared)(bool $shared) Sets if the service must be shared or not. | from [Definition](definition#method_setShared "Symfony\Component\DependencyInjection\Definition") | | bool | [isShared](#method_isShared)() Whether this service is shared. | from [Definition](definition#method_isShared "Symfony\Component\DependencyInjection\Definition") | | $this | [setPublic](#method_setPublic)(bool $boolean) Sets the visibility of this service. | from [Definition](definition#method_setPublic "Symfony\Component\DependencyInjection\Definition") | | bool | [isPublic](#method_isPublic)() Whether this service is public facing. | from [Definition](definition#method_isPublic "Symfony\Component\DependencyInjection\Definition") | | $this | [setPrivate](#method_setPrivate)(bool $boolean) Sets if this service is private. | from [Definition](definition#method_setPrivate "Symfony\Component\DependencyInjection\Definition") | | bool | [isPrivate](#method_isPrivate)() Whether this service is private. | from [Definition](definition#method_isPrivate "Symfony\Component\DependencyInjection\Definition") | | $this | [setLazy](#method_setLazy)(bool $lazy) Sets the lazy flag of this service. | from [Definition](definition#method_setLazy "Symfony\Component\DependencyInjection\Definition") | | bool | [isLazy](#method_isLazy)() Whether this service is lazy. | from [Definition](definition#method_isLazy "Symfony\Component\DependencyInjection\Definition") | | $this | [setSynthetic](#method_setSynthetic)(bool $boolean) Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected. | from [Definition](definition#method_setSynthetic "Symfony\Component\DependencyInjection\Definition") | | bool | [isSynthetic](#method_isSynthetic)() Whether this definition is synthetic, that is not constructed by the container, but dynamically injected. | from [Definition](definition#method_isSynthetic "Symfony\Component\DependencyInjection\Definition") | | $this | [setAbstract](#method_setAbstract)(bool $boolean) Whether this definition is abstract, that means it merely serves as a template for other definitions. | from [Definition](definition#method_setAbstract "Symfony\Component\DependencyInjection\Definition") | | bool | [isAbstract](#method_isAbstract)() Whether this definition is abstract, that means it merely serves as a template for other definitions. | from [Definition](definition#method_isAbstract "Symfony\Component\DependencyInjection\Definition") | | $this | [setDeprecated](#method_setDeprecated)(bool $status = true, string $template = null) Whether this definition is deprecated, that means it should not be called anymore. | from [Definition](definition#method_setDeprecated "Symfony\Component\DependencyInjection\Definition") | | bool | [isDeprecated](#method_isDeprecated)() Whether this definition is deprecated, that means it should not be called anymore. | from [Definition](definition#method_isDeprecated "Symfony\Component\DependencyInjection\Definition") | | string | [getDeprecationMessage](#method_getDeprecationMessage)(string $id) Message to use if this definition is deprecated. | from [Definition](definition#method_getDeprecationMessage "Symfony\Component\DependencyInjection\Definition") | | $this | [setConfigurator](#method_setConfigurator)(string|array $configurator) Sets a configurator to call after the service is fully initialized. | from [Definition](definition#method_setConfigurator "Symfony\Component\DependencyInjection\Definition") | | callable|null | [getConfigurator](#method_getConfigurator)() Gets the configurator to call after the service is fully initialized. | from [Definition](definition#method_getConfigurator "Symfony\Component\DependencyInjection\Definition") | | bool | [isAutowired](#method_isAutowired)() Is the definition autowired? | from [Definition](definition#method_isAutowired "Symfony\Component\DependencyInjection\Definition") | | $this | [setAutowired](#method_setAutowired)(bool $autowired) Enables/disables autowiring. | from [Definition](definition#method_setAutowired "Symfony\Component\DependencyInjection\Definition") | | array|[BoundArgument](argument/boundargument "Symfony\Component\DependencyInjection\Argument\BoundArgument")[] | [getBindings](#method_getBindings)() Gets bindings. | from [Definition](definition#method_getBindings "Symfony\Component\DependencyInjection\Definition") | | $this | [setBindings](#method_setBindings)(array $bindings) Sets bindings. | from [Definition](definition#method_setBindings "Symfony\Component\DependencyInjection\Definition") | | $this | [addError](#method_addError)(string $error) Add an error that occurred when building this Definition. | from [Definition](definition#method_addError "Symfony\Component\DependencyInjection\Definition") | | array | [getErrors](#method_getErrors)() Returns any errors that occurred while building this Definition. | from [Definition](definition#method_getErrors "Symfony\Component\DependencyInjection\Definition") | | string | [getParent](#method_getParent)() Returns the Definition to inherit from. | | | $this | [setParent](#method_setParent)(string $parent) Sets the Definition to inherit from. | | Details ------- ### \_\_construct(string $parent) #### Parameters | | | | | --- | --- | --- | | string | $parent | The id of Definition instance to decorate | ### array getChanges() Returns all changes tracked for the Definition object. #### Return Value | | | | --- | --- | | array | An array of changes for this Definition | ### $this setChanges(array $changes) Sets the tracked changes for the Definition object. #### Parameters | | | | | --- | --- | --- | | array | $changes | An array of changes for this Definition | #### Return Value | | | | --- | --- | | $this | | ### $this setFactory(string|array $factory) Sets a factory. #### Parameters | | | | | --- | --- | --- | | string|array | $factory | A PHP function or an array containing a class/Reference and a method to call | #### Return Value | | | | --- | --- | | $this | | ### string|array|null getFactory() Gets the factory. #### Return Value | | | | --- | --- | | string|array|null | The PHP function or an array containing a class/Reference and a method to call | ### $this setDecoratedService(string|null $id, string|null $renamedId = null, int $priority = 0) Sets the service that this service is decorating. #### Parameters | | | | | --- | --- | --- | | string|null | $id | The decorated service id, use null to remove decoration | | string|null | $renamedId | The new decorated service id | | int | $priority | The priority of decoration | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | in case the decorated service id and the new decorated service id are equals | ### array|null getDecoratedService() Gets the service that this service is decorating. #### Return Value | | | | --- | --- | | array|null | An array composed of the decorated service id, the new id for it and the priority of decoration, null if no service is decorated | ### $this setClass(string $class) Sets the service class. #### Parameters | | | | | --- | --- | --- | | string | $class | The service class | #### Return Value | | | | --- | --- | | $this | | ### string|null getClass() Gets the service class. #### Return Value | | | | --- | --- | | string|null | The service class | ### $this setArguments(array $arguments) Sets the arguments to pass to the service constructor/factory method. #### Parameters | | | | | --- | --- | --- | | array | $arguments | | #### Return Value | | | | --- | --- | | $this | | ### $this setProperties(array $properties) Sets the properties to define when creating the service. #### Parameters | | | | | --- | --- | --- | | array | $properties | | #### Return Value | | | | --- | --- | | $this | | ### array getProperties() Gets the properties to define when creating the service. #### Return Value | | | | --- | --- | | array | | ### $this setProperty(string $name, mixed $value) Sets a specific property. #### Parameters | | | | | --- | --- | --- | | string | $name | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this addArgument(mixed $argument) Adds an argument to pass to the service constructor/factory method. #### Parameters | | | | | --- | --- | --- | | mixed | $argument | An argument | #### Return Value | | | | --- | --- | | $this | | ### $this replaceArgument(int|string $index, mixed $value) You should always use this method when overwriting existing arguments of the parent definition. If you directly call setArguments() keep in mind that you must follow certain conventions when you want to overwrite the arguments of the parent definition, otherwise your arguments will only be appended. #### Parameters | | | | | --- | --- | --- | | int|string | $index | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when $index isn't an integer | ### $this setArgument(int|string $key, mixed $value) Sets a specific argument. #### Parameters | | | | | --- | --- | --- | | int|string | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### array getArguments() Gets the arguments to pass to the service constructor/factory method. #### Return Value | | | | --- | --- | | array | The array of arguments | ### mixed getArgument(int|string $index) Gets an argument to pass to the service constructor/factory method. If replaceArgument() has been used to replace an argument, this method will return the replacement value. #### Parameters | | | | | --- | --- | --- | | int|string | $index | | #### Return Value | | | | --- | --- | | mixed | The argument value | #### Exceptions | | | | --- | --- | | [OutOfBoundsException](exception/outofboundsexception "Symfony\Component\DependencyInjection\Exception\OutOfBoundsException") | When the argument does not exist | ### $this setMethodCalls(array $calls = array()) Sets the methods to call after service initialization. #### Parameters | | | | | --- | --- | --- | | array | $calls | | #### Return Value | | | | --- | --- | | $this | | ### $this addMethodCall(string $method, array $arguments = array()) Adds a method to call after service initialization. #### Parameters | | | | | --- | --- | --- | | string | $method | The method name to call | | array | $arguments | An array of arguments to pass to the method call | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | on empty $method param | ### $this removeMethodCall(string $method) Removes a method to call after service initialization. #### Parameters | | | | | --- | --- | --- | | string | $method | The method name to remove | #### Return Value | | | | --- | --- | | $this | | ### bool hasMethodCall(string $method) Check if the current definition has a given method to call after service initialization. #### Parameters | | | | | --- | --- | --- | | string | $method | The method name to search for | #### Return Value | | | | --- | --- | | bool | | ### array getMethodCalls() Gets the methods to call after service initialization. #### Return Value | | | | --- | --- | | array | An array of method calls | ### $this setInstanceofConditionals(array $instanceof) #### Parameters | | | | | --- | --- | --- | | array | $instanceof | ChildDefinition[] | #### Return Value | | | | --- | --- | | $this | | ### [ChildDefinition](childdefinition "Symfony\Component\DependencyInjection\ChildDefinition")[] getInstanceofConditionals() Gets the definition templates to conditionally apply on the current definition, keyed by parent interface/class. #### Return Value | | | | --- | --- | | [ChildDefinition](childdefinition "Symfony\Component\DependencyInjection\ChildDefinition")[] | | ### $this setAutoconfigured(bool $autoconfigured) #### Parameters | | | | | --- | --- | --- | | bool | $autoconfigured | | #### Return Value | | | | --- | --- | | $this | | ### bool isAutoconfigured() #### Return Value | | | | --- | --- | | bool | | ### $this setTags(array $tags) Sets tags for this definition. #### Parameters | | | | | --- | --- | --- | | array | $tags | | #### Return Value | | | | --- | --- | | $this | | ### array getTags() Returns all tags. #### Return Value | | | | --- | --- | | array | An array of tags | ### array getTag(string $name) Gets a tag by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The tag name | #### Return Value | | | | --- | --- | | array | An array of attributes | ### $this addTag(string $name, array $attributes = array()) Adds a tag for this definition. #### Parameters | | | | | --- | --- | --- | | string | $name | The tag name | | array | $attributes | An array of attributes | #### Return Value | | | | --- | --- | | $this | | ### bool hasTag(string $name) Whether this definition has a tag with the given name. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | bool | | ### $this clearTag(string $name) Clears all tags for a given name. #### Parameters | | | | | --- | --- | --- | | string | $name | The tag name | #### Return Value | | | | --- | --- | | $this | | ### $this clearTags() Clears the tags for this definition. #### Return Value | | | | --- | --- | | $this | | ### $this setFile(string $file) Sets a file to require before creating the service. #### Parameters | | | | | --- | --- | --- | | string | $file | A full pathname to include | #### Return Value | | | | --- | --- | | $this | | ### string|null getFile() Gets the file to require before creating the service. #### Return Value | | | | --- | --- | | string|null | The full pathname to include | ### $this setShared(bool $shared) Sets if the service must be shared or not. #### Parameters | | | | | --- | --- | --- | | bool | $shared | Whether the service must be shared or not | #### Return Value | | | | --- | --- | | $this | | ### bool isShared() Whether this service is shared. #### Return Value | | | | --- | --- | | bool | | ### $this setPublic(bool $boolean) Sets the visibility of this service. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | | #### Return Value | | | | --- | --- | | $this | | ### bool isPublic() Whether this service is public facing. #### Return Value | | | | --- | --- | | bool | | ### $this setPrivate(bool $boolean) Sets if this service is private. When set, the "private" state has a higher precedence than "public". In version 3.4, a "private" service always remains publicly accessible, but triggers a deprecation notice when accessed from the container, so that the service can be made really private in 4.0. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | | #### Return Value | | | | --- | --- | | $this | | ### bool isPrivate() Whether this service is private. #### Return Value | | | | --- | --- | | bool | | ### $this setLazy(bool $lazy) Sets the lazy flag of this service. #### Parameters | | | | | --- | --- | --- | | bool | $lazy | | #### Return Value | | | | --- | --- | | $this | | ### bool isLazy() Whether this service is lazy. #### Return Value | | | | --- | --- | | bool | | ### $this setSynthetic(bool $boolean) Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | | #### Return Value | | | | --- | --- | | $this | | ### bool isSynthetic() Whether this definition is synthetic, that is not constructed by the container, but dynamically injected. #### Return Value | | | | --- | --- | | bool | | ### $this setAbstract(bool $boolean) Whether this definition is abstract, that means it merely serves as a template for other definitions. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | | #### Return Value | | | | --- | --- | | $this | | ### bool isAbstract() Whether this definition is abstract, that means it merely serves as a template for other definitions. #### Return Value | | | | --- | --- | | bool | | ### $this setDeprecated(bool $status = true, string $template = null) Whether this definition is deprecated, that means it should not be called anymore. #### Parameters | | | | | --- | --- | --- | | bool | $status | | | string | $template | Template message to use if the definition is deprecated | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when the message template is invalid | ### bool isDeprecated() Whether this definition is deprecated, that means it should not be called anymore. #### Return Value | | | | --- | --- | | bool | | ### string getDeprecationMessage(string $id) Message to use if this definition is deprecated. #### Parameters | | | | | --- | --- | --- | | string | $id | Service id relying on this definition | #### Return Value | | | | --- | --- | | string | | ### $this setConfigurator(string|array $configurator) Sets a configurator to call after the service is fully initialized. #### Parameters | | | | | --- | --- | --- | | string|array | $configurator | A PHP callable | #### Return Value | | | | --- | --- | | $this | | ### callable|null getConfigurator() Gets the configurator to call after the service is fully initialized. #### Return Value | | | | --- | --- | | callable|null | The PHP callable to call | ### bool isAutowired() Is the definition autowired? #### Return Value | | | | --- | --- | | bool | | ### $this setAutowired(bool $autowired) Enables/disables autowiring. #### Parameters | | | | | --- | --- | --- | | bool | $autowired | | #### Return Value | | | | --- | --- | | $this | | ### array|[BoundArgument](argument/boundargument "Symfony\Component\DependencyInjection\Argument\BoundArgument")[] getBindings() Gets bindings. #### Return Value | | | | --- | --- | | array|[BoundArgument](argument/boundargument "Symfony\Component\DependencyInjection\Argument\BoundArgument")[] | | ### $this setBindings(array $bindings) Sets bindings. Bindings map $named or FQCN arguments to values that should be injected in the matching parameters (of the constructor, of methods called and of controller actions). #### Parameters | | | | | --- | --- | --- | | array | $bindings | | #### Return Value | | | | --- | --- | | $this | | ### $this addError(string $error) Add an error that occurred when building this Definition. #### Parameters | | | | | --- | --- | --- | | string | $error | | #### Return Value | | | | --- | --- | | $this | | ### array getErrors() Returns any errors that occurred while building this Definition. #### Return Value | | | | --- | --- | | array | | ### string getParent() Returns the Definition to inherit from. #### Return Value | | | | --- | --- | | string | | ### $this setParent(string $parent) Sets the Definition to inherit from. #### Parameters | | | | | --- | --- | --- | | string | $parent | | #### Return Value | | | | --- | --- | | $this | |
programming_docs
symfony Symfony\Component\DependencyInjection\Argument Symfony\Component\DependencyInjection\Argument ============================================== Classes ------- | | | | --- | --- | | [BoundArgument](argument/boundargument "Symfony\Component\DependencyInjection\Argument\BoundArgument") | | | [IteratorArgument](argument/iteratorargument "Symfony\Component\DependencyInjection\Argument\IteratorArgument") | Represents a collection of values to lazily iterate over. | | [RewindableGenerator](argument/rewindablegenerator "Symfony\Component\DependencyInjection\Argument\RewindableGenerator") | | | [ServiceClosureArgument](argument/serviceclosureargument "Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument") | Represents a service wrapped in a memoizing closure. | | [TaggedIteratorArgument](argument/taggediteratorargument "Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument") | Represents a collection of services found by tag name to lazily iterate over. | Interfaces ---------- | | | | --- | --- | | *[ArgumentInterface](argument/argumentinterface "Symfony\Component\DependencyInjection\Argument\ArgumentInterface")* | Represents a complex argument containing nested values. | symfony ExpressionLanguage ExpressionLanguage =================== class **ExpressionLanguage** extends [ExpressionLanguage](../expressionlanguage/expressionlanguage "Symfony\Component\ExpressionLanguage\ExpressionLanguage") Adds some function to the default ExpressionLanguage. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $functions | | from [ExpressionLanguage](../expressionlanguage/expressionlanguage#property_functions "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(CacheItemPoolInterface $cache = null, array $providers = array(), callable $serviceCompiler = null) | | | string | [compile](#method_compile)([Expression](../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $names = array()) Compiles an expression source code. | from [ExpressionLanguage](../expressionlanguage/expressionlanguage#method_compile "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | mixed | [evaluate](#method_evaluate)([Expression](../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $values = array()) Evaluate an expression. | from [ExpressionLanguage](../expressionlanguage/expressionlanguage#method_evaluate "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | [ParsedExpression](../expressionlanguage/parsedexpression "Symfony\Component\ExpressionLanguage\ParsedExpression") | [parse](#method_parse)([Expression](../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $names) Parses an expression. | from [ExpressionLanguage](../expressionlanguage/expressionlanguage#method_parse "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | | [register](#method_register)(string $name, callable $compiler, callable $evaluator) Registers a function. | from [ExpressionLanguage](../expressionlanguage/expressionlanguage#method_register "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | | [addFunction](#method_addFunction)([ExpressionFunction](../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") $function) | from [ExpressionLanguage](../expressionlanguage/expressionlanguage#method_addFunction "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | | [registerProvider](#method_registerProvider)([ExpressionFunctionProviderInterface](../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) | from [ExpressionLanguage](../expressionlanguage/expressionlanguage#method_registerProvider "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | | | [registerFunctions](#method_registerFunctions)() | from [ExpressionLanguage](../expressionlanguage/expressionlanguage#method_registerFunctions "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | Details ------- ### \_\_construct(CacheItemPoolInterface $cache = null, array $providers = array(), callable $serviceCompiler = null) #### Parameters | | | | | --- | --- | --- | | CacheItemPoolInterface | $cache | | | array | $providers | | | callable | $serviceCompiler | | ### string compile([Expression](../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $names = array()) Compiles an expression source code. #### Parameters | | | | | --- | --- | --- | | [Expression](../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string | $expression | The expression to compile | | array | $names | An array of valid names | #### Return Value | | | | --- | --- | | string | The compiled PHP source code | ### mixed evaluate([Expression](../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $values = array()) Evaluate an expression. #### Parameters | | | | | --- | --- | --- | | [Expression](../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string | $expression | The expression to compile | | array | $values | An array of values | #### Return Value | | | | --- | --- | | mixed | The result of the evaluation of the expression | ### [ParsedExpression](../expressionlanguage/parsedexpression "Symfony\Component\ExpressionLanguage\ParsedExpression") parse([Expression](../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string $expression, array $names) Parses an expression. #### Parameters | | | | | --- | --- | --- | | [Expression](../expressionlanguage/expression "Symfony\Component\ExpressionLanguage\Expression")|string | $expression | The expression to parse | | array | $names | An array of valid names | #### Return Value | | | | --- | --- | | [ParsedExpression](../expressionlanguage/parsedexpression "Symfony\Component\ExpressionLanguage\ParsedExpression") | A ParsedExpression instance | ### register(string $name, callable $compiler, callable $evaluator) Registers a function. #### Parameters | | | | | --- | --- | --- | | string | $name | The function name | | callable | $compiler | A callable able to compile the function | | callable | $evaluator | A callable able to evaluate the function | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | when registering a function after calling evaluate(), compile() or parse() | #### See also | | | | --- | --- | | [ExpressionFunction](../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") | | ### addFunction([ExpressionFunction](../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") $function) #### Parameters | | | | | --- | --- | --- | | [ExpressionFunction](../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction") | $function | | ### registerProvider([ExpressionFunctionProviderInterface](../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) #### Parameters | | | | | --- | --- | --- | | [ExpressionFunctionProviderInterface](../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") | $provider | | ### protected registerFunctions() symfony ServiceLocator ServiceLocator =============== class **ServiceLocator** implements ContainerInterface Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $factories) | | | | [has](#method_has)($id) {@inheritdoc} | | | | [get](#method_get)($id) {@inheritdoc} | | | | [\_\_invoke](#method___invoke)($id) | | | | [withContext](#method_withContext)($externalId, [Container](container "Symfony\Component\DependencyInjection\Container") $container) | | Details ------- ### \_\_construct(array $factories) #### Parameters | | | | | --- | --- | --- | | array | $factories | | ### has($id) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $id | | ### get($id) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $id | | ### \_\_invoke($id) #### Parameters | | | | | --- | --- | --- | | | $id | | ### withContext($externalId, [Container](container "Symfony\Component\DependencyInjection\Container") $container) #### Parameters | | | | | --- | --- | --- | | | $externalId | | | [Container](container "Symfony\Component\DependencyInjection\Container") | $container | | symfony Parameter Parameter ========== class **Parameter** Parameter represents a parameter reference. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $id) | | | string | [\_\_toString](#method___toString)() | | Details ------- ### \_\_construct(string $id) #### Parameters | | | | | --- | --- | --- | | string | $id | | ### string \_\_toString() #### Return Value | | | | --- | --- | | string | The parameter key | symfony Symfony\Component\DependencyInjection\Exception Symfony\Component\DependencyInjection\Exception =============================================== Classes ------- | | | | --- | --- | | [AutowiringFailedException](exception/autowiringfailedexception "Symfony\Component\DependencyInjection\Exception\AutowiringFailedException") | Thrown when a definition cannot be autowired. | | [BadMethodCallException](exception/badmethodcallexception "Symfony\Component\DependencyInjection\Exception\BadMethodCallException") | Base BadMethodCallException for Dependency Injection component. | | [EnvNotFoundException](exception/envnotfoundexception "Symfony\Component\DependencyInjection\Exception\EnvNotFoundException") | This exception is thrown when an environment variable is not found. | | [EnvParameterException](exception/envparameterexception "Symfony\Component\DependencyInjection\Exception\EnvParameterException") | This exception wraps exceptions whose messages contain a reference to an env parameter. | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | Base InvalidArgumentException for Dependency Injection component. | | [LogicException](exception/logicexception "Symfony\Component\DependencyInjection\Exception\LogicException") | Base LogicException for Dependency Injection component. | | [OutOfBoundsException](exception/outofboundsexception "Symfony\Component\DependencyInjection\Exception\OutOfBoundsException") | Base OutOfBoundsException for Dependency Injection component. | | [ParameterCircularReferenceException](exception/parametercircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException") | This exception is thrown when a circular reference in a parameter is detected. | | [ParameterNotFoundException](exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | This exception is thrown when a non-existent parameter is used. | | [RuntimeException](exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | Base RuntimeException for Dependency Injection component. | | [ServiceCircularReferenceException](exception/servicecircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException") | This exception is thrown when a circular reference is detected. | | [ServiceNotFoundException](exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | This exception is thrown when a non-existent service is requested. | Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\DependencyInjection\Exception\ExceptionInterface")* | Base ExceptionInterface for Dependency Injection component. | symfony Alias Alias ====== class **Alias** Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $id, bool $public = true) | | | bool | [isPublic](#method_isPublic)() Checks if this DI Alias should be public or not. | | | $this | [setPublic](#method_setPublic)(bool $boolean) Sets if this Alias is public. | | | $this | [setPrivate](#method_setPrivate)(bool $boolean) Sets if this Alias is private. | | | bool | [isPrivate](#method_isPrivate)() Whether this alias is private. | | | string | [\_\_toString](#method___toString)() Returns the Id of this alias. | | Details ------- ### \_\_construct(string $id, bool $public = true) #### Parameters | | | | | --- | --- | --- | | string | $id | | | bool | $public | | ### bool isPublic() Checks if this DI Alias should be public or not. #### Return Value | | | | --- | --- | | bool | | ### $this setPublic(bool $boolean) Sets if this Alias is public. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | If this Alias should be public | #### Return Value | | | | --- | --- | | $this | | ### $this setPrivate(bool $boolean) Sets if this Alias is private. When set, the "private" state has a higher precedence than "public". In version 3.4, a "private" alias always remains publicly accessible, but triggers a deprecation notice when accessed from the container, so that the alias can be made really private in 4.0. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | | #### Return Value | | | | --- | --- | | $this | | ### bool isPrivate() Whether this alias is private. #### Return Value | | | | --- | --- | | bool | | ### string \_\_toString() Returns the Id of this alias. #### Return Value | | | | --- | --- | | string | The alias id | symfony EnvVarProcessor EnvVarProcessor ================ class **EnvVarProcessor** implements [EnvVarProcessorInterface](envvarprocessorinterface "Symfony\Component\DependencyInjection\EnvVarProcessorInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ContainerInterface](containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") $container) | | | static string[] | [getProvidedTypes](#method_getProvidedTypes)() | | | mixed | [getEnv](#method_getEnv)(string $prefix, string $name, [Closure](http://php.net/Closure) $getEnv) Returns the value of the given variable as managed by the current instance. | | Details ------- ### \_\_construct([ContainerInterface](containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") $container) #### Parameters | | | | | --- | --- | --- | | [ContainerInterface](containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") | $container | | ### static string[] getProvidedTypes() #### Return Value | | | | --- | --- | | string[] | The PHP-types managed by getEnv(), keyed by prefixes | ### mixed getEnv(string $prefix, string $name, [Closure](http://php.net/Closure) $getEnv) Returns the value of the given variable as managed by the current instance. #### Parameters | | | | | --- | --- | --- | | string | $prefix | The namespace of the variable | | string | $name | The name of the variable within the namespace | | [Closure](http://php.net/Closure) | $getEnv | A closure that allows fetching more env vars | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | on error | symfony TypedReference TypedReference =============== class **TypedReference** extends [Reference](reference "Symfony\Component\DependencyInjection\Reference") Represents a PHP type-hinted service reference. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $id, string $type, int $invalidBehavior = ContainerInterface::EXCEPTION\_ON\_INVALID\_REFERENCE) | | | string | [\_\_toString](#method___toString)() | from [Reference](reference#method___toString "Symfony\Component\DependencyInjection\Reference") | | int | [getInvalidBehavior](#method_getInvalidBehavior)() Returns the behavior to be used when the service does not exist. | from [Reference](reference#method_getInvalidBehavior "Symfony\Component\DependencyInjection\Reference") | | | [getType](#method_getType)() | | | | [getRequiringClass](#method_getRequiringClass)() deprecated | | | | [canBeAutoregistered](#method_canBeAutoregistered)() deprecated | | Details ------- ### \_\_construct(string $id, string $type, int $invalidBehavior = ContainerInterface::EXCEPTION\_ON\_INVALID\_REFERENCE) #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $type | The PHP type of the identified service | | int | $invalidBehavior | | ### string \_\_toString() #### Return Value | | | | --- | --- | | string | The service identifier | ### int getInvalidBehavior() Returns the behavior to be used when the service does not exist. #### Return Value | | | | --- | --- | | int | | ### getType() ### getRequiringClass() deprecated deprecated | since | Symfony 4.1 | ### canBeAutoregistered() deprecated deprecated | since | Symfony 4.1 | symfony Symfony\Component\DependencyInjection\Loader Symfony\Component\DependencyInjection\Loader ============================================ Namespaces ---------- [Symfony\Component\DependencyInjection\Loader\Configurator](loader/configurator) Classes ------- | | | | --- | --- | | [ClosureLoader](loader/closureloader "Symfony\Component\DependencyInjection\Loader\ClosureLoader") | ClosureLoader loads service definitions from a PHP closure. | | [DirectoryLoader](loader/directoryloader "Symfony\Component\DependencyInjection\Loader\DirectoryLoader") | DirectoryLoader is a recursive loader to go through directories. | | [FileLoader](loader/fileloader "Symfony\Component\DependencyInjection\Loader\FileLoader") | FileLoader is the abstract class used by all built-in loaders that are file based. | | [GlobFileLoader](loader/globfileloader "Symfony\Component\DependencyInjection\Loader\GlobFileLoader") | GlobFileLoader loads files from a glob pattern. | | [IniFileLoader](loader/inifileloader "Symfony\Component\DependencyInjection\Loader\IniFileLoader") | IniFileLoader loads parameters from INI files. | | [PhpFileLoader](loader/phpfileloader "Symfony\Component\DependencyInjection\Loader\PhpFileLoader") | PhpFileLoader loads service definitions from a PHP file. | | [ProtectedPhpFileLoader](loader/protectedphpfileloader "Symfony\Component\DependencyInjection\Loader\ProtectedPhpFileLoader") | | | [XmlFileLoader](loader/xmlfileloader "Symfony\Component\DependencyInjection\Loader\XmlFileLoader") | XmlFileLoader loads XML files service definitions. | | [YamlFileLoader](loader/yamlfileloader "Symfony\Component\DependencyInjection\Loader\YamlFileLoader") | YamlFileLoader loads YAML files service definitions. | symfony ExpressionLanguageProvider ExpressionLanguageProvider =========================== class **ExpressionLanguageProvider** implements [ExpressionFunctionProviderInterface](../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") Define some ExpressionLanguage functions. To get a service, use service('request'). To get a parameter, use parameter('kernel.debug'). Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(callable $serviceCompiler = null) | | | [ExpressionFunction](../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction")[] | [getFunctions](#method_getFunctions)() | | Details ------- ### \_\_construct(callable $serviceCompiler = null) #### Parameters | | | | | --- | --- | --- | | callable | $serviceCompiler | | ### [ExpressionFunction](../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction")[] getFunctions() #### Return Value | | | | --- | --- | | [ExpressionFunction](../expressionlanguage/expressionfunction "Symfony\Component\ExpressionLanguage\ExpressionFunction")[] | An array of Function instances |
programming_docs
symfony ResettableContainerInterface ResettableContainerInterface ============================= interface **ResettableContainerInterface** implements [ContainerInterface](containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") ResettableContainerInterface defines additional resetting functionality for containers, allowing to release shared services when the container is not needed anymore. Methods ------- | | | | | --- | --- | --- | | | [set](#method_set)(string $id, object $service) Sets a service. | from [ContainerInterface](containerinterface#method_set "Symfony\Component\DependencyInjection\ContainerInterface") | | object | [get](#method_get)(string $id, int $invalidBehavior = self::EXCEPTION\_ON\_INVALID\_REFERENCE) Gets a service. | from [ContainerInterface](containerinterface#method_get "Symfony\Component\DependencyInjection\ContainerInterface") | | bool | [has](#method_has)(string $id) Returns true if the given service is defined. | from [ContainerInterface](containerinterface#method_has "Symfony\Component\DependencyInjection\ContainerInterface") | | bool | [initialized](#method_initialized)(string $id) Check for whether or not a service has been initialized. | from [ContainerInterface](containerinterface#method_initialized "Symfony\Component\DependencyInjection\ContainerInterface") | | mixed | [getParameter](#method_getParameter)(string $name) Gets a parameter. | from [ContainerInterface](containerinterface#method_getParameter "Symfony\Component\DependencyInjection\ContainerInterface") | | bool | [hasParameter](#method_hasParameter)(string $name) Checks if a parameter exists. | from [ContainerInterface](containerinterface#method_hasParameter "Symfony\Component\DependencyInjection\ContainerInterface") | | | [setParameter](#method_setParameter)(string $name, mixed $value) Sets a parameter. | from [ContainerInterface](containerinterface#method_setParameter "Symfony\Component\DependencyInjection\ContainerInterface") | | | [reset](#method_reset)() Resets shared services from the container. | | Details ------- ### set(string $id, object $service) Sets a service. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | | object | $service | The service instance | ### object get(string $id, int $invalidBehavior = self::EXCEPTION\_ON\_INVALID\_REFERENCE) Gets a service. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | | int | $invalidBehavior | The behavior when the service does not exist | #### Return Value | | | | --- | --- | | object | The associated service | #### Exceptions | | | | --- | --- | | [ServiceCircularReferenceException](exception/servicecircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException") | When a circular reference is detected | | [ServiceNotFoundException](exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | When the service is not defined | #### See also | | | | --- | --- | | [Reference](reference "Symfony\Component\DependencyInjection\Reference") | | ### bool has(string $id) Returns true if the given service is defined. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | #### Return Value | | | | --- | --- | | bool | true if the service is defined, false otherwise | ### bool initialized(string $id) Check for whether or not a service has been initialized. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | bool | true if the service has been initialized, false otherwise | ### mixed getParameter(string $name) Gets a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | mixed | The parameter value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | if the parameter is not defined | ### bool hasParameter(string $name) Checks if a parameter exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | bool | The presence of parameter in container | ### setParameter(string $name, mixed $value) Sets a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | | mixed | $value | The parameter value | ### reset() Resets shared services from the container. The container is not intended to be used again after being reset in a normal workflow. This method is meant as a way to release references for ref-counting. A subsequent call to ContainerInterface::get will recreate a new instance of the shared service. symfony EnvVarProcessorInterface EnvVarProcessorInterface ========================= interface **EnvVarProcessorInterface** The EnvVarProcessorInterface is implemented by objects that manage environment-like variables. Methods ------- | | | | | --- | --- | --- | | mixed | [getEnv](#method_getEnv)(string $prefix, string $name, [Closure](http://php.net/Closure) $getEnv) Returns the value of the given variable as managed by the current instance. | | | static string[] | [getProvidedTypes](#method_getProvidedTypes)() | | Details ------- ### mixed getEnv(string $prefix, string $name, [Closure](http://php.net/Closure) $getEnv) Returns the value of the given variable as managed by the current instance. #### Parameters | | | | | --- | --- | --- | | string | $prefix | The namespace of the variable | | string | $name | The name of the variable within the namespace | | [Closure](http://php.net/Closure) | $getEnv | A closure that allows fetching more env vars | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | on error | ### static string[] getProvidedTypes() #### Return Value | | | | --- | --- | | string[] | The PHP-types managed by getEnv(), keyed by prefixes | symfony Symfony\Component\DependencyInjection\Compiler Symfony\Component\DependencyInjection\Compiler ============================================== Classes ------- | | | | --- | --- | | [AbstractRecursivePass](compiler/abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | | [AnalyzeServiceReferencesPass](compiler/analyzeservicereferencespass "Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass") | Run this pass before passes that need to know more about the relation of your services. | | [AutoAliasServicePass](compiler/autoaliasservicepass "Symfony\Component\DependencyInjection\Compiler\AutoAliasServicePass") | Sets a service to be an alias of another one, given a format pattern. | | [AutowirePass](compiler/autowirepass "Symfony\Component\DependencyInjection\Compiler\AutowirePass") | Inspects existing service definitions and wires the autowired ones using the type hints of their classes. | | [AutowireRequiredMethodsPass](compiler/autowirerequiredmethodspass "Symfony\Component\DependencyInjection\Compiler\AutowireRequiredMethodsPass") | Looks for definitions with autowiring enabled and registers their corresponding "@required" methods as setters. | | [CheckArgumentsValidityPass](compiler/checkargumentsvaliditypass "Symfony\Component\DependencyInjection\Compiler\CheckArgumentsValidityPass") | Checks if arguments of methods are properly configured. | | [CheckCircularReferencesPass](compiler/checkcircularreferencespass "Symfony\Component\DependencyInjection\Compiler\CheckCircularReferencesPass") | Checks your services for circular references. | | [CheckDefinitionValidityPass](compiler/checkdefinitionvaliditypass "Symfony\Component\DependencyInjection\Compiler\CheckDefinitionValidityPass") | This pass validates each definition individually only taking the information into account which is contained in the definition itself. | | [CheckExceptionOnInvalidReferenceBehaviorPass](compiler/checkexceptiononinvalidreferencebehaviorpass "Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass") | Checks that all references are pointing to a valid service. | | [CheckReferenceValidityPass](compiler/checkreferencevaliditypass "Symfony\Component\DependencyInjection\Compiler\CheckReferenceValidityPass") | Checks the validity of references. | | [Compiler](compiler/compiler "Symfony\Component\DependencyInjection\Compiler\Compiler") | This class is used to remove circular dependencies between individual passes. | | [DecoratorServicePass](compiler/decoratorservicepass "Symfony\Component\DependencyInjection\Compiler\DecoratorServicePass") | Overwrites a service but keeps the overridden one. | | [DefinitionErrorExceptionPass](compiler/definitionerrorexceptionpass "Symfony\Component\DependencyInjection\Compiler\DefinitionErrorExceptionPass") | Throws an exception for any Definitions that have errors and still exist. | | [ExtensionCompilerPass](compiler/extensioncompilerpass "Symfony\Component\DependencyInjection\Compiler\ExtensionCompilerPass") | A pass to automatically process extensions if they implement CompilerPassInterface. | | [InlineServiceDefinitionsPass](compiler/inlineservicedefinitionspass "Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass") | Inline service definitions where this is possible. | | [MergeExtensionConfigurationContainerBuilder](compiler/mergeextensionconfigurationcontainerbuilder "Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationContainerBuilder") | A container builder preventing using methods that wouldn't have any effect from extensions. | | [MergeExtensionConfigurationParameterBag](compiler/mergeextensionconfigurationparameterbag "Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationParameterBag") | | | [MergeExtensionConfigurationPass](compiler/mergeextensionconfigurationpass "Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass") | Merges extension configs into the container builder. | | [PassConfig](compiler/passconfig "Symfony\Component\DependencyInjection\Compiler\PassConfig") | Compiler Pass Configuration. | | [PriorityTaggedServiceTrait](compiler/prioritytaggedservicetrait "Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait") | Trait that allows a generic method to find and sort service by priority option in the tag. | | [RegisterEnvVarProcessorsPass](compiler/registerenvvarprocessorspass "Symfony\Component\DependencyInjection\Compiler\RegisterEnvVarProcessorsPass") | Creates the container.env\_var\_processors\_locator service. | | [RegisterServiceSubscribersPass](compiler/registerservicesubscriberspass "Symfony\Component\DependencyInjection\Compiler\RegisterServiceSubscribersPass") | Compiler pass to register tagged services that require a service locator. | | [RemoveAbstractDefinitionsPass](compiler/removeabstractdefinitionspass "Symfony\Component\DependencyInjection\Compiler\RemoveAbstractDefinitionsPass") | Removes abstract Definitions. | | [RemovePrivateAliasesPass](compiler/removeprivatealiasespass "Symfony\Component\DependencyInjection\Compiler\RemovePrivateAliasesPass") | Remove private aliases from the container. They were only used to establish dependencies between services, and these dependencies have been resolved in one of the previous passes. | | [RemoveUnusedDefinitionsPass](compiler/removeunuseddefinitionspass "Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass") | Removes unused service definitions from the container. | | [RepeatedPass](compiler/repeatedpass "Symfony\Component\DependencyInjection\Compiler\RepeatedPass") | A pass that might be run repeatedly. | | [ReplaceAliasByActualDefinitionPass](compiler/replacealiasbyactualdefinitionpass "Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass") | Replaces aliases with actual service definitions, effectively removing these aliases. | | [ResolveBindingsPass](compiler/resolvebindingspass "Symfony\Component\DependencyInjection\Compiler\ResolveBindingsPass") | | | [ResolveChildDefinitionsPass](compiler/resolvechilddefinitionspass "Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass") | This replaces all ChildDefinition instances with their equivalent fully merged Definition instance. | | [ResolveClassPass](compiler/resolveclasspass "Symfony\Component\DependencyInjection\Compiler\ResolveClassPass") | | | [ResolveEnvPlaceholdersPass](compiler/resolveenvplaceholderspass "Symfony\Component\DependencyInjection\Compiler\ResolveEnvPlaceholdersPass") | Replaces env var placeholders by their current values. | | [ResolveFactoryClassPass](compiler/resolvefactoryclasspass "Symfony\Component\DependencyInjection\Compiler\ResolveFactoryClassPass") | | | [ResolveHotPathPass](compiler/resolvehotpathpass "Symfony\Component\DependencyInjection\Compiler\ResolveHotPathPass") | Propagate "container.hot\_path" tags to referenced services. | | [ResolveInstanceofConditionalsPass](compiler/resolveinstanceofconditionalspass "Symfony\Component\DependencyInjection\Compiler\ResolveInstanceofConditionalsPass") | Applies instanceof conditionals to definitions. | | [ResolveInvalidReferencesPass](compiler/resolveinvalidreferencespass "Symfony\Component\DependencyInjection\Compiler\ResolveInvalidReferencesPass") | Emulates the invalid behavior if the reference is not found within the container. | | [ResolveNamedArgumentsPass](compiler/resolvenamedargumentspass "Symfony\Component\DependencyInjection\Compiler\ResolveNamedArgumentsPass") | Resolves named arguments to their corresponding numeric index. | | [ResolveParameterPlaceHoldersPass](compiler/resolveparameterplaceholderspass "Symfony\Component\DependencyInjection\Compiler\ResolveParameterPlaceHoldersPass") | Resolves all parameter placeholders "%somevalue%" to their real values. | | [ResolvePrivatesPass](compiler/resolveprivatespass "Symfony\Component\DependencyInjection\Compiler\ResolvePrivatesPass") | | | [ResolveReferencesToAliasesPass](compiler/resolvereferencestoaliasespass "Symfony\Component\DependencyInjection\Compiler\ResolveReferencesToAliasesPass") | Replaces all references to aliases with references to the actual service. | | [ResolveServiceSubscribersPass](compiler/resolveservicesubscriberspass "Symfony\Component\DependencyInjection\Compiler\ResolveServiceSubscribersPass") | Compiler pass to inject their service locator to service subscribers. | | [ResolveTaggedIteratorArgumentPass](compiler/resolvetaggediteratorargumentpass "Symfony\Component\DependencyInjection\Compiler\ResolveTaggedIteratorArgumentPass") | Resolves all TaggedIteratorArgument arguments. | | [ServiceLocatorTagPass](compiler/servicelocatortagpass "Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass") | Applies the "container.service\_locator" tag by wrapping references into ServiceClosureArgument instances. | | [ServiceReferenceGraph](compiler/servicereferencegraph "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraph") | This is a directed graph of your services. | | [ServiceReferenceGraphEdge](compiler/servicereferencegraphedge "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphEdge") | Represents an edge in your service graph. | | [ServiceReferenceGraphNode](compiler/servicereferencegraphnode "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode") | Represents a node in your service graph. | | [ValidateEnvPlaceholdersPass](compiler/validateenvplaceholderspass "Symfony\Component\DependencyInjection\Compiler\ValidateEnvPlaceholdersPass") | Validates environment variable placeholders used in extension configuration with dummy values. | Interfaces ---------- | | | | --- | --- | | *[CompilerPassInterface](compiler/compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")* | Interface that must be implemented by compilation passes. | | *[RepeatablePassInterface](compiler/repeatablepassinterface "Symfony\Component\DependencyInjection\Compiler\RepeatablePassInterface")* | Interface that must be implemented by passes that are run as part of an RepeatedPass. | symfony Container Container ========== class **Container** implements [ResettableContainerInterface](resettablecontainerinterface "Symfony\Component\DependencyInjection\ResettableContainerInterface") Container is a dependency injection container. It gives access to object instances (services). Services and parameters are simple key/pair stores. The container can have four possible behaviors when a service does not exist (or is not initialized for the last case): * EXCEPTION\_ON\_INVALID\_REFERENCE: Throws an exception (the default) * NULL\_ON\_INVALID\_REFERENCE: Returns null * IGNORE\_ON\_INVALID\_REFERENCE: Ignores the wrapping command asking for the reference (for instance, ignore a setter if the service does not exist) * IGNORE\_ON\_UNINITIALIZED\_REFERENCE: Ignores/returns null for uninitialized services or invalid references Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $parameterBag | | | | protected | $services | | | | protected | $fileMap | | | | protected | $methodMap | | | | protected | $factories | | | | protected | $aliases | | | | protected | $loading | | | | protected | $resolving | | | | protected | $syntheticIds | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ParameterBagInterface](parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") $parameterBag = null) | | | | [compile](#method_compile)() Compiles the container. | | | bool | [isCompiled](#method_isCompiled)() Returns true if the container is compiled. | | | [ParameterBagInterface](parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") | [getParameterBag](#method_getParameterBag)() Gets the service container parameter bag. | | | mixed | [getParameter](#method_getParameter)(string $name) Gets a parameter. | | | bool | [hasParameter](#method_hasParameter)(string $name) Checks if a parameter exists. | | | | [setParameter](#method_setParameter)(string $name, mixed $value) Sets a parameter. | | | | [set](#method_set)(string $id, object $service) Sets a service. | | | bool | [has](#method_has)(string $id) Returns true if the given service is defined. | | | object | [get](#method_get)(string $id, int $invalidBehavior = 1) Gets a service. | | | bool | [initialized](#method_initialized)(string $id) Returns true if the given service has actually been initialized. | | | | [reset](#method_reset)() Resets shared services from the container. | | | array | [getServiceIds](#method_getServiceIds)() Gets all service ids. | | | array | [getRemovedIds](#method_getRemovedIds)() Gets service ids that existed at compile time. | | | static string | [camelize](#method_camelize)(string $id) Camelizes a string. | | | static string | [underscore](#method_underscore)(string $id) A string to underscore. | | | object | [load](#method_load)($file) Creates a service by requiring its factory file. | | | mixed | [getEnv](#method_getEnv)(string $name) Fetches a variable from the environment. | | Details ------- ### \_\_construct([ParameterBagInterface](parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") $parameterBag = null) #### Parameters | | | | | --- | --- | --- | | [ParameterBagInterface](parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") | $parameterBag | | ### compile() Compiles the container. This method does two things: * Parameter values are resolved; * The parameter bag is frozen. ### bool isCompiled() Returns true if the container is compiled. #### Return Value | | | | --- | --- | | bool | | ### [ParameterBagInterface](parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") getParameterBag() Gets the service container parameter bag. #### Return Value | | | | --- | --- | | [ParameterBagInterface](parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") | A ParameterBagInterface instance | ### mixed getParameter(string $name) Gets a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | mixed | The parameter value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | if the parameter is not defined | ### bool hasParameter(string $name) Checks if a parameter exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | bool | The presence of parameter in container | ### setParameter(string $name, mixed $value) Sets a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | | mixed | $value | The parameter value | ### set(string $id, object $service) Sets a service. Setting a service to null resets the service: has() returns false and get() behaves in the same way as if the service was never created. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | | object | $service | The service instance | ### bool has(string $id) Returns true if the given service is defined. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | #### Return Value | | | | --- | --- | | bool | true if the service is defined, false otherwise | ### object get(string $id, int $invalidBehavior = 1) Gets a service. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | | int | $invalidBehavior | The behavior when the service does not exist | #### Return Value | | | | --- | --- | | object | The associated service | #### Exceptions | | | | --- | --- | | [ServiceCircularReferenceException](exception/servicecircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException") | When a circular reference is detected | | [ServiceNotFoundException](exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | When the service is not defined | | [Exception](http://php.net/Exception) | if an exception has been thrown when the service has been resolved | #### See also | | | | --- | --- | | [Reference](reference "Symfony\Component\DependencyInjection\Reference") | | ### bool initialized(string $id) Returns true if the given service has actually been initialized. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | bool | true if the service has been initialized, false otherwise | ### reset() Resets shared services from the container. The container is not intended to be used again after being reset in a normal workflow. This method is meant as a way to release references for ref-counting. A subsequent call to ContainerInterface::get will recreate a new instance of the shared service. ### array getServiceIds() Gets all service ids. #### Return Value | | | | --- | --- | | array | An array of all defined service ids | ### array getRemovedIds() Gets service ids that existed at compile time. #### Return Value | | | | --- | --- | | array | | ### static string camelize(string $id) Camelizes a string. #### Parameters | | | | | --- | --- | --- | | string | $id | A string to camelize | #### Return Value | | | | --- | --- | | string | The camelized string | ### static string underscore(string $id) A string to underscore. #### Parameters | | | | | --- | --- | --- | | string | $id | The string to underscore | #### Return Value | | | | --- | --- | | string | The underscored string | ### protected object load($file) Creates a service by requiring its factory file. #### Parameters | | | | | --- | --- | --- | | | $file | | #### Return Value | | | | --- | --- | | object | The service created by the file | ### protected mixed getEnv(string $name) Fetches a variable from the environment. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the environment variable | #### Return Value | | | | --- | --- | | mixed | The value to use for the provided environment variable name | #### Exceptions | | | | --- | --- | | [EnvNotFoundException](exception/envnotfoundexception "Symfony\Component\DependencyInjection\Exception\EnvNotFoundException") | When the environment variable is not found and has no default value |
programming_docs
symfony Reference Reference ========== class **Reference** Reference represents a service reference. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $id, int $invalidBehavior = ContainerInterface::EXCEPTION\_ON\_INVALID\_REFERENCE) | | | string | [\_\_toString](#method___toString)() | | | int | [getInvalidBehavior](#method_getInvalidBehavior)() Returns the behavior to be used when the service does not exist. | | Details ------- ### \_\_construct(string $id, int $invalidBehavior = ContainerInterface::EXCEPTION\_ON\_INVALID\_REFERENCE) #### Parameters | | | | | --- | --- | --- | | string | $id | | | int | $invalidBehavior | | ### string \_\_toString() #### Return Value | | | | --- | --- | | string | The service identifier | ### int getInvalidBehavior() Returns the behavior to be used when the service does not exist. #### Return Value | | | | --- | --- | | int | | symfony Variable Variable ========= class **Variable** Represents a variable. $var = new Variable('a'); will be dumped as ``` $a ``` by the PHP dumper. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $name) | | | | [\_\_toString](#method___toString)() | | Details ------- ### \_\_construct(string $name) #### Parameters | | | | | --- | --- | --- | | string | $name | | ### \_\_toString() symfony ContainerInterface ContainerInterface =================== interface **ContainerInterface** implements ContainerInterface ContainerInterface is the interface implemented by service container classes. Constants --------- | | | | --- | --- | | RUNTIME\_EXCEPTION\_ON\_INVALID\_REFERENCE | | | EXCEPTION\_ON\_INVALID\_REFERENCE | | | NULL\_ON\_INVALID\_REFERENCE | | | IGNORE\_ON\_INVALID\_REFERENCE | | | IGNORE\_ON\_UNINITIALIZED\_REFERENCE | | Methods ------- | | | | | --- | --- | --- | | | [set](#method_set)(string $id, object $service) Sets a service. | | | object | [get](#method_get)(string $id, int $invalidBehavior = self::EXCEPTION\_ON\_INVALID\_REFERENCE) Gets a service. | | | bool | [has](#method_has)(string $id) Returns true if the given service is defined. | | | bool | [initialized](#method_initialized)(string $id) Check for whether or not a service has been initialized. | | | mixed | [getParameter](#method_getParameter)(string $name) Gets a parameter. | | | bool | [hasParameter](#method_hasParameter)(string $name) Checks if a parameter exists. | | | | [setParameter](#method_setParameter)(string $name, mixed $value) Sets a parameter. | | Details ------- ### set(string $id, object $service) Sets a service. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | | object | $service | The service instance | ### object get(string $id, int $invalidBehavior = self::EXCEPTION\_ON\_INVALID\_REFERENCE) Gets a service. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | | int | $invalidBehavior | The behavior when the service does not exist | #### Return Value | | | | --- | --- | | object | The associated service | #### Exceptions | | | | --- | --- | | [ServiceCircularReferenceException](exception/servicecircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException") | When a circular reference is detected | | [ServiceNotFoundException](exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | When the service is not defined | #### See also | | | | --- | --- | | [Reference](reference "Symfony\Component\DependencyInjection\Reference") | | ### bool has(string $id) Returns true if the given service is defined. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | #### Return Value | | | | --- | --- | | bool | true if the service is defined, false otherwise | ### bool initialized(string $id) Check for whether or not a service has been initialized. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | bool | true if the service has been initialized, false otherwise | ### mixed getParameter(string $name) Gets a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | mixed | The parameter value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | if the parameter is not defined | ### bool hasParameter(string $name) Checks if a parameter exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | bool | The presence of parameter in container | ### setParameter(string $name, mixed $value) Sets a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | | mixed | $value | The parameter value | symfony Symfony\Component\DependencyInjection\Dumper Symfony\Component\DependencyInjection\Dumper ============================================ Classes ------- | | | | --- | --- | | [Dumper](dumper/dumper "Symfony\Component\DependencyInjection\Dumper\Dumper") | Dumper is the abstract class for all built-in dumpers. | | [GraphvizDumper](dumper/graphvizdumper "Symfony\Component\DependencyInjection\Dumper\GraphvizDumper") | GraphvizDumper dumps a service container as a graphviz file. | | [PhpDumper](dumper/phpdumper "Symfony\Component\DependencyInjection\Dumper\PhpDumper") | PhpDumper dumps a service container as a PHP class. | | [XmlDumper](dumper/xmldumper "Symfony\Component\DependencyInjection\Dumper\XmlDumper") | XmlDumper dumps a service container as an XML string. | | [YamlDumper](dumper/yamldumper "Symfony\Component\DependencyInjection\Dumper\YamlDumper") | YamlDumper dumps a service container as a YAML string. | Interfaces ---------- | | | | --- | --- | | *[DumperInterface](dumper/dumperinterface "Symfony\Component\DependencyInjection\Dumper\DumperInterface")* | DumperInterface is the interface implemented by service container dumper classes. | symfony Symfony\Component\DependencyInjection\ParameterBag Symfony\Component\DependencyInjection\ParameterBag ================================================== Classes ------- | | | | --- | --- | | [ContainerBag](parameterbag/containerbag "Symfony\Component\DependencyInjection\ParameterBag\ContainerBag") | | | [EnvPlaceholderParameterBag](parameterbag/envplaceholderparameterbag "Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag") | | | [FrozenParameterBag](parameterbag/frozenparameterbag "Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag") | Holds read-only parameters. | | [ParameterBag](parameterbag/parameterbag "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | Holds parameters. | Interfaces ---------- | | | | --- | --- | | *[ContainerBagInterface](parameterbag/containerbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ContainerBagInterface")* | | | *[ParameterBagInterface](parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface")* | ParameterBagInterface. | symfony Symfony\Component\DependencyInjection\Config Symfony\Component\DependencyInjection\Config ============================================ Classes ------- | | | | --- | --- | | [ContainerParametersResource](config/containerparametersresource "Symfony\Component\DependencyInjection\Config\ContainerParametersResource") | Tracks container parameters. | | [ContainerParametersResourceChecker](config/containerparametersresourcechecker "Symfony\Component\DependencyInjection\Config\ContainerParametersResourceChecker") | | symfony Symfony\Component\DependencyInjection\LazyProxy Symfony\Component\DependencyInjection\LazyProxy =============================================== Namespaces ---------- [Symfony\Component\DependencyInjection\LazyProxy\Instantiator](lazyproxy/instantiator)[Symfony\Component\DependencyInjection\LazyProxy\PhpDumper](lazyproxy/phpdumper) Classes ------- | | | | --- | --- | | [ProxyHelper](lazyproxy/proxyhelper "Symfony\Component\DependencyInjection\LazyProxy\ProxyHelper") | | symfony ContainerAwareInterface ContainerAwareInterface ======================== interface **ContainerAwareInterface** ContainerAwareInterface should be implemented by classes that depends on a Container. Methods ------- | | | | | --- | --- | --- | | | [setContainer](#method_setContainer)([ContainerInterface](containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") $container = null) Sets the container. | | Details ------- ### setContainer([ContainerInterface](containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") $container = null) Sets the container. #### Parameters | | | | | --- | --- | --- | | [ContainerInterface](containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") | $container | | symfony ContainerBuilder ContainerBuilder ================= class **ContainerBuilder** extends [Container](container "Symfony\Component\DependencyInjection\Container") implements [TaggedContainerInterface](taggedcontainerinterface "Symfony\Component\DependencyInjection\TaggedContainerInterface") ContainerBuilder is a DI container that provides an API to easily describe services. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $parameterBag | | from [Container](container#property_parameterBag "Symfony\Component\DependencyInjection\Container") | | protected | $services | | from [Container](container#property_services "Symfony\Component\DependencyInjection\Container") | | protected | $fileMap | | from [Container](container#property_fileMap "Symfony\Component\DependencyInjection\Container") | | protected | $methodMap | | from [Container](container#property_methodMap "Symfony\Component\DependencyInjection\Container") | | protected | $factories | | from [Container](container#property_factories "Symfony\Component\DependencyInjection\Container") | | protected | $aliases | | from [Container](container#property_aliases "Symfony\Component\DependencyInjection\Container") | | protected | $loading | | from [Container](container#property_loading "Symfony\Component\DependencyInjection\Container") | | protected | $resolving | | from [Container](container#property_resolving "Symfony\Component\DependencyInjection\Container") | | protected | $syntheticIds | | from [Container](container#property_syntheticIds "Symfony\Component\DependencyInjection\Container") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ParameterBagInterface](parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") $parameterBag = null) | | | | [compile](#method_compile)(bool $resolveEnvPlaceholders = false) Compiles the container. | | | bool | [isCompiled](#method_isCompiled)() Returns true if the container is compiled. | from [Container](container#method_isCompiled "Symfony\Component\DependencyInjection\Container") | | [ParameterBagInterface](parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") | [getParameterBag](#method_getParameterBag)() Gets the service container parameter bag. | from [Container](container#method_getParameterBag "Symfony\Component\DependencyInjection\Container") | | mixed | [getParameter](#method_getParameter)(string $name) Gets a parameter. | from [Container](container#method_getParameter "Symfony\Component\DependencyInjection\Container") | | bool | [hasParameter](#method_hasParameter)(string $name) Checks if a parameter exists. | from [Container](container#method_hasParameter "Symfony\Component\DependencyInjection\Container") | | | [setParameter](#method_setParameter)(string $name, mixed $value) Sets a parameter. | from [Container](container#method_setParameter "Symfony\Component\DependencyInjection\Container") | | | [set](#method_set)(string $id, object $service) Sets a service. | | | bool | [has](#method_has)(string $id) Returns true if the given service is defined. | | | object | [get](#method_get)(string $id, int $invalidBehavior = ContainerInterface::EXCEPTION\_ON\_INVALID\_REFERENCE) Gets a service. | | | bool | [initialized](#method_initialized)(string $id) Returns true if the given service has actually been initialized. | from [Container](container#method_initialized "Symfony\Component\DependencyInjection\Container") | | | [reset](#method_reset)() Resets shared services from the container. | from [Container](container#method_reset "Symfony\Component\DependencyInjection\Container") | | array | [getServiceIds](#method_getServiceIds)() Gets all service ids. | | | array | [getRemovedIds](#method_getRemovedIds)() Gets removed service or alias ids. | | | static string | [camelize](#method_camelize)(string $id) Camelizes a string. | from [Container](container#method_camelize "Symfony\Component\DependencyInjection\Container") | | static string | [underscore](#method_underscore)(string $id) A string to underscore. | from [Container](container#method_underscore "Symfony\Component\DependencyInjection\Container") | | object | [load](#method_load)($file) Creates a service by requiring its factory file. | from [Container](container#method_load "Symfony\Component\DependencyInjection\Container") | | mixed | [getEnv](#method_getEnv)(string $name) Fetches a variable from the environment. | | | | [setResourceTracking](#method_setResourceTracking)(bool $track) Sets the track resources flag. | | | bool | [isTrackingResources](#method_isTrackingResources)() Checks if resources are tracked. | | | | [setProxyInstantiator](#method_setProxyInstantiator)([InstantiatorInterface](lazyproxy/instantiator/instantiatorinterface "Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInterface") $proxyInstantiator) Sets the instantiator to be used when fetching proxies. | | | | [registerExtension](#method_registerExtension)([ExtensionInterface](extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface") $extension) | | | [ExtensionInterface](extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface") | [getExtension](#method_getExtension)(string $name) Returns an extension by alias or namespace. | | | [ExtensionInterface](extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface")[] | [getExtensions](#method_getExtensions)() Returns all registered extensions. | | | bool | [hasExtension](#method_hasExtension)(string $name) Checks if we have an extension. | | | [ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface")[] | [getResources](#method_getResources)() Returns an array of resources loaded to build this configuration. | | | $this | [addResource](#method_addResource)([ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $resource) | | | $this | [setResources](#method_setResources)(array $resources) Sets the resources for this configuration. | | | $this | [addObjectResource](#method_addObjectResource)(object|string $object) Adds the object class hierarchy as resources. | | | ReflectionClass|null | [getReflectionClass](#method_getReflectionClass)(string|null $class, bool $throw = true) Retrieves the requested reflection class and registers it for resource tracking. | | | bool | [fileExists](#method_fileExists)(string $path, bool|string $trackContents = true) Checks whether the requested file or directory exists and registers the result for resource tracking. | | | $this | [loadFromExtension](#method_loadFromExtension)(string $extension, array $values = null) Loads the configuration for an extension. | | | $this | [addCompilerPass](#method_addCompilerPass)([CompilerPassInterface](compiler/compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") $pass, string $type = PassConfig::TYPE\_BEFORE\_OPTIMIZATION, int $priority = 0) Adds a compiler pass. | | | [PassConfig](compiler/passconfig "Symfony\Component\DependencyInjection\Compiler\PassConfig") | [getCompilerPassConfig](#method_getCompilerPassConfig)() Returns the compiler pass config which can then be modified. | | | [Compiler](compiler/compiler "Symfony\Component\DependencyInjection\Compiler\Compiler") | [getCompiler](#method_getCompiler)() Returns the compiler. | | | | [removeDefinition](#method_removeDefinition)(string $id) Removes a service definition. | | | | [merge](#method_merge)([ContainerBuilder](containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Merges a ContainerBuilder with the current ContainerBuilder configuration. | | | array | [getExtensionConfig](#method_getExtensionConfig)(string $name) Returns the configuration array for the given extension. | | | | [prependExtensionConfig](#method_prependExtensionConfig)(string $name, array $config) Prepends a config array to the configs of the given extension. | | | | [addAliases](#method_addAliases)(array $aliases) Adds the service aliases. | | | | [setAliases](#method_setAliases)(array $aliases) Sets the service aliases. | | | [Alias](alias "Symfony\Component\DependencyInjection\Alias") | [setAlias](#method_setAlias)(string $alias, string|[Alias](alias "Symfony\Component\DependencyInjection\Alias") $id) Sets an alias for an existing service. | | | | [removeAlias](#method_removeAlias)(string $alias) Removes an alias. | | | bool | [hasAlias](#method_hasAlias)(string $id) Returns true if an alias exists under the given identifier. | | | [Alias](alias "Symfony\Component\DependencyInjection\Alias")[] | [getAliases](#method_getAliases)() Gets all defined aliases. | | | [Alias](alias "Symfony\Component\DependencyInjection\Alias") | [getAlias](#method_getAlias)(string $id) Gets an alias. | | | [Definition](definition "Symfony\Component\DependencyInjection\Definition") | [register](#method_register)($id, $class = null) Registers a service definition. | | | [Definition](definition "Symfony\Component\DependencyInjection\Definition") | [autowire](#method_autowire)(string $id, string|null $class = null) Registers an autowired service definition. | | | | [addDefinitions](#method_addDefinitions)(array $definitions) Adds the service definitions. | | | | [setDefinitions](#method_setDefinitions)(array $definitions) Sets the service definitions. | | | [Definition](definition "Symfony\Component\DependencyInjection\Definition")[] | [getDefinitions](#method_getDefinitions)() Gets all service definitions. | | | [Definition](definition "Symfony\Component\DependencyInjection\Definition") | [setDefinition](#method_setDefinition)(string $id, [Definition](definition "Symfony\Component\DependencyInjection\Definition") $definition) Sets a service definition. | | | bool | [hasDefinition](#method_hasDefinition)(string $id) Returns true if a service definition exists under the given identifier. | | | [Definition](definition "Symfony\Component\DependencyInjection\Definition") | [getDefinition](#method_getDefinition)(string $id) Gets a service definition. | | | [Definition](definition "Symfony\Component\DependencyInjection\Definition") | [findDefinition](#method_findDefinition)(string $id) Gets a service definition by id or alias. | | | mixed | [resolveServices](#method_resolveServices)(mixed $value) Replaces service references by the real service instance and evaluates expressions. | | | array | [findTaggedServiceIds](#method_findTaggedServiceIds)(string $name, bool $throwOnAbstract = false) Returns service ids for a given tag. | | | array | [findTags](#method_findTags)() Returns all tags the defined services use. | | | string[] | [findUnusedTags](#method_findUnusedTags)() Returns all tags not queried by findTaggedServiceIds. | | | | [addExpressionLanguageProvider](#method_addExpressionLanguageProvider)([ExpressionFunctionProviderInterface](../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) | | | [ExpressionFunctionProviderInterface](../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface")[] | [getExpressionLanguageProviders](#method_getExpressionLanguageProviders)() | | | [ChildDefinition](childdefinition "Symfony\Component\DependencyInjection\ChildDefinition") | [registerForAutoconfiguration](#method_registerForAutoconfiguration)(string $interface) Returns a ChildDefinition that will be used for autoconfiguring the interface/class. | | | [ChildDefinition](childdefinition "Symfony\Component\DependencyInjection\ChildDefinition")[] | [getAutoconfiguredInstanceof](#method_getAutoconfiguredInstanceof)() Returns an array of ChildDefinition[] keyed by interface. | | | mixed | [resolveEnvPlaceholders](#method_resolveEnvPlaceholders)(mixed $value, string|true|null $format = null, array $usedEnvs = null) Resolves env parameter placeholders in a string or an array. | | | int[] | [getEnvCounters](#method_getEnvCounters)() Get statistics about env usage. | | | | [log](#method_log)([CompilerPassInterface](compiler/compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") $pass, string $message) | | | static array | [getServiceConditionals](#method_getServiceConditionals)(mixed $value) Returns the Service Conditionals. | | | static array | [getInitializedConditionals](#method_getInitializedConditionals)(mixed $value) Returns the initialized conditionals. | | | static string | [hash](#method_hash)(mixed $value) Computes a reasonably unique hash of a value. | | Details ------- ### \_\_construct([ParameterBagInterface](parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") $parameterBag = null) #### Parameters | | | | | --- | --- | --- | | [ParameterBagInterface](parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") | $parameterBag | | ### compile(bool $resolveEnvPlaceholders = false) Compiles the container. This method passes the container to compiler passes whose job is to manipulate and optimize the container. The main compiler passes roughly do four things: * The extension configurations are merged; * Parameter values are resolved; * The parameter bag is frozen; * Extension loading is disabled. #### Parameters | | | | | --- | --- | --- | | bool | $resolveEnvPlaceholders | Whether %env()% parameters should be resolved using the current env vars or be replaced by uniquely identifiable placeholders. Set to "true" when you want to use the current ContainerBuilder directly, keep to "false" when the container is dumped instead. | ### bool isCompiled() Returns true if the container is compiled. #### Return Value | | | | --- | --- | | bool | | ### [ParameterBagInterface](parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") getParameterBag() Gets the service container parameter bag. #### Return Value | | | | --- | --- | | [ParameterBagInterface](parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") | A ParameterBagInterface instance | ### mixed getParameter(string $name) Gets a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | mixed | The parameter value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | if the parameter is not defined | ### bool hasParameter(string $name) Checks if a parameter exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | bool | The presence of parameter in container | ### setParameter(string $name, mixed $value) Sets a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | | mixed | $value | The parameter value | ### set(string $id, object $service) Sets a service. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | | object | $service | The service instance | #### Exceptions | | | | --- | --- | | [BadMethodCallException](exception/badmethodcallexception "Symfony\Component\DependencyInjection\Exception\BadMethodCallException") | When this ContainerBuilder is compiled | ### bool has(string $id) Returns true if the given service is defined. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | #### Return Value | | | | --- | --- | | bool | true if the service is defined, false otherwise | ### object get(string $id, int $invalidBehavior = ContainerInterface::EXCEPTION\_ON\_INVALID\_REFERENCE) Gets a service. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | | int | $invalidBehavior | The behavior when the service does not exist | #### Return Value | | | | --- | --- | | object | The associated service | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when no definitions are available | | [ServiceCircularReferenceException](exception/servicecircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException") | When a circular reference is detected | | [ServiceNotFoundException](exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | When the service is not defined | | [Exception](http://php.net/Exception) | | #### See also | | | | --- | --- | | [Reference](reference "Symfony\Component\DependencyInjection\Reference") | | ### bool initialized(string $id) Returns true if the given service has actually been initialized. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | bool | true if the service has been initialized, false otherwise | ### reset() Resets shared services from the container. The container is not intended to be used again after being reset in a normal workflow. This method is meant as a way to release references for ref-counting. A subsequent call to ContainerInterface::get will recreate a new instance of the shared service. ### array getServiceIds() Gets all service ids. #### Return Value | | | | --- | --- | | array | An array of all defined service ids | ### array getRemovedIds() Gets removed service or alias ids. #### Return Value | | | | --- | --- | | array | | ### static string camelize(string $id) Camelizes a string. #### Parameters | | | | | --- | --- | --- | | string | $id | A string to camelize | #### Return Value | | | | --- | --- | | string | The camelized string | ### static string underscore(string $id) A string to underscore. #### Parameters | | | | | --- | --- | --- | | string | $id | The string to underscore | #### Return Value | | | | --- | --- | | string | The underscored string | ### protected object load($file) Creates a service by requiring its factory file. #### Parameters | | | | | --- | --- | --- | | | $file | | #### Return Value | | | | --- | --- | | object | The service created by the file | ### protected mixed getEnv(string $name) Fetches a variable from the environment. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the environment variable | #### Return Value | | | | --- | --- | | mixed | The value to use for the provided environment variable name | #### Exceptions | | | | --- | --- | | [EnvNotFoundException](exception/envnotfoundexception "Symfony\Component\DependencyInjection\Exception\EnvNotFoundException") | When the environment variable is not found and has no default value | ### setResourceTracking(bool $track) Sets the track resources flag. If you are not using the loaders and therefore don't want to depend on the Config component, set this flag to false. #### Parameters | | | | | --- | --- | --- | | bool | $track | True if you want to track resources, false otherwise | ### bool isTrackingResources() Checks if resources are tracked. #### Return Value | | | | --- | --- | | bool | true If resources are tracked, false otherwise | ### setProxyInstantiator([InstantiatorInterface](lazyproxy/instantiator/instantiatorinterface "Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInterface") $proxyInstantiator) Sets the instantiator to be used when fetching proxies. #### Parameters | | | | | --- | --- | --- | | [InstantiatorInterface](lazyproxy/instantiator/instantiatorinterface "Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInterface") | $proxyInstantiator | | ### registerExtension([ExtensionInterface](extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface") $extension) #### Parameters | | | | | --- | --- | --- | | [ExtensionInterface](extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface") | $extension | | ### [ExtensionInterface](extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface") getExtension(string $name) Returns an extension by alias or namespace. #### Parameters | | | | | --- | --- | --- | | string | $name | An alias or a namespace | #### Return Value | | | | --- | --- | | [ExtensionInterface](extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface") | An extension instance | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\DependencyInjection\Exception\LogicException") | if the extension is not registered | ### [ExtensionInterface](extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface")[] getExtensions() Returns all registered extensions. #### Return Value | | | | --- | --- | | [ExtensionInterface](extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface")[] | An array of ExtensionInterface | ### bool hasExtension(string $name) Checks if we have an extension. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the extension | #### Return Value | | | | --- | --- | | bool | If the extension exists | ### [ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface")[] getResources() Returns an array of resources loaded to build this configuration. #### Return Value | | | | --- | --- | | [ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface")[] | An array of resources | ### $this addResource([ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $resource) #### Parameters | | | | | --- | --- | --- | | [ResourceInterface](../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") | $resource | | #### Return Value | | | | --- | --- | | $this | | ### $this setResources(array $resources) Sets the resources for this configuration. #### Parameters | | | | | --- | --- | --- | | array | $resources | An array of resources | #### Return Value | | | | --- | --- | | $this | | ### $this addObjectResource(object|string $object) Adds the object class hierarchy as resources. #### Parameters | | | | | --- | --- | --- | | object|string | $object | An object instance or class name | #### Return Value | | | | --- | --- | | $this | | ### ReflectionClass|null getReflectionClass(string|null $class, bool $throw = true) Retrieves the requested reflection class and registers it for resource tracking. #### Parameters | | | | | --- | --- | --- | | string|null | $class | | | bool | $throw | | #### Return Value | | | | --- | --- | | ReflectionClass|null | | #### Exceptions | | | | --- | --- | | [ReflectionException](http://php.net/ReflectionException) | when a parent class/interface/trait is not found and $throw is true | ### bool fileExists(string $path, bool|string $trackContents = true) Checks whether the requested file or directory exists and registers the result for resource tracking. #### Parameters | | | | | --- | --- | --- | | string | $path | The file or directory path for which to check the existence | | bool|string | $trackContents | Whether to track contents of the given resource. If a string is passed, it will be used as pattern for tracking contents of the requested directory | #### Return Value | | | | --- | --- | | bool | | ### $this loadFromExtension(string $extension, array $values = null) Loads the configuration for an extension. #### Parameters | | | | | --- | --- | --- | | string | $extension | The extension alias or namespace | | array | $values | An array of values that customizes the extension | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [BadMethodCallException](exception/badmethodcallexception "Symfony\Component\DependencyInjection\Exception\BadMethodCallException") | When this ContainerBuilder is compiled | | [LogicException](http://php.net/LogicException) | if the extension is not registered | ### $this addCompilerPass([CompilerPassInterface](compiler/compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") $pass, string $type = PassConfig::TYPE\_BEFORE\_OPTIMIZATION, int $priority = 0) Adds a compiler pass. #### Parameters | | | | | --- | --- | --- | | [CompilerPassInterface](compiler/compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") | $pass | A compiler pass | | string | $type | The type of compiler pass | | int | $priority | Used to sort the passes | #### Return Value | | | | --- | --- | | $this | | ### [PassConfig](compiler/passconfig "Symfony\Component\DependencyInjection\Compiler\PassConfig") getCompilerPassConfig() Returns the compiler pass config which can then be modified. #### Return Value | | | | --- | --- | | [PassConfig](compiler/passconfig "Symfony\Component\DependencyInjection\Compiler\PassConfig") | The compiler pass config | ### [Compiler](compiler/compiler "Symfony\Component\DependencyInjection\Compiler\Compiler") getCompiler() Returns the compiler. #### Return Value | | | | --- | --- | | [Compiler](compiler/compiler "Symfony\Component\DependencyInjection\Compiler\Compiler") | The compiler | ### removeDefinition(string $id) Removes a service definition. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | ### merge([ContainerBuilder](containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Merges a ContainerBuilder with the current ContainerBuilder configuration. Service definitions overrides the current defined ones. But for parameters, they are overridden by the current ones. It allows the parameters passed to the container constructor to have precedence over the loaded ones. ``` $container = new ContainerBuilder(new ParameterBag(array('foo' => 'bar'))); $loader = new LoaderXXX($container); $loader->load('resource_name'); $container->register('foo', 'stdClass'); ``` In the above example, even if the loaded resource defines a foo parameter, the value will still be 'bar' as defined in the ContainerBuilder constructor. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | #### Exceptions | | | | --- | --- | | [BadMethodCallException](exception/badmethodcallexception "Symfony\Component\DependencyInjection\Exception\BadMethodCallException") | When this ContainerBuilder is compiled | ### array getExtensionConfig(string $name) Returns the configuration array for the given extension. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the extension | #### Return Value | | | | --- | --- | | array | An array of configuration | ### prependExtensionConfig(string $name, array $config) Prepends a config array to the configs of the given extension. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the extension | | array | $config | The config to set | ### addAliases(array $aliases) Adds the service aliases. #### Parameters | | | | | --- | --- | --- | | array | $aliases | | ### setAliases(array $aliases) Sets the service aliases. #### Parameters | | | | | --- | --- | --- | | array | $aliases | | ### [Alias](alias "Symfony\Component\DependencyInjection\Alias") setAlias(string $alias, string|[Alias](alias "Symfony\Component\DependencyInjection\Alias") $id) Sets an alias for an existing service. #### Parameters | | | | | --- | --- | --- | | string | $alias | The alias to create | | string|[Alias](alias "Symfony\Component\DependencyInjection\Alias") | $id | The service to alias | #### Return Value | | | | --- | --- | | [Alias](alias "Symfony\Component\DependencyInjection\Alias") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | if the id is not a string or an Alias | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | if the alias is for itself | ### removeAlias(string $alias) Removes an alias. #### Parameters | | | | | --- | --- | --- | | string | $alias | The alias to remove | ### bool hasAlias(string $id) Returns true if an alias exists under the given identifier. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | #### Return Value | | | | --- | --- | | bool | true if the alias exists, false otherwise | ### [Alias](alias "Symfony\Component\DependencyInjection\Alias")[] getAliases() Gets all defined aliases. #### Return Value | | | | --- | --- | | [Alias](alias "Symfony\Component\DependencyInjection\Alias")[] | An array of aliases | ### [Alias](alias "Symfony\Component\DependencyInjection\Alias") getAlias(string $id) Gets an alias. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | #### Return Value | | | | --- | --- | | [Alias](alias "Symfony\Component\DependencyInjection\Alias") | An Alias instance | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | if the alias does not exist | ### [Definition](definition "Symfony\Component\DependencyInjection\Definition") register($id, $class = null) Registers a service definition. This methods allows for simple registration of service definition with a fluid interface. #### Parameters | | | | | --- | --- | --- | | | $id | | | | $class | | #### Return Value | | | | --- | --- | | [Definition](definition "Symfony\Component\DependencyInjection\Definition") | A Definition instance | ### [Definition](definition "Symfony\Component\DependencyInjection\Definition") autowire(string $id, string|null $class = null) Registers an autowired service definition. This method implements a shortcut for using setDefinition() with an autowired definition. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | | string|null | $class | The service class | #### Return Value | | | | --- | --- | | [Definition](definition "Symfony\Component\DependencyInjection\Definition") | The created definition | ### addDefinitions(array $definitions) Adds the service definitions. #### Parameters | | | | | --- | --- | --- | | array | $definitions | An array of service definitions | ### setDefinitions(array $definitions) Sets the service definitions. #### Parameters | | | | | --- | --- | --- | | array | $definitions | An array of service definitions | ### [Definition](definition "Symfony\Component\DependencyInjection\Definition")[] getDefinitions() Gets all service definitions. #### Return Value | | | | --- | --- | | [Definition](definition "Symfony\Component\DependencyInjection\Definition")[] | An array of Definition instances | ### [Definition](definition "Symfony\Component\DependencyInjection\Definition") setDefinition(string $id, [Definition](definition "Symfony\Component\DependencyInjection\Definition") $definition) Sets a service definition. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | | [Definition](definition "Symfony\Component\DependencyInjection\Definition") | $definition | A Definition instance | #### Return Value | | | | --- | --- | | [Definition](definition "Symfony\Component\DependencyInjection\Definition") | the service definition | #### Exceptions | | | | --- | --- | | [BadMethodCallException](exception/badmethodcallexception "Symfony\Component\DependencyInjection\Exception\BadMethodCallException") | When this ContainerBuilder is compiled | ### bool hasDefinition(string $id) Returns true if a service definition exists under the given identifier. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | #### Return Value | | | | --- | --- | | bool | true if the service definition exists, false otherwise | ### [Definition](definition "Symfony\Component\DependencyInjection\Definition") getDefinition(string $id) Gets a service definition. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | #### Return Value | | | | --- | --- | | [Definition](definition "Symfony\Component\DependencyInjection\Definition") | A Definition instance | #### Exceptions | | | | --- | --- | | [ServiceNotFoundException](exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | if the service definition does not exist | ### [Definition](definition "Symfony\Component\DependencyInjection\Definition") findDefinition(string $id) Gets a service definition by id or alias. The method "unaliases" recursively to return a Definition instance. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier or alias | #### Return Value | | | | --- | --- | | [Definition](definition "Symfony\Component\DependencyInjection\Definition") | A Definition instance | #### Exceptions | | | | --- | --- | | [ServiceNotFoundException](exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | if the service definition does not exist | ### mixed resolveServices(mixed $value) Replaces service references by the real service instance and evaluates expressions. #### Parameters | | | | | --- | --- | --- | | mixed | $value | A value | #### Return Value | | | | --- | --- | | mixed | The same value with all service references replaced by the real service instances and all expressions evaluated | ### array findTaggedServiceIds(string $name, bool $throwOnAbstract = false) Returns service ids for a given tag. Example: ``` $container->register('foo')->addTag('my.tag', array('hello' => 'world')); $serviceIds = $container->findTaggedServiceIds('my.tag'); foreach ($serviceIds as $serviceId => $tags) { foreach ($tags as $tag) { echo $tag['hello']; } } ``` #### Parameters | | | | | --- | --- | --- | | string | $name | The tag name | | bool | $throwOnAbstract | | #### Return Value | | | | --- | --- | | array | An array of tags | ### array findTags() Returns all tags the defined services use. #### Return Value | | | | --- | --- | | array | An array of tags | ### string[] findUnusedTags() Returns all tags not queried by findTaggedServiceIds. #### Return Value | | | | --- | --- | | string[] | An array of tags | ### addExpressionLanguageProvider([ExpressionFunctionProviderInterface](../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) #### Parameters | | | | | --- | --- | --- | | [ExpressionFunctionProviderInterface](../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") | $provider | | ### [ExpressionFunctionProviderInterface](../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface")[] getExpressionLanguageProviders() #### Return Value | | | | --- | --- | | [ExpressionFunctionProviderInterface](../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface")[] | | ### [ChildDefinition](childdefinition "Symfony\Component\DependencyInjection\ChildDefinition") registerForAutoconfiguration(string $interface) Returns a ChildDefinition that will be used for autoconfiguring the interface/class. #### Parameters | | | | | --- | --- | --- | | string | $interface | The class or interface to match | #### Return Value | | | | --- | --- | | [ChildDefinition](childdefinition "Symfony\Component\DependencyInjection\ChildDefinition") | | ### [ChildDefinition](childdefinition "Symfony\Component\DependencyInjection\ChildDefinition")[] getAutoconfiguredInstanceof() Returns an array of ChildDefinition[] keyed by interface. #### Return Value | | | | --- | --- | | [ChildDefinition](childdefinition "Symfony\Component\DependencyInjection\ChildDefinition")[] | | ### mixed resolveEnvPlaceholders(mixed $value, string|true|null $format = null, array $usedEnvs = null) Resolves env parameter placeholders in a string or an array. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to resolve | | string|true|null | $format | A sprintf() format returning the replacement for each env var name or null to resolve back to the original "%env(VAR)%" format or true to resolve to the actual values of the referenced env vars | | array | $usedEnvs | &$usedEnvs Env vars found while resolving are added to this array | #### Return Value | | | | --- | --- | | mixed | The value with env parameters resolved if a string or an array is passed | ### int[] getEnvCounters() Get statistics about env usage. #### Return Value | | | | --- | --- | | int[] | The number of time each env vars has been resolved | ### log([CompilerPassInterface](compiler/compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") $pass, string $message) #### Parameters | | | | | --- | --- | --- | | [CompilerPassInterface](compiler/compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") | $pass | | | string | $message | | ### static array getServiceConditionals(mixed $value) Returns the Service Conditionals. #### Parameters | | | | | --- | --- | --- | | mixed | $value | An array of conditionals to return | #### Return Value | | | | --- | --- | | array | An array of Service conditionals | ### static array getInitializedConditionals(mixed $value) Returns the initialized conditionals. #### Parameters | | | | | --- | --- | --- | | mixed | $value | An array of conditionals to return | #### Return Value | | | | --- | --- | | array | An array of uninitialized conditionals | ### static string hash(mixed $value) Computes a reasonably unique hash of a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | A serializable value | #### Return Value | | | | --- | --- | | string | |
programming_docs
symfony ContainerAwareTrait ContainerAwareTrait ==================== trait **ContainerAwareTrait** ContainerAware trait. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerInterface](containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") | $container | | | Methods ------- | | | | | --- | --- | --- | | | [setContainer](#method_setContainer)([ContainerInterface](containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") $container = null) | | Details ------- ### setContainer([ContainerInterface](containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") $container = null) #### Parameters | | | | | --- | --- | --- | | [ContainerInterface](containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") | $container | | symfony Extension Extension ========== abstract class **Extension** implements [ExtensionInterface](extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface"), [ConfigurationExtensionInterface](configurationextensioninterface "Symfony\Component\DependencyInjection\Extension\ConfigurationExtensionInterface") Provides useful features shared by many extensions. Methods ------- | | | | | --- | --- | --- | | string | [getXsdValidationBasePath](#method_getXsdValidationBasePath)() Returns the base path for the XSD files. | | | string | [getNamespace](#method_getNamespace)() Returns the namespace to be used for this extension (XML namespace). | | | string | [getAlias](#method_getAlias)() Returns the recommended alias to use in XML. | | | [ConfigurationInterface](../../config/definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface")|null | [getConfiguration](#method_getConfiguration)(array $config, [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Returns extension configuration. | | | | [processConfiguration](#method_processConfiguration)([ConfigurationInterface](../../config/definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") $configuration, array $configs) | | | | [getProcessedConfigs](#method_getProcessedConfigs)() | | | bool | [isConfigEnabled](#method_isConfigEnabled)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, array $config) | | Details ------- ### string getXsdValidationBasePath() Returns the base path for the XSD files. #### Return Value | | | | --- | --- | | string | The XSD base path | ### string getNamespace() Returns the namespace to be used for this extension (XML namespace). #### Return Value | | | | --- | --- | | string | The XML namespace | ### string getAlias() Returns the recommended alias to use in XML. This alias is also the mandatory prefix to use when using YAML. This convention is to remove the "Extension" postfix from the class name and then lowercase and underscore the result. So: ``` AcmeHelloExtension ``` becomes ``` acme_hello ``` This can be overridden in a sub-class to specify the alias manually. #### Return Value | | | | --- | --- | | string | The alias | #### Exceptions | | | | --- | --- | | [BadMethodCallException](../exception/badmethodcallexception "Symfony\Component\DependencyInjection\Exception\BadMethodCallException") | When the extension name does not follow conventions | ### [ConfigurationInterface](../../config/definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface")|null getConfiguration(array $config, [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Returns extension configuration. #### Parameters | | | | | --- | --- | --- | | array | $config | | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | #### Return Value | | | | --- | --- | | [ConfigurationInterface](../../config/definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface")|null | The configuration or null | ### final protected processConfiguration([ConfigurationInterface](../../config/definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") $configuration, array $configs) #### Parameters | | | | | --- | --- | --- | | [ConfigurationInterface](../../config/definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") | $configuration | | | array | $configs | | ### final getProcessedConfigs() ### protected bool isConfigEnabled([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, array $config) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | array | $config | | #### Return Value | | | | --- | --- | | bool | Whether the configuration is enabled | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | When the config is not enableable | symfony ConfigurationExtensionInterface ConfigurationExtensionInterface ================================ interface **ConfigurationExtensionInterface** ConfigurationExtensionInterface is the interface implemented by container extension classes. Methods ------- | | | | | --- | --- | --- | | [ConfigurationInterface](../../config/definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface")|null | [getConfiguration](#method_getConfiguration)(array $config, [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Returns extension configuration. | | Details ------- ### [ConfigurationInterface](../../config/definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface")|null getConfiguration(array $config, [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Returns extension configuration. #### Parameters | | | | | --- | --- | --- | | array | $config | | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | #### Return Value | | | | --- | --- | | [ConfigurationInterface](../../config/definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface")|null | The configuration or null | symfony PrependExtensionInterface PrependExtensionInterface ========================== interface **PrependExtensionInterface** Methods ------- | | | | | --- | --- | --- | | | [prepend](#method_prepend)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Allow an extension to prepend the extension configurations. | | Details ------- ### prepend([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Allow an extension to prepend the extension configurations. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony ExtensionInterface ExtensionInterface =================== interface **ExtensionInterface** ExtensionInterface is the interface implemented by container extension classes. Methods ------- | | | | | --- | --- | --- | | | [load](#method_load)(array $configs, [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Loads a specific configuration. | | | string | [getNamespace](#method_getNamespace)() Returns the namespace to be used for this extension (XML namespace). | | | string | [getXsdValidationBasePath](#method_getXsdValidationBasePath)() Returns the base path for the XSD files. | | | string | [getAlias](#method_getAlias)() Returns the recommended alias to use in XML. | | Details ------- ### load(array $configs, [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Loads a specific configuration. #### Parameters | | | | | --- | --- | --- | | array | $configs | | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When provided tag is not defined in this extension | ### string getNamespace() Returns the namespace to be used for this extension (XML namespace). #### Return Value | | | | --- | --- | | string | The XML namespace | ### string getXsdValidationBasePath() Returns the base path for the XSD files. #### Return Value | | | | --- | --- | | string | The XSD base path | ### string getAlias() Returns the recommended alias to use in XML. This alias is also the mandatory prefix to use when using YAML. #### Return Value | | | | --- | --- | | string | The alias | symfony ContainerParametersResource ContainerParametersResource ============================ class **ContainerParametersResource** implements [ResourceInterface](../../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface"), [Serializable](http://php.net/Serializable) Tracks container parameters. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $parameters) | | | string | [\_\_toString](#method___toString)() Returns a string representation of the Resource. | | | | [serialize](#method_serialize)() {@inheritdoc} | | | | [unserialize](#method_unserialize)($serialized) {@inheritdoc} | | | array | [getParameters](#method_getParameters)() | | Details ------- ### \_\_construct(array $parameters) #### Parameters | | | | | --- | --- | --- | | array | $parameters | The container parameters to track | ### string \_\_toString() Returns a string representation of the Resource. This method is necessary to allow for resource de-duplication, for example by means of array\_unique(). The string returned need not have a particular meaning, but has to be identical for different ResourceInterface instances referring to the same resource; and it should be unlikely to collide with that of other, unrelated resource instances. #### Return Value | | | | --- | --- | | string | A string representation unique to the underlying Resource | ### serialize() {@inheritdoc} ### unserialize($serialized) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $serialized | | ### array getParameters() #### Return Value | | | | --- | --- | | array | Tracked parameters | symfony ContainerParametersResourceChecker ContainerParametersResourceChecker =================================== class **ContainerParametersResourceChecker** implements [ResourceCheckerInterface](../../config/resourcecheckerinterface "Symfony\Component\Config\ResourceCheckerInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ContainerInterface](../containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") $container) | | | bool | [supports](#method_supports)([ResourceInterface](../../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $metadata) Queries the ResourceChecker whether it can validate a given resource or not. | | | bool | [isFresh](#method_isFresh)([ResourceInterface](../../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $resource, int $timestamp) Validates the resource. | | Details ------- ### \_\_construct([ContainerInterface](../containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") $container) #### Parameters | | | | | --- | --- | --- | | [ContainerInterface](../containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") | $container | | ### bool supports([ResourceInterface](../../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $metadata) Queries the ResourceChecker whether it can validate a given resource or not. #### Parameters | | | | | --- | --- | --- | | [ResourceInterface](../../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") | $metadata | The resource to be checked for freshness | #### Return Value | | | | --- | --- | | bool | True if the ResourceChecker can handle this resource type, false if not | ### bool isFresh([ResourceInterface](../../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $resource, int $timestamp) Validates the resource. #### Parameters | | | | | --- | --- | --- | | [ResourceInterface](../../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") | $resource | The resource to be validated | | int | $timestamp | The timestamp at which the cache associated with this resource was created | #### Return Value | | | | --- | --- | | bool | True if the resource has not changed since the given timestamp, false otherwise | symfony RewindableGenerator RewindableGenerator ==================== class **RewindableGenerator** implements [IteratorAggregate](http://php.net/IteratorAggregate), [Countable](http://php.net/Countable) Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(callable $generator, int|callable $count) | | | | [getIterator](#method_getIterator)() | | | | [count](#method_count)() | | Details ------- ### \_\_construct(callable $generator, int|callable $count) #### Parameters | | | | | --- | --- | --- | | callable | $generator | | | int|callable | $count | | ### getIterator() ### count() symfony TaggedIteratorArgument TaggedIteratorArgument ======================= class **TaggedIteratorArgument** extends [IteratorArgument](iteratorargument "Symfony\Component\DependencyInjection\Argument\IteratorArgument") Represents a collection of services found by tag name to lazily iterate over. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $tag) | | | array | [getValues](#method_getValues)() | from [IteratorArgument](iteratorargument#method_getValues "Symfony\Component\DependencyInjection\Argument\IteratorArgument") | | | [setValues](#method_setValues)(array $values) | from [IteratorArgument](iteratorargument#method_setValues "Symfony\Component\DependencyInjection\Argument\IteratorArgument") | | | [getTag](#method_getTag)() | | Details ------- ### \_\_construct(string $tag) #### Parameters | | | | | --- | --- | --- | | string | $tag | | ### array getValues() #### Return Value | | | | --- | --- | | array | | ### setValues(array $values) #### Parameters | | | | | --- | --- | --- | | array | $values | | ### getTag() symfony ArgumentInterface ArgumentInterface ================== interface **ArgumentInterface** Represents a complex argument containing nested values. Methods ------- | | | | | --- | --- | --- | | array | [getValues](#method_getValues)() | | | | [setValues](#method_setValues)(array $values) | | Details ------- ### array getValues() #### Return Value | | | | --- | --- | | array | | ### setValues(array $values) #### Parameters | | | | | --- | --- | --- | | array | $values | | symfony BoundArgument BoundArgument ============== class **BoundArgument** implements [ArgumentInterface](argumentinterface "Symfony\Component\DependencyInjection\Argument\ArgumentInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)($value) | | | array | [getValues](#method_getValues)() | | | | [setValues](#method_setValues)(array $values) | | Details ------- ### \_\_construct($value) #### Parameters | | | | | --- | --- | --- | | | $value | | ### array getValues() #### Return Value | | | | --- | --- | | array | | ### setValues(array $values) #### Parameters | | | | | --- | --- | --- | | array | $values | | symfony ServiceClosureArgument ServiceClosureArgument ======================= class **ServiceClosureArgument** implements [ArgumentInterface](argumentinterface "Symfony\Component\DependencyInjection\Argument\ArgumentInterface") Represents a service wrapped in a memoizing closure. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Reference](../reference "Symfony\Component\DependencyInjection\Reference") $reference) | | | array | [getValues](#method_getValues)() | | | | [setValues](#method_setValues)(array $values) | | Details ------- ### \_\_construct([Reference](../reference "Symfony\Component\DependencyInjection\Reference") $reference) #### Parameters | | | | | --- | --- | --- | | [Reference](../reference "Symfony\Component\DependencyInjection\Reference") | $reference | | ### array getValues() #### Return Value | | | | --- | --- | | array | | ### setValues(array $values) #### Parameters | | | | | --- | --- | --- | | array | $values | | symfony IteratorArgument IteratorArgument ================= class **IteratorArgument** implements [ArgumentInterface](argumentinterface "Symfony\Component\DependencyInjection\Argument\ArgumentInterface") Represents a collection of values to lazily iterate over. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $values) | | | array | [getValues](#method_getValues)() | | | | [setValues](#method_setValues)(array $values) | | Details ------- ### \_\_construct(array $values) #### Parameters | | | | | --- | --- | --- | | array | $values | | ### array getValues() #### Return Value | | | | --- | --- | | array | | ### setValues(array $values) #### Parameters | | | | | --- | --- | --- | | array | $values | | symfony EnvPlaceholderParameterBag EnvPlaceholderParameterBag =========================== class **EnvPlaceholderParameterBag** extends [ParameterBag](parameterbag "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $parameters | | from [ParameterBag](parameterbag#property_parameters "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | protected | $resolved | | from [ParameterBag](parameterbag#property_resolved "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $parameters = array()) | from [ParameterBag](parameterbag#method___construct "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | | [clear](#method_clear)() Clears all parameters. | from [ParameterBag](parameterbag#method_clear "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | | [add](#method_add)(array $parameters) Adds parameters to the service container parameters. | from [ParameterBag](parameterbag#method_add "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | array | [all](#method_all)() Gets the service container parameters. | from [ParameterBag](parameterbag#method_all "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | mixed | [get](#method_get)(string $name) Gets a service container parameter. | | | | [set](#method_set)(string $name, mixed $value) Sets a service container parameter. | from [ParameterBag](parameterbag#method_set "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | bool | [has](#method_has)(string $name) Returns true if a parameter name is defined. | from [ParameterBag](parameterbag#method_has "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | | [remove](#method_remove)(string $name) Removes a parameter. | from [ParameterBag](parameterbag#method_remove "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | | [resolve](#method_resolve)() Replaces parameter placeholders (%name%) by their values for all parameters. | | | | [resolveValue](#method_resolveValue)(mixed $value, array $resolving = array()) Replaces parameter placeholders (%name%) by their values. | from [ParameterBag](parameterbag#method_resolveValue "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | string | [resolveString](#method_resolveString)(string $value, array $resolving = array()) Resolves parameters inside a string. | from [ParameterBag](parameterbag#method_resolveString "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | | [isResolved](#method_isResolved)() | from [ParameterBag](parameterbag#method_isResolved "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | mixed | [escapeValue](#method_escapeValue)(mixed $value) Escape parameter placeholders %. | from [ParameterBag](parameterbag#method_escapeValue "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | mixed | [unescapeValue](#method_unescapeValue)(mixed $value) Unescape parameter placeholders %. | from [ParameterBag](parameterbag#method_unescapeValue "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | string | [getEnvPlaceholderUniquePrefix](#method_getEnvPlaceholderUniquePrefix)() Gets the common env placeholder prefix for env vars created by this bag. | | | string[][] | [getEnvPlaceholders](#method_getEnvPlaceholders)() Returns the map of env vars used in the resolved parameter values to their placeholders. | | | array | [getUnusedEnvPlaceholders](#method_getUnusedEnvPlaceholders)() | | | | [clearUnusedEnvPlaceholders](#method_clearUnusedEnvPlaceholders)() | | | | [mergeEnvPlaceholders](#method_mergeEnvPlaceholders)([EnvPlaceholderParameterBag](envplaceholderparameterbag "Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag") $bag) Merges the env placeholders of another EnvPlaceholderParameterBag. | | | | [setProvidedTypes](#method_setProvidedTypes)(array $providedTypes) Maps env prefixes to their corresponding PHP types. | | | string[][] | [getProvidedTypes](#method_getProvidedTypes)() Gets the PHP types corresponding to env() parameter prefixes. | | Details ------- ### \_\_construct(array $parameters = array()) #### Parameters | | | | | --- | --- | --- | | array | $parameters | An array of parameters | ### clear() Clears all parameters. ### add(array $parameters) Adds parameters to the service container parameters. #### Parameters | | | | | --- | --- | --- | | array | $parameters | An array of parameters | ### array all() Gets the service container parameters. #### Return Value | | | | --- | --- | | array | An array of parameters | ### mixed get(string $name) Gets a service container parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | mixed | The parameter value | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if the parameter is not defined | ### set(string $name, mixed $value) Sets a service container parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | | mixed | $value | The parameter value | ### bool has(string $name) Returns true if a parameter name is defined. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | bool | true if the parameter name is defined, false otherwise | ### remove(string $name) Removes a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | ### resolve() Replaces parameter placeholders (%name%) by their values for all parameters. ### resolveValue(mixed $value, array $resolving = array()) Replaces parameter placeholders (%name%) by their values. #### Parameters | | | | | --- | --- | --- | | mixed | $value | A value | | array | $resolving | An array of keys that are being resolved (used internally to detect circular references) | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if a placeholder references a parameter that does not exist | | [ParameterCircularReferenceException](../exception/parametercircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException") | if a circular reference if detected | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | when a given parameter has a type problem | ### string resolveString(string $value, array $resolving = array()) Resolves parameters inside a string. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to resolve | | array | $resolving | An array of keys that are being resolved (used internally to detect circular references) | #### Return Value | | | | --- | --- | | string | The resolved string | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if a placeholder references a parameter that does not exist | | [ParameterCircularReferenceException](../exception/parametercircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException") | if a circular reference if detected | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | when a given parameter has a type problem | ### isResolved() ### mixed escapeValue(mixed $value) Escape parameter placeholders %. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | mixed | | ### mixed unescapeValue(mixed $value) Unescape parameter placeholders %. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | mixed | | ### string getEnvPlaceholderUniquePrefix() Gets the common env placeholder prefix for env vars created by this bag. #### Return Value | | | | --- | --- | | string | | ### string[][] getEnvPlaceholders() Returns the map of env vars used in the resolved parameter values to their placeholders. #### Return Value | | | | --- | --- | | string[][] | A map of env var names to their placeholders | ### array getUnusedEnvPlaceholders() #### Return Value | | | | --- | --- | | array | | ### clearUnusedEnvPlaceholders() ### mergeEnvPlaceholders([EnvPlaceholderParameterBag](envplaceholderparameterbag "Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag") $bag) Merges the env placeholders of another EnvPlaceholderParameterBag. #### Parameters | | | | | --- | --- | --- | | [EnvPlaceholderParameterBag](envplaceholderparameterbag "Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag") | $bag | | ### setProvidedTypes(array $providedTypes) Maps env prefixes to their corresponding PHP types. #### Parameters | | | | | --- | --- | --- | | array | $providedTypes | | ### string[][] getProvidedTypes() Gets the PHP types corresponding to env() parameter prefixes. #### Return Value | | | | --- | --- | | string[][] | |
programming_docs
symfony ContainerBagInterface ContainerBagInterface ====================== interface **ContainerBagInterface** implements ContainerInterface Methods ------- | | | | | --- | --- | --- | | array | [all](#method_all)() Gets the service container parameters. | | | | [resolveValue](#method_resolveValue)(mixed $value) Replaces parameter placeholders (%name%) by their values. | | | mixed | [escapeValue](#method_escapeValue)(mixed $value) Escape parameter placeholders %. | | | mixed | [unescapeValue](#method_unescapeValue)(mixed $value) Unescape parameter placeholders %. | | Details ------- ### array all() Gets the service container parameters. #### Return Value | | | | --- | --- | | array | An array of parameters | ### resolveValue(mixed $value) Replaces parameter placeholders (%name%) by their values. #### Parameters | | | | | --- | --- | --- | | mixed | $value | A value | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if a placeholder references a parameter that does not exist | ### mixed escapeValue(mixed $value) Escape parameter placeholders %. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | mixed | | ### mixed unescapeValue(mixed $value) Unescape parameter placeholders %. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | mixed | | symfony ParameterBagInterface ParameterBagInterface ====================== interface **ParameterBagInterface** ParameterBagInterface. Methods ------- | | | | | --- | --- | --- | | | [clear](#method_clear)() Clears all parameters. | | | | [add](#method_add)(array $parameters) Adds parameters to the service container parameters. | | | array | [all](#method_all)() Gets the service container parameters. | | | mixed | [get](#method_get)(string $name) Gets a service container parameter. | | | | [remove](#method_remove)(string $name) Removes a parameter. | | | | [set](#method_set)(string $name, mixed $value) Sets a service container parameter. | | | bool | [has](#method_has)(string $name) Returns true if a parameter name is defined. | | | | [resolve](#method_resolve)() Replaces parameter placeholders (%name%) by their values for all parameters. | | | | [resolveValue](#method_resolveValue)(mixed $value) Replaces parameter placeholders (%name%) by their values. | | | mixed | [escapeValue](#method_escapeValue)(mixed $value) Escape parameter placeholders %. | | | mixed | [unescapeValue](#method_unescapeValue)(mixed $value) Unescape parameter placeholders %. | | Details ------- ### clear() Clears all parameters. #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\DependencyInjection\Exception\LogicException") | if the ParameterBagInterface can not be cleared | ### add(array $parameters) Adds parameters to the service container parameters. #### Parameters | | | | | --- | --- | --- | | array | $parameters | An array of parameters | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\DependencyInjection\Exception\LogicException") | if the parameter can not be added | ### array all() Gets the service container parameters. #### Return Value | | | | --- | --- | | array | An array of parameters | ### mixed get(string $name) Gets a service container parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | mixed | The parameter value | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if the parameter is not defined | ### remove(string $name) Removes a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | ### set(string $name, mixed $value) Sets a service container parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | | mixed | $value | The parameter value | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\DependencyInjection\Exception\LogicException") | if the parameter can not be set | ### bool has(string $name) Returns true if a parameter name is defined. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | bool | true if the parameter name is defined, false otherwise | ### resolve() Replaces parameter placeholders (%name%) by their values for all parameters. ### resolveValue(mixed $value) Replaces parameter placeholders (%name%) by their values. #### Parameters | | | | | --- | --- | --- | | mixed | $value | A value | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if a placeholder references a parameter that does not exist | ### mixed escapeValue(mixed $value) Escape parameter placeholders %. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | mixed | | ### mixed unescapeValue(mixed $value) Unescape parameter placeholders %. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | mixed | | symfony FrozenParameterBag FrozenParameterBag =================== class **FrozenParameterBag** extends [ParameterBag](parameterbag "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") Holds read-only parameters. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $parameters | | from [ParameterBag](parameterbag#property_parameters "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | protected | $resolved | | from [ParameterBag](parameterbag#property_resolved "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $parameters = array()) For performance reasons, the constructor assumes that all keys are already lowercased. | | | | [clear](#method_clear)() Clears all parameters. | | | | [add](#method_add)(array $parameters) Adds parameters to the service container parameters. | | | array | [all](#method_all)() Gets the service container parameters. | from [ParameterBag](parameterbag#method_all "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | mixed | [get](#method_get)(string $name) Gets a service container parameter. | from [ParameterBag](parameterbag#method_get "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | | [set](#method_set)(string $name, mixed $value) Sets a service container parameter. | | | bool | [has](#method_has)(string $name) Returns true if a parameter name is defined. | from [ParameterBag](parameterbag#method_has "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | | [remove](#method_remove)(string $name) Removes a parameter. | | | | [resolve](#method_resolve)() Replaces parameter placeholders (%name%) by their values for all parameters. | from [ParameterBag](parameterbag#method_resolve "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | | [resolveValue](#method_resolveValue)(mixed $value, array $resolving = array()) Replaces parameter placeholders (%name%) by their values. | from [ParameterBag](parameterbag#method_resolveValue "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | string | [resolveString](#method_resolveString)(string $value, array $resolving = array()) Resolves parameters inside a string. | from [ParameterBag](parameterbag#method_resolveString "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | | [isResolved](#method_isResolved)() | from [ParameterBag](parameterbag#method_isResolved "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | mixed | [escapeValue](#method_escapeValue)(mixed $value) Escape parameter placeholders %. | from [ParameterBag](parameterbag#method_escapeValue "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | mixed | [unescapeValue](#method_unescapeValue)(mixed $value) Unescape parameter placeholders %. | from [ParameterBag](parameterbag#method_unescapeValue "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | Details ------- ### \_\_construct(array $parameters = array()) For performance reasons, the constructor assumes that all keys are already lowercased. This is always the case when used internally. #### Parameters | | | | | --- | --- | --- | | array | $parameters | An array of parameters | ### clear() Clears all parameters. ### add(array $parameters) Adds parameters to the service container parameters. #### Parameters | | | | | --- | --- | --- | | array | $parameters | An array of parameters | ### array all() Gets the service container parameters. #### Return Value | | | | --- | --- | | array | An array of parameters | ### mixed get(string $name) Gets a service container parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | mixed | The parameter value | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if the parameter is not defined | ### set(string $name, mixed $value) Sets a service container parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | | mixed | $value | The parameter value | ### bool has(string $name) Returns true if a parameter name is defined. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | bool | true if the parameter name is defined, false otherwise | ### remove(string $name) Removes a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | ### resolve() Replaces parameter placeholders (%name%) by their values for all parameters. ### resolveValue(mixed $value, array $resolving = array()) Replaces parameter placeholders (%name%) by their values. #### Parameters | | | | | --- | --- | --- | | mixed | $value | A value | | array | $resolving | An array of keys that are being resolved (used internally to detect circular references) | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if a placeholder references a parameter that does not exist | | [ParameterCircularReferenceException](../exception/parametercircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException") | if a circular reference if detected | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | when a given parameter has a type problem | ### string resolveString(string $value, array $resolving = array()) Resolves parameters inside a string. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to resolve | | array | $resolving | An array of keys that are being resolved (used internally to detect circular references) | #### Return Value | | | | --- | --- | | string | The resolved string | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if a placeholder references a parameter that does not exist | | [ParameterCircularReferenceException](../exception/parametercircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException") | if a circular reference if detected | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | when a given parameter has a type problem | ### isResolved() ### mixed escapeValue(mixed $value) Escape parameter placeholders %. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | mixed | | ### mixed unescapeValue(mixed $value) Unescape parameter placeholders %. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | mixed | | symfony ParameterBag ParameterBag ============= class **ParameterBag** implements [ParameterBagInterface](parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") Holds parameters. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $parameters | | | | protected | $resolved | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $parameters = array()) | | | | [clear](#method_clear)() Clears all parameters. | | | | [add](#method_add)(array $parameters) Adds parameters to the service container parameters. | | | array | [all](#method_all)() Gets the service container parameters. | | | mixed | [get](#method_get)(string $name) Gets a service container parameter. | | | | [set](#method_set)(string $name, mixed $value) Sets a service container parameter. | | | bool | [has](#method_has)(string $name) Returns true if a parameter name is defined. | | | | [remove](#method_remove)(string $name) Removes a parameter. | | | | [resolve](#method_resolve)() Replaces parameter placeholders (%name%) by their values for all parameters. | | | | [resolveValue](#method_resolveValue)(mixed $value, array $resolving = array()) Replaces parameter placeholders (%name%) by their values. | | | string | [resolveString](#method_resolveString)(string $value, array $resolving = array()) Resolves parameters inside a string. | | | | [isResolved](#method_isResolved)() | | | mixed | [escapeValue](#method_escapeValue)(mixed $value) Escape parameter placeholders %. | | | mixed | [unescapeValue](#method_unescapeValue)(mixed $value) Unescape parameter placeholders %. | | Details ------- ### \_\_construct(array $parameters = array()) #### Parameters | | | | | --- | --- | --- | | array | $parameters | An array of parameters | ### clear() Clears all parameters. ### add(array $parameters) Adds parameters to the service container parameters. #### Parameters | | | | | --- | --- | --- | | array | $parameters | An array of parameters | ### array all() Gets the service container parameters. #### Return Value | | | | --- | --- | | array | An array of parameters | ### mixed get(string $name) Gets a service container parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | mixed | The parameter value | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if the parameter is not defined | ### set(string $name, mixed $value) Sets a service container parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | | mixed | $value | The parameter value | ### bool has(string $name) Returns true if a parameter name is defined. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | bool | true if the parameter name is defined, false otherwise | ### remove(string $name) Removes a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | ### resolve() Replaces parameter placeholders (%name%) by their values for all parameters. ### resolveValue(mixed $value, array $resolving = array()) Replaces parameter placeholders (%name%) by their values. #### Parameters | | | | | --- | --- | --- | | mixed | $value | A value | | array | $resolving | An array of keys that are being resolved (used internally to detect circular references) | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if a placeholder references a parameter that does not exist | | [ParameterCircularReferenceException](../exception/parametercircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException") | if a circular reference if detected | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | when a given parameter has a type problem | ### string resolveString(string $value, array $resolving = array()) Resolves parameters inside a string. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to resolve | | array | $resolving | An array of keys that are being resolved (used internally to detect circular references) | #### Return Value | | | | --- | --- | | string | The resolved string | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if a placeholder references a parameter that does not exist | | [ParameterCircularReferenceException](../exception/parametercircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException") | if a circular reference if detected | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | when a given parameter has a type problem | ### isResolved() ### mixed escapeValue(mixed $value) Escape parameter placeholders %. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | mixed | | ### mixed unescapeValue(mixed $value) Unescape parameter placeholders %. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | mixed | | symfony ContainerBag ContainerBag ============= class **ContainerBag** extends [FrozenParameterBag](frozenparameterbag "Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag") implements [ContainerBagInterface](containerbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ContainerBagInterface") Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $parameters | | from [ParameterBag](parameterbag#property_parameters "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | protected | $resolved | | from [ParameterBag](parameterbag#property_resolved "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Container](../container "Symfony\Component\DependencyInjection\Container") $container) For performance reasons, the constructor assumes that all keys are already lowercased. | | | | [clear](#method_clear)() Clears all parameters. | from [FrozenParameterBag](frozenparameterbag#method_clear "Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag") | | | [add](#method_add)(array $parameters) Adds parameters to the service container parameters. | from [FrozenParameterBag](frozenparameterbag#method_add "Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag") | | array | [all](#method_all)() Gets the service container parameters. | | | mixed | [get](#method_get)(string $name) Gets a service container parameter. | | | | [set](#method_set)(string $name, mixed $value) Sets a service container parameter. | from [FrozenParameterBag](frozenparameterbag#method_set "Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag") | | bool | [has](#method_has)(string $name) Returns true if a parameter name is defined. | | | | [remove](#method_remove)(string $name) Removes a parameter. | from [FrozenParameterBag](frozenparameterbag#method_remove "Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag") | | | [resolve](#method_resolve)() Replaces parameter placeholders (%name%) by their values for all parameters. | from [ParameterBag](parameterbag#method_resolve "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | | [resolveValue](#method_resolveValue)(mixed $value, array $resolving = array()) Replaces parameter placeholders (%name%) by their values. | from [ParameterBag](parameterbag#method_resolveValue "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | string | [resolveString](#method_resolveString)(string $value, array $resolving = array()) Resolves parameters inside a string. | from [ParameterBag](parameterbag#method_resolveString "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | | [isResolved](#method_isResolved)() | from [ParameterBag](parameterbag#method_isResolved "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | mixed | [escapeValue](#method_escapeValue)(mixed $value) Escape parameter placeholders %. | from [ParameterBag](parameterbag#method_escapeValue "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | mixed | [unescapeValue](#method_unescapeValue)(mixed $value) Unescape parameter placeholders %. | from [ParameterBag](parameterbag#method_unescapeValue "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | Details ------- ### \_\_construct([Container](../container "Symfony\Component\DependencyInjection\Container") $container) For performance reasons, the constructor assumes that all keys are already lowercased. This is always the case when used internally. #### Parameters | | | | | --- | --- | --- | | [Container](../container "Symfony\Component\DependencyInjection\Container") | $container | | ### clear() Clears all parameters. ### add(array $parameters) Adds parameters to the service container parameters. #### Parameters | | | | | --- | --- | --- | | array | $parameters | An array of parameters | ### array all() Gets the service container parameters. #### Return Value | | | | --- | --- | | array | An array of parameters | ### mixed get(string $name) Gets a service container parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | mixed | The parameter value | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if the parameter is not defined | ### set(string $name, mixed $value) Sets a service container parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | | mixed | $value | The parameter value | ### bool has(string $name) Returns true if a parameter name is defined. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | bool | true if the parameter name is defined, false otherwise | ### remove(string $name) Removes a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | ### resolve() Replaces parameter placeholders (%name%) by their values for all parameters. ### resolveValue(mixed $value, array $resolving = array()) Replaces parameter placeholders (%name%) by their values. #### Parameters | | | | | --- | --- | --- | | mixed | $value | A value | | array | $resolving | An array of keys that are being resolved (used internally to detect circular references) | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if a placeholder references a parameter that does not exist | | [ParameterCircularReferenceException](../exception/parametercircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException") | if a circular reference if detected | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | when a given parameter has a type problem | ### string resolveString(string $value, array $resolving = array()) Resolves parameters inside a string. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to resolve | | array | $resolving | An array of keys that are being resolved (used internally to detect circular references) | #### Return Value | | | | --- | --- | | string | The resolved string | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if a placeholder references a parameter that does not exist | | [ParameterCircularReferenceException](../exception/parametercircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException") | if a circular reference if detected | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | when a given parameter has a type problem | ### isResolved() ### mixed escapeValue(mixed $value) Escape parameter placeholders %. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | mixed | | ### mixed unescapeValue(mixed $value) Unescape parameter placeholders %. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | mixed | |
programming_docs
symfony PhpFileLoader PhpFileLoader ============== class **PhpFileLoader** extends [FileLoader](fileloader "Symfony\Component\DependencyInjection\Loader\FileLoader") PhpFileLoader loads service definitions from a PHP file. The PHP file is required and the $container variable can be used within the file to change the container. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](../../config/loader/fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](../../config/loader/fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | | protected | $container | | from [FileLoader](fileloader#property_container "Symfony\Component\DependencyInjection\Loader\FileLoader") | | protected | $isLoadingInstanceof | | from [FileLoader](fileloader#property_isLoadingInstanceof "Symfony\Component\DependencyInjection\Loader\FileLoader") | | protected | $instanceof | | from [FileLoader](fileloader#property_instanceof "Symfony\Component\DependencyInjection\Loader\FileLoader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](../../config/loader/fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) | from [FileLoader](fileloader#method___construct "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](../../config/loader/fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](../../config/loader/fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](../../config/loader/fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [registerClasses](#method_registerClasses)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $prototype, string $namespace, string $resource, string $exclude = null) Registers a set of classes as services using PSR-4 for discovery. | from [FileLoader](fileloader#method_registerClasses "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [setDefinition](#method_setDefinition)(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Registers a definition in the container with its instanceof-conditionals. | from [FileLoader](fileloader#method_setDefinition "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [load](#method_load)(mixed $resource, string|null $type = null) Loads a resource. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../../config/exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../../config/exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### registerClasses([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $prototype, string $namespace, string $resource, string $exclude = null) Registers a set of classes as services using PSR-4 for discovery. #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $prototype | A definition to use as template | | string | $namespace | The namespace prefix of classes in the scanned directory | | string | $resource | The directory to look for classes, glob-patterns allowed | | string | $exclude | A globed path of files to exclude | ### protected setDefinition(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Registers a definition in the container with its instanceof-conditionals. #### Parameters | | | | | --- | --- | --- | | string | $id | | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | ### load(mixed $resource, string|null $type = null) Loads a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | The resource | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | If something went wrong | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | symfony FileLoader FileLoader =========== abstract class **FileLoader** extends [FileLoader](../../config/loader/fileloader "Symfony\Component\Config\Loader\FileLoader") FileLoader is the abstract class used by all built-in loaders that are file based. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](../../config/loader/fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](../../config/loader/fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | | protected | $container | | | | protected | $isLoadingInstanceof | | | | protected | $instanceof | | | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](../../config/loader/fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) | | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](../../config/loader/fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](../../config/loader/fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](../../config/loader/fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [registerClasses](#method_registerClasses)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $prototype, string $namespace, string $resource, string $exclude = null) Registers a set of classes as services using PSR-4 for discovery. | | | | [setDefinition](#method_setDefinition)(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Registers a definition in the container with its instanceof-conditionals. | | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../../config/exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../../config/exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### registerClasses([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $prototype, string $namespace, string $resource, string $exclude = null) Registers a set of classes as services using PSR-4 for discovery. #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $prototype | A definition to use as template | | string | $namespace | The namespace prefix of classes in the scanned directory | | string | $resource | The directory to look for classes, glob-patterns allowed | | string | $exclude | A globed path of files to exclude | ### protected setDefinition(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Registers a definition in the container with its instanceof-conditionals. #### Parameters | | | | | --- | --- | --- | | string | $id | | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | symfony ProtectedPhpFileLoader ProtectedPhpFileLoader ======================= class **ProtectedPhpFileLoader** extends [PhpFileLoader](phpfileloader "Symfony\Component\DependencyInjection\Loader\PhpFileLoader") Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](../../config/loader/fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](../../config/loader/fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | | protected | $container | | from [FileLoader](fileloader#property_container "Symfony\Component\DependencyInjection\Loader\FileLoader") | | protected | $isLoadingInstanceof | | from [FileLoader](fileloader#property_isLoadingInstanceof "Symfony\Component\DependencyInjection\Loader\FileLoader") | | protected | $instanceof | | from [FileLoader](fileloader#property_instanceof "Symfony\Component\DependencyInjection\Loader\FileLoader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](../../config/loader/fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) | from [FileLoader](fileloader#method___construct "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](../../config/loader/fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](../../config/loader/fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](../../config/loader/fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [registerClasses](#method_registerClasses)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $prototype, string $namespace, string $resource, string $exclude = null) Registers a set of classes as services using PSR-4 for discovery. | from [FileLoader](fileloader#method_registerClasses "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [setDefinition](#method_setDefinition)(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Registers a definition in the container with its instanceof-conditionals. | from [FileLoader](fileloader#method_setDefinition "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [load](#method_load)(mixed $resource, string|null $type = null) Loads a resource. | from [PhpFileLoader](phpfileloader#method_load "Symfony\Component\DependencyInjection\Loader\PhpFileLoader") | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | from [PhpFileLoader](phpfileloader#method_supports "Symfony\Component\DependencyInjection\Loader\PhpFileLoader") | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../../config/exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../../config/exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### registerClasses([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $prototype, string $namespace, string $resource, string $exclude = null) Registers a set of classes as services using PSR-4 for discovery. #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $prototype | A definition to use as template | | string | $namespace | The namespace prefix of classes in the scanned directory | | string | $resource | The directory to look for classes, glob-patterns allowed | | string | $exclude | A globed path of files to exclude | ### protected setDefinition(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Registers a definition in the container with its instanceof-conditionals. #### Parameters | | | | | --- | --- | --- | | string | $id | | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | ### load(mixed $resource, string|null $type = null) Loads a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | The resource | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | If something went wrong | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise |
programming_docs
symfony IniFileLoader IniFileLoader ============== class **IniFileLoader** extends [FileLoader](fileloader "Symfony\Component\DependencyInjection\Loader\FileLoader") IniFileLoader loads parameters from INI files. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](../../config/loader/fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](../../config/loader/fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | | protected | $container | | from [FileLoader](fileloader#property_container "Symfony\Component\DependencyInjection\Loader\FileLoader") | | protected | $isLoadingInstanceof | | from [FileLoader](fileloader#property_isLoadingInstanceof "Symfony\Component\DependencyInjection\Loader\FileLoader") | | protected | $instanceof | | from [FileLoader](fileloader#property_instanceof "Symfony\Component\DependencyInjection\Loader\FileLoader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](../../config/loader/fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) | from [FileLoader](fileloader#method___construct "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](../../config/loader/fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](../../config/loader/fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](../../config/loader/fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [registerClasses](#method_registerClasses)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $prototype, string $namespace, string $resource, string $exclude = null) Registers a set of classes as services using PSR-4 for discovery. | from [FileLoader](fileloader#method_registerClasses "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [setDefinition](#method_setDefinition)(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Registers a definition in the container with its instanceof-conditionals. | from [FileLoader](fileloader#method_setDefinition "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [load](#method_load)(mixed $resource, string|null $type = null) Loads a resource. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../../config/exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../../config/exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### registerClasses([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $prototype, string $namespace, string $resource, string $exclude = null) Registers a set of classes as services using PSR-4 for discovery. #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $prototype | A definition to use as template | | string | $namespace | The namespace prefix of classes in the scanned directory | | string | $resource | The directory to look for classes, glob-patterns allowed | | string | $exclude | A globed path of files to exclude | ### protected setDefinition(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Registers a definition in the container with its instanceof-conditionals. #### Parameters | | | | | --- | --- | --- | | string | $id | | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | ### load(mixed $resource, string|null $type = null) Loads a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | The resource | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | If something went wrong | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | symfony DirectoryLoader DirectoryLoader ================ class **DirectoryLoader** extends [FileLoader](fileloader "Symfony\Component\DependencyInjection\Loader\FileLoader") DirectoryLoader is a recursive loader to go through directories. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](../../config/loader/fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](../../config/loader/fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | | protected | $container | | from [FileLoader](fileloader#property_container "Symfony\Component\DependencyInjection\Loader\FileLoader") | | protected | $isLoadingInstanceof | | from [FileLoader](fileloader#property_isLoadingInstanceof "Symfony\Component\DependencyInjection\Loader\FileLoader") | | protected | $instanceof | | from [FileLoader](fileloader#property_instanceof "Symfony\Component\DependencyInjection\Loader\FileLoader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](../../config/loader/fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) | from [FileLoader](fileloader#method___construct "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](../../config/loader/fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](../../config/loader/fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](../../config/loader/fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [registerClasses](#method_registerClasses)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $prototype, string $namespace, string $resource, string $exclude = null) Registers a set of classes as services using PSR-4 for discovery. | from [FileLoader](fileloader#method_registerClasses "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [setDefinition](#method_setDefinition)(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Registers a definition in the container with its instanceof-conditionals. | from [FileLoader](fileloader#method_setDefinition "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [load](#method_load)($file, string|null $type = null) Loads a resource. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../../config/exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../../config/exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### registerClasses([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $prototype, string $namespace, string $resource, string $exclude = null) Registers a set of classes as services using PSR-4 for discovery. #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $prototype | A definition to use as template | | string | $namespace | The namespace prefix of classes in the scanned directory | | string | $resource | The directory to look for classes, glob-patterns allowed | | string | $exclude | A globed path of files to exclude | ### protected setDefinition(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Registers a definition in the container with its instanceof-conditionals. #### Parameters | | | | | --- | --- | --- | | string | $id | | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | ### load($file, string|null $type = null) Loads a resource. #### Parameters | | | | | --- | --- | --- | | | $file | | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | If something went wrong | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise |
programming_docs
symfony ClosureLoader ClosureLoader ============== class **ClosureLoader** extends [Loader](../../config/loader/loader "Symfony\Component\Config\Loader\Loader") ClosureLoader loads service definitions from a PHP closure. The Closure has access to the container as its first argument. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null) Imports a resource. | from [Loader](../../config/loader/loader#method_import "Symfony\Component\Config\Loader\Loader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) | | | | [load](#method_load)(mixed $resource, string|null $type = null) Loads a resource. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | mixed | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### load(mixed $resource, string|null $type = null) Loads a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | The resource | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | If something went wrong | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | symfony GlobFileLoader GlobFileLoader =============== class **GlobFileLoader** extends [FileLoader](fileloader "Symfony\Component\DependencyInjection\Loader\FileLoader") GlobFileLoader loads files from a glob pattern. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](../../config/loader/fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](../../config/loader/fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | | protected | $container | | from [FileLoader](fileloader#property_container "Symfony\Component\DependencyInjection\Loader\FileLoader") | | protected | $isLoadingInstanceof | | from [FileLoader](fileloader#property_isLoadingInstanceof "Symfony\Component\DependencyInjection\Loader\FileLoader") | | protected | $instanceof | | from [FileLoader](fileloader#property_instanceof "Symfony\Component\DependencyInjection\Loader\FileLoader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](../../config/loader/fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) | from [FileLoader](fileloader#method___construct "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](../../config/loader/fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](../../config/loader/fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](../../config/loader/fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [registerClasses](#method_registerClasses)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $prototype, string $namespace, string $resource, string $exclude = null) Registers a set of classes as services using PSR-4 for discovery. | from [FileLoader](fileloader#method_registerClasses "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [setDefinition](#method_setDefinition)(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Registers a definition in the container with its instanceof-conditionals. | from [FileLoader](fileloader#method_setDefinition "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [load](#method_load)(mixed $resource, string|null $type = null) Loads a resource. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../../config/exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../../config/exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### registerClasses([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $prototype, string $namespace, string $resource, string $exclude = null) Registers a set of classes as services using PSR-4 for discovery. #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $prototype | A definition to use as template | | string | $namespace | The namespace prefix of classes in the scanned directory | | string | $resource | The directory to look for classes, glob-patterns allowed | | string | $exclude | A globed path of files to exclude | ### protected setDefinition(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Registers a definition in the container with its instanceof-conditionals. #### Parameters | | | | | --- | --- | --- | | string | $id | | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | ### load(mixed $resource, string|null $type = null) Loads a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | The resource | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | If something went wrong | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | symfony YamlFileLoader YamlFileLoader =============== class **YamlFileLoader** extends [FileLoader](fileloader "Symfony\Component\DependencyInjection\Loader\FileLoader") YamlFileLoader loads YAML files service definitions. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](../../config/loader/fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](../../config/loader/fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | | protected | $container | | from [FileLoader](fileloader#property_container "Symfony\Component\DependencyInjection\Loader\FileLoader") | | protected | $isLoadingInstanceof | | from [FileLoader](fileloader#property_isLoadingInstanceof "Symfony\Component\DependencyInjection\Loader\FileLoader") | | protected | $instanceof | | from [FileLoader](fileloader#property_instanceof "Symfony\Component\DependencyInjection\Loader\FileLoader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](../../config/loader/fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) | from [FileLoader](fileloader#method___construct "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](../../config/loader/fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](../../config/loader/fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](../../config/loader/fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [registerClasses](#method_registerClasses)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $prototype, string $namespace, string $resource, string $exclude = null) Registers a set of classes as services using PSR-4 for discovery. | from [FileLoader](fileloader#method_registerClasses "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [setDefinition](#method_setDefinition)(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Registers a definition in the container with its instanceof-conditionals. | from [FileLoader](fileloader#method_setDefinition "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [load](#method_load)(mixed $resource, string|null $type = null) Loads a resource. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | | array | [loadFile](#method_loadFile)(string $file) Loads a YAML file. | | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../../config/exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../../config/exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### registerClasses([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $prototype, string $namespace, string $resource, string $exclude = null) Registers a set of classes as services using PSR-4 for discovery. #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $prototype | A definition to use as template | | string | $namespace | The namespace prefix of classes in the scanned directory | | string | $resource | The directory to look for classes, glob-patterns allowed | | string | $exclude | A globed path of files to exclude | ### protected setDefinition(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Registers a definition in the container with its instanceof-conditionals. #### Parameters | | | | | --- | --- | --- | | string | $id | | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | ### load(mixed $resource, string|null $type = null) Loads a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | The resource | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | If something went wrong | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | ### protected array loadFile(string $file) Loads a YAML file. #### Parameters | | | | | --- | --- | --- | | string | $file | | #### Return Value | | | | --- | --- | | array | The file content | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when the given file is not a local file or when it does not exist |
programming_docs
symfony XmlFileLoader XmlFileLoader ============== class **XmlFileLoader** extends [FileLoader](fileloader "Symfony\Component\DependencyInjection\Loader\FileLoader") XmlFileLoader loads XML files service definitions. Constants --------- | | | | --- | --- | | NS | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $resolver | | from [Loader](../../config/loader/loader#property_resolver "Symfony\Component\Config\Loader\Loader") | | static protected | $loading | | from [FileLoader](../../config/loader/fileloader#property_loading "Symfony\Component\Config\Loader\FileLoader") | | protected | $locator | | from [FileLoader](../../config/loader/fileloader#property_locator "Symfony\Component\Config\Loader\FileLoader") | | protected | $container | | from [FileLoader](fileloader#property_container "Symfony\Component\DependencyInjection\Loader\FileLoader") | | protected | $isLoadingInstanceof | | from [FileLoader](fileloader#property_isLoadingInstanceof "Symfony\Component\DependencyInjection\Loader\FileLoader") | | protected | $instanceof | | from [FileLoader](fileloader#property_instanceof "Symfony\Component\DependencyInjection\Loader\FileLoader") | Methods ------- | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | [getResolver](#method_getResolver)() Gets the loader resolver. | from [Loader](../../config/loader/loader#method_getResolver "Symfony\Component\Config\Loader\Loader") | | | [setResolver](#method_setResolver)([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. | from [Loader](../../config/loader/loader#method_setResolver "Symfony\Component\Config\Loader\Loader") | | mixed | [import](#method_import)(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. | from [FileLoader](../../config/loader/fileloader#method_import "Symfony\Component\Config\Loader\FileLoader") | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | [resolve](#method_resolve)(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. | from [Loader](../../config/loader/loader#method_resolve "Symfony\Component\Config\Loader\Loader") | | | [\_\_construct](#method___construct)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) | from [FileLoader](fileloader#method___construct "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [setCurrentDir](#method_setCurrentDir)(string $dir) Sets the current directory. | from [FileLoader](../../config/loader/fileloader#method_setCurrentDir "Symfony\Component\Config\Loader\FileLoader") | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | [getLocator](#method_getLocator)() Returns the file locator used by this loader. | from [FileLoader](../../config/loader/fileloader#method_getLocator "Symfony\Component\Config\Loader\FileLoader") | | | [glob](#method_glob)(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) | from [FileLoader](../../config/loader/fileloader#method_glob "Symfony\Component\Config\Loader\FileLoader") | | | [registerClasses](#method_registerClasses)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $prototype, string $namespace, string $resource, string $exclude = null) Registers a set of classes as services using PSR-4 for discovery. | from [FileLoader](fileloader#method_registerClasses "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [setDefinition](#method_setDefinition)(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Registers a definition in the container with its instanceof-conditionals. | from [FileLoader](fileloader#method_setDefinition "Symfony\Component\DependencyInjection\Loader\FileLoader") | | | [load](#method_load)(mixed $resource, string|null $type = null) Loads a resource. | | | bool | [supports](#method_supports)(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. | | | bool | [validateSchema](#method_validateSchema)([DOMDocument](http://php.net/DOMDocument) $dom) Validates a documents XML schema. | | | static array | [convertDomElementToArray](#method_convertDomElementToArray)([DOMElement](http://php.net/DOMElement) $element) Converts a \DOMElement object to a PHP array. | | Details ------- ### [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") getResolver() Gets the loader resolver. #### Return Value | | | | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | A LoaderResolverInterface instance | ### setResolver([LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") $resolver) Sets the loader resolver. #### Parameters | | | | | --- | --- | --- | | [LoaderResolverInterface](../../config/loader/loaderresolverinterface "Symfony\Component\Config\Loader\LoaderResolverInterface") | $resolver | | ### mixed import(mixed $resource, string|null $type = null, bool $ignoreErrors = false, string|null $sourceResource = null) Imports a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | | bool | $ignoreErrors | Whether to ignore import errors or not | | string|null | $sourceResource | The original resource importing the new resource | #### Return Value | | | | --- | --- | | mixed | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | | | [FileLoaderImportCircularReferenceException](../../config/exception/fileloaderimportcircularreferenceexception "Symfony\Component\Config\Exception\FileLoaderImportCircularReferenceException") | | | [FileLocatorFileNotFoundException](../../config/exception/filelocatorfilenotfoundexception "Symfony\Component\Config\Exception\FileLocatorFileNotFoundException") | | ### $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") resolve(mixed $resource, string|null $type = null) Finds a loader able to load an imported resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | $this|[LoaderInterface](../../config/loader/loaderinterface "Symfony\Component\Config\Loader\LoaderInterface") | | #### Exceptions | | | | --- | --- | | [FileLoaderLoadException](../../config/exception/fileloaderloadexception "Symfony\Component\Config\Exception\FileLoaderLoadException") | If no loader is found | ### \_\_construct([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") $locator) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | $locator | | ### setCurrentDir(string $dir) Sets the current directory. #### Parameters | | | | | --- | --- | --- | | string | $dir | | ### [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") getLocator() Returns the file locator used by this loader. #### Return Value | | | | --- | --- | | [FileLocatorInterface](../../config/filelocatorinterface "Symfony\Component\Config\FileLocatorInterface") | | ### protected glob(string $pattern, bool $recursive, $resource = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $pattern | | | bool | $recursive | | | | $resource | | | bool | $ignoreErrors | | ### registerClasses([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $prototype, string $namespace, string $resource, string $exclude = null) Registers a set of classes as services using PSR-4 for discovery. #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $prototype | A definition to use as template | | string | $namespace | The namespace prefix of classes in the scanned directory | | string | $resource | The directory to look for classes, glob-patterns allowed | | string | $exclude | A globed path of files to exclude | ### protected setDefinition(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Registers a definition in the container with its instanceof-conditionals. #### Parameters | | | | | --- | --- | --- | | string | $id | | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | ### load(mixed $resource, string|null $type = null) Loads a resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | The resource | | string|null | $type | The resource type or null if unknown | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | If something went wrong | ### bool supports(mixed $resource, string|null $type = null) Returns whether this class supports the given resource. #### Parameters | | | | | --- | --- | --- | | mixed | $resource | A resource | | string|null | $type | The resource type or null if unknown | #### Return Value | | | | --- | --- | | bool | True if this class supports the given resource, false otherwise | ### bool validateSchema([DOMDocument](http://php.net/DOMDocument) $dom) Validates a documents XML schema. #### Parameters | | | | | --- | --- | --- | | [DOMDocument](http://php.net/DOMDocument) | $dom | | #### Return Value | | | | --- | --- | | bool | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | When extension references a non-existent XSD file | ### static array convertDomElementToArray([DOMElement](http://php.net/DOMElement) $element) Converts a \DOMElement object to a PHP array. The following rules applies during the conversion: * Each tag is converted to a key value or an array if there is more than one "value" * The content of a tag is set under a "value" key (bar) if the tag also has some nested tags * The attributes are converted to keys () * The nested-tags are converted to keys (bar) #### Parameters | | | | | --- | --- | --- | | [DOMElement](http://php.net/DOMElement) | $element | A \DOMElement instance | #### Return Value | | | | --- | --- | | array | A PHP array | symfony Symfony\Component\DependencyInjection\Loader\Configurator Symfony\Component\DependencyInjection\Loader\Configurator ========================================================= Namespaces ---------- [Symfony\Component\DependencyInjection\Loader\Configurator\Traits](configurator/traits) Classes ------- | | | | --- | --- | | [AbstractConfigurator](configurator/abstractconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | | [AbstractServiceConfigurator](configurator/abstractserviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | | [AliasConfigurator](configurator/aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") | | | [ContainerConfigurator](configurator/containerconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator") | | | [DefaultsConfigurator](configurator/defaultsconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\DefaultsConfigurator") | | | [InlineServiceConfigurator](configurator/inlineserviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\InlineServiceConfigurator") | | | [InstanceofConfigurator](configurator/instanceofconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\InstanceofConfigurator") | | | [ParametersConfigurator](configurator/parametersconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ParametersConfigurator") | | | [PrototypeConfigurator](configurator/prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") | | | [ReferenceConfigurator](configurator/referenceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ReferenceConfigurator") | | | [ServiceConfigurator](configurator/serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | | [ServicesConfigurator](configurator/servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") | | symfony InstanceofConfigurator InstanceofConfigurator ======================= class **InstanceofConfigurator** extends [AbstractServiceConfigurator](abstractserviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") Traits ------ | | | | --- | --- | | [AutowireTrait](traits/autowiretrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutowireTrait") | | | [CallTrait](traits/calltrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\CallTrait") | | | [ConfiguratorTrait](traits/configuratortrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ConfiguratorTrait") | | | [LazyTrait](traits/lazytrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\LazyTrait") | | | [PropertyTrait](traits/propertytrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PropertyTrait") | | | [PublicTrait](traits/publictrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PublicTrait") | | | [ShareTrait](traits/sharetrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ShareTrait") | | | [TagTrait](traits/tagtrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\TagTrait") | | Constants --------- | | | | --- | --- | | FACTORY | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $definition | | from [AbstractConfigurator](abstractconfigurator#property_definition "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | protected | $parent | | from [AbstractServiceConfigurator](abstractserviceconfigurator#property_parent "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | protected | $id | | from [AbstractServiceConfigurator](abstractserviceconfigurator#property_id "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | Methods ------- | | | | | --- | --- | --- | | | [\_\_call](#method___call)($method, $args) | from [AbstractConfigurator](abstractconfigurator#method___call "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | static mixed | [processValue](#method_processValue)(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. | from [AbstractConfigurator](abstractconfigurator#method_processValue "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | | [\_\_construct](#method___construct)([ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") $parent, [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $id = null, array $defaultTags = array()) | from [AbstractServiceConfigurator](abstractserviceconfigurator#method___construct "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | | [\_\_destruct](#method___destruct)() | from [AbstractServiceConfigurator](abstractserviceconfigurator#method___destruct "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [set](#method_set)(string $id, string $class = null) Registers a service. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_set "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") | [alias](#method_alias)(string $id, string $referencedId) Creates an alias. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_alias "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") | [load](#method_load)(string $namespace, string $resource) Registers a PSR-4 namespace using a glob pattern. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_load "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [get](#method_get)(string $id) Gets an already defined service definition. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_get "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [\_\_invoke](#method___invoke)(string $id, string $class = null) Registers a service. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method___invoke "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | $this | [autowire](#method_autowire)(bool $autowired = true) Enables/disables autowiring. | from [AutowireTrait](traits/autowiretrait#method_autowire "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutowireTrait") | | $this | [call](#method_call)(string $method, array $arguments = array()) Adds a method to call after service initialization. | from [CallTrait](traits/calltrait#method_call "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\CallTrait") | | $this | [configurator](#method_configurator)(string|array $configurator) Sets a configurator to call after the service is fully initialized. | from [ConfiguratorTrait](traits/configuratortrait#method_configurator "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ConfiguratorTrait") | | $this | [lazy](#method_lazy)(bool $lazy = true) Sets the lazy flag of this service. | from [LazyTrait](traits/lazytrait#method_lazy "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\LazyTrait") | | $this | [property](#method_property)(string $name, $value) Sets a specific property. | from [PropertyTrait](traits/propertytrait#method_property "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PropertyTrait") | | $this | [public](#method_public)() | from [PublicTrait](traits/publictrait#method_public "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PublicTrait") | | $this | [private](#method_private)() | from [PublicTrait](traits/publictrait#method_private "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PublicTrait") | | $this | [share](#method_share)(bool $shared = true) Sets if the service must be shared or not. | from [ShareTrait](traits/sharetrait#method_share "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ShareTrait") | | $this | [tag](#method_tag)(string $name, array $attributes = array()) Adds a tag for this definition. | from [TagTrait](traits/tagtrait#method_tag "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\TagTrait") | | [InstanceofConfigurator](instanceofconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\InstanceofConfigurator") | [instanceof](#method_instanceof)(string $fqcn) Defines an instanceof-conditional to be applied to following service definitions. | | Details ------- ### \_\_call($method, $args) #### Parameters | | | | | --- | --- | --- | | | $method | | | | $args | | ### static mixed processValue(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $allowServices | whether Definition and Reference are allowed; by default, only scalars and arrays are | #### Return Value | | | | --- | --- | | mixed | the value, optionally cast to a Definition/Reference | ### \_\_construct([ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") $parent, [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $id = null, array $defaultTags = array()) #### Parameters | | | | | --- | --- | --- | | [ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") | $parent | | | [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $id | | | array | $defaultTags | | ### \_\_destruct() ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") set(string $id, string $class = null) Registers a service. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $class | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | ### final [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") alias(string $id, string $referencedId) Creates an alias. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $referencedId | | #### Return Value | | | | --- | --- | | [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") | | ### final [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") load(string $namespace, string $resource) Registers a PSR-4 namespace using a glob pattern. #### Parameters | | | | | --- | --- | --- | | string | $namespace | | | string | $resource | | #### Return Value | | | | --- | --- | | [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") | | ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") get(string $id) Gets an already defined service definition. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | #### Exceptions | | | | --- | --- | | [ServiceNotFoundException](../../exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | if the service definition does not exist | ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") \_\_invoke(string $id, string $class = null) Registers a service. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $class | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | ### final $this autowire(bool $autowired = true) Enables/disables autowiring. #### Parameters | | | | | --- | --- | --- | | bool | $autowired | | #### Return Value | | | | --- | --- | | $this | | ### final $this call(string $method, array $arguments = array()) Adds a method to call after service initialization. #### Parameters | | | | | --- | --- | --- | | string | $method | The method name to call | | array | $arguments | An array of arguments to pass to the method call | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | on empty $method param | ### final $this configurator(string|array $configurator) Sets a configurator to call after the service is fully initialized. #### Parameters | | | | | --- | --- | --- | | string|array | $configurator | A PHP callable reference | #### Return Value | | | | --- | --- | | $this | | ### final $this lazy(bool $lazy = true) Sets the lazy flag of this service. #### Parameters | | | | | --- | --- | --- | | bool | $lazy | | #### Return Value | | | | --- | --- | | $this | | ### final $this property(string $name, $value) Sets a specific property. #### Parameters | | | | | --- | --- | --- | | string | $name | | | | $value | | #### Return Value | | | | --- | --- | | $this | | ### final $this public() #### Return Value | | | | --- | --- | | $this | | ### final $this private() #### Return Value | | | | --- | --- | | $this | | ### final $this share(bool $shared = true) Sets if the service must be shared or not. #### Parameters | | | | | --- | --- | --- | | bool | $shared | Whether the service must be shared or not | #### Return Value | | | | --- | --- | | $this | | ### final $this tag(string $name, array $attributes = array()) Adds a tag for this definition. #### Parameters | | | | | --- | --- | --- | | string | $name | The tag name | | array | $attributes | An array of attributes | #### Return Value | | | | --- | --- | | $this | | ### final [InstanceofConfigurator](instanceofconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\InstanceofConfigurator") instanceof(string $fqcn) Defines an instanceof-conditional to be applied to following service definitions. #### Parameters | | | | | --- | --- | --- | | string | $fqcn | | #### Return Value | | | | --- | --- | | [InstanceofConfigurator](instanceofconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\InstanceofConfigurator") | |
programming_docs
symfony InlineServiceConfigurator InlineServiceConfigurator ========================== class **InlineServiceConfigurator** extends [AbstractConfigurator](abstractconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") Traits ------ | | | | --- | --- | | [ArgumentTrait](traits/argumenttrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ArgumentTrait") | | | [AutowireTrait](traits/autowiretrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutowireTrait") | | | [BindTrait](traits/bindtrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\BindTrait") | | | [FactoryTrait](traits/factorytrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\FactoryTrait") | | | [FileTrait](traits/filetrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\FileTrait") | | | [LazyTrait](traits/lazytrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\LazyTrait") | | | [ParentTrait](traits/parenttrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ParentTrait") | | | [TagTrait](traits/tagtrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\TagTrait") | | Constants --------- | | | | --- | --- | | FACTORY | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $definition | | from [AbstractConfigurator](abstractconfigurator#property_definition "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | Methods ------- | | | | | --- | --- | --- | | | [\_\_call](#method___call)($method, $args) | from [AbstractConfigurator](abstractconfigurator#method___call "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | static mixed | [processValue](#method_processValue)(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. | from [AbstractConfigurator](abstractconfigurator#method_processValue "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | $this | [args](#method_args)(array $arguments) Sets the arguments to pass to the service constructor/factory method. | from [ArgumentTrait](traits/argumenttrait#method_args "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ArgumentTrait") | | $this | [arg](#method_arg)(string|int $key, mixed $value) Sets one argument to pass to the service constructor/factory method. | from [ArgumentTrait](traits/argumenttrait#method_arg "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ArgumentTrait") | | $this | [autowire](#method_autowire)(bool $autowired = true) Enables/disables autowiring. | from [AutowireTrait](traits/autowiretrait#method_autowire "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutowireTrait") | | $this | [bind](#method_bind)(string $nameOrFqcn, mixed $valueOrRef) Sets bindings. | from [BindTrait](traits/bindtrait#method_bind "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\BindTrait") | | $this | [factory](#method_factory)(string|array $factory) Sets a factory. | from [FactoryTrait](traits/factorytrait#method_factory "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\FactoryTrait") | | $this | [file](#method_file)(string $file) Sets a file to require before creating the service. | from [FileTrait](traits/filetrait#method_file "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\FileTrait") | | $this | [lazy](#method_lazy)(bool $lazy = true) Sets the lazy flag of this service. | from [LazyTrait](traits/lazytrait#method_lazy "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\LazyTrait") | | $this | [parent](#method_parent)(string $parent) Sets the Definition to inherit from. | from [ParentTrait](traits/parenttrait#method_parent "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ParentTrait") | | $this | [tag](#method_tag)(string $name, array $attributes = array()) Adds a tag for this definition. | from [TagTrait](traits/tagtrait#method_tag "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\TagTrait") | | | [\_\_construct](#method___construct)([Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition) | | Details ------- ### \_\_call($method, $args) #### Parameters | | | | | --- | --- | --- | | | $method | | | | $args | | ### static mixed processValue(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $allowServices | whether Definition and Reference are allowed; by default, only scalars and arrays are | #### Return Value | | | | --- | --- | | mixed | the value, optionally cast to a Definition/Reference | ### final $this args(array $arguments) Sets the arguments to pass to the service constructor/factory method. #### Parameters | | | | | --- | --- | --- | | array | $arguments | An array of arguments | #### Return Value | | | | --- | --- | | $this | | ### final $this arg(string|int $key, mixed $value) Sets one argument to pass to the service constructor/factory method. #### Parameters | | | | | --- | --- | --- | | string|int | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### final $this autowire(bool $autowired = true) Enables/disables autowiring. #### Parameters | | | | | --- | --- | --- | | bool | $autowired | | #### Return Value | | | | --- | --- | | $this | | ### final $this bind(string $nameOrFqcn, mixed $valueOrRef) Sets bindings. Bindings map $named or FQCN arguments to values that should be injected in the matching parameters (of the constructor, of methods called and of controller actions). #### Parameters | | | | | --- | --- | --- | | string | $nameOrFqcn | A parameter name with its "$" prefix, or a FQCN | | mixed | $valueOrRef | The value or reference to bind | #### Return Value | | | | --- | --- | | $this | | ### final $this factory(string|array $factory) Sets a factory. #### Parameters | | | | | --- | --- | --- | | string|array | $factory | A PHP callable reference | #### Return Value | | | | --- | --- | | $this | | ### final $this file(string $file) Sets a file to require before creating the service. #### Parameters | | | | | --- | --- | --- | | string | $file | A full pathname to include | #### Return Value | | | | --- | --- | | $this | | ### final $this lazy(bool $lazy = true) Sets the lazy flag of this service. #### Parameters | | | | | --- | --- | --- | | bool | $lazy | | #### Return Value | | | | --- | --- | | $this | | ### final $this parent(string $parent) Sets the Definition to inherit from. #### Parameters | | | | | --- | --- | --- | | string | $parent | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when parent cannot be set | ### final $this tag(string $name, array $attributes = array()) Adds a tag for this definition. #### Parameters | | | | | --- | --- | --- | | string | $name | The tag name | | array | $attributes | An array of attributes | #### Return Value | | | | --- | --- | | $this | | ### \_\_construct([Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition) #### Parameters | | | | | --- | --- | --- | | [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | symfony DefaultsConfigurator DefaultsConfigurator ===================== class **DefaultsConfigurator** extends [AbstractServiceConfigurator](abstractserviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") Traits ------ | | | | --- | --- | | [AutoconfigureTrait](traits/autoconfiguretrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutoconfigureTrait") | | | [AutowireTrait](traits/autowiretrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutowireTrait") | | | [BindTrait](traits/bindtrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\BindTrait") | | | [PublicTrait](traits/publictrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PublicTrait") | | Constants --------- | | | | --- | --- | | FACTORY | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $definition | | from [AbstractConfigurator](abstractconfigurator#property_definition "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | protected | $parent | | from [AbstractServiceConfigurator](abstractserviceconfigurator#property_parent "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | protected | $id | | from [AbstractServiceConfigurator](abstractserviceconfigurator#property_id "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | Methods ------- | | | | | --- | --- | --- | | | [\_\_call](#method___call)($method, $args) | from [AbstractConfigurator](abstractconfigurator#method___call "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | static mixed | [processValue](#method_processValue)(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. | from [AbstractConfigurator](abstractconfigurator#method_processValue "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | | [\_\_construct](#method___construct)([ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") $parent, [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $id = null, array $defaultTags = array()) | from [AbstractServiceConfigurator](abstractserviceconfigurator#method___construct "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | | [\_\_destruct](#method___destruct)() | from [AbstractServiceConfigurator](abstractserviceconfigurator#method___destruct "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [set](#method_set)(string $id, string $class = null) Registers a service. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_set "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") | [alias](#method_alias)(string $id, string $referencedId) Creates an alias. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_alias "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") | [load](#method_load)(string $namespace, string $resource) Registers a PSR-4 namespace using a glob pattern. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_load "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [get](#method_get)(string $id) Gets an already defined service definition. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_get "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [\_\_invoke](#method___invoke)(string $id, string $class = null) Registers a service. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method___invoke "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | $this | [autoconfigure](#method_autoconfigure)(bool $autoconfigured = true) Sets whether or not instanceof conditionals should be prepended with a global set. | from [AutoconfigureTrait](traits/autoconfiguretrait#method_autoconfigure "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutoconfigureTrait") | | $this | [autowire](#method_autowire)(bool $autowired = true) Enables/disables autowiring. | from [AutowireTrait](traits/autowiretrait#method_autowire "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutowireTrait") | | $this | [bind](#method_bind)(string $nameOrFqcn, mixed $valueOrRef) Sets bindings. | from [BindTrait](traits/bindtrait#method_bind "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\BindTrait") | | $this | [public](#method_public)() | from [PublicTrait](traits/publictrait#method_public "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PublicTrait") | | $this | [private](#method_private)() | from [PublicTrait](traits/publictrait#method_private "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PublicTrait") | | $this | [tag](#method_tag)(string $name, array $attributes = array()) Adds a tag for this definition. | | | [InstanceofConfigurator](instanceofconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\InstanceofConfigurator") | [instanceof](#method_instanceof)(string $fqcn) Defines an instanceof-conditional to be applied to following service definitions. | | Details ------- ### \_\_call($method, $args) #### Parameters | | | | | --- | --- | --- | | | $method | | | | $args | | ### static mixed processValue(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $allowServices | whether Definition and Reference are allowed; by default, only scalars and arrays are | #### Return Value | | | | --- | --- | | mixed | the value, optionally cast to a Definition/Reference | ### \_\_construct([ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") $parent, [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $id = null, array $defaultTags = array()) #### Parameters | | | | | --- | --- | --- | | [ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") | $parent | | | [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $id | | | array | $defaultTags | | ### \_\_destruct() ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") set(string $id, string $class = null) Registers a service. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $class | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | ### final [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") alias(string $id, string $referencedId) Creates an alias. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $referencedId | | #### Return Value | | | | --- | --- | | [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") | | ### final [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") load(string $namespace, string $resource) Registers a PSR-4 namespace using a glob pattern. #### Parameters | | | | | --- | --- | --- | | string | $namespace | | | string | $resource | | #### Return Value | | | | --- | --- | | [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") | | ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") get(string $id) Gets an already defined service definition. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | #### Exceptions | | | | --- | --- | | [ServiceNotFoundException](../../exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | if the service definition does not exist | ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") \_\_invoke(string $id, string $class = null) Registers a service. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $class | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | ### final $this autoconfigure(bool $autoconfigured = true) Sets whether or not instanceof conditionals should be prepended with a global set. #### Parameters | | | | | --- | --- | --- | | bool | $autoconfigured | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when a parent is already set | ### final $this autowire(bool $autowired = true) Enables/disables autowiring. #### Parameters | | | | | --- | --- | --- | | bool | $autowired | | #### Return Value | | | | --- | --- | | $this | | ### final $this bind(string $nameOrFqcn, mixed $valueOrRef) Sets bindings. Bindings map $named or FQCN arguments to values that should be injected in the matching parameters (of the constructor, of methods called and of controller actions). #### Parameters | | | | | --- | --- | --- | | string | $nameOrFqcn | A parameter name with its "$" prefix, or a FQCN | | mixed | $valueOrRef | The value or reference to bind | #### Return Value | | | | --- | --- | | $this | | ### final $this public() #### Return Value | | | | --- | --- | | $this | | ### final $this private() #### Return Value | | | | --- | --- | | $this | | ### final $this tag(string $name, array $attributes = array()) Adds a tag for this definition. #### Parameters | | | | | --- | --- | --- | | string | $name | | | array | $attributes | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when an invalid tag name or attribute is provided | ### final [InstanceofConfigurator](instanceofconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\InstanceofConfigurator") instanceof(string $fqcn) Defines an instanceof-conditional to be applied to following service definitions. #### Parameters | | | | | --- | --- | --- | | string | $fqcn | | #### Return Value | | | | --- | --- | | [InstanceofConfigurator](instanceofconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\InstanceofConfigurator") | |
programming_docs
symfony ServiceConfigurator ServiceConfigurator ==================== class **ServiceConfigurator** extends [AbstractServiceConfigurator](abstractserviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") Traits ------ | | | | --- | --- | | [AbstractTrait](traits/abstracttrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AbstractTrait") | | | [ArgumentTrait](traits/argumenttrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ArgumentTrait") | | | [AutoconfigureTrait](traits/autoconfiguretrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutoconfigureTrait") | | | [AutowireTrait](traits/autowiretrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutowireTrait") | | | [BindTrait](traits/bindtrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\BindTrait") | | | [CallTrait](traits/calltrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\CallTrait") | | | [ClassTrait](traits/classtrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ClassTrait") | | | [ConfiguratorTrait](traits/configuratortrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ConfiguratorTrait") | | | [DecorateTrait](traits/decoratetrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\DecorateTrait") | | | [DeprecateTrait](traits/deprecatetrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\DeprecateTrait") | | | [FactoryTrait](traits/factorytrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\FactoryTrait") | | | [FileTrait](traits/filetrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\FileTrait") | | | [LazyTrait](traits/lazytrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\LazyTrait") | | | [ParentTrait](traits/parenttrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ParentTrait") | | | [PropertyTrait](traits/propertytrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PropertyTrait") | | | [PublicTrait](traits/publictrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PublicTrait") | | | [ShareTrait](traits/sharetrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ShareTrait") | | | [SyntheticTrait](traits/synthetictrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\SyntheticTrait") | | | [TagTrait](traits/tagtrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\TagTrait") | | Constants --------- | | | | --- | --- | | FACTORY | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $definition | | from [AbstractConfigurator](abstractconfigurator#property_definition "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | protected | $parent | | from [AbstractServiceConfigurator](abstractserviceconfigurator#property_parent "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | protected | $id | | from [AbstractServiceConfigurator](abstractserviceconfigurator#property_id "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | Methods ------- | | | | | --- | --- | --- | | | [\_\_call](#method___call)($method, $args) | from [AbstractConfigurator](abstractconfigurator#method___call "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | static mixed | [processValue](#method_processValue)(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. | from [AbstractConfigurator](abstractconfigurator#method_processValue "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | | [\_\_construct](#method___construct)([ContainerBuilder](../../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, array $instanceof, bool $allowParent, [ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") $parent, [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $id, array $defaultTags) | | | | [\_\_destruct](#method___destruct)() | | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [set](#method_set)(string $id, string $class = null) Registers a service. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_set "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") | [alias](#method_alias)(string $id, string $referencedId) Creates an alias. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_alias "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") | [load](#method_load)(string $namespace, string $resource) Registers a PSR-4 namespace using a glob pattern. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_load "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [get](#method_get)(string $id) Gets an already defined service definition. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_get "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [\_\_invoke](#method___invoke)(string $id, string $class = null) Registers a service. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method___invoke "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | $this | [abstract](#method_abstract)(bool $abstract = true) Whether this definition is abstract, that means it merely serves as a template for other definitions. | from [AbstractTrait](traits/abstracttrait#method_abstract "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AbstractTrait") | | $this | [args](#method_args)(array $arguments) Sets the arguments to pass to the service constructor/factory method. | from [ArgumentTrait](traits/argumenttrait#method_args "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ArgumentTrait") | | $this | [arg](#method_arg)(string|int $key, mixed $value) Sets one argument to pass to the service constructor/factory method. | from [ArgumentTrait](traits/argumenttrait#method_arg "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ArgumentTrait") | | $this | [autoconfigure](#method_autoconfigure)(bool $autoconfigured = true) Sets whether or not instanceof conditionals should be prepended with a global set. | from [AutoconfigureTrait](traits/autoconfiguretrait#method_autoconfigure "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutoconfigureTrait") | | $this | [autowire](#method_autowire)(bool $autowired = true) Enables/disables autowiring. | from [AutowireTrait](traits/autowiretrait#method_autowire "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutowireTrait") | | $this | [bind](#method_bind)(string $nameOrFqcn, mixed $valueOrRef) Sets bindings. | from [BindTrait](traits/bindtrait#method_bind "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\BindTrait") | | $this | [call](#method_call)(string $method, array $arguments = array()) Adds a method to call after service initialization. | from [CallTrait](traits/calltrait#method_call "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\CallTrait") | | $this | [class](#method_class)($class) Sets the service class. | from [ClassTrait](traits/classtrait#method_class "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ClassTrait") | | $this | [configurator](#method_configurator)(string|array $configurator) Sets a configurator to call after the service is fully initialized. | from [ConfiguratorTrait](traits/configuratortrait#method_configurator "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ConfiguratorTrait") | | $this | [decorate](#method_decorate)(string|null $id, string|null $renamedId = null, int $priority = 0) Sets the service that this service is decorating. | from [DecorateTrait](traits/decoratetrait#method_decorate "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\DecorateTrait") | | $this | [deprecate](#method_deprecate)(string $template = null) Whether this definition is deprecated, that means it should not be called anymore. | from [DeprecateTrait](traits/deprecatetrait#method_deprecate "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\DeprecateTrait") | | $this | [factory](#method_factory)(string|array $factory) Sets a factory. | from [FactoryTrait](traits/factorytrait#method_factory "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\FactoryTrait") | | $this | [file](#method_file)(string $file) Sets a file to require before creating the service. | from [FileTrait](traits/filetrait#method_file "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\FileTrait") | | $this | [lazy](#method_lazy)(bool $lazy = true) Sets the lazy flag of this service. | from [LazyTrait](traits/lazytrait#method_lazy "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\LazyTrait") | | $this | [parent](#method_parent)(string $parent) Sets the Definition to inherit from. | from [ParentTrait](traits/parenttrait#method_parent "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ParentTrait") | | $this | [property](#method_property)(string $name, $value) Sets a specific property. | from [PropertyTrait](traits/propertytrait#method_property "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PropertyTrait") | | $this | [public](#method_public)() | from [PublicTrait](traits/publictrait#method_public "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PublicTrait") | | $this | [private](#method_private)() | from [PublicTrait](traits/publictrait#method_private "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PublicTrait") | | $this | [share](#method_share)(bool $shared = true) Sets if the service must be shared or not. | from [ShareTrait](traits/sharetrait#method_share "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ShareTrait") | | $this | [synthetic](#method_synthetic)(bool $synthetic = true) Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected. | from [SyntheticTrait](traits/synthetictrait#method_synthetic "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\SyntheticTrait") | | $this | [tag](#method_tag)(string $name, array $attributes = array()) Adds a tag for this definition. | from [TagTrait](traits/tagtrait#method_tag "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\TagTrait") | Details ------- ### \_\_call($method, $args) #### Parameters | | | | | --- | --- | --- | | | $method | | | | $args | | ### static mixed processValue(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $allowServices | whether Definition and Reference are allowed; by default, only scalars and arrays are | #### Return Value | | | | --- | --- | | mixed | the value, optionally cast to a Definition/Reference | ### \_\_construct([ContainerBuilder](../../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, array $instanceof, bool $allowParent, [ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") $parent, [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $id, array $defaultTags) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | array | $instanceof | | | bool | $allowParent | | | [ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") | $parent | | | [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $id | | | array | $defaultTags | | ### \_\_destruct() ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") set(string $id, string $class = null) Registers a service. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $class | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | ### final [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") alias(string $id, string $referencedId) Creates an alias. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $referencedId | | #### Return Value | | | | --- | --- | | [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") | | ### final [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") load(string $namespace, string $resource) Registers a PSR-4 namespace using a glob pattern. #### Parameters | | | | | --- | --- | --- | | string | $namespace | | | string | $resource | | #### Return Value | | | | --- | --- | | [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") | | ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") get(string $id) Gets an already defined service definition. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | #### Exceptions | | | | --- | --- | | [ServiceNotFoundException](../../exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | if the service definition does not exist | ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") \_\_invoke(string $id, string $class = null) Registers a service. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $class | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | ### final $this abstract(bool $abstract = true) Whether this definition is abstract, that means it merely serves as a template for other definitions. #### Parameters | | | | | --- | --- | --- | | bool | $abstract | | #### Return Value | | | | --- | --- | | $this | | ### final $this args(array $arguments) Sets the arguments to pass to the service constructor/factory method. #### Parameters | | | | | --- | --- | --- | | array | $arguments | An array of arguments | #### Return Value | | | | --- | --- | | $this | | ### final $this arg(string|int $key, mixed $value) Sets one argument to pass to the service constructor/factory method. #### Parameters | | | | | --- | --- | --- | | string|int | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### final $this autoconfigure(bool $autoconfigured = true) Sets whether or not instanceof conditionals should be prepended with a global set. #### Parameters | | | | | --- | --- | --- | | bool | $autoconfigured | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when a parent is already set | ### final $this autowire(bool $autowired = true) Enables/disables autowiring. #### Parameters | | | | | --- | --- | --- | | bool | $autowired | | #### Return Value | | | | --- | --- | | $this | | ### final $this bind(string $nameOrFqcn, mixed $valueOrRef) Sets bindings. Bindings map $named or FQCN arguments to values that should be injected in the matching parameters (of the constructor, of methods called and of controller actions). #### Parameters | | | | | --- | --- | --- | | string | $nameOrFqcn | A parameter name with its "$" prefix, or a FQCN | | mixed | $valueOrRef | The value or reference to bind | #### Return Value | | | | --- | --- | | $this | | ### final $this call(string $method, array $arguments = array()) Adds a method to call after service initialization. #### Parameters | | | | | --- | --- | --- | | string | $method | The method name to call | | array | $arguments | An array of arguments to pass to the method call | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | on empty $method param | ### final $this class($class) Sets the service class. #### Parameters | | | | | --- | --- | --- | | | $class | | #### Return Value | | | | --- | --- | | $this | | ### final $this configurator(string|array $configurator) Sets a configurator to call after the service is fully initialized. #### Parameters | | | | | --- | --- | --- | | string|array | $configurator | A PHP callable reference | #### Return Value | | | | --- | --- | | $this | | ### final $this decorate(string|null $id, string|null $renamedId = null, int $priority = 0) Sets the service that this service is decorating. #### Parameters | | | | | --- | --- | --- | | string|null | $id | The decorated service id, use null to remove decoration | | string|null | $renamedId | The new decorated service id | | int | $priority | The priority of decoration | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | in case the decorated service id and the new decorated service id are equals | ### final $this deprecate(string $template = null) Whether this definition is deprecated, that means it should not be called anymore. #### Parameters | | | | | --- | --- | --- | | string | $template | Template message to use if the definition is deprecated | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when the message template is invalid | ### final $this factory(string|array $factory) Sets a factory. #### Parameters | | | | | --- | --- | --- | | string|array | $factory | A PHP callable reference | #### Return Value | | | | --- | --- | | $this | | ### final $this file(string $file) Sets a file to require before creating the service. #### Parameters | | | | | --- | --- | --- | | string | $file | A full pathname to include | #### Return Value | | | | --- | --- | | $this | | ### final $this lazy(bool $lazy = true) Sets the lazy flag of this service. #### Parameters | | | | | --- | --- | --- | | bool | $lazy | | #### Return Value | | | | --- | --- | | $this | | ### final $this parent(string $parent) Sets the Definition to inherit from. #### Parameters | | | | | --- | --- | --- | | string | $parent | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when parent cannot be set | ### final $this property(string $name, $value) Sets a specific property. #### Parameters | | | | | --- | --- | --- | | string | $name | | | | $value | | #### Return Value | | | | --- | --- | | $this | | ### final $this public() #### Return Value | | | | --- | --- | | $this | | ### final $this private() #### Return Value | | | | --- | --- | | $this | | ### final $this share(bool $shared = true) Sets if the service must be shared or not. #### Parameters | | | | | --- | --- | --- | | bool | $shared | Whether the service must be shared or not | #### Return Value | | | | --- | --- | | $this | | ### final $this synthetic(bool $synthetic = true) Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected. #### Parameters | | | | | --- | --- | --- | | bool | $synthetic | | #### Return Value | | | | --- | --- | | $this | | ### final $this tag(string $name, array $attributes = array()) Adds a tag for this definition. #### Parameters | | | | | --- | --- | --- | | string | $name | The tag name | | array | $attributes | An array of attributes | #### Return Value | | | | --- | --- | | $this | |
programming_docs
symfony ReferenceConfigurator ReferenceConfigurator ====================== class **ReferenceConfigurator** extends [AbstractConfigurator](abstractconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") Constants --------- | | | | --- | --- | | FACTORY | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $definition | | from [AbstractConfigurator](abstractconfigurator#property_definition "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | protected | $id | | | | protected | $invalidBehavior | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_call](#method___call)($method, $args) | from [AbstractConfigurator](abstractconfigurator#method___call "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | static mixed | [processValue](#method_processValue)(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. | from [AbstractConfigurator](abstractconfigurator#method_processValue "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | | [\_\_construct](#method___construct)(string $id) | | | $this | [ignoreOnInvalid](#method_ignoreOnInvalid)() | | | $this | [nullOnInvalid](#method_nullOnInvalid)() | | | $this | [ignoreOnUninitialized](#method_ignoreOnUninitialized)() | | | | [\_\_toString](#method___toString)() | | Details ------- ### \_\_call($method, $args) #### Parameters | | | | | --- | --- | --- | | | $method | | | | $args | | ### static mixed processValue(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $allowServices | whether Definition and Reference are allowed; by default, only scalars and arrays are | #### Return Value | | | | --- | --- | | mixed | the value, optionally cast to a Definition/Reference | ### \_\_construct(string $id) #### Parameters | | | | | --- | --- | --- | | string | $id | | ### final $this ignoreOnInvalid() #### Return Value | | | | --- | --- | | $this | | ### final $this nullOnInvalid() #### Return Value | | | | --- | --- | | $this | | ### final $this ignoreOnUninitialized() #### Return Value | | | | --- | --- | | $this | | ### \_\_toString() symfony PrototypeConfigurator PrototypeConfigurator ====================== class **PrototypeConfigurator** extends [AbstractServiceConfigurator](abstractserviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") Traits ------ | | | | --- | --- | | [AbstractTrait](traits/abstracttrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AbstractTrait") | | | [ArgumentTrait](traits/argumenttrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ArgumentTrait") | | | [AutoconfigureTrait](traits/autoconfiguretrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutoconfigureTrait") | | | [AutowireTrait](traits/autowiretrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutowireTrait") | | | [BindTrait](traits/bindtrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\BindTrait") | | | [CallTrait](traits/calltrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\CallTrait") | | | [ConfiguratorTrait](traits/configuratortrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ConfiguratorTrait") | | | [DeprecateTrait](traits/deprecatetrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\DeprecateTrait") | | | [FactoryTrait](traits/factorytrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\FactoryTrait") | | | [LazyTrait](traits/lazytrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\LazyTrait") | | | [ParentTrait](traits/parenttrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ParentTrait") | | | [PropertyTrait](traits/propertytrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PropertyTrait") | | | [PublicTrait](traits/publictrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PublicTrait") | | | [ShareTrait](traits/sharetrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ShareTrait") | | | [TagTrait](traits/tagtrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\TagTrait") | | Constants --------- | | | | --- | --- | | FACTORY | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $definition | | from [AbstractConfigurator](abstractconfigurator#property_definition "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | protected | $parent | | from [AbstractServiceConfigurator](abstractserviceconfigurator#property_parent "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | protected | $id | | from [AbstractServiceConfigurator](abstractserviceconfigurator#property_id "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | Methods ------- | | | | | --- | --- | --- | | | [\_\_call](#method___call)($method, $args) | from [AbstractConfigurator](abstractconfigurator#method___call "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | static mixed | [processValue](#method_processValue)(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. | from [AbstractConfigurator](abstractconfigurator#method_processValue "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | | [\_\_construct](#method___construct)([ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") $parent, [PhpFileLoader](../phpfileloader "Symfony\Component\DependencyInjection\Loader\PhpFileLoader") $loader, [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $defaults, string $namespace, string $resource, bool $allowParent) | | | | [\_\_destruct](#method___destruct)() | | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [set](#method_set)(string $id, string $class = null) Registers a service. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_set "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") | [alias](#method_alias)(string $id, string $referencedId) Creates an alias. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_alias "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") | [load](#method_load)(string $namespace, string $resource) Registers a PSR-4 namespace using a glob pattern. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_load "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [get](#method_get)(string $id) Gets an already defined service definition. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_get "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [\_\_invoke](#method___invoke)(string $id, string $class = null) Registers a service. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method___invoke "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | $this | [abstract](#method_abstract)(bool $abstract = true) Whether this definition is abstract, that means it merely serves as a template for other definitions. | from [AbstractTrait](traits/abstracttrait#method_abstract "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AbstractTrait") | | $this | [args](#method_args)(array $arguments) Sets the arguments to pass to the service constructor/factory method. | from [ArgumentTrait](traits/argumenttrait#method_args "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ArgumentTrait") | | $this | [arg](#method_arg)(string|int $key, mixed $value) Sets one argument to pass to the service constructor/factory method. | from [ArgumentTrait](traits/argumenttrait#method_arg "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ArgumentTrait") | | $this | [autoconfigure](#method_autoconfigure)(bool $autoconfigured = true) Sets whether or not instanceof conditionals should be prepended with a global set. | from [AutoconfigureTrait](traits/autoconfiguretrait#method_autoconfigure "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutoconfigureTrait") | | $this | [autowire](#method_autowire)(bool $autowired = true) Enables/disables autowiring. | from [AutowireTrait](traits/autowiretrait#method_autowire "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutowireTrait") | | $this | [bind](#method_bind)(string $nameOrFqcn, mixed $valueOrRef) Sets bindings. | from [BindTrait](traits/bindtrait#method_bind "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\BindTrait") | | $this | [call](#method_call)(string $method, array $arguments = array()) Adds a method to call after service initialization. | from [CallTrait](traits/calltrait#method_call "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\CallTrait") | | $this | [configurator](#method_configurator)(string|array $configurator) Sets a configurator to call after the service is fully initialized. | from [ConfiguratorTrait](traits/configuratortrait#method_configurator "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ConfiguratorTrait") | | $this | [deprecate](#method_deprecate)(string $template = null) Whether this definition is deprecated, that means it should not be called anymore. | from [DeprecateTrait](traits/deprecatetrait#method_deprecate "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\DeprecateTrait") | | $this | [factory](#method_factory)(string|array $factory) Sets a factory. | from [FactoryTrait](traits/factorytrait#method_factory "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\FactoryTrait") | | $this | [lazy](#method_lazy)(bool $lazy = true) Sets the lazy flag of this service. | from [LazyTrait](traits/lazytrait#method_lazy "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\LazyTrait") | | $this | [parent](#method_parent)(string $parent) Sets the Definition to inherit from. | from [ParentTrait](traits/parenttrait#method_parent "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ParentTrait") | | $this | [property](#method_property)(string $name, $value) Sets a specific property. | from [PropertyTrait](traits/propertytrait#method_property "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PropertyTrait") | | $this | [public](#method_public)() | from [PublicTrait](traits/publictrait#method_public "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PublicTrait") | | $this | [private](#method_private)() | from [PublicTrait](traits/publictrait#method_private "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PublicTrait") | | $this | [share](#method_share)(bool $shared = true) Sets if the service must be shared or not. | from [ShareTrait](traits/sharetrait#method_share "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ShareTrait") | | $this | [tag](#method_tag)(string $name, array $attributes = array()) Adds a tag for this definition. | from [TagTrait](traits/tagtrait#method_tag "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\TagTrait") | | $this | [exclude](#method_exclude)(string $exclude) Excludes files from registration using a glob pattern. | | Details ------- ### \_\_call($method, $args) #### Parameters | | | | | --- | --- | --- | | | $method | | | | $args | | ### static mixed processValue(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $allowServices | whether Definition and Reference are allowed; by default, only scalars and arrays are | #### Return Value | | | | --- | --- | | mixed | the value, optionally cast to a Definition/Reference | ### \_\_construct([ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") $parent, [PhpFileLoader](../phpfileloader "Symfony\Component\DependencyInjection\Loader\PhpFileLoader") $loader, [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $defaults, string $namespace, string $resource, bool $allowParent) #### Parameters | | | | | --- | --- | --- | | [ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") | $parent | | | [PhpFileLoader](../phpfileloader "Symfony\Component\DependencyInjection\Loader\PhpFileLoader") | $loader | | | [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") | $defaults | | | string | $namespace | | | string | $resource | | | bool | $allowParent | | ### \_\_destruct() ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") set(string $id, string $class = null) Registers a service. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $class | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | ### final [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") alias(string $id, string $referencedId) Creates an alias. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $referencedId | | #### Return Value | | | | --- | --- | | [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") | | ### final [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") load(string $namespace, string $resource) Registers a PSR-4 namespace using a glob pattern. #### Parameters | | | | | --- | --- | --- | | string | $namespace | | | string | $resource | | #### Return Value | | | | --- | --- | | [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") | | ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") get(string $id) Gets an already defined service definition. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | #### Exceptions | | | | --- | --- | | [ServiceNotFoundException](../../exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | if the service definition does not exist | ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") \_\_invoke(string $id, string $class = null) Registers a service. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $class | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | ### final $this abstract(bool $abstract = true) Whether this definition is abstract, that means it merely serves as a template for other definitions. #### Parameters | | | | | --- | --- | --- | | bool | $abstract | | #### Return Value | | | | --- | --- | | $this | | ### final $this args(array $arguments) Sets the arguments to pass to the service constructor/factory method. #### Parameters | | | | | --- | --- | --- | | array | $arguments | An array of arguments | #### Return Value | | | | --- | --- | | $this | | ### final $this arg(string|int $key, mixed $value) Sets one argument to pass to the service constructor/factory method. #### Parameters | | | | | --- | --- | --- | | string|int | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | ### final $this autoconfigure(bool $autoconfigured = true) Sets whether or not instanceof conditionals should be prepended with a global set. #### Parameters | | | | | --- | --- | --- | | bool | $autoconfigured | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when a parent is already set | ### final $this autowire(bool $autowired = true) Enables/disables autowiring. #### Parameters | | | | | --- | --- | --- | | bool | $autowired | | #### Return Value | | | | --- | --- | | $this | | ### final $this bind(string $nameOrFqcn, mixed $valueOrRef) Sets bindings. Bindings map $named or FQCN arguments to values that should be injected in the matching parameters (of the constructor, of methods called and of controller actions). #### Parameters | | | | | --- | --- | --- | | string | $nameOrFqcn | A parameter name with its "$" prefix, or a FQCN | | mixed | $valueOrRef | The value or reference to bind | #### Return Value | | | | --- | --- | | $this | | ### final $this call(string $method, array $arguments = array()) Adds a method to call after service initialization. #### Parameters | | | | | --- | --- | --- | | string | $method | The method name to call | | array | $arguments | An array of arguments to pass to the method call | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | on empty $method param | ### final $this configurator(string|array $configurator) Sets a configurator to call after the service is fully initialized. #### Parameters | | | | | --- | --- | --- | | string|array | $configurator | A PHP callable reference | #### Return Value | | | | --- | --- | | $this | | ### final $this deprecate(string $template = null) Whether this definition is deprecated, that means it should not be called anymore. #### Parameters | | | | | --- | --- | --- | | string | $template | Template message to use if the definition is deprecated | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when the message template is invalid | ### final $this factory(string|array $factory) Sets a factory. #### Parameters | | | | | --- | --- | --- | | string|array | $factory | A PHP callable reference | #### Return Value | | | | --- | --- | | $this | | ### final $this lazy(bool $lazy = true) Sets the lazy flag of this service. #### Parameters | | | | | --- | --- | --- | | bool | $lazy | | #### Return Value | | | | --- | --- | | $this | | ### final $this parent(string $parent) Sets the Definition to inherit from. #### Parameters | | | | | --- | --- | --- | | string | $parent | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when parent cannot be set | ### final $this property(string $name, $value) Sets a specific property. #### Parameters | | | | | --- | --- | --- | | string | $name | | | | $value | | #### Return Value | | | | --- | --- | | $this | | ### final $this public() #### Return Value | | | | --- | --- | | $this | | ### final $this private() #### Return Value | | | | --- | --- | | $this | | ### final $this share(bool $shared = true) Sets if the service must be shared or not. #### Parameters | | | | | --- | --- | --- | | bool | $shared | Whether the service must be shared or not | #### Return Value | | | | --- | --- | | $this | | ### final $this tag(string $name, array $attributes = array()) Adds a tag for this definition. #### Parameters | | | | | --- | --- | --- | | string | $name | The tag name | | array | $attributes | An array of attributes | #### Return Value | | | | --- | --- | | $this | | ### final $this exclude(string $exclude) Excludes files from registration using a glob pattern. #### Parameters | | | | | --- | --- | --- | | string | $exclude | | #### Return Value | | | | --- | --- | | $this | |
programming_docs
symfony AbstractServiceConfigurator AbstractServiceConfigurator ============================ abstract class **AbstractServiceConfigurator** extends [AbstractConfigurator](abstractconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") Constants --------- | | | | --- | --- | | FACTORY | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $definition | | from [AbstractConfigurator](abstractconfigurator#property_definition "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | protected | $parent | | | | protected | $id | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_call](#method___call)($method, $args) | from [AbstractConfigurator](abstractconfigurator#method___call "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | static mixed | [processValue](#method_processValue)(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. | from [AbstractConfigurator](abstractconfigurator#method_processValue "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | | [\_\_construct](#method___construct)([ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") $parent, [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $id = null, array $defaultTags = array()) | | | | [\_\_destruct](#method___destruct)() | | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [set](#method_set)(string $id, string $class = null) Registers a service. | | | [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") | [alias](#method_alias)(string $id, string $referencedId) Creates an alias. | | | [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") | [load](#method_load)(string $namespace, string $resource) Registers a PSR-4 namespace using a glob pattern. | | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [get](#method_get)(string $id) Gets an already defined service definition. | | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [\_\_invoke](#method___invoke)(string $id, string $class = null) Registers a service. | | Details ------- ### \_\_call($method, $args) #### Parameters | | | | | --- | --- | --- | | | $method | | | | $args | | ### static mixed processValue(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $allowServices | whether Definition and Reference are allowed; by default, only scalars and arrays are | #### Return Value | | | | --- | --- | | mixed | the value, optionally cast to a Definition/Reference | ### \_\_construct([ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") $parent, [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $id = null, array $defaultTags = array()) #### Parameters | | | | | --- | --- | --- | | [ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") | $parent | | | [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $id | | | array | $defaultTags | | ### \_\_destruct() ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") set(string $id, string $class = null) Registers a service. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $class | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | ### final [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") alias(string $id, string $referencedId) Creates an alias. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $referencedId | | #### Return Value | | | | --- | --- | | [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") | | ### final [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") load(string $namespace, string $resource) Registers a PSR-4 namespace using a glob pattern. #### Parameters | | | | | --- | --- | --- | | string | $namespace | | | string | $resource | | #### Return Value | | | | --- | --- | | [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") | | ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") get(string $id) Gets an already defined service definition. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | #### Exceptions | | | | --- | --- | | [ServiceNotFoundException](../../exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | if the service definition does not exist | ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") \_\_invoke(string $id, string $class = null) Registers a service. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $class | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | symfony AliasConfigurator AliasConfigurator ================== class **AliasConfigurator** extends [AbstractServiceConfigurator](abstractserviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") Traits ------ | | | | --- | --- | | [PublicTrait](traits/publictrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PublicTrait") | | Constants --------- | | | | --- | --- | | FACTORY | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $definition | | from [AbstractConfigurator](abstractconfigurator#property_definition "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | protected | $parent | | from [AbstractServiceConfigurator](abstractserviceconfigurator#property_parent "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | protected | $id | | from [AbstractServiceConfigurator](abstractserviceconfigurator#property_id "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | Methods ------- | | | | | --- | --- | --- | | | [\_\_call](#method___call)($method, $args) | from [AbstractConfigurator](abstractconfigurator#method___call "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | static mixed | [processValue](#method_processValue)(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. | from [AbstractConfigurator](abstractconfigurator#method_processValue "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | | [\_\_construct](#method___construct)([ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") $parent, [Alias](../../alias "Symfony\Component\DependencyInjection\Alias") $alias) | | | | [\_\_destruct](#method___destruct)() | from [AbstractServiceConfigurator](abstractserviceconfigurator#method___destruct "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [set](#method_set)(string $id, string $class = null) Registers a service. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_set "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") | [alias](#method_alias)(string $id, string $referencedId) Creates an alias. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_alias "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") | [load](#method_load)(string $namespace, string $resource) Registers a PSR-4 namespace using a glob pattern. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_load "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [get](#method_get)(string $id) Gets an already defined service definition. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method_get "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [\_\_invoke](#method___invoke)(string $id, string $class = null) Registers a service. | from [AbstractServiceConfigurator](abstractserviceconfigurator#method___invoke "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractServiceConfigurator") | | $this | [public](#method_public)() | from [PublicTrait](traits/publictrait#method_public "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PublicTrait") | | $this | [private](#method_private)() | from [PublicTrait](traits/publictrait#method_private "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PublicTrait") | Details ------- ### \_\_call($method, $args) #### Parameters | | | | | --- | --- | --- | | | $method | | | | $args | | ### static mixed processValue(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $allowServices | whether Definition and Reference are allowed; by default, only scalars and arrays are | #### Return Value | | | | --- | --- | | mixed | the value, optionally cast to a Definition/Reference | ### \_\_construct([ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") $parent, [Alias](../../alias "Symfony\Component\DependencyInjection\Alias") $alias) #### Parameters | | | | | --- | --- | --- | | [ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") | $parent | | | [Alias](../../alias "Symfony\Component\DependencyInjection\Alias") | $alias | | ### \_\_destruct() ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") set(string $id, string $class = null) Registers a service. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $class | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | ### final [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") alias(string $id, string $referencedId) Creates an alias. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $referencedId | | #### Return Value | | | | --- | --- | | [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") | | ### final [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") load(string $namespace, string $resource) Registers a PSR-4 namespace using a glob pattern. #### Parameters | | | | | --- | --- | --- | | string | $namespace | | | string | $resource | | #### Return Value | | | | --- | --- | | [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") | | ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") get(string $id) Gets an already defined service definition. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | #### Exceptions | | | | --- | --- | | [ServiceNotFoundException](../../exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | if the service definition does not exist | ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") \_\_invoke(string $id, string $class = null) Registers a service. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $class | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | ### final $this public() #### Return Value | | | | --- | --- | | $this | | ### final $this private() #### Return Value | | | | --- | --- | | $this | | symfony ParametersConfigurator ParametersConfigurator ======================= class **ParametersConfigurator** extends [AbstractConfigurator](abstractconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") Constants --------- | | | | --- | --- | | FACTORY | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $definition | | from [AbstractConfigurator](abstractconfigurator#property_definition "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | Methods ------- | | | | | --- | --- | --- | | | [\_\_call](#method___call)($method, $args) | from [AbstractConfigurator](abstractconfigurator#method___call "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | static mixed | [processValue](#method_processValue)(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. | from [AbstractConfigurator](abstractconfigurator#method_processValue "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | | [\_\_construct](#method___construct)([ContainerBuilder](../../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) | | | $this | [set](#method_set)(string $name, $value) Creates a parameter. | | | $this | [\_\_invoke](#method___invoke)(string $name, $value) Creates a parameter. | | Details ------- ### \_\_call($method, $args) #### Parameters | | | | | --- | --- | --- | | | $method | | | | $args | | ### static mixed processValue(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $allowServices | whether Definition and Reference are allowed; by default, only scalars and arrays are | #### Return Value | | | | --- | --- | | mixed | the value, optionally cast to a Definition/Reference | ### \_\_construct([ContainerBuilder](../../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### final $this set(string $name, $value) Creates a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | | | | $value | | #### Return Value | | | | --- | --- | | $this | | ### final $this \_\_invoke(string $name, $value) Creates a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | | | | $value | | #### Return Value | | | | --- | --- | | $this | | symfony AbstractConfigurator AbstractConfigurator ===================== abstract class **AbstractConfigurator** Constants --------- | | | | --- | --- | | FACTORY | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $definition | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_call](#method___call)($method, $args) | | | static mixed | [processValue](#method_processValue)(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. | | Details ------- ### \_\_call($method, $args) #### Parameters | | | | | --- | --- | --- | | | $method | | | | $args | | ### static mixed processValue(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $allowServices | whether Definition and Reference are allowed; by default, only scalars and arrays are | #### Return Value | | | | --- | --- | | mixed | the value, optionally cast to a Definition/Reference | symfony Symfony\Component\DependencyInjection\Loader\Configurator\Traits Symfony\Component\DependencyInjection\Loader\Configurator\Traits ================================================================ Classes ------- | | | | --- | --- | | [AbstractTrait](traits/abstracttrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AbstractTrait") | | | [ArgumentTrait](traits/argumenttrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ArgumentTrait") | | | [AutoconfigureTrait](traits/autoconfiguretrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutoconfigureTrait") | | | [AutowireTrait](traits/autowiretrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\AutowireTrait") | | | [BindTrait](traits/bindtrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\BindTrait") | | | [CallTrait](traits/calltrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\CallTrait") | | | [ClassTrait](traits/classtrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ClassTrait") | | | [ConfiguratorTrait](traits/configuratortrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ConfiguratorTrait") | | | [DecorateTrait](traits/decoratetrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\DecorateTrait") | | | [DeprecateTrait](traits/deprecatetrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\DeprecateTrait") | | | [FactoryTrait](traits/factorytrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\FactoryTrait") | | | [FileTrait](traits/filetrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\FileTrait") | | | [LazyTrait](traits/lazytrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\LazyTrait") | | | [ParentTrait](traits/parenttrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ParentTrait") | | | [PropertyTrait](traits/propertytrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PropertyTrait") | | | [PublicTrait](traits/publictrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\PublicTrait") | | | [ShareTrait](traits/sharetrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\ShareTrait") | | | [SyntheticTrait](traits/synthetictrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\SyntheticTrait") | | | [TagTrait](traits/tagtrait "Symfony\Component\DependencyInjection\Loader\Configurator\Traits\TagTrait") | |
programming_docs
symfony ContainerConfigurator ContainerConfigurator ====================== class **ContainerConfigurator** extends [AbstractConfigurator](abstractconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") Constants --------- | | | | --- | --- | | FACTORY | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $definition | | from [AbstractConfigurator](abstractconfigurator#property_definition "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | Methods ------- | | | | | --- | --- | --- | | | [\_\_call](#method___call)($method, $args) | from [AbstractConfigurator](abstractconfigurator#method___call "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | static mixed | [processValue](#method_processValue)(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. | from [AbstractConfigurator](abstractconfigurator#method_processValue "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | | [\_\_construct](#method___construct)([ContainerBuilder](../../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [PhpFileLoader](../phpfileloader "Symfony\Component\DependencyInjection\Loader\PhpFileLoader") $loader, array $instanceof, string $path, string $file) | | | | [extension](#method_extension)(string $namespace, array $config) | | | | [import](#method_import)(string $resource, string $type = null, bool $ignoreErrors = false) | | | [ParametersConfigurator](parametersconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ParametersConfigurator") | [parameters](#method_parameters)() | | | [ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") | [services](#method_services)() | | Details ------- ### \_\_call($method, $args) #### Parameters | | | | | --- | --- | --- | | | $method | | | | $args | | ### static mixed processValue(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $allowServices | whether Definition and Reference are allowed; by default, only scalars and arrays are | #### Return Value | | | | --- | --- | | mixed | the value, optionally cast to a Definition/Reference | ### \_\_construct([ContainerBuilder](../../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [PhpFileLoader](../phpfileloader "Symfony\Component\DependencyInjection\Loader\PhpFileLoader") $loader, array $instanceof, string $path, string $file) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | [PhpFileLoader](../phpfileloader "Symfony\Component\DependencyInjection\Loader\PhpFileLoader") | $loader | | | array | $instanceof | | | string | $path | | | string | $file | | ### final extension(string $namespace, array $config) #### Parameters | | | | | --- | --- | --- | | string | $namespace | | | array | $config | | ### final import(string $resource, string $type = null, bool $ignoreErrors = false) #### Parameters | | | | | --- | --- | --- | | string | $resource | | | string | $type | | | bool | $ignoreErrors | | ### final [ParametersConfigurator](parametersconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ParametersConfigurator") parameters() #### Return Value | | | | --- | --- | | [ParametersConfigurator](parametersconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ParametersConfigurator") | | ### final [ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") services() #### Return Value | | | | --- | --- | | [ServicesConfigurator](servicesconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServicesConfigurator") | | symfony ServicesConfigurator ServicesConfigurator ===================== class **ServicesConfigurator** extends [AbstractConfigurator](abstractconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") Constants --------- | | | | --- | --- | | FACTORY | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $definition | | from [AbstractConfigurator](abstractconfigurator#property_definition "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | Methods ------- | | | | | --- | --- | --- | | | [\_\_call](#method___call)($method, $args) | from [AbstractConfigurator](abstractconfigurator#method___call "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | static mixed | [processValue](#method_processValue)(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. | from [AbstractConfigurator](abstractconfigurator#method_processValue "Symfony\Component\DependencyInjection\Loader\Configurator\AbstractConfigurator") | | | [\_\_construct](#method___construct)([ContainerBuilder](../../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [PhpFileLoader](../phpfileloader "Symfony\Component\DependencyInjection\Loader\PhpFileLoader") $loader, array $instanceof, string $path = null, int $anonymousCount = 0) | | | [DefaultsConfigurator](defaultsconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\DefaultsConfigurator") | [defaults](#method_defaults)() Defines a set of defaults for following service definitions. | | | [InstanceofConfigurator](instanceofconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\InstanceofConfigurator") | [instanceof](#method_instanceof)(string $fqcn) Defines an instanceof-conditional to be applied to following service definitions. | | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [set](#method_set)(string|null $id, string $class = null) Registers a service. | | | [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") | [alias](#method_alias)(string $id, string $referencedId) Creates an alias. | | | [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") | [load](#method_load)(string $namespace, string $resource) Registers a PSR-4 namespace using a glob pattern. | | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [get](#method_get)(string $id) Gets an already defined service definition. | | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | [\_\_invoke](#method___invoke)(string $id, string $class = null) Registers a service. | | Details ------- ### \_\_call($method, $args) #### Parameters | | | | | --- | --- | --- | | | $method | | | | $args | | ### static mixed processValue(mixed $value, bool $allowServices = false) Checks that a value is valid, optionally replacing Definition and Reference configurators by their configure value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $allowServices | whether Definition and Reference are allowed; by default, only scalars and arrays are | #### Return Value | | | | --- | --- | | mixed | the value, optionally cast to a Definition/Reference | ### \_\_construct([ContainerBuilder](../../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, [PhpFileLoader](../phpfileloader "Symfony\Component\DependencyInjection\Loader\PhpFileLoader") $loader, array $instanceof, string $path = null, int $anonymousCount = 0) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | [PhpFileLoader](../phpfileloader "Symfony\Component\DependencyInjection\Loader\PhpFileLoader") | $loader | | | array | $instanceof | | | string | $path | | | int | $anonymousCount | | ### final [DefaultsConfigurator](defaultsconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\DefaultsConfigurator") defaults() Defines a set of defaults for following service definitions. #### Return Value | | | | --- | --- | | [DefaultsConfigurator](defaultsconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\DefaultsConfigurator") | | ### final [InstanceofConfigurator](instanceofconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\InstanceofConfigurator") instanceof(string $fqcn) Defines an instanceof-conditional to be applied to following service definitions. #### Parameters | | | | | --- | --- | --- | | string | $fqcn | | #### Return Value | | | | --- | --- | | [InstanceofConfigurator](instanceofconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\InstanceofConfigurator") | | ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") set(string|null $id, string $class = null) Registers a service. #### Parameters | | | | | --- | --- | --- | | string|null | $id | The service id, or null to create an anonymous service | | string | $class | The class of the service, or null when $id is also the class name | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | ### final [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") alias(string $id, string $referencedId) Creates an alias. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $referencedId | | #### Return Value | | | | --- | --- | | [AliasConfigurator](aliasconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\AliasConfigurator") | | ### final [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") load(string $namespace, string $resource) Registers a PSR-4 namespace using a glob pattern. #### Parameters | | | | | --- | --- | --- | | string | $namespace | | | string | $resource | | #### Return Value | | | | --- | --- | | [PrototypeConfigurator](prototypeconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\PrototypeConfigurator") | | ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") get(string $id) Gets an already defined service definition. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | #### Exceptions | | | | --- | --- | | [ServiceNotFoundException](../../exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | if the service definition does not exist | ### final [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") \_\_invoke(string $id, string $class = null) Registers a service. #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $class | | #### Return Value | | | | --- | --- | | [ServiceConfigurator](serviceconfigurator "Symfony\Component\DependencyInjection\Loader\Configurator\ServiceConfigurator") | | symfony PropertyTrait PropertyTrait ============== trait **PropertyTrait** Methods ------- | | | | | --- | --- | --- | | $this | [property](#method_property)(string $name, $value) Sets a specific property. | | Details ------- ### final $this property(string $name, $value) Sets a specific property. #### Parameters | | | | | --- | --- | --- | | string | $name | | | | $value | | #### Return Value | | | | --- | --- | | $this | | symfony PublicTrait PublicTrait ============ trait **PublicTrait** Methods ------- | | | | | --- | --- | --- | | $this | [public](#method_public)() | | | $this | [private](#method_private)() | | Details ------- ### final $this public() #### Return Value | | | | --- | --- | | $this | | ### final $this private() #### Return Value | | | | --- | --- | | $this | | symfony DeprecateTrait DeprecateTrait =============== trait **DeprecateTrait** Methods ------- | | | | | --- | --- | --- | | $this | [deprecate](#method_deprecate)(string $template = null) Whether this definition is deprecated, that means it should not be called anymore. | | Details ------- ### final $this deprecate(string $template = null) Whether this definition is deprecated, that means it should not be called anymore. #### Parameters | | | | | --- | --- | --- | | string | $template | Template message to use if the definition is deprecated | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when the message template is invalid | symfony ArgumentTrait ArgumentTrait ============== trait **ArgumentTrait** Methods ------- | | | | | --- | --- | --- | | $this | [args](#method_args)(array $arguments) Sets the arguments to pass to the service constructor/factory method. | | | $this | [arg](#method_arg)(string|int $key, mixed $value) Sets one argument to pass to the service constructor/factory method. | | Details ------- ### final $this args(array $arguments) Sets the arguments to pass to the service constructor/factory method. #### Parameters | | | | | --- | --- | --- | | array | $arguments | An array of arguments | #### Return Value | | | | --- | --- | | $this | | ### final $this arg(string|int $key, mixed $value) Sets one argument to pass to the service constructor/factory method. #### Parameters | | | | | --- | --- | --- | | string|int | $key | | | mixed | $value | | #### Return Value | | | | --- | --- | | $this | | symfony TagTrait TagTrait ========= trait **TagTrait** Methods ------- | | | | | --- | --- | --- | | $this | [tag](#method_tag)(string $name, array $attributes = array()) Adds a tag for this definition. | | Details ------- ### final $this tag(string $name, array $attributes = array()) Adds a tag for this definition. #### Parameters | | | | | --- | --- | --- | | string | $name | The tag name | | array | $attributes | An array of attributes | #### Return Value | | | | --- | --- | | $this | | symfony ConfiguratorTrait ConfiguratorTrait ================== trait **ConfiguratorTrait** Methods ------- | | | | | --- | --- | --- | | $this | [configurator](#method_configurator)(string|array $configurator) Sets a configurator to call after the service is fully initialized. | | Details ------- ### final $this configurator(string|array $configurator) Sets a configurator to call after the service is fully initialized. #### Parameters | | | | | --- | --- | --- | | string|array | $configurator | A PHP callable reference | #### Return Value | | | | --- | --- | | $this | | symfony AbstractTrait AbstractTrait ============== trait **AbstractTrait** Methods ------- | | | | | --- | --- | --- | | $this | [abstract](#method_abstract)(bool $abstract = true) Whether this definition is abstract, that means it merely serves as a template for other definitions. | | Details ------- ### final $this abstract(bool $abstract = true) Whether this definition is abstract, that means it merely serves as a template for other definitions. #### Parameters | | | | | --- | --- | --- | | bool | $abstract | | #### Return Value | | | | --- | --- | | $this | | symfony SyntheticTrait SyntheticTrait =============== trait **SyntheticTrait** Methods ------- | | | | | --- | --- | --- | | $this | [synthetic](#method_synthetic)(bool $synthetic = true) Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected. | | Details ------- ### final $this synthetic(bool $synthetic = true) Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected. #### Parameters | | | | | --- | --- | --- | | bool | $synthetic | | #### Return Value | | | | --- | --- | | $this | | symfony AutowireTrait AutowireTrait ============== trait **AutowireTrait** Methods ------- | | | | | --- | --- | --- | | $this | [autowire](#method_autowire)(bool $autowired = true) Enables/disables autowiring. | | Details ------- ### final $this autowire(bool $autowired = true) Enables/disables autowiring. #### Parameters | | | | | --- | --- | --- | | bool | $autowired | | #### Return Value | | | | --- | --- | | $this | | symfony BindTrait BindTrait ========== trait **BindTrait** Methods ------- | | | | | --- | --- | --- | | $this | [bind](#method_bind)(string $nameOrFqcn, mixed $valueOrRef) Sets bindings. | | Details ------- ### final $this bind(string $nameOrFqcn, mixed $valueOrRef) Sets bindings. Bindings map $named or FQCN arguments to values that should be injected in the matching parameters (of the constructor, of methods called and of controller actions). #### Parameters | | | | | --- | --- | --- | | string | $nameOrFqcn | A parameter name with its "$" prefix, or a FQCN | | mixed | $valueOrRef | The value or reference to bind | #### Return Value | | | | --- | --- | | $this | | symfony AutoconfigureTrait AutoconfigureTrait =================== trait **AutoconfigureTrait** Methods ------- | | | | | --- | --- | --- | | $this | [autoconfigure](#method_autoconfigure)(bool $autoconfigured = true) Sets whether or not instanceof conditionals should be prepended with a global set. | | Details ------- ### final $this autoconfigure(bool $autoconfigured = true) Sets whether or not instanceof conditionals should be prepended with a global set. #### Parameters | | | | | --- | --- | --- | | bool | $autoconfigured | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when a parent is already set | symfony CallTrait CallTrait ========== trait **CallTrait** Methods ------- | | | | | --- | --- | --- | | $this | [call](#method_call)(string $method, array $arguments = array()) Adds a method to call after service initialization. | | Details ------- ### final $this call(string $method, array $arguments = array()) Adds a method to call after service initialization. #### Parameters | | | | | --- | --- | --- | | string | $method | The method name to call | | array | $arguments | An array of arguments to pass to the method call | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | on empty $method param |
programming_docs
symfony ParentTrait ParentTrait ============ trait **ParentTrait** Methods ------- | | | | | --- | --- | --- | | $this | [parent](#method_parent)(string $parent) Sets the Definition to inherit from. | | Details ------- ### final $this parent(string $parent) Sets the Definition to inherit from. #### Parameters | | | | | --- | --- | --- | | string | $parent | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when parent cannot be set | symfony FileTrait FileTrait ========== trait **FileTrait** Methods ------- | | | | | --- | --- | --- | | $this | [file](#method_file)(string $file) Sets a file to require before creating the service. | | Details ------- ### final $this file(string $file) Sets a file to require before creating the service. #### Parameters | | | | | --- | --- | --- | | string | $file | A full pathname to include | #### Return Value | | | | --- | --- | | $this | | symfony ClassTrait ClassTrait =========== trait **ClassTrait** Methods ------- | | | | | --- | --- | --- | | $this | [class](#method_class)($class) Sets the service class. | | Details ------- ### final $this class($class) Sets the service class. #### Parameters | | | | | --- | --- | --- | | | $class | | #### Return Value | | | | --- | --- | | $this | | symfony ShareTrait ShareTrait =========== trait **ShareTrait** Methods ------- | | | | | --- | --- | --- | | $this | [share](#method_share)(bool $shared = true) Sets if the service must be shared or not. | | Details ------- ### final $this share(bool $shared = true) Sets if the service must be shared or not. #### Parameters | | | | | --- | --- | --- | | bool | $shared | Whether the service must be shared or not | #### Return Value | | | | --- | --- | | $this | | symfony LazyTrait LazyTrait ========== trait **LazyTrait** Methods ------- | | | | | --- | --- | --- | | $this | [lazy](#method_lazy)(bool $lazy = true) Sets the lazy flag of this service. | | Details ------- ### final $this lazy(bool $lazy = true) Sets the lazy flag of this service. #### Parameters | | | | | --- | --- | --- | | bool | $lazy | | #### Return Value | | | | --- | --- | | $this | | symfony FactoryTrait FactoryTrait ============= trait **FactoryTrait** Methods ------- | | | | | --- | --- | --- | | $this | [factory](#method_factory)(string|array $factory) Sets a factory. | | Details ------- ### final $this factory(string|array $factory) Sets a factory. #### Parameters | | | | | --- | --- | --- | | string|array | $factory | A PHP callable reference | #### Return Value | | | | --- | --- | | $this | | symfony DecorateTrait DecorateTrait ============== trait **DecorateTrait** Methods ------- | | | | | --- | --- | --- | | $this | [decorate](#method_decorate)(string|null $id, string|null $renamedId = null, int $priority = 0) Sets the service that this service is decorating. | | Details ------- ### final $this decorate(string|null $id, string|null $renamedId = null, int $priority = 0) Sets the service that this service is decorating. #### Parameters | | | | | --- | --- | --- | | string|null | $id | The decorated service id, use null to remove decoration | | string|null | $renamedId | The new decorated service id | | int | $priority | The priority of decoration | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | in case the decorated service id and the new decorated service id are equals | symfony Symfony\Component\DependencyInjection\LazyProxy\Instantiator Symfony\Component\DependencyInjection\LazyProxy\Instantiator ============================================================ Classes ------- | | | | --- | --- | | [RealServiceInstantiator](instantiator/realserviceinstantiator "Symfony\Component\DependencyInjection\LazyProxy\Instantiator\RealServiceInstantiator") | {@inheritdoc} | Interfaces ---------- | | | | --- | --- | | *[InstantiatorInterface](instantiator/instantiatorinterface "Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInterface")* | Lazy proxy instantiator, capable of instantiating a proxy given a container, the service definitions and a callback that produces the real service instance. | symfony ProxyHelper ProxyHelper ============ class **ProxyHelper** Methods ------- | | | | | --- | --- | --- | | static string|null | [getTypeHint](#method_getTypeHint)([ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) $r, [ReflectionParameter](http://php.net/ReflectionParameter) $p = null, $noBuiltin = false) | | Details ------- ### static string|null getTypeHint([ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) $r, [ReflectionParameter](http://php.net/ReflectionParameter) $p = null, $noBuiltin = false) #### Parameters | | | | | --- | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | $r | | | [ReflectionParameter](http://php.net/ReflectionParameter) | $p | | | | $noBuiltin | | #### Return Value | | | | --- | --- | | string|null | The FQCN or builtin name of the type hint, or null when the type hint references an invalid self|parent context | symfony Symfony\Component\DependencyInjection\LazyProxy\PhpDumper Symfony\Component\DependencyInjection\LazyProxy\PhpDumper ========================================================= Classes ------- | | | | --- | --- | | [NullDumper](phpdumper/nulldumper "Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\NullDumper") | Null dumper, negates any proxy code generation for any given service definition. | Interfaces ---------- | | | | --- | --- | | *[DumperInterface](phpdumper/dumperinterface "Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface")* | Lazy proxy dumper capable of generating the instantiation logic PHP code for proxied services. | symfony DumperInterface DumperInterface ================ interface **DumperInterface** Lazy proxy dumper capable of generating the instantiation logic PHP code for proxied services. Methods ------- | | | | | --- | --- | --- | | bool | [isProxyCandidate](#method_isProxyCandidate)([Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition) Inspects whether the given definitions should produce proxy instantiation logic in the dumped container. | | | string | [getProxyFactoryCode](#method_getProxyFactoryCode)([Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $id, string $factoryCode) Generates the code to be used to instantiate a proxy in the dumped factory code. | | | string | [getProxyCode](#method_getProxyCode)([Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition) Generates the code for the lazy proxy. | | Details ------- ### bool isProxyCandidate([Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition) Inspects whether the given definitions should produce proxy instantiation logic in the dumped container. #### Parameters | | | | | --- | --- | --- | | [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | #### Return Value | | | | --- | --- | | bool | | ### string getProxyFactoryCode([Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $id, string $factoryCode) Generates the code to be used to instantiate a proxy in the dumped factory code. #### Parameters | | | | | --- | --- | --- | | [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $id | Service identifier | | string | $factoryCode | The code to execute to create the service | #### Return Value | | | | --- | --- | | string | | ### string getProxyCode([Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition) Generates the code for the lazy proxy. #### Parameters | | | | | --- | --- | --- | | [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | #### Return Value | | | | --- | --- | | string | | symfony NullDumper NullDumper =========== class **NullDumper** implements [DumperInterface](dumperinterface "Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface") Null dumper, negates any proxy code generation for any given service definition. Methods ------- | | | | | --- | --- | --- | | bool | [isProxyCandidate](#method_isProxyCandidate)([Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition) Inspects whether the given definitions should produce proxy instantiation logic in the dumped container. | | | string | [getProxyFactoryCode](#method_getProxyFactoryCode)([Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $id, string $factoryCode = null) Generates the code to be used to instantiate a proxy in the dumped factory code. | | | string | [getProxyCode](#method_getProxyCode)([Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition) Generates the code for the lazy proxy. | | Details ------- ### bool isProxyCandidate([Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition) Inspects whether the given definitions should produce proxy instantiation logic in the dumped container. #### Parameters | | | | | --- | --- | --- | | [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | #### Return Value | | | | --- | --- | | bool | | ### string getProxyFactoryCode([Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $id, string $factoryCode = null) Generates the code to be used to instantiate a proxy in the dumped factory code. #### Parameters | | | | | --- | --- | --- | | [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $id | Service identifier | | string | $factoryCode | The code to execute to create the service | #### Return Value | | | | --- | --- | | string | | ### string getProxyCode([Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition) Generates the code for the lazy proxy. #### Parameters | | | | | --- | --- | --- | | [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | #### Return Value | | | | --- | --- | | string | | symfony InstantiatorInterface InstantiatorInterface ====================== interface **InstantiatorInterface** Lazy proxy instantiator, capable of instantiating a proxy given a container, the service definitions and a callback that produces the real service instance. Methods ------- | | | | | --- | --- | --- | | object | [instantiateProxy](#method_instantiateProxy)([ContainerInterface](../../containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") $container, [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $id, callable $realInstantiator) Instantiates a proxy object. | | Details ------- ### object instantiateProxy([ContainerInterface](../../containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") $container, [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $id, callable $realInstantiator) Instantiates a proxy object. #### Parameters | | | | | --- | --- | --- | | [ContainerInterface](../../containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") | $container | The container from which the service is being requested | | [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") | $definition | The definition of the requested service | | string | $id | Identifier of the requested service | | callable | $realInstantiator | Zero-argument callback that is capable of producing the real service instance | #### Return Value | | | | --- | --- | | object | | symfony RealServiceInstantiator RealServiceInstantiator ======================== class **RealServiceInstantiator** implements [InstantiatorInterface](instantiatorinterface "Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInterface") {@inheritdoc} Noop proxy instantiator - simply produces the real service instead of a proxy instance. Methods ------- | | | | | --- | --- | --- | | object | [instantiateProxy](#method_instantiateProxy)([ContainerInterface](../../containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") $container, [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $id, callable $realInstantiator) Instantiates a proxy object. | | Details ------- ### object instantiateProxy([ContainerInterface](../../containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") $container, [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $id, callable $realInstantiator) Instantiates a proxy object. #### Parameters | | | | | --- | --- | --- | | [ContainerInterface](../../containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") | $container | The container from which the service is being requested | | [Definition](../../definition "Symfony\Component\DependencyInjection\Definition") | $definition | The definition of the requested service | | string | $id | Identifier of the requested service | | callable | $realInstantiator | Zero-argument callback that is capable of producing the real service instance | #### Return Value | | | | --- | --- | | object | | symfony ServiceNotFoundException ServiceNotFoundException ========================= class **ServiceNotFoundException** extends [InvalidArgumentException](invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") implements NotFoundExceptionInterface This exception is thrown when a non-existent service is requested. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $id, string $sourceId = null, [Exception](http://php.net/Exception) $previous = null, array $alternatives = array(), string $msg = null) | | | | [getId](#method_getId)() | | | | [getSourceId](#method_getSourceId)() | | | | [getAlternatives](#method_getAlternatives)() | | Details ------- ### \_\_construct(string $id, string $sourceId = null, [Exception](http://php.net/Exception) $previous = null, array $alternatives = array(), string $msg = null) #### Parameters | | | | | --- | --- | --- | | string | $id | | | string | $sourceId | | | [Exception](http://php.net/Exception) | $previous | | | array | $alternatives | | | string | $msg | | ### getId() ### getSourceId() ### getAlternatives() symfony ServiceCircularReferenceException ServiceCircularReferenceException ================================== class **ServiceCircularReferenceException** extends [RuntimeException](runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") This exception is thrown when a circular reference is detected. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $serviceId, array $path, [Exception](http://php.net/Exception) $previous = null) | | | | [getServiceId](#method_getServiceId)() | | | | [getPath](#method_getPath)() | | Details ------- ### \_\_construct(string $serviceId, array $path, [Exception](http://php.net/Exception) $previous = null) #### Parameters | | | | | --- | --- | --- | | string | $serviceId | | | array | $path | | | [Exception](http://php.net/Exception) | $previous | | ### getServiceId() ### getPath() symfony ParameterNotFoundException ParameterNotFoundException =========================== class **ParameterNotFoundException** extends [InvalidArgumentException](invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") implements NotFoundExceptionInterface This exception is thrown when a non-existent parameter is used. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $key, string $sourceId = null, string $sourceKey = null, [Exception](http://php.net/Exception) $previous = null, array $alternatives = array(), string $nonNestedAlternative = null) | | | | [updateRepr](#method_updateRepr)() | | | | [getKey](#method_getKey)() | | | | [getSourceId](#method_getSourceId)() | | | | [getSourceKey](#method_getSourceKey)() | | | | [setSourceId](#method_setSourceId)($sourceId) | | | | [setSourceKey](#method_setSourceKey)($sourceKey) | | Details ------- ### \_\_construct(string $key, string $sourceId = null, string $sourceKey = null, [Exception](http://php.net/Exception) $previous = null, array $alternatives = array(), string $nonNestedAlternative = null) #### Parameters | | | | | --- | --- | --- | | string | $key | The requested parameter key | | string | $sourceId | The service id that references the non-existent parameter | | string | $sourceKey | The parameter key that references the non-existent parameter | | [Exception](http://php.net/Exception) | $previous | The previous exception | | array | $alternatives | Some parameter name alternatives | | string | $nonNestedAlternative | The alternative parameter name when the user expected dot notation for nested parameters | ### updateRepr() ### getKey() ### getSourceId() ### getSourceKey() ### setSourceId($sourceId) #### Parameters | | | | | --- | --- | --- | | | $sourceId | | ### setSourceKey($sourceKey) #### Parameters | | | | | --- | --- | --- | | | $sourceKey | | symfony InvalidArgumentException InvalidArgumentException ========================= class **InvalidArgumentException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\DependencyInjection\Exception\ExceptionInterface") Base InvalidArgumentException for Dependency Injection component. symfony ParameterCircularReferenceException ParameterCircularReferenceException ==================================== class **ParameterCircularReferenceException** extends [RuntimeException](runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") This exception is thrown when a circular reference in a parameter is detected. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $parameters, [Exception](http://php.net/Exception) $previous = null) | | | | [getParameters](#method_getParameters)() | | Details ------- ### \_\_construct(array $parameters, [Exception](http://php.net/Exception) $previous = null) #### Parameters | | | | | --- | --- | --- | | array | $parameters | | | [Exception](http://php.net/Exception) | $previous | | ### getParameters()
programming_docs
symfony ExceptionInterface ExceptionInterface =================== interface **ExceptionInterface** implements ContainerExceptionInterface Base ExceptionInterface for Dependency Injection component. symfony LogicException LogicException =============== class **LogicException** extends [LogicException](http://php.net/LogicException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\DependencyInjection\Exception\ExceptionInterface") Base LogicException for Dependency Injection component. symfony RuntimeException RuntimeException ================= class **RuntimeException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\DependencyInjection\Exception\ExceptionInterface") Base RuntimeException for Dependency Injection component. symfony OutOfBoundsException OutOfBoundsException ===================== class **OutOfBoundsException** extends [OutOfBoundsException](http://php.net/OutOfBoundsException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\DependencyInjection\Exception\ExceptionInterface") Base OutOfBoundsException for Dependency Injection component. symfony AutowiringFailedException AutowiringFailedException ========================== class **AutowiringFailedException** extends [RuntimeException](runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") Thrown when a definition cannot be autowired. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $serviceId, string $message = '', int $code = 0, [Exception](http://php.net/Exception) $previous = null) | | | | [getServiceId](#method_getServiceId)() | | Details ------- ### \_\_construct(string $serviceId, string $message = '', int $code = 0, [Exception](http://php.net/Exception) $previous = null) #### Parameters | | | | | --- | --- | --- | | string | $serviceId | | | string | $message | | | int | $code | | | [Exception](http://php.net/Exception) | $previous | | ### getServiceId() symfony BadMethodCallException BadMethodCallException ======================= class **BadMethodCallException** extends [BadMethodCallException](http://php.net/BadMethodCallException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\DependencyInjection\Exception\ExceptionInterface") Base BadMethodCallException for Dependency Injection component. symfony EnvNotFoundException EnvNotFoundException ===================== class **EnvNotFoundException** extends [InvalidArgumentException](invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") This exception is thrown when an environment variable is not found. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $name) | | Details ------- ### \_\_construct(string $name) #### Parameters | | | | | --- | --- | --- | | string | $name | | symfony EnvParameterException EnvParameterException ====================== class **EnvParameterException** extends [InvalidArgumentException](invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") This exception wraps exceptions whose messages contain a reference to an env parameter. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $envs, [Exception](http://php.net/Exception) $previous = null, string $message = 'Incompatible use of dynamic environment variables "%s" found in parameters.') | | Details ------- ### \_\_construct(array $envs, [Exception](http://php.net/Exception) $previous = null, string $message = 'Incompatible use of dynamic environment variables "%s" found in parameters.') #### Parameters | | | | | --- | --- | --- | | array | $envs | | | [Exception](http://php.net/Exception) | $previous | | | string | $message | | symfony AutowireRequiredMethodsPass AutowireRequiredMethodsPass ============================ class **AutowireRequiredMethodsPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Looks for definitions with autowiring enabled and registers their corresponding "@required" methods as setters. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | from [AbstractRecursivePass](abstractrecursivepass#method_process "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | symfony ResolveParameterPlaceHoldersPass ResolveParameterPlaceHoldersPass ================================= class **ResolveParameterPlaceHoldersPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Resolves all parameter placeholders "%somevalue%" to their real values. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | | [\_\_construct](#method___construct)(bool $resolveArrays = true) | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### \_\_construct(bool $resolveArrays = true) #### Parameters | | | | | --- | --- | --- | | bool | $resolveArrays | | symfony DefinitionErrorExceptionPass DefinitionErrorExceptionPass ============================= class **DefinitionErrorExceptionPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Throws an exception for any Definitions that have errors and still exist. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | from [AbstractRecursivePass](abstractrecursivepass#method_process "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | symfony InlineServiceDefinitionsPass InlineServiceDefinitionsPass ============================= class **InlineServiceDefinitionsPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") implements [RepeatablePassInterface](repeatablepassinterface "Symfony\Component\DependencyInjection\Compiler\RepeatablePassInterface") Inline service definitions where this is possible. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | from [AbstractRecursivePass](abstractrecursivepass#method_process "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | | [setRepeatedPass](#method_setRepeatedPass)([RepeatedPass](repeatedpass "Symfony\Component\DependencyInjection\Compiler\RepeatedPass") $repeatedPass) | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### setRepeatedPass([RepeatedPass](repeatedpass "Symfony\Component\DependencyInjection\Compiler\RepeatedPass") $repeatedPass) #### Parameters | | | | | --- | --- | --- | | [RepeatedPass](repeatedpass "Symfony\Component\DependencyInjection\Compiler\RepeatedPass") | $repeatedPass | |
programming_docs
symfony CheckExceptionOnInvalidReferenceBehaviorPass CheckExceptionOnInvalidReferenceBehaviorPass ============================================= class **CheckExceptionOnInvalidReferenceBehaviorPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Checks that all references are pointing to a valid service. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | from [AbstractRecursivePass](abstractrecursivepass#method_process "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | symfony CompilerPassInterface CompilerPassInterface ====================== interface **CompilerPassInterface** Interface that must be implemented by compilation passes. Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony ResolveClassPass ResolveClassPass ================= class **ResolveClassPass** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony ValidateEnvPlaceholdersPass ValidateEnvPlaceholdersPass ============================ class **ValidateEnvPlaceholdersPass** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Validates environment variable placeholders used in extension configuration with dummy values. Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony ServiceReferenceGraphNode ServiceReferenceGraphNode ========================== class **ServiceReferenceGraphNode** Represents a node in your service graph. Value is typically a definition, or an alias. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $id, mixed $value) | | | | [addInEdge](#method_addInEdge)([ServiceReferenceGraphEdge](servicereferencegraphedge "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphEdge") $edge) | | | | [addOutEdge](#method_addOutEdge)([ServiceReferenceGraphEdge](servicereferencegraphedge "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphEdge") $edge) | | | bool | [isAlias](#method_isAlias)() Checks if the value of this node is an Alias. | | | bool | [isDefinition](#method_isDefinition)() Checks if the value of this node is a Definition. | | | string | [getId](#method_getId)() Returns the identifier. | | | array | [getInEdges](#method_getInEdges)() Returns the in edges. | | | array | [getOutEdges](#method_getOutEdges)() Returns the out edges. | | | mixed | [getValue](#method_getValue)() Returns the value of this Node. | | | | [clear](#method_clear)() Clears all edges. | | Details ------- ### \_\_construct(string $id, mixed $value) #### Parameters | | | | | --- | --- | --- | | string | $id | The node identifier | | mixed | $value | The node value | ### addInEdge([ServiceReferenceGraphEdge](servicereferencegraphedge "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphEdge") $edge) #### Parameters | | | | | --- | --- | --- | | [ServiceReferenceGraphEdge](servicereferencegraphedge "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphEdge") | $edge | | ### addOutEdge([ServiceReferenceGraphEdge](servicereferencegraphedge "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphEdge") $edge) #### Parameters | | | | | --- | --- | --- | | [ServiceReferenceGraphEdge](servicereferencegraphedge "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphEdge") | $edge | | ### bool isAlias() Checks if the value of this node is an Alias. #### Return Value | | | | --- | --- | | bool | True if the value is an Alias instance | ### bool isDefinition() Checks if the value of this node is a Definition. #### Return Value | | | | --- | --- | | bool | True if the value is a Definition instance | ### string getId() Returns the identifier. #### Return Value | | | | --- | --- | | string | | ### array getInEdges() Returns the in edges. #### Return Value | | | | --- | --- | | array | The in ServiceReferenceGraphEdge array | ### array getOutEdges() Returns the out edges. #### Return Value | | | | --- | --- | | array | The out ServiceReferenceGraphEdge array | ### mixed getValue() Returns the value of this Node. #### Return Value | | | | --- | --- | | mixed | The value | ### clear() Clears all edges. symfony RepeatablePassInterface RepeatablePassInterface ======================== interface **RepeatablePassInterface** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Interface that must be implemented by passes that are run as part of an RepeatedPass. Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | from [CompilerPassInterface](compilerpassinterface#method_process "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") | | | [setRepeatedPass](#method_setRepeatedPass)([RepeatedPass](repeatedpass "Symfony\Component\DependencyInjection\Compiler\RepeatedPass") $repeatedPass) | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### setRepeatedPass([RepeatedPass](repeatedpass "Symfony\Component\DependencyInjection\Compiler\RepeatedPass") $repeatedPass) #### Parameters | | | | | --- | --- | --- | | [RepeatedPass](repeatedpass "Symfony\Component\DependencyInjection\Compiler\RepeatedPass") | $repeatedPass | | symfony PriorityTaggedServiceTrait PriorityTaggedServiceTrait =========================== trait **PriorityTaggedServiceTrait** Trait that allows a generic method to find and sort service by priority option in the tag. symfony RemoveUnusedDefinitionsPass RemoveUnusedDefinitionsPass ============================ class **RemoveUnusedDefinitionsPass** implements [RepeatablePassInterface](repeatablepassinterface "Symfony\Component\DependencyInjection\Compiler\RepeatablePassInterface") Removes unused service definitions from the container. Methods ------- | | | | | --- | --- | --- | | | [setRepeatedPass](#method_setRepeatedPass)([RepeatedPass](repeatedpass "Symfony\Component\DependencyInjection\Compiler\RepeatedPass") $repeatedPass) | | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Processes the ContainerBuilder to remove unused definitions. | | Details ------- ### setRepeatedPass([RepeatedPass](repeatedpass "Symfony\Component\DependencyInjection\Compiler\RepeatedPass") $repeatedPass) #### Parameters | | | | | --- | --- | --- | | [RepeatedPass](repeatedpass "Symfony\Component\DependencyInjection\Compiler\RepeatedPass") | $repeatedPass | | ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Processes the ContainerBuilder to remove unused definitions. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony PassConfig PassConfig =========== class **PassConfig** Compiler Pass Configuration. This class has a default configuration embedded. Constants --------- | | | | --- | --- | | TYPE\_AFTER\_REMOVING | | | TYPE\_BEFORE\_OPTIMIZATION | | | TYPE\_BEFORE\_REMOVING | | | TYPE\_OPTIMIZE | | | TYPE\_REMOVE | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)() | | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] | [getPasses](#method_getPasses)() Returns all passes in order to be processed. | | | | [addPass](#method_addPass)([CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") $pass, string $type = self::TYPE\_BEFORE\_OPTIMIZATION, int $priority = 0) Adds a pass. | | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] | [getAfterRemovingPasses](#method_getAfterRemovingPasses)() Gets all passes for the AfterRemoving pass. | | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] | [getBeforeOptimizationPasses](#method_getBeforeOptimizationPasses)() Gets all passes for the BeforeOptimization pass. | | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] | [getBeforeRemovingPasses](#method_getBeforeRemovingPasses)() Gets all passes for the BeforeRemoving pass. | | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] | [getOptimizationPasses](#method_getOptimizationPasses)() Gets all passes for the Optimization pass. | | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] | [getRemovingPasses](#method_getRemovingPasses)() Gets all passes for the Removing pass. | | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") | [getMergePass](#method_getMergePass)() Gets the Merge pass. | | | | [setMergePass](#method_setMergePass)([CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") $pass) | | | | [setAfterRemovingPasses](#method_setAfterRemovingPasses)(array $passes) Sets the AfterRemoving passes. | | | | [setBeforeOptimizationPasses](#method_setBeforeOptimizationPasses)(array $passes) Sets the BeforeOptimization passes. | | | | [setBeforeRemovingPasses](#method_setBeforeRemovingPasses)(array $passes) Sets the BeforeRemoving passes. | | | | [setOptimizationPasses](#method_setOptimizationPasses)(array $passes) Sets the Optimization passes. | | | | [setRemovingPasses](#method_setRemovingPasses)(array $passes) Sets the Removing passes. | | Details ------- ### \_\_construct() ### [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] getPasses() Returns all passes in order to be processed. #### Return Value | | | | --- | --- | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] | | ### addPass([CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") $pass, string $type = self::TYPE\_BEFORE\_OPTIMIZATION, int $priority = 0) Adds a pass. #### Parameters | | | | | --- | --- | --- | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") | $pass | A Compiler pass | | string | $type | The pass type | | int | $priority | Used to sort the passes | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when a pass type doesn't exist | ### [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] getAfterRemovingPasses() Gets all passes for the AfterRemoving pass. #### Return Value | | | | --- | --- | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] | | ### [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] getBeforeOptimizationPasses() Gets all passes for the BeforeOptimization pass. #### Return Value | | | | --- | --- | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] | | ### [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] getBeforeRemovingPasses() Gets all passes for the BeforeRemoving pass. #### Return Value | | | | --- | --- | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] | | ### [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] getOptimizationPasses() Gets all passes for the Optimization pass. #### Return Value | | | | --- | --- | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] | | ### [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] getRemovingPasses() Gets all passes for the Removing pass. #### Return Value | | | | --- | --- | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface")[] | | ### [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") getMergePass() Gets the Merge pass. #### Return Value | | | | --- | --- | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") | | ### setMergePass([CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") $pass) #### Parameters | | | | | --- | --- | --- | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") | $pass | | ### setAfterRemovingPasses(array $passes) Sets the AfterRemoving passes. #### Parameters | | | | | --- | --- | --- | | array | $passes | | ### setBeforeOptimizationPasses(array $passes) Sets the BeforeOptimization passes. #### Parameters | | | | | --- | --- | --- | | array | $passes | | ### setBeforeRemovingPasses(array $passes) Sets the BeforeRemoving passes. #### Parameters | | | | | --- | --- | --- | | array | $passes | | ### setOptimizationPasses(array $passes) Sets the Optimization passes. #### Parameters | | | | | --- | --- | --- | | array | $passes | | ### setRemovingPasses(array $passes) Sets the Removing passes. #### Parameters | | | | | --- | --- | --- | | array | $passes | |
programming_docs
symfony AnalyzeServiceReferencesPass AnalyzeServiceReferencesPass ============================= class **AnalyzeServiceReferencesPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") implements [RepeatablePassInterface](repeatablepassinterface "Symfony\Component\DependencyInjection\Compiler\RepeatablePassInterface") Run this pass before passes that need to know more about the relation of your services. This class will populate the ServiceReferenceGraph with information. You can retrieve the graph in other passes from the compiler. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Processes a ContainerBuilder object to populate the service reference graph. | | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | | [\_\_construct](#method___construct)(bool $onlyConstructorArguments = false, bool $hasProxyDumper = true) | | | | [setRepeatedPass](#method_setRepeatedPass)([RepeatedPass](repeatedpass "Symfony\Component\DependencyInjection\Compiler\RepeatedPass") $repeatedPass) | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Processes a ContainerBuilder object to populate the service reference graph. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### \_\_construct(bool $onlyConstructorArguments = false, bool $hasProxyDumper = true) #### Parameters | | | | | --- | --- | --- | | bool | $onlyConstructorArguments | | | bool | $hasProxyDumper | | ### setRepeatedPass([RepeatedPass](repeatedpass "Symfony\Component\DependencyInjection\Compiler\RepeatedPass") $repeatedPass) #### Parameters | | | | | --- | --- | --- | | [RepeatedPass](repeatedpass "Symfony\Component\DependencyInjection\Compiler\RepeatedPass") | $repeatedPass | | symfony RemovePrivateAliasesPass RemovePrivateAliasesPass ========================= class **RemovePrivateAliasesPass** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Remove private aliases from the container. They were only used to establish dependencies between services, and these dependencies have been resolved in one of the previous passes. Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Removes private aliases from the ContainerBuilder. | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Removes private aliases from the ContainerBuilder. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony RemoveAbstractDefinitionsPass RemoveAbstractDefinitionsPass ============================== class **RemoveAbstractDefinitionsPass** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Removes abstract Definitions. Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Removes abstract definitions from the ContainerBuilder. | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Removes abstract definitions from the ContainerBuilder. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony DecoratorServicePass DecoratorServicePass ===================== class **DecoratorServicePass** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Overwrites a service but keeps the overridden one. Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony ResolveReferencesToAliasesPass ResolveReferencesToAliasesPass =============================== class **ResolveReferencesToAliasesPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Replaces all references to aliases with references to the actual service. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | symfony AutoAliasServicePass AutoAliasServicePass ===================== class **AutoAliasServicePass** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Sets a service to be an alias of another one, given a format pattern. Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony MergeExtensionConfigurationParameterBag MergeExtensionConfigurationParameterBag ======================================== class **MergeExtensionConfigurationParameterBag** extends [EnvPlaceholderParameterBag](../parameterbag/envplaceholderparameterbag "Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag") Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $parameters | | from [ParameterBag](../parameterbag/parameterbag#property_parameters "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | protected | $resolved | | from [ParameterBag](../parameterbag/parameterbag#property_resolved "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(parent $parameterBag) | | | | [clear](#method_clear)() Clears all parameters. | from [ParameterBag](../parameterbag/parameterbag#method_clear "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | | [add](#method_add)(array $parameters) Adds parameters to the service container parameters. | from [ParameterBag](../parameterbag/parameterbag#method_add "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | array | [all](#method_all)() Gets the service container parameters. | from [ParameterBag](../parameterbag/parameterbag#method_all "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | mixed | [get](#method_get)(string $name) Gets a service container parameter. | from [EnvPlaceholderParameterBag](../parameterbag/envplaceholderparameterbag#method_get "Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag") | | | [set](#method_set)(string $name, mixed $value) Sets a service container parameter. | from [ParameterBag](../parameterbag/parameterbag#method_set "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | bool | [has](#method_has)(string $name) Returns true if a parameter name is defined. | from [ParameterBag](../parameterbag/parameterbag#method_has "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | | [remove](#method_remove)(string $name) Removes a parameter. | from [ParameterBag](../parameterbag/parameterbag#method_remove "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | | [resolve](#method_resolve)() Replaces parameter placeholders (%name%) by their values for all parameters. | from [EnvPlaceholderParameterBag](../parameterbag/envplaceholderparameterbag#method_resolve "Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag") | | | [resolveValue](#method_resolveValue)(mixed $value, array $resolving = array()) Replaces parameter placeholders (%name%) by their values. | from [ParameterBag](../parameterbag/parameterbag#method_resolveValue "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | string | [resolveString](#method_resolveString)(string $value, array $resolving = array()) Resolves parameters inside a string. | from [ParameterBag](../parameterbag/parameterbag#method_resolveString "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | | [isResolved](#method_isResolved)() | from [ParameterBag](../parameterbag/parameterbag#method_isResolved "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | mixed | [escapeValue](#method_escapeValue)(mixed $value) Escape parameter placeholders %. | from [ParameterBag](../parameterbag/parameterbag#method_escapeValue "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | mixed | [unescapeValue](#method_unescapeValue)(mixed $value) Unescape parameter placeholders %. | from [ParameterBag](../parameterbag/parameterbag#method_unescapeValue "Symfony\Component\DependencyInjection\ParameterBag\ParameterBag") | | string | [getEnvPlaceholderUniquePrefix](#method_getEnvPlaceholderUniquePrefix)() Gets the common env placeholder prefix for env vars created by this bag. | from [EnvPlaceholderParameterBag](../parameterbag/envplaceholderparameterbag#method_getEnvPlaceholderUniquePrefix "Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag") | | string[][] | [getEnvPlaceholders](#method_getEnvPlaceholders)() Returns the map of env vars used in the resolved parameter values to their placeholders. | | | array | [getUnusedEnvPlaceholders](#method_getUnusedEnvPlaceholders)() | | | | [clearUnusedEnvPlaceholders](#method_clearUnusedEnvPlaceholders)() | from [EnvPlaceholderParameterBag](../parameterbag/envplaceholderparameterbag#method_clearUnusedEnvPlaceholders "Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag") | | | [mergeEnvPlaceholders](#method_mergeEnvPlaceholders)([EnvPlaceholderParameterBag](../parameterbag/envplaceholderparameterbag "Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag") $bag) Merges the env placeholders of another EnvPlaceholderParameterBag. | from [EnvPlaceholderParameterBag](../parameterbag/envplaceholderparameterbag#method_mergeEnvPlaceholders "Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag") | | | [setProvidedTypes](#method_setProvidedTypes)(array $providedTypes) Maps env prefixes to their corresponding PHP types. | from [EnvPlaceholderParameterBag](../parameterbag/envplaceholderparameterbag#method_setProvidedTypes "Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag") | | string[][] | [getProvidedTypes](#method_getProvidedTypes)() Gets the PHP types corresponding to env() parameter prefixes. | from [EnvPlaceholderParameterBag](../parameterbag/envplaceholderparameterbag#method_getProvidedTypes "Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag") | | | [freezeAfterProcessing](#method_freezeAfterProcessing)([Extension](../extension/extension "Symfony\Component\DependencyInjection\Extension\Extension") $extension, [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) | | Details ------- ### \_\_construct(parent $parameterBag) #### Parameters | | | | | --- | --- | --- | | parent | $parameterBag | | ### clear() Clears all parameters. ### add(array $parameters) Adds parameters to the service container parameters. #### Parameters | | | | | --- | --- | --- | | array | $parameters | An array of parameters | ### array all() Gets the service container parameters. #### Return Value | | | | --- | --- | | array | An array of parameters | ### mixed get(string $name) Gets a service container parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | mixed | The parameter value | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if the parameter is not defined | ### set(string $name, mixed $value) Sets a service container parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | | mixed | $value | The parameter value | ### bool has(string $name) Returns true if a parameter name is defined. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | bool | true if the parameter name is defined, false otherwise | ### remove(string $name) Removes a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | ### resolve() Replaces parameter placeholders (%name%) by their values for all parameters. ### resolveValue(mixed $value, array $resolving = array()) Replaces parameter placeholders (%name%) by their values. #### Parameters | | | | | --- | --- | --- | | mixed | $value | A value | | array | $resolving | An array of keys that are being resolved (used internally to detect circular references) | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if a placeholder references a parameter that does not exist | | [ParameterCircularReferenceException](../exception/parametercircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException") | if a circular reference if detected | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | when a given parameter has a type problem | ### string resolveString(string $value, array $resolving = array()) Resolves parameters inside a string. #### Parameters | | | | | --- | --- | --- | | string | $value | The string to resolve | | array | $resolving | An array of keys that are being resolved (used internally to detect circular references) | #### Return Value | | | | --- | --- | | string | The resolved string | #### Exceptions | | | | --- | --- | | [ParameterNotFoundException](../exception/parameternotfoundexception "Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException") | if a placeholder references a parameter that does not exist | | [ParameterCircularReferenceException](../exception/parametercircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException") | if a circular reference if detected | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | when a given parameter has a type problem | ### isResolved() ### mixed escapeValue(mixed $value) Escape parameter placeholders %. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | mixed | | ### mixed unescapeValue(mixed $value) Unescape parameter placeholders %. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | #### Return Value | | | | --- | --- | | mixed | | ### string getEnvPlaceholderUniquePrefix() Gets the common env placeholder prefix for env vars created by this bag. #### Return Value | | | | --- | --- | | string | | ### string[][] getEnvPlaceholders() Returns the map of env vars used in the resolved parameter values to their placeholders. #### Return Value | | | | --- | --- | | string[][] | A map of env var names to their placeholders | ### array getUnusedEnvPlaceholders() #### Return Value | | | | --- | --- | | array | | ### clearUnusedEnvPlaceholders() ### mergeEnvPlaceholders([EnvPlaceholderParameterBag](../parameterbag/envplaceholderparameterbag "Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag") $bag) Merges the env placeholders of another EnvPlaceholderParameterBag. #### Parameters | | | | | --- | --- | --- | | [EnvPlaceholderParameterBag](../parameterbag/envplaceholderparameterbag "Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag") | $bag | | ### setProvidedTypes(array $providedTypes) Maps env prefixes to their corresponding PHP types. #### Parameters | | | | | --- | --- | --- | | array | $providedTypes | | ### string[][] getProvidedTypes() Gets the PHP types corresponding to env() parameter prefixes. #### Return Value | | | | --- | --- | | string[][] | | ### freezeAfterProcessing([Extension](../extension/extension "Symfony\Component\DependencyInjection\Extension\Extension") $extension, [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) #### Parameters | | | | | --- | --- | --- | | [Extension](../extension/extension "Symfony\Component\DependencyInjection\Extension\Extension") | $extension | | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | |
programming_docs
symfony CheckCircularReferencesPass CheckCircularReferencesPass ============================ class **CheckCircularReferencesPass** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Checks your services for circular references. References from method calls are ignored since we might be able to resolve these references depending on the order in which services are called. Circular reference from method calls will only be detected at run-time. Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Checks the ContainerBuilder object for circular references. | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Checks the ContainerBuilder object for circular references. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony CheckArgumentsValidityPass CheckArgumentsValidityPass =========================== class **CheckArgumentsValidityPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Checks if arguments of methods are properly configured. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | from [AbstractRecursivePass](abstractrecursivepass#method_process "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | | [\_\_construct](#method___construct)(bool $throwExceptions = true) | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### \_\_construct(bool $throwExceptions = true) #### Parameters | | | | | --- | --- | --- | | bool | $throwExceptions | | symfony ExtensionCompilerPass ExtensionCompilerPass ====================== class **ExtensionCompilerPass** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") A pass to automatically process extensions if they implement CompilerPassInterface. Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony ResolveHotPathPass ResolveHotPathPass =================== class **ResolveHotPathPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Propagate "container.hot\_path" tags to referenced services. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | | [\_\_construct](#method___construct)($tagName = 'container.hot\_path') | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### \_\_construct($tagName = 'container.hot\_path') #### Parameters | | | | | --- | --- | --- | | | $tagName | | symfony RegisterServiceSubscribersPass RegisterServiceSubscribersPass =============================== class **RegisterServiceSubscribersPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Compiler pass to register tagged services that require a service locator. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | from [AbstractRecursivePass](abstractrecursivepass#method_process "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | symfony AutowirePass AutowirePass ============= class **AutowirePass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Inspects existing service definitions and wires the autowired ones using the type hints of their classes. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | | [\_\_construct](#method___construct)(bool $throwOnAutowireException = true) | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### \_\_construct(bool $throwOnAutowireException = true) #### Parameters | | | | | --- | --- | --- | | bool | $throwOnAutowireException | | symfony ServiceReferenceGraph ServiceReferenceGraph ====================== class **ServiceReferenceGraph** This is a directed graph of your services. This information can be used by your compiler passes instead of collecting it themselves which improves performance quite a lot. Methods ------- | | | | | --- | --- | --- | | bool | [hasNode](#method_hasNode)(string $id) | | | [ServiceReferenceGraphNode](servicereferencegraphnode "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode") | [getNode](#method_getNode)(string $id) Gets a node by identifier. | | | array | [getNodes](#method_getNodes)() Returns all nodes. | | | | [clear](#method_clear)() Clears all nodes. | | | | [connect](#method_connect)(string|null $sourceId, $sourceValue, string|null $destId, $destValue = null, $reference = null, bool $lazy = false, bool $weak = false) Connects 2 nodes together in the Graph. | | Details ------- ### bool hasNode(string $id) #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | bool | | ### [ServiceReferenceGraphNode](servicereferencegraphnode "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode") getNode(string $id) Gets a node by identifier. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | [ServiceReferenceGraphNode](servicereferencegraphnode "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | if no node matches the supplied identifier | ### array getNodes() Returns all nodes. #### Return Value | | | | --- | --- | | array | | ### clear() Clears all nodes. ### connect(string|null $sourceId, $sourceValue, string|null $destId, $destValue = null, $reference = null, bool $lazy = false, bool $weak = false) Connects 2 nodes together in the Graph. #### Parameters | | | | | --- | --- | --- | | string|null | $sourceId | | | | $sourceValue | | | string|null | $destId | | | | $destValue | | | | $reference | | | bool | $lazy | | | bool | $weak | |
programming_docs
symfony Compiler Compiler ========= class **Compiler** This class is used to remove circular dependencies between individual passes. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)() | | | [PassConfig](passconfig "Symfony\Component\DependencyInjection\Compiler\PassConfig") | [getPassConfig](#method_getPassConfig)() Returns the PassConfig. | | | [ServiceReferenceGraph](servicereferencegraph "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraph") | [getServiceReferenceGraph](#method_getServiceReferenceGraph)() Returns the ServiceReferenceGraph. | | | | [addPass](#method_addPass)([CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") $pass, string $type = PassConfig::TYPE\_BEFORE\_OPTIMIZATION, int $priority = 0) Adds a pass to the PassConfig. | | | | [log](#method_log)([CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") $pass, string $message) | | | array | [getLog](#method_getLog)() Returns the log. | | | | [compile](#method_compile)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Run the Compiler and process all Passes. | | Details ------- ### \_\_construct() ### [PassConfig](passconfig "Symfony\Component\DependencyInjection\Compiler\PassConfig") getPassConfig() Returns the PassConfig. #### Return Value | | | | --- | --- | | [PassConfig](passconfig "Symfony\Component\DependencyInjection\Compiler\PassConfig") | The PassConfig instance | ### [ServiceReferenceGraph](servicereferencegraph "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraph") getServiceReferenceGraph() Returns the ServiceReferenceGraph. #### Return Value | | | | --- | --- | | [ServiceReferenceGraph](servicereferencegraph "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraph") | The ServiceReferenceGraph instance | ### addPass([CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") $pass, string $type = PassConfig::TYPE\_BEFORE\_OPTIMIZATION, int $priority = 0) Adds a pass to the PassConfig. #### Parameters | | | | | --- | --- | --- | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") | $pass | A compiler pass | | string | $type | The type of the pass | | int | $priority | Used to sort the passes | ### log([CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") $pass, string $message) #### Parameters | | | | | --- | --- | --- | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") | $pass | | | string | $message | | ### array getLog() Returns the log. #### Return Value | | | | --- | --- | | array | Log array | ### compile([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Run the Compiler and process all Passes. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony RegisterEnvVarProcessorsPass RegisterEnvVarProcessorsPass ============================= class **RegisterEnvVarProcessorsPass** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Creates the container.env\_var\_processors\_locator service. Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony ResolveServiceSubscribersPass ResolveServiceSubscribersPass ============================== class **ResolveServiceSubscribersPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Compiler pass to inject their service locator to service subscribers. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | from [AbstractRecursivePass](abstractrecursivepass#method_process "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | symfony MergeExtensionConfigurationPass MergeExtensionConfigurationPass ================================ class **MergeExtensionConfigurationPass** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Merges extension configs into the container builder. Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony ServiceLocatorTagPass ServiceLocatorTagPass ====================== class **ServiceLocatorTagPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Applies the "container.service\_locator" tag by wrapping references into ServiceClosureArgument instances. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | from [AbstractRecursivePass](abstractrecursivepass#method_process "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | static [Reference](../reference "Symfony\Component\DependencyInjection\Reference") | [register](#method_register)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, array $refMap, string|null $callerId = null) | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### static [Reference](../reference "Symfony\Component\DependencyInjection\Reference") register([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, array $refMap, string|null $callerId = null) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | array | $refMap | | | string|null | $callerId | | #### Return Value | | | | --- | --- | | [Reference](../reference "Symfony\Component\DependencyInjection\Reference") | | symfony AbstractRecursivePass AbstractRecursivePass ====================== abstract class **AbstractRecursivePass** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | | protected | $currentId | | | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | symfony CheckDefinitionValidityPass CheckDefinitionValidityPass ============================ class **CheckDefinitionValidityPass** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") This pass validates each definition individually only taking the information into account which is contained in the definition itself. Later passes can rely on the following, and specifically do not need to perform these checks themselves: * non synthetic, non abstract services always have a class set * synthetic services are always public Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Processes the ContainerBuilder to validate the Definition. | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Processes the ContainerBuilder to validate the Definition. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | When the Definition is invalid | symfony RepeatedPass RepeatedPass ============= class **RepeatedPass** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") A pass that might be run repeatedly. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $passes) | | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Process the repeatable passes that run more than once. | | | | [setRepeat](#method_setRepeat)() Sets if the pass should repeat. | | | [RepeatablePassInterface](repeatablepassinterface "Symfony\Component\DependencyInjection\Compiler\RepeatablePassInterface")[] | [getPasses](#method_getPasses)() Returns the passes. | | Details ------- ### \_\_construct(array $passes) #### Parameters | | | | | --- | --- | --- | | array | $passes | An array of RepeatablePassInterface objects | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when the passes don't implement RepeatablePassInterface | ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Process the repeatable passes that run more than once. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### setRepeat() Sets if the pass should repeat. ### [RepeatablePassInterface](repeatablepassinterface "Symfony\Component\DependencyInjection\Compiler\RepeatablePassInterface")[] getPasses() Returns the passes. #### Return Value | | | | --- | --- | | [RepeatablePassInterface](repeatablepassinterface "Symfony\Component\DependencyInjection\Compiler\RepeatablePassInterface")[] | An array of RepeatablePassInterface objects |
programming_docs
symfony ResolveChildDefinitionsPass ResolveChildDefinitionsPass ============================ class **ResolveChildDefinitionsPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") This replaces all ChildDefinition instances with their equivalent fully merged Definition instance. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | from [AbstractRecursivePass](abstractrecursivepass#method_process "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | symfony ResolveFactoryClassPass ResolveFactoryClassPass ======================== class **ResolveFactoryClassPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | from [AbstractRecursivePass](abstractrecursivepass#method_process "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | symfony ResolveEnvPlaceholdersPass ResolveEnvPlaceholdersPass =========================== class **ResolveEnvPlaceholdersPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Replaces env var placeholders by their current values. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | from [AbstractRecursivePass](abstractrecursivepass#method_process "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | symfony ResolvePrivatesPass ResolvePrivatesPass ==================== class **ResolvePrivatesPass** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony ResolveInstanceofConditionalsPass ResolveInstanceofConditionalsPass ================================== class **ResolveInstanceofConditionalsPass** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Applies instanceof conditionals to definitions. Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony ResolveTaggedIteratorArgumentPass ResolveTaggedIteratorArgumentPass ================================== class **ResolveTaggedIteratorArgumentPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Resolves all TaggedIteratorArgument arguments. Traits ------ | | | | --- | --- | | [PriorityTaggedServiceTrait](prioritytaggedservicetrait "Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait") | Trait that allows a generic method to find and sort service by priority option in the tag. | Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | from [AbstractRecursivePass](abstractrecursivepass#method_process "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | symfony ServiceReferenceGraphEdge ServiceReferenceGraphEdge ========================== class **ServiceReferenceGraphEdge** Represents an edge in your service graph. Value is typically a reference. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ServiceReferenceGraphNode](servicereferencegraphnode "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode") $sourceNode, [ServiceReferenceGraphNode](servicereferencegraphnode "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode") $destNode, $value = null, bool $lazy = false, bool $weak = false) | | | mixed | [getValue](#method_getValue)() Returns the value of the edge. | | | [ServiceReferenceGraphNode](servicereferencegraphnode "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode") | [getSourceNode](#method_getSourceNode)() Returns the source node. | | | [ServiceReferenceGraphNode](servicereferencegraphnode "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode") | [getDestNode](#method_getDestNode)() Returns the destination node. | | | bool | [isLazy](#method_isLazy)() Returns true if the edge is lazy, meaning it's a dependency not requiring direct instantiation. | | | bool | [isWeak](#method_isWeak)() Returns true if the edge is weak, meaning it shouldn't prevent removing the target service. | | Details ------- ### \_\_construct([ServiceReferenceGraphNode](servicereferencegraphnode "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode") $sourceNode, [ServiceReferenceGraphNode](servicereferencegraphnode "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode") $destNode, $value = null, bool $lazy = false, bool $weak = false) #### Parameters | | | | | --- | --- | --- | | [ServiceReferenceGraphNode](servicereferencegraphnode "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode") | $sourceNode | | | [ServiceReferenceGraphNode](servicereferencegraphnode "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode") | $destNode | | | | $value | | | bool | $lazy | | | bool | $weak | | ### mixed getValue() Returns the value of the edge. #### Return Value | | | | --- | --- | | mixed | | ### [ServiceReferenceGraphNode](servicereferencegraphnode "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode") getSourceNode() Returns the source node. #### Return Value | | | | --- | --- | | [ServiceReferenceGraphNode](servicereferencegraphnode "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode") | | ### [ServiceReferenceGraphNode](servicereferencegraphnode "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode") getDestNode() Returns the destination node. #### Return Value | | | | --- | --- | | [ServiceReferenceGraphNode](servicereferencegraphnode "Symfony\Component\DependencyInjection\Compiler\ServiceReferenceGraphNode") | | ### bool isLazy() Returns true if the edge is lazy, meaning it's a dependency not requiring direct instantiation. #### Return Value | | | | --- | --- | | bool | | ### bool isWeak() Returns true if the edge is weak, meaning it shouldn't prevent removing the target service. #### Return Value | | | | --- | --- | | bool | |
programming_docs
symfony ReplaceAliasByActualDefinitionPass ReplaceAliasByActualDefinitionPass =================================== class **ReplaceAliasByActualDefinitionPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Replaces aliases with actual service definitions, effectively removing these aliases. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Process the Container to replace aliases with service definitions. | | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Process the Container to replace aliases with service definitions. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | if the service definition does not exist | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | symfony ResolveInvalidReferencesPass ResolveInvalidReferencesPass ============================= class **ResolveInvalidReferencesPass** implements [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Emulates the invalid behavior if the reference is not found within the container. Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Process the ContainerBuilder to resolve invalid references. | | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Process the ContainerBuilder to resolve invalid references. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony ResolveNamedArgumentsPass ResolveNamedArgumentsPass ========================== class **ResolveNamedArgumentsPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Resolves named arguments to their corresponding numeric index. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | from [AbstractRecursivePass](abstractrecursivepass#method_process "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | symfony CheckReferenceValidityPass CheckReferenceValidityPass =========================== class **CheckReferenceValidityPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Checks the validity of references. The following checks are performed by this pass: - target definitions are not abstract Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | from [AbstractRecursivePass](abstractrecursivepass#method_process "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | symfony MergeExtensionConfigurationContainerBuilder MergeExtensionConfigurationContainerBuilder ============================================ class **MergeExtensionConfigurationContainerBuilder** extends [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") A container builder preventing using methods that wouldn't have any effect from extensions. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $parameterBag | | from [Container](../container#property_parameterBag "Symfony\Component\DependencyInjection\Container") | | protected | $services | | from [Container](../container#property_services "Symfony\Component\DependencyInjection\Container") | | protected | $fileMap | | from [Container](../container#property_fileMap "Symfony\Component\DependencyInjection\Container") | | protected | $methodMap | | from [Container](../container#property_methodMap "Symfony\Component\DependencyInjection\Container") | | protected | $factories | | from [Container](../container#property_factories "Symfony\Component\DependencyInjection\Container") | | protected | $aliases | | from [Container](../container#property_aliases "Symfony\Component\DependencyInjection\Container") | | protected | $loading | | from [Container](../container#property_loading "Symfony\Component\DependencyInjection\Container") | | protected | $resolving | | from [Container](../container#property_resolving "Symfony\Component\DependencyInjection\Container") | | protected | $syntheticIds | | from [Container](../container#property_syntheticIds "Symfony\Component\DependencyInjection\Container") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ExtensionInterface](../extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface") $extension, [ParameterBagInterface](../parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") $parameterBag = null) | | | | [compile](#method_compile)(bool $resolveEnvPlaceholders = false) Compiles the container. | | | bool | [isCompiled](#method_isCompiled)() Returns true if the container is compiled. | from [Container](../container#method_isCompiled "Symfony\Component\DependencyInjection\Container") | | [ParameterBagInterface](../parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") | [getParameterBag](#method_getParameterBag)() Gets the service container parameter bag. | from [Container](../container#method_getParameterBag "Symfony\Component\DependencyInjection\Container") | | mixed | [getParameter](#method_getParameter)(string $name) Gets a parameter. | from [Container](../container#method_getParameter "Symfony\Component\DependencyInjection\Container") | | bool | [hasParameter](#method_hasParameter)(string $name) Checks if a parameter exists. | from [Container](../container#method_hasParameter "Symfony\Component\DependencyInjection\Container") | | | [setParameter](#method_setParameter)(string $name, mixed $value) Sets a parameter. | from [Container](../container#method_setParameter "Symfony\Component\DependencyInjection\Container") | | | [set](#method_set)(string $id, object $service) Sets a service. | from [ContainerBuilder](../containerbuilder#method_set "Symfony\Component\DependencyInjection\ContainerBuilder") | | bool | [has](#method_has)(string $id) Returns true if the given service is defined. | from [ContainerBuilder](../containerbuilder#method_has "Symfony\Component\DependencyInjection\ContainerBuilder") | | object | [get](#method_get)(string $id, int $invalidBehavior = ContainerInterface::EXCEPTION\_ON\_INVALID\_REFERENCE) Gets a service. | from [ContainerBuilder](../containerbuilder#method_get "Symfony\Component\DependencyInjection\ContainerBuilder") | | bool | [initialized](#method_initialized)(string $id) Returns true if the given service has actually been initialized. | from [Container](../container#method_initialized "Symfony\Component\DependencyInjection\Container") | | | [reset](#method_reset)() Resets shared services from the container. | from [Container](../container#method_reset "Symfony\Component\DependencyInjection\Container") | | array | [getServiceIds](#method_getServiceIds)() Gets all service ids. | from [ContainerBuilder](../containerbuilder#method_getServiceIds "Symfony\Component\DependencyInjection\ContainerBuilder") | | array | [getRemovedIds](#method_getRemovedIds)() Gets removed service or alias ids. | from [ContainerBuilder](../containerbuilder#method_getRemovedIds "Symfony\Component\DependencyInjection\ContainerBuilder") | | static string | [camelize](#method_camelize)(string $id) Camelizes a string. | from [Container](../container#method_camelize "Symfony\Component\DependencyInjection\Container") | | static string | [underscore](#method_underscore)(string $id) A string to underscore. | from [Container](../container#method_underscore "Symfony\Component\DependencyInjection\Container") | | object | [load](#method_load)($file) Creates a service by requiring its factory file. | from [Container](../container#method_load "Symfony\Component\DependencyInjection\Container") | | mixed | [getEnv](#method_getEnv)(string $name) Fetches a variable from the environment. | from [ContainerBuilder](../containerbuilder#method_getEnv "Symfony\Component\DependencyInjection\ContainerBuilder") | | | [setResourceTracking](#method_setResourceTracking)(bool $track) Sets the track resources flag. | from [ContainerBuilder](../containerbuilder#method_setResourceTracking "Symfony\Component\DependencyInjection\ContainerBuilder") | | bool | [isTrackingResources](#method_isTrackingResources)() Checks if resources are tracked. | from [ContainerBuilder](../containerbuilder#method_isTrackingResources "Symfony\Component\DependencyInjection\ContainerBuilder") | | | [setProxyInstantiator](#method_setProxyInstantiator)([InstantiatorInterface](../lazyproxy/instantiator/instantiatorinterface "Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInterface") $proxyInstantiator) Sets the instantiator to be used when fetching proxies. | from [ContainerBuilder](../containerbuilder#method_setProxyInstantiator "Symfony\Component\DependencyInjection\ContainerBuilder") | | | [registerExtension](#method_registerExtension)([ExtensionInterface](../extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface") $extension) | | | [ExtensionInterface](../extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface") | [getExtension](#method_getExtension)(string $name) Returns an extension by alias or namespace. | from [ContainerBuilder](../containerbuilder#method_getExtension "Symfony\Component\DependencyInjection\ContainerBuilder") | | [ExtensionInterface](../extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface")[] | [getExtensions](#method_getExtensions)() Returns all registered extensions. | from [ContainerBuilder](../containerbuilder#method_getExtensions "Symfony\Component\DependencyInjection\ContainerBuilder") | | bool | [hasExtension](#method_hasExtension)(string $name) Checks if we have an extension. | from [ContainerBuilder](../containerbuilder#method_hasExtension "Symfony\Component\DependencyInjection\ContainerBuilder") | | [ResourceInterface](../../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface")[] | [getResources](#method_getResources)() Returns an array of resources loaded to build this configuration. | from [ContainerBuilder](../containerbuilder#method_getResources "Symfony\Component\DependencyInjection\ContainerBuilder") | | $this | [addResource](#method_addResource)([ResourceInterface](../../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $resource) | from [ContainerBuilder](../containerbuilder#method_addResource "Symfony\Component\DependencyInjection\ContainerBuilder") | | $this | [setResources](#method_setResources)(array $resources) Sets the resources for this configuration. | from [ContainerBuilder](../containerbuilder#method_setResources "Symfony\Component\DependencyInjection\ContainerBuilder") | | $this | [addObjectResource](#method_addObjectResource)(object|string $object) Adds the object class hierarchy as resources. | from [ContainerBuilder](../containerbuilder#method_addObjectResource "Symfony\Component\DependencyInjection\ContainerBuilder") | | ReflectionClass|null | [getReflectionClass](#method_getReflectionClass)(string|null $class, bool $throw = true) Retrieves the requested reflection class and registers it for resource tracking. | from [ContainerBuilder](../containerbuilder#method_getReflectionClass "Symfony\Component\DependencyInjection\ContainerBuilder") | | bool | [fileExists](#method_fileExists)(string $path, bool|string $trackContents = true) Checks whether the requested file or directory exists and registers the result for resource tracking. | from [ContainerBuilder](../containerbuilder#method_fileExists "Symfony\Component\DependencyInjection\ContainerBuilder") | | $this | [loadFromExtension](#method_loadFromExtension)(string $extension, array $values = null) Loads the configuration for an extension. | from [ContainerBuilder](../containerbuilder#method_loadFromExtension "Symfony\Component\DependencyInjection\ContainerBuilder") | | $this | [addCompilerPass](#method_addCompilerPass)([CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") $pass, string $type = PassConfig::TYPE\_BEFORE\_OPTIMIZATION, int $priority = 0) Adds a compiler pass. | | | [PassConfig](passconfig "Symfony\Component\DependencyInjection\Compiler\PassConfig") | [getCompilerPassConfig](#method_getCompilerPassConfig)() Returns the compiler pass config which can then be modified. | from [ContainerBuilder](../containerbuilder#method_getCompilerPassConfig "Symfony\Component\DependencyInjection\ContainerBuilder") | | [Compiler](compiler "Symfony\Component\DependencyInjection\Compiler\Compiler") | [getCompiler](#method_getCompiler)() Returns the compiler. | from [ContainerBuilder](../containerbuilder#method_getCompiler "Symfony\Component\DependencyInjection\ContainerBuilder") | | | [removeDefinition](#method_removeDefinition)(string $id) Removes a service definition. | from [ContainerBuilder](../containerbuilder#method_removeDefinition "Symfony\Component\DependencyInjection\ContainerBuilder") | | | [merge](#method_merge)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Merges a ContainerBuilder with the current ContainerBuilder configuration. | from [ContainerBuilder](../containerbuilder#method_merge "Symfony\Component\DependencyInjection\ContainerBuilder") | | array | [getExtensionConfig](#method_getExtensionConfig)(string $name) Returns the configuration array for the given extension. | from [ContainerBuilder](../containerbuilder#method_getExtensionConfig "Symfony\Component\DependencyInjection\ContainerBuilder") | | | [prependExtensionConfig](#method_prependExtensionConfig)(string $name, array $config) Prepends a config array to the configs of the given extension. | from [ContainerBuilder](../containerbuilder#method_prependExtensionConfig "Symfony\Component\DependencyInjection\ContainerBuilder") | | | [addAliases](#method_addAliases)(array $aliases) Adds the service aliases. | from [ContainerBuilder](../containerbuilder#method_addAliases "Symfony\Component\DependencyInjection\ContainerBuilder") | | | [setAliases](#method_setAliases)(array $aliases) Sets the service aliases. | from [ContainerBuilder](../containerbuilder#method_setAliases "Symfony\Component\DependencyInjection\ContainerBuilder") | | [Alias](../alias "Symfony\Component\DependencyInjection\Alias") | [setAlias](#method_setAlias)(string $alias, string|[Alias](../alias "Symfony\Component\DependencyInjection\Alias") $id) Sets an alias for an existing service. | from [ContainerBuilder](../containerbuilder#method_setAlias "Symfony\Component\DependencyInjection\ContainerBuilder") | | | [removeAlias](#method_removeAlias)(string $alias) Removes an alias. | from [ContainerBuilder](../containerbuilder#method_removeAlias "Symfony\Component\DependencyInjection\ContainerBuilder") | | bool | [hasAlias](#method_hasAlias)(string $id) Returns true if an alias exists under the given identifier. | from [ContainerBuilder](../containerbuilder#method_hasAlias "Symfony\Component\DependencyInjection\ContainerBuilder") | | [Alias](../alias "Symfony\Component\DependencyInjection\Alias")[] | [getAliases](#method_getAliases)() Gets all defined aliases. | from [ContainerBuilder](../containerbuilder#method_getAliases "Symfony\Component\DependencyInjection\ContainerBuilder") | | [Alias](../alias "Symfony\Component\DependencyInjection\Alias") | [getAlias](#method_getAlias)(string $id) Gets an alias. | from [ContainerBuilder](../containerbuilder#method_getAlias "Symfony\Component\DependencyInjection\ContainerBuilder") | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | [register](#method_register)($id, $class = null) Registers a service definition. | from [ContainerBuilder](../containerbuilder#method_register "Symfony\Component\DependencyInjection\ContainerBuilder") | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | [autowire](#method_autowire)(string $id, string|null $class = null) Registers an autowired service definition. | from [ContainerBuilder](../containerbuilder#method_autowire "Symfony\Component\DependencyInjection\ContainerBuilder") | | | [addDefinitions](#method_addDefinitions)(array $definitions) Adds the service definitions. | from [ContainerBuilder](../containerbuilder#method_addDefinitions "Symfony\Component\DependencyInjection\ContainerBuilder") | | | [setDefinitions](#method_setDefinitions)(array $definitions) Sets the service definitions. | from [ContainerBuilder](../containerbuilder#method_setDefinitions "Symfony\Component\DependencyInjection\ContainerBuilder") | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition")[] | [getDefinitions](#method_getDefinitions)() Gets all service definitions. | from [ContainerBuilder](../containerbuilder#method_getDefinitions "Symfony\Component\DependencyInjection\ContainerBuilder") | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | [setDefinition](#method_setDefinition)(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Sets a service definition. | from [ContainerBuilder](../containerbuilder#method_setDefinition "Symfony\Component\DependencyInjection\ContainerBuilder") | | bool | [hasDefinition](#method_hasDefinition)(string $id) Returns true if a service definition exists under the given identifier. | from [ContainerBuilder](../containerbuilder#method_hasDefinition "Symfony\Component\DependencyInjection\ContainerBuilder") | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | [getDefinition](#method_getDefinition)(string $id) Gets a service definition. | from [ContainerBuilder](../containerbuilder#method_getDefinition "Symfony\Component\DependencyInjection\ContainerBuilder") | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | [findDefinition](#method_findDefinition)(string $id) Gets a service definition by id or alias. | from [ContainerBuilder](../containerbuilder#method_findDefinition "Symfony\Component\DependencyInjection\ContainerBuilder") | | mixed | [resolveServices](#method_resolveServices)(mixed $value) Replaces service references by the real service instance and evaluates expressions. | from [ContainerBuilder](../containerbuilder#method_resolveServices "Symfony\Component\DependencyInjection\ContainerBuilder") | | array | [findTaggedServiceIds](#method_findTaggedServiceIds)(string $name, bool $throwOnAbstract = false) Returns service ids for a given tag. | from [ContainerBuilder](../containerbuilder#method_findTaggedServiceIds "Symfony\Component\DependencyInjection\ContainerBuilder") | | array | [findTags](#method_findTags)() Returns all tags the defined services use. | from [ContainerBuilder](../containerbuilder#method_findTags "Symfony\Component\DependencyInjection\ContainerBuilder") | | string[] | [findUnusedTags](#method_findUnusedTags)() Returns all tags not queried by findTaggedServiceIds. | from [ContainerBuilder](../containerbuilder#method_findUnusedTags "Symfony\Component\DependencyInjection\ContainerBuilder") | | | [addExpressionLanguageProvider](#method_addExpressionLanguageProvider)([ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) | from [ContainerBuilder](../containerbuilder#method_addExpressionLanguageProvider "Symfony\Component\DependencyInjection\ContainerBuilder") | | [ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface")[] | [getExpressionLanguageProviders](#method_getExpressionLanguageProviders)() | from [ContainerBuilder](../containerbuilder#method_getExpressionLanguageProviders "Symfony\Component\DependencyInjection\ContainerBuilder") | | [ChildDefinition](../childdefinition "Symfony\Component\DependencyInjection\ChildDefinition") | [registerForAutoconfiguration](#method_registerForAutoconfiguration)(string $interface) Returns a ChildDefinition that will be used for autoconfiguring the interface/class. | from [ContainerBuilder](../containerbuilder#method_registerForAutoconfiguration "Symfony\Component\DependencyInjection\ContainerBuilder") | | [ChildDefinition](../childdefinition "Symfony\Component\DependencyInjection\ChildDefinition")[] | [getAutoconfiguredInstanceof](#method_getAutoconfiguredInstanceof)() Returns an array of ChildDefinition[] keyed by interface. | from [ContainerBuilder](../containerbuilder#method_getAutoconfiguredInstanceof "Symfony\Component\DependencyInjection\ContainerBuilder") | | mixed | [resolveEnvPlaceholders](#method_resolveEnvPlaceholders)(mixed $value, string|true|null $format = null, array $usedEnvs = null) Resolves env parameter placeholders in a string or an array. | | | int[] | [getEnvCounters](#method_getEnvCounters)() Get statistics about env usage. | from [ContainerBuilder](../containerbuilder#method_getEnvCounters "Symfony\Component\DependencyInjection\ContainerBuilder") | | | [log](#method_log)([CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") $pass, string $message) | from [ContainerBuilder](../containerbuilder#method_log "Symfony\Component\DependencyInjection\ContainerBuilder") | | static array | [getServiceConditionals](#method_getServiceConditionals)(mixed $value) Returns the Service Conditionals. | from [ContainerBuilder](../containerbuilder#method_getServiceConditionals "Symfony\Component\DependencyInjection\ContainerBuilder") | | static array | [getInitializedConditionals](#method_getInitializedConditionals)(mixed $value) Returns the initialized conditionals. | from [ContainerBuilder](../containerbuilder#method_getInitializedConditionals "Symfony\Component\DependencyInjection\ContainerBuilder") | | static string | [hash](#method_hash)(mixed $value) Computes a reasonably unique hash of a value. | from [ContainerBuilder](../containerbuilder#method_hash "Symfony\Component\DependencyInjection\ContainerBuilder") | Details ------- ### \_\_construct([ExtensionInterface](../extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface") $extension, [ParameterBagInterface](../parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") $parameterBag = null) #### Parameters | | | | | --- | --- | --- | | [ExtensionInterface](../extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface") | $extension | | | [ParameterBagInterface](../parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") | $parameterBag | | ### compile(bool $resolveEnvPlaceholders = false) Compiles the container. This method passes the container to compiler passes whose job is to manipulate and optimize the container. The main compiler passes roughly do four things: * The extension configurations are merged; * Parameter values are resolved; * The parameter bag is frozen; * Extension loading is disabled. #### Parameters | | | | | --- | --- | --- | | bool | $resolveEnvPlaceholders | Whether %env()% parameters should be resolved using the current env vars or be replaced by uniquely identifiable placeholders. Set to "true" when you want to use the current ContainerBuilder directly, keep to "false" when the container is dumped instead. | ### bool isCompiled() Returns true if the container is compiled. #### Return Value | | | | --- | --- | | bool | | ### [ParameterBagInterface](../parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") getParameterBag() Gets the service container parameter bag. #### Return Value | | | | --- | --- | | [ParameterBagInterface](../parameterbag/parameterbaginterface "Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface") | A ParameterBagInterface instance | ### mixed getParameter(string $name) Gets a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | mixed | The parameter value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | if the parameter is not defined | ### bool hasParameter(string $name) Checks if a parameter exists. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | #### Return Value | | | | --- | --- | | bool | The presence of parameter in container | ### setParameter(string $name, mixed $value) Sets a parameter. #### Parameters | | | | | --- | --- | --- | | string | $name | The parameter name | | mixed | $value | The parameter value | ### set(string $id, object $service) Sets a service. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | | object | $service | The service instance | #### Exceptions | | | | --- | --- | | [BadMethodCallException](../exception/badmethodcallexception "Symfony\Component\DependencyInjection\Exception\BadMethodCallException") | When this ContainerBuilder is compiled | ### bool has(string $id) Returns true if the given service is defined. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | #### Return Value | | | | --- | --- | | bool | true if the service is defined, false otherwise | ### object get(string $id, int $invalidBehavior = ContainerInterface::EXCEPTION\_ON\_INVALID\_REFERENCE) Gets a service. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | | int | $invalidBehavior | The behavior when the service does not exist | #### Return Value | | | | --- | --- | | object | The associated service | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | when no definitions are available | | [ServiceCircularReferenceException](../exception/servicecircularreferenceexception "Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException") | When a circular reference is detected | | [ServiceNotFoundException](../exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | When the service is not defined | | [Exception](http://php.net/Exception) | | #### See also | | | | --- | --- | | [Reference](../reference "Symfony\Component\DependencyInjection\Reference") | | ### bool initialized(string $id) Returns true if the given service has actually been initialized. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Return Value | | | | --- | --- | | bool | true if the service has been initialized, false otherwise | ### reset() Resets shared services from the container. The container is not intended to be used again after being reset in a normal workflow. This method is meant as a way to release references for ref-counting. A subsequent call to ContainerInterface::get will recreate a new instance of the shared service. ### array getServiceIds() Gets all service ids. #### Return Value | | | | --- | --- | | array | An array of all defined service ids | ### array getRemovedIds() Gets removed service or alias ids. #### Return Value | | | | --- | --- | | array | | ### static string camelize(string $id) Camelizes a string. #### Parameters | | | | | --- | --- | --- | | string | $id | A string to camelize | #### Return Value | | | | --- | --- | | string | The camelized string | ### static string underscore(string $id) A string to underscore. #### Parameters | | | | | --- | --- | --- | | string | $id | The string to underscore | #### Return Value | | | | --- | --- | | string | The underscored string | ### protected object load($file) Creates a service by requiring its factory file. #### Parameters | | | | | --- | --- | --- | | | $file | | #### Return Value | | | | --- | --- | | object | The service created by the file | ### protected mixed getEnv(string $name) Fetches a variable from the environment. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the environment variable | #### Return Value | | | | --- | --- | | mixed | The value to use for the provided environment variable name | #### Exceptions | | | | --- | --- | | [EnvNotFoundException](../exception/envnotfoundexception "Symfony\Component\DependencyInjection\Exception\EnvNotFoundException") | When the environment variable is not found and has no default value | ### setResourceTracking(bool $track) Sets the track resources flag. If you are not using the loaders and therefore don't want to depend on the Config component, set this flag to false. #### Parameters | | | | | --- | --- | --- | | bool | $track | True if you want to track resources, false otherwise | ### bool isTrackingResources() Checks if resources are tracked. #### Return Value | | | | --- | --- | | bool | true If resources are tracked, false otherwise | ### setProxyInstantiator([InstantiatorInterface](../lazyproxy/instantiator/instantiatorinterface "Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInterface") $proxyInstantiator) Sets the instantiator to be used when fetching proxies. #### Parameters | | | | | --- | --- | --- | | [InstantiatorInterface](../lazyproxy/instantiator/instantiatorinterface "Symfony\Component\DependencyInjection\LazyProxy\Instantiator\InstantiatorInterface") | $proxyInstantiator | | ### registerExtension([ExtensionInterface](../extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface") $extension) #### Parameters | | | | | --- | --- | --- | | [ExtensionInterface](../extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface") | $extension | | ### [ExtensionInterface](../extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface") getExtension(string $name) Returns an extension by alias or namespace. #### Parameters | | | | | --- | --- | --- | | string | $name | An alias or a namespace | #### Return Value | | | | --- | --- | | [ExtensionInterface](../extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface") | An extension instance | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\DependencyInjection\Exception\LogicException") | if the extension is not registered | ### [ExtensionInterface](../extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface")[] getExtensions() Returns all registered extensions. #### Return Value | | | | --- | --- | | [ExtensionInterface](../extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface")[] | An array of ExtensionInterface | ### bool hasExtension(string $name) Checks if we have an extension. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the extension | #### Return Value | | | | --- | --- | | bool | If the extension exists | ### [ResourceInterface](../../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface")[] getResources() Returns an array of resources loaded to build this configuration. #### Return Value | | | | --- | --- | | [ResourceInterface](../../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface")[] | An array of resources | ### $this addResource([ResourceInterface](../../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") $resource) #### Parameters | | | | | --- | --- | --- | | [ResourceInterface](../../config/resource/resourceinterface "Symfony\Component\Config\Resource\ResourceInterface") | $resource | | #### Return Value | | | | --- | --- | | $this | | ### $this setResources(array $resources) Sets the resources for this configuration. #### Parameters | | | | | --- | --- | --- | | array | $resources | An array of resources | #### Return Value | | | | --- | --- | | $this | | ### $this addObjectResource(object|string $object) Adds the object class hierarchy as resources. #### Parameters | | | | | --- | --- | --- | | object|string | $object | An object instance or class name | #### Return Value | | | | --- | --- | | $this | | ### ReflectionClass|null getReflectionClass(string|null $class, bool $throw = true) Retrieves the requested reflection class and registers it for resource tracking. #### Parameters | | | | | --- | --- | --- | | string|null | $class | | | bool | $throw | | #### Return Value | | | | --- | --- | | ReflectionClass|null | | #### Exceptions | | | | --- | --- | | [ReflectionException](http://php.net/ReflectionException) | when a parent class/interface/trait is not found and $throw is true | ### bool fileExists(string $path, bool|string $trackContents = true) Checks whether the requested file or directory exists and registers the result for resource tracking. #### Parameters | | | | | --- | --- | --- | | string | $path | The file or directory path for which to check the existence | | bool|string | $trackContents | Whether to track contents of the given resource. If a string is passed, it will be used as pattern for tracking contents of the requested directory | #### Return Value | | | | --- | --- | | bool | | ### $this loadFromExtension(string $extension, array $values = null) Loads the configuration for an extension. #### Parameters | | | | | --- | --- | --- | | string | $extension | The extension alias or namespace | | array | $values | An array of values that customizes the extension | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [BadMethodCallException](../exception/badmethodcallexception "Symfony\Component\DependencyInjection\Exception\BadMethodCallException") | When this ContainerBuilder is compiled | | [LogicException](http://php.net/LogicException) | if the extension is not registered | ### $this addCompilerPass([CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") $pass, string $type = PassConfig::TYPE\_BEFORE\_OPTIMIZATION, int $priority = 0) Adds a compiler pass. #### Parameters | | | | | --- | --- | --- | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") | $pass | A compiler pass | | string | $type | The type of compiler pass | | int | $priority | Used to sort the passes | #### Return Value | | | | --- | --- | | $this | | ### [PassConfig](passconfig "Symfony\Component\DependencyInjection\Compiler\PassConfig") getCompilerPassConfig() Returns the compiler pass config which can then be modified. #### Return Value | | | | --- | --- | | [PassConfig](passconfig "Symfony\Component\DependencyInjection\Compiler\PassConfig") | The compiler pass config | ### [Compiler](compiler "Symfony\Component\DependencyInjection\Compiler\Compiler") getCompiler() Returns the compiler. #### Return Value | | | | --- | --- | | [Compiler](compiler "Symfony\Component\DependencyInjection\Compiler\Compiler") | The compiler | ### removeDefinition(string $id) Removes a service definition. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | ### merge([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Merges a ContainerBuilder with the current ContainerBuilder configuration. Service definitions overrides the current defined ones. But for parameters, they are overridden by the current ones. It allows the parameters passed to the container constructor to have precedence over the loaded ones. ``` $container = new ContainerBuilder(new ParameterBag(array('foo' => 'bar'))); $loader = new LoaderXXX($container); $loader->load('resource_name'); $container->register('foo', 'stdClass'); ``` In the above example, even if the loaded resource defines a foo parameter, the value will still be 'bar' as defined in the ContainerBuilder constructor. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | #### Exceptions | | | | --- | --- | | [BadMethodCallException](../exception/badmethodcallexception "Symfony\Component\DependencyInjection\Exception\BadMethodCallException") | When this ContainerBuilder is compiled | ### array getExtensionConfig(string $name) Returns the configuration array for the given extension. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the extension | #### Return Value | | | | --- | --- | | array | An array of configuration | ### prependExtensionConfig(string $name, array $config) Prepends a config array to the configs of the given extension. #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the extension | | array | $config | The config to set | ### addAliases(array $aliases) Adds the service aliases. #### Parameters | | | | | --- | --- | --- | | array | $aliases | | ### setAliases(array $aliases) Sets the service aliases. #### Parameters | | | | | --- | --- | --- | | array | $aliases | | ### [Alias](../alias "Symfony\Component\DependencyInjection\Alias") setAlias(string $alias, string|[Alias](../alias "Symfony\Component\DependencyInjection\Alias") $id) Sets an alias for an existing service. #### Parameters | | | | | --- | --- | --- | | string | $alias | The alias to create | | string|[Alias](../alias "Symfony\Component\DependencyInjection\Alias") | $id | The service to alias | #### Return Value | | | | --- | --- | | [Alias](../alias "Symfony\Component\DependencyInjection\Alias") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | if the id is not a string or an Alias | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | if the alias is for itself | ### removeAlias(string $alias) Removes an alias. #### Parameters | | | | | --- | --- | --- | | string | $alias | The alias to remove | ### bool hasAlias(string $id) Returns true if an alias exists under the given identifier. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | #### Return Value | | | | --- | --- | | bool | true if the alias exists, false otherwise | ### [Alias](../alias "Symfony\Component\DependencyInjection\Alias")[] getAliases() Gets all defined aliases. #### Return Value | | | | --- | --- | | [Alias](../alias "Symfony\Component\DependencyInjection\Alias")[] | An array of aliases | ### [Alias](../alias "Symfony\Component\DependencyInjection\Alias") getAlias(string $id) Gets an alias. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | #### Return Value | | | | --- | --- | | [Alias](../alias "Symfony\Component\DependencyInjection\Alias") | An Alias instance | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | if the alias does not exist | ### [Definition](../definition "Symfony\Component\DependencyInjection\Definition") register($id, $class = null) Registers a service definition. This methods allows for simple registration of service definition with a fluid interface. #### Parameters | | | | | --- | --- | --- | | | $id | | | | $class | | #### Return Value | | | | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | A Definition instance | ### [Definition](../definition "Symfony\Component\DependencyInjection\Definition") autowire(string $id, string|null $class = null) Registers an autowired service definition. This method implements a shortcut for using setDefinition() with an autowired definition. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | | string|null | $class | The service class | #### Return Value | | | | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | The created definition | ### addDefinitions(array $definitions) Adds the service definitions. #### Parameters | | | | | --- | --- | --- | | array | $definitions | An array of service definitions | ### setDefinitions(array $definitions) Sets the service definitions. #### Parameters | | | | | --- | --- | --- | | array | $definitions | An array of service definitions | ### [Definition](../definition "Symfony\Component\DependencyInjection\Definition")[] getDefinitions() Gets all service definitions. #### Return Value | | | | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition")[] | An array of Definition instances | ### [Definition](../definition "Symfony\Component\DependencyInjection\Definition") setDefinition(string $id, [Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition) Sets a service definition. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | A Definition instance | #### Return Value | | | | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | the service definition | #### Exceptions | | | | --- | --- | | [BadMethodCallException](../exception/badmethodcallexception "Symfony\Component\DependencyInjection\Exception\BadMethodCallException") | When this ContainerBuilder is compiled | ### bool hasDefinition(string $id) Returns true if a service definition exists under the given identifier. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | #### Return Value | | | | --- | --- | | bool | true if the service definition exists, false otherwise | ### [Definition](../definition "Symfony\Component\DependencyInjection\Definition") getDefinition(string $id) Gets a service definition. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier | #### Return Value | | | | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | A Definition instance | #### Exceptions | | | | --- | --- | | [ServiceNotFoundException](../exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | if the service definition does not exist | ### [Definition](../definition "Symfony\Component\DependencyInjection\Definition") findDefinition(string $id) Gets a service definition by id or alias. The method "unaliases" recursively to return a Definition instance. #### Parameters | | | | | --- | --- | --- | | string | $id | The service identifier or alias | #### Return Value | | | | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | A Definition instance | #### Exceptions | | | | --- | --- | | [ServiceNotFoundException](../exception/servicenotfoundexception "Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException") | if the service definition does not exist | ### mixed resolveServices(mixed $value) Replaces service references by the real service instance and evaluates expressions. #### Parameters | | | | | --- | --- | --- | | mixed | $value | A value | #### Return Value | | | | --- | --- | | mixed | The same value with all service references replaced by the real service instances and all expressions evaluated | ### array findTaggedServiceIds(string $name, bool $throwOnAbstract = false) Returns service ids for a given tag. Example: ``` $container->register('foo')->addTag('my.tag', array('hello' => 'world')); $serviceIds = $container->findTaggedServiceIds('my.tag'); foreach ($serviceIds as $serviceId => $tags) { foreach ($tags as $tag) { echo $tag['hello']; } } ``` #### Parameters | | | | | --- | --- | --- | | string | $name | The tag name | | bool | $throwOnAbstract | | #### Return Value | | | | --- | --- | | array | An array of tags | ### array findTags() Returns all tags the defined services use. #### Return Value | | | | --- | --- | | array | An array of tags | ### string[] findUnusedTags() Returns all tags not queried by findTaggedServiceIds. #### Return Value | | | | --- | --- | | string[] | An array of tags | ### addExpressionLanguageProvider([ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") $provider) #### Parameters | | | | | --- | --- | --- | | [ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface") | $provider | | ### [ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface")[] getExpressionLanguageProviders() #### Return Value | | | | --- | --- | | [ExpressionFunctionProviderInterface](../../expressionlanguage/expressionfunctionproviderinterface "Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface")[] | | ### [ChildDefinition](../childdefinition "Symfony\Component\DependencyInjection\ChildDefinition") registerForAutoconfiguration(string $interface) Returns a ChildDefinition that will be used for autoconfiguring the interface/class. #### Parameters | | | | | --- | --- | --- | | string | $interface | The class or interface to match | #### Return Value | | | | --- | --- | | [ChildDefinition](../childdefinition "Symfony\Component\DependencyInjection\ChildDefinition") | | ### [ChildDefinition](../childdefinition "Symfony\Component\DependencyInjection\ChildDefinition")[] getAutoconfiguredInstanceof() Returns an array of ChildDefinition[] keyed by interface. #### Return Value | | | | --- | --- | | [ChildDefinition](../childdefinition "Symfony\Component\DependencyInjection\ChildDefinition")[] | | ### mixed resolveEnvPlaceholders(mixed $value, string|true|null $format = null, array $usedEnvs = null) Resolves env parameter placeholders in a string or an array. #### Parameters | | | | | --- | --- | --- | | mixed | $value | The value to resolve | | string|true|null | $format | A sprintf() format returning the replacement for each env var name or null to resolve back to the original "%env(VAR)%" format or true to resolve to the actual values of the referenced env vars | | array | $usedEnvs | &$usedEnvs Env vars found while resolving are added to this array | #### Return Value | | | | --- | --- | | mixed | The value with env parameters resolved if a string or an array is passed | ### int[] getEnvCounters() Get statistics about env usage. #### Return Value | | | | --- | --- | | int[] | The number of time each env vars has been resolved | ### log([CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") $pass, string $message) #### Parameters | | | | | --- | --- | --- | | [CompilerPassInterface](compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") | $pass | | | string | $message | | ### static array getServiceConditionals(mixed $value) Returns the Service Conditionals. #### Parameters | | | | | --- | --- | --- | | mixed | $value | An array of conditionals to return | #### Return Value | | | | --- | --- | | array | An array of Service conditionals | ### static array getInitializedConditionals(mixed $value) Returns the initialized conditionals. #### Parameters | | | | | --- | --- | --- | | mixed | $value | An array of conditionals to return | #### Return Value | | | | --- | --- | | array | An array of uninitialized conditionals | ### static string hash(mixed $value) Computes a reasonably unique hash of a value. #### Parameters | | | | | --- | --- | --- | | mixed | $value | A serializable value | #### Return Value | | | | --- | --- | | string | |
programming_docs
symfony ResolveBindingsPass ResolveBindingsPass ==================== class **ResolveBindingsPass** extends [AbstractRecursivePass](abstractrecursivepass "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | from [AbstractRecursivePass](abstractrecursivepass#property_container "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | protected | $currentId | | from [AbstractRecursivePass](abstractrecursivepass#property_currentId "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Methods ------- | | | | | --- | --- | --- | | | [process](#method_process)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | | mixed | [processValue](#method_processValue)(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. | | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | [getConstructor](#method_getConstructor)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) | from [AbstractRecursivePass](abstractrecursivepass#method_getConstructor "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | [getReflectionMethod](#method_getReflectionMethod)([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) | from [AbstractRecursivePass](abstractrecursivepass#method_getReflectionMethod "Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass") | Details ------- ### process([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### protected mixed processValue(mixed $value, bool $isRoot = false) Processes a value found in a definition tree. #### Parameters | | | | | --- | --- | --- | | mixed | $value | | | bool | $isRoot | | #### Return Value | | | | --- | --- | | mixed | The processed value | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null getConstructor([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, bool $required) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | bool | $required | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract)|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | ### protected [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) getReflectionMethod([Definition](../definition "Symfony\Component\DependencyInjection\Definition") $definition, string $method) #### Parameters | | | | | --- | --- | --- | | [Definition](../definition "Symfony\Component\DependencyInjection\Definition") | $definition | | | string | $method | | #### Return Value | | | | --- | --- | | [ReflectionFunctionAbstract](http://php.net/ReflectionFunctionAbstract) | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | | symfony DumperInterface DumperInterface ================ interface **DumperInterface** DumperInterface is the interface implemented by service container dumper classes. Methods ------- | | | | | --- | --- | --- | | string | [dump](#method_dump)(array $options = array()) Dumps the service container. | | Details ------- ### string dump(array $options = array()) Dumps the service container. #### Parameters | | | | | --- | --- | --- | | array | $options | An array of options | #### Return Value | | | | --- | --- | | string | The representation of the service container | symfony GraphvizDumper GraphvizDumper =============== class **GraphvizDumper** extends [Dumper](dumper "Symfony\Component\DependencyInjection\Dumper\Dumper") GraphvizDumper dumps a service container as a graphviz file. You can convert the generated dot file with the dot utility (http://www.graphviz.org/): dot -Tpng container.dot > foo.png Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $container | | from [Dumper](dumper#property_container "Symfony\Component\DependencyInjection\Dumper\Dumper") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) | from [Dumper](dumper#method___construct "Symfony\Component\DependencyInjection\Dumper\Dumper") | | string | [dump](#method_dump)(array $options = array()) Dumps the service container as a graphviz graph. | | Details ------- ### \_\_construct([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### string dump(array $options = array()) Dumps the service container as a graphviz graph. Available options: * graph: The default options for the whole graph * node: The default options for nodes * edge: The default options for edges * node.instance: The default options for services that are defined directly by object instances * node.definition: The default options for services that are defined via service definition instances * node.missing: The default options for missing services #### Parameters | | | | | --- | --- | --- | | array | $options | An array of options | #### Return Value | | | | --- | --- | | string | The representation of the service container | symfony YamlDumper YamlDumper =========== class **YamlDumper** extends [Dumper](dumper "Symfony\Component\DependencyInjection\Dumper\Dumper") YamlDumper dumps a service container as a YAML string. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $container | | from [Dumper](dumper#property_container "Symfony\Component\DependencyInjection\Dumper\Dumper") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) | from [Dumper](dumper#method___construct "Symfony\Component\DependencyInjection\Dumper\Dumper") | | string | [dump](#method_dump)(array $options = array()) Dumps the service container as an YAML string. | | Details ------- ### \_\_construct([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### string dump(array $options = array()) Dumps the service container as an YAML string. #### Parameters | | | | | --- | --- | --- | | array | $options | An array of options | #### Return Value | | | | --- | --- | | string | The representation of the service container | symfony XmlDumper XmlDumper ========== class **XmlDumper** extends [Dumper](dumper "Symfony\Component\DependencyInjection\Dumper\Dumper") XmlDumper dumps a service container as an XML string. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $container | | from [Dumper](dumper#property_container "Symfony\Component\DependencyInjection\Dumper\Dumper") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) | from [Dumper](dumper#method___construct "Symfony\Component\DependencyInjection\Dumper\Dumper") | | string | [dump](#method_dump)(array $options = array()) Dumps the service container as an XML string. | | | static string | [phpToXml](#method_phpToXml)(mixed $value) Converts php types to xml types. | | Details ------- ### \_\_construct([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### string dump(array $options = array()) Dumps the service container as an XML string. #### Parameters | | | | | --- | --- | --- | | array | $options | An array of options | #### Return Value | | | | --- | --- | | string | The representation of the service container | ### static string phpToXml(mixed $value) Converts php types to xml types. #### Parameters | | | | | --- | --- | --- | | mixed | $value | Value to convert | #### Return Value | | | | --- | --- | | string | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\DependencyInjection\Exception\RuntimeException") | When trying to dump object or resource | symfony PhpDumper PhpDumper ========== class **PhpDumper** extends [Dumper](dumper "Symfony\Component\DependencyInjection\Dumper\Dumper") PhpDumper dumps a service container as a PHP class. Constants --------- | | | | --- | --- | | FIRST\_CHARS | *Characters that might appear in the generated variable name as first character.* | | NON\_FIRST\_CHARS | *Characters that might appear in the generated variable name as any but the first character.* | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $container | | from [Dumper](dumper#property_container "Symfony\Component\DependencyInjection\Dumper\Dumper") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) | | | | [setProxyDumper](#method_setProxyDumper)([DumperInterface](../lazyproxy/phpdumper/dumperinterface "Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface") $proxyDumper) Sets the dumper to be used when dumping proxies in the generated container. | | | string | [dump](#method_dump)(array $options = array()) Dumps the service container as a PHP class. | | Details ------- ### \_\_construct([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### setProxyDumper([DumperInterface](../lazyproxy/phpdumper/dumperinterface "Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface") $proxyDumper) Sets the dumper to be used when dumping proxies in the generated container. #### Parameters | | | | | --- | --- | --- | | [DumperInterface](../lazyproxy/phpdumper/dumperinterface "Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface") | $proxyDumper | | ### string dump(array $options = array()) Dumps the service container as a PHP class. Available options: * class: The class name * base\_class: The base class name * namespace: The class namespace * as\_files: To split the container in several files #### Parameters | | | | | --- | --- | --- | | array | $options | An array of options | #### Return Value | | | | --- | --- | | string | The representation of the service container | #### Exceptions | | | | --- | --- | | [EnvParameterException](../exception/envparameterexception "Symfony\Component\DependencyInjection\Exception\EnvParameterException") | When an env var exists but has not been dumped | symfony Dumper Dumper ======= abstract class **Dumper** implements [DumperInterface](dumperinterface "Symfony\Component\DependencyInjection\Dumper\DumperInterface") Dumper is the abstract class for all built-in dumpers. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $container | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) | | Details ------- ### \_\_construct([ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony BinaryFileResponse BinaryFileResponse =================== class **BinaryFileResponse** extends [Response](response "Symfony\Component\HttpFoundation\Response") BinaryFileResponse represents an HTTP response delivering a file. Constants --------- | | | | --- | --- | | HTTP\_CONTINUE | | | HTTP\_SWITCHING\_PROTOCOLS | | | HTTP\_PROCESSING | | | HTTP\_EARLY\_HINTS | | | HTTP\_OK | | | HTTP\_CREATED | | | HTTP\_ACCEPTED | | | HTTP\_NON\_AUTHORITATIVE\_INFORMATION | | | HTTP\_NO\_CONTENT | | | HTTP\_RESET\_CONTENT | | | HTTP\_PARTIAL\_CONTENT | | | HTTP\_MULTI\_STATUS | | | HTTP\_ALREADY\_REPORTED | | | HTTP\_IM\_USED | | | HTTP\_MULTIPLE\_CHOICES | | | HTTP\_MOVED\_PERMANENTLY | | | HTTP\_FOUND | | | HTTP\_SEE\_OTHER | | | HTTP\_NOT\_MODIFIED | | | HTTP\_USE\_PROXY | | | HTTP\_RESERVED | | | HTTP\_TEMPORARY\_REDIRECT | | | HTTP\_PERMANENTLY\_REDIRECT | | | HTTP\_BAD\_REQUEST | | | HTTP\_UNAUTHORIZED | | | HTTP\_PAYMENT\_REQUIRED | | | HTTP\_FORBIDDEN | | | HTTP\_NOT\_FOUND | | | HTTP\_METHOD\_NOT\_ALLOWED | | | HTTP\_NOT\_ACCEPTABLE | | | HTTP\_PROXY\_AUTHENTICATION\_REQUIRED | | | HTTP\_REQUEST\_TIMEOUT | | | HTTP\_CONFLICT | | | HTTP\_GONE | | | HTTP\_LENGTH\_REQUIRED | | | HTTP\_PRECONDITION\_FAILED | | | HTTP\_REQUEST\_ENTITY\_TOO\_LARGE | | | HTTP\_REQUEST\_URI\_TOO\_LONG | | | HTTP\_UNSUPPORTED\_MEDIA\_TYPE | | | HTTP\_REQUESTED\_RANGE\_NOT\_SATISFIABLE | | | HTTP\_EXPECTATION\_FAILED | | | HTTP\_I\_AM\_A\_TEAPOT | | | HTTP\_MISDIRECTED\_REQUEST | | | HTTP\_UNPROCESSABLE\_ENTITY | | | HTTP\_LOCKED | | | HTTP\_FAILED\_DEPENDENCY | | | HTTP\_RESERVED\_FOR\_WEBDAV\_ADVANCED\_COLLECTIONS\_EXPIRED\_PROPOSAL | | | HTTP\_TOO\_EARLY | | | HTTP\_UPGRADE\_REQUIRED | | | HTTP\_PRECONDITION\_REQUIRED | | | HTTP\_TOO\_MANY\_REQUESTS | | | HTTP\_REQUEST\_HEADER\_FIELDS\_TOO\_LARGE | | | HTTP\_UNAVAILABLE\_FOR\_LEGAL\_REASONS | | | HTTP\_INTERNAL\_SERVER\_ERROR | | | HTTP\_NOT\_IMPLEMENTED | | | HTTP\_BAD\_GATEWAY | | | HTTP\_SERVICE\_UNAVAILABLE | | | HTTP\_GATEWAY\_TIMEOUT | | | HTTP\_VERSION\_NOT\_SUPPORTED | | | HTTP\_VARIANT\_ALSO\_NEGOTIATES\_EXPERIMENTAL | | | HTTP\_INSUFFICIENT\_STORAGE | | | HTTP\_LOOP\_DETECTED | | | HTTP\_NOT\_EXTENDED | | | HTTP\_NETWORK\_AUTHENTICATION\_REQUIRED | | Properties ---------- | | | | | | --- | --- | --- | --- | | [ResponseHeaderBag](responseheaderbag "Symfony\Component\HttpFoundation\ResponseHeaderBag") | $headers | | from [Response](response#property_headers "Symfony\Component\HttpFoundation\Response") | | protected string | $content | | from [Response](response#property_content "Symfony\Component\HttpFoundation\Response") | | protected string | $version | | from [Response](response#property_version "Symfony\Component\HttpFoundation\Response") | | protected int | $statusCode | | from [Response](response#property_statusCode "Symfony\Component\HttpFoundation\Response") | | protected string | $statusText | | from [Response](response#property_statusText "Symfony\Component\HttpFoundation\Response") | | protected string | $charset | | from [Response](response#property_charset "Symfony\Component\HttpFoundation\Response") | | static array | $statusTexts | Status codes translation table. | from [Response](response#property_statusTexts "Symfony\Component\HttpFoundation\Response") | | static protected | $trustXSendfileTypeHeader | | | | protected [File](file/file "Symfony\Component\HttpFoundation\File\File") | $file | | | | protected | $offset | | | | protected | $maxlen | | | | protected | $deleteFileAfterSend | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([SplFileInfo](http://php.net/SplFileInfo)|string $file, int $status = 200, array $headers = array(), bool $public = true, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) | | | static [Response](response "Symfony\Component\HttpFoundation\Response") | [create](#method_create)([SplFileInfo](http://php.net/SplFileInfo)|string $file = null, int $status = 200, array $headers = array(), bool $public = true, string|null $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) | | | string | [\_\_toString](#method___toString)() Returns the Response as an HTTP string. | from [Response](response#method___toString "Symfony\Component\HttpFoundation\Response") | | | [\_\_clone](#method___clone)() Clones the current Response instance. | from [Response](response#method___clone "Symfony\Component\HttpFoundation\Response") | | $this | [prepare](#method_prepare)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Prepares the Response before it is sent to the client. | | | $this | [sendHeaders](#method_sendHeaders)() Sends HTTP headers. | from [Response](response#method_sendHeaders "Symfony\Component\HttpFoundation\Response") | | $this | [sendContent](#method_sendContent)() Sends the file. | | | $this | [send](#method_send)() Sends HTTP headers and content. | from [Response](response#method_send "Symfony\Component\HttpFoundation\Response") | | $this | [setContent](#method_setContent)(mixed $content) Sets the response content. | | | string | [getContent](#method_getContent)() Gets the current response content. | | | $this | [setProtocolVersion](#method_setProtocolVersion)(string $version) Sets the HTTP protocol version (1.0 or 1.1). | from [Response](response#method_setProtocolVersion "Symfony\Component\HttpFoundation\Response") | | string | [getProtocolVersion](#method_getProtocolVersion)() Gets the HTTP protocol version. | from [Response](response#method_getProtocolVersion "Symfony\Component\HttpFoundation\Response") | | $this | [setStatusCode](#method_setStatusCode)(int $code, $text = null) Sets the response status code. | from [Response](response#method_setStatusCode "Symfony\Component\HttpFoundation\Response") | | int | [getStatusCode](#method_getStatusCode)() Retrieves the status code for the current web response. | from [Response](response#method_getStatusCode "Symfony\Component\HttpFoundation\Response") | | $this | [setCharset](#method_setCharset)(string $charset) Sets the response charset. | from [Response](response#method_setCharset "Symfony\Component\HttpFoundation\Response") | | string|null | [getCharset](#method_getCharset)() Retrieves the response charset. | from [Response](response#method_getCharset "Symfony\Component\HttpFoundation\Response") | | bool | [isCacheable](#method_isCacheable)() Returns true if the response may safely be kept in a shared (surrogate) cache. | from [Response](response#method_isCacheable "Symfony\Component\HttpFoundation\Response") | | bool | [isFresh](#method_isFresh)() Returns true if the response is "fresh". | from [Response](response#method_isFresh "Symfony\Component\HttpFoundation\Response") | | bool | [isValidateable](#method_isValidateable)() Returns true if the response includes headers that can be used to validate the response with the origin server using a conditional GET request. | from [Response](response#method_isValidateable "Symfony\Component\HttpFoundation\Response") | | $this | [setPrivate](#method_setPrivate)() Marks the response as "private". | from [Response](response#method_setPrivate "Symfony\Component\HttpFoundation\Response") | | $this | [setPublic](#method_setPublic)() Marks the response as "public". | from [Response](response#method_setPublic "Symfony\Component\HttpFoundation\Response") | | $this | [setImmutable](#method_setImmutable)(bool $immutable = true) Marks the response as "immutable". | from [Response](response#method_setImmutable "Symfony\Component\HttpFoundation\Response") | | bool | [isImmutable](#method_isImmutable)() Returns true if the response is marked as "immutable". | from [Response](response#method_isImmutable "Symfony\Component\HttpFoundation\Response") | | bool | [mustRevalidate](#method_mustRevalidate)() Returns true if the response must be revalidated by caches. | from [Response](response#method_mustRevalidate "Symfony\Component\HttpFoundation\Response") | | DateTimeInterface|null | [getDate](#method_getDate)() Returns the Date header as a DateTime instance. | from [Response](response#method_getDate "Symfony\Component\HttpFoundation\Response") | | $this | [setDate](#method_setDate)([DateTimeInterface](http://php.net/DateTimeInterface) $date) Sets the Date header. | from [Response](response#method_setDate "Symfony\Component\HttpFoundation\Response") | | int | [getAge](#method_getAge)() Returns the age of the response in seconds. | from [Response](response#method_getAge "Symfony\Component\HttpFoundation\Response") | | $this | [expire](#method_expire)() Marks the response stale by setting the Age header to be equal to the maximum age of the response. | from [Response](response#method_expire "Symfony\Component\HttpFoundation\Response") | | DateTimeInterface|null | [getExpires](#method_getExpires)() Returns the value of the Expires header as a DateTime instance. | from [Response](response#method_getExpires "Symfony\Component\HttpFoundation\Response") | | $this | [setExpires](#method_setExpires)([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Expires HTTP header with a DateTime instance. | from [Response](response#method_setExpires "Symfony\Component\HttpFoundation\Response") | | int|null | [getMaxAge](#method_getMaxAge)() Returns the number of seconds after the time specified in the response's Date header when the response should no longer be considered fresh. | from [Response](response#method_getMaxAge "Symfony\Component\HttpFoundation\Response") | | $this | [setMaxAge](#method_setMaxAge)(int $value) Sets the number of seconds after which the response should no longer be considered fresh. | from [Response](response#method_setMaxAge "Symfony\Component\HttpFoundation\Response") | | $this | [setSharedMaxAge](#method_setSharedMaxAge)(int $value) Sets the number of seconds after which the response should no longer be considered fresh by shared caches. | from [Response](response#method_setSharedMaxAge "Symfony\Component\HttpFoundation\Response") | | int|null | [getTtl](#method_getTtl)() Returns the response's time-to-live in seconds. | from [Response](response#method_getTtl "Symfony\Component\HttpFoundation\Response") | | $this | [setTtl](#method_setTtl)(int $seconds) Sets the response's time-to-live for shared caches in seconds. | from [Response](response#method_setTtl "Symfony\Component\HttpFoundation\Response") | | $this | [setClientTtl](#method_setClientTtl)(int $seconds) Sets the response's time-to-live for private/client caches in seconds. | from [Response](response#method_setClientTtl "Symfony\Component\HttpFoundation\Response") | | DateTimeInterface|null | [getLastModified](#method_getLastModified)() Returns the Last-Modified HTTP header as a DateTime instance. | from [Response](response#method_getLastModified "Symfony\Component\HttpFoundation\Response") | | $this | [setLastModified](#method_setLastModified)([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Last-Modified HTTP header with a DateTime instance. | from [Response](response#method_setLastModified "Symfony\Component\HttpFoundation\Response") | | string|null | [getEtag](#method_getEtag)() Returns the literal value of the ETag HTTP header. | from [Response](response#method_getEtag "Symfony\Component\HttpFoundation\Response") | | $this | [setEtag](#method_setEtag)(string $etag = null, bool $weak = false) Sets the ETag value. | from [Response](response#method_setEtag "Symfony\Component\HttpFoundation\Response") | | $this | [setCache](#method_setCache)(array $options) Sets the response's cache headers (validation and/or expiration). | from [Response](response#method_setCache "Symfony\Component\HttpFoundation\Response") | | $this | [setNotModified](#method_setNotModified)() Modifies the response so that it conforms to the rules defined for a 304 status code. | from [Response](response#method_setNotModified "Symfony\Component\HttpFoundation\Response") | | bool | [hasVary](#method_hasVary)() Returns true if the response includes a Vary header. | from [Response](response#method_hasVary "Symfony\Component\HttpFoundation\Response") | | array | [getVary](#method_getVary)() Returns an array of header names given in the Vary header. | from [Response](response#method_getVary "Symfony\Component\HttpFoundation\Response") | | $this | [setVary](#method_setVary)(string|array $headers, bool $replace = true) Sets the Vary header. | from [Response](response#method_setVary "Symfony\Component\HttpFoundation\Response") | | bool | [isNotModified](#method_isNotModified)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Determines if the Response validators (ETag, Last-Modified) match a conditional value specified in the Request. | from [Response](response#method_isNotModified "Symfony\Component\HttpFoundation\Response") | | bool | [isInvalid](#method_isInvalid)() Is response invalid? | from [Response](response#method_isInvalid "Symfony\Component\HttpFoundation\Response") | | bool | [isInformational](#method_isInformational)() Is response informative? | from [Response](response#method_isInformational "Symfony\Component\HttpFoundation\Response") | | bool | [isSuccessful](#method_isSuccessful)() Is response successful? | from [Response](response#method_isSuccessful "Symfony\Component\HttpFoundation\Response") | | bool | [isRedirection](#method_isRedirection)() Is the response a redirect? | from [Response](response#method_isRedirection "Symfony\Component\HttpFoundation\Response") | | bool | [isClientError](#method_isClientError)() Is there a client error? | from [Response](response#method_isClientError "Symfony\Component\HttpFoundation\Response") | | bool | [isServerError](#method_isServerError)() Was there a server side error? | from [Response](response#method_isServerError "Symfony\Component\HttpFoundation\Response") | | bool | [isOk](#method_isOk)() Is the response OK? | from [Response](response#method_isOk "Symfony\Component\HttpFoundation\Response") | | bool | [isForbidden](#method_isForbidden)() Is the response forbidden? | from [Response](response#method_isForbidden "Symfony\Component\HttpFoundation\Response") | | bool | [isNotFound](#method_isNotFound)() Is the response a not found error? | from [Response](response#method_isNotFound "Symfony\Component\HttpFoundation\Response") | | bool | [isRedirect](#method_isRedirect)(string $location = null) Is the response a redirect of some form? | from [Response](response#method_isRedirect "Symfony\Component\HttpFoundation\Response") | | bool | [isEmpty](#method_isEmpty)() Is the response empty? | from [Response](response#method_isEmpty "Symfony\Component\HttpFoundation\Response") | | static | [closeOutputBuffers](#method_closeOutputBuffers)(int $targetLevel, bool $flush) Cleans or flushes output buffers up to target level. | from [Response](response#method_closeOutputBuffers "Symfony\Component\HttpFoundation\Response") | | | [ensureIEOverSSLCompatibility](#method_ensureIEOverSSLCompatibility)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9. | from [Response](response#method_ensureIEOverSSLCompatibility "Symfony\Component\HttpFoundation\Response") | | $this | [setFile](#method_setFile)([SplFileInfo](http://php.net/SplFileInfo)|string $file, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) Sets the file to stream. | | | [File](file/file "Symfony\Component\HttpFoundation\File\File") | [getFile](#method_getFile)() Gets the file. | | | | [setAutoLastModified](#method_setAutoLastModified)() Automatically sets the Last-Modified header according the file modification date. | | | | [setAutoEtag](#method_setAutoEtag)() Automatically sets the ETag header according to the checksum of the file. | | | $this | [setContentDisposition](#method_setContentDisposition)(string $disposition, string $filename = '', string $filenameFallback = '') Sets the Content-Disposition header with the given filename. | | | static | [trustXSendfileTypeHeader](#method_trustXSendfileTypeHeader)() Trust X-Sendfile-Type header. | | | $this | [deleteFileAfterSend](#method_deleteFileAfterSend)(bool $shouldDelete = true) If this is set to true, the file will be unlinked after the request is send Note: If the X-Sendfile header is used, the deleteFileAfterSend setting will not be used. | | Details ------- ### \_\_construct([SplFileInfo](http://php.net/SplFileInfo)|string $file, int $status = 200, array $headers = array(), bool $public = true, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) #### Parameters | | | | | --- | --- | --- | | [SplFileInfo](http://php.net/SplFileInfo)|string | $file | The file to stream | | int | $status | | | array | $headers | | | bool | $public | Files are public by default | | string | $contentDisposition | The type of Content-Disposition to set automatically with the filename | | bool | $autoEtag | Whether the ETag header should be automatically set | | bool | $autoLastModified | Whether the Last-Modified header should be automatically set | ### static [Response](response "Symfony\Component\HttpFoundation\Response") create([SplFileInfo](http://php.net/SplFileInfo)|string $file = null, int $status = 200, array $headers = array(), bool $public = true, string|null $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) #### Parameters | | | | | --- | --- | --- | | [SplFileInfo](http://php.net/SplFileInfo)|string | $file | The file to stream | | int | $status | The response status code | | array | $headers | An array of response headers | | bool | $public | Files are public by default | | string|null | $contentDisposition | The type of Content-Disposition to set automatically with the filename | | bool | $autoEtag | Whether the ETag header should be automatically set | | bool | $autoLastModified | Whether the Last-Modified header should be automatically set | #### Return Value | | | | --- | --- | | [Response](response "Symfony\Component\HttpFoundation\Response") | | ### string \_\_toString() Returns the Response as an HTTP string. The string representation of the Response is the same as the one that will be sent to the client only if the prepare() method has been called before. #### Return Value | | | | --- | --- | | string | The Response as an HTTP string | #### See also | | | | --- | --- | | prepare() | | ### \_\_clone() Clones the current Response instance. ### $this prepare([Request](request "Symfony\Component\HttpFoundation\Request") $request) Prepares the Response before it is sent to the client. This method tweaks the Response to ensure that it is compliant with RFC 2616. Most of the changes are based on the Request that is "associated" with this Response. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | $this | | ### $this sendHeaders() Sends HTTP headers. #### Return Value | | | | --- | --- | | $this | | ### $this sendContent() Sends the file. {@inheritdoc} #### Return Value | | | | --- | --- | | $this | | ### $this send() Sends HTTP headers and content. #### Return Value | | | | --- | --- | | $this | | ### $this setContent(mixed $content) Sets the response content. Valid types are strings, numbers, null, and objects that implement a \_\_toString() method. #### Parameters | | | | | --- | --- | --- | | mixed | $content | Content that can be cast to string | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [UnexpectedValueException](http://php.net/UnexpectedValueException) | | ### string getContent() Gets the current response content. #### Return Value | | | | --- | --- | | string | Content | ### $this setProtocolVersion(string $version) Sets the HTTP protocol version (1.0 or 1.1). #### Parameters | | | | | --- | --- | --- | | string | $version | | #### Return Value | | | | --- | --- | | $this | | ### string getProtocolVersion() Gets the HTTP protocol version. #### Return Value | | | | --- | --- | | string | | ### $this setStatusCode(int $code, $text = null) Sets the response status code. If the status text is null it will be automatically populated for the known status codes and left empty otherwise. #### Parameters | | | | | --- | --- | --- | | int | $code | | | | $text | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When the HTTP status code is not valid | ### int getStatusCode() Retrieves the status code for the current web response. #### Return Value | | | | --- | --- | | int | | ### $this setCharset(string $charset) Sets the response charset. #### Parameters | | | | | --- | --- | --- | | string | $charset | | #### Return Value | | | | --- | --- | | $this | | ### string|null getCharset() Retrieves the response charset. #### Return Value | | | | --- | --- | | string|null | | ### bool isCacheable() Returns true if the response may safely be kept in a shared (surrogate) cache. Responses marked "private" with an explicit Cache-Control directive are considered uncacheable. Responses with neither a freshness lifetime (Expires, max-age) nor cache validator (Last-Modified, ETag) are considered uncacheable because there is no way to tell when or how to remove them from the cache. Note that RFC 7231 and RFC 7234 possibly allow for a more permissive implementation, for example "status codes that are defined as cacheable by default [...] can be reused by a cache with heuristic expiration unless otherwise indicated" (https://tools.ietf.org/html/rfc7231#section-6.1) #### Return Value | | | | --- | --- | | bool | | ### bool isFresh() Returns true if the response is "fresh". Fresh responses may be served from cache without any interaction with the origin. A response is considered fresh when it includes a Cache-Control/max-age indicator or Expires header and the calculated age is less than the freshness lifetime. #### Return Value | | | | --- | --- | | bool | | ### bool isValidateable() Returns true if the response includes headers that can be used to validate the response with the origin server using a conditional GET request. #### Return Value | | | | --- | --- | | bool | | ### $this setPrivate() Marks the response as "private". It makes the response ineligible for serving other clients. #### Return Value | | | | --- | --- | | $this | | ### $this setPublic() Marks the response as "public". It makes the response eligible for serving other clients. #### Return Value | | | | --- | --- | | $this | | ### $this setImmutable(bool $immutable = true) Marks the response as "immutable". #### Parameters | | | | | --- | --- | --- | | bool | $immutable | | #### Return Value | | | | --- | --- | | $this | | ### bool isImmutable() Returns true if the response is marked as "immutable". #### Return Value | | | | --- | --- | | bool | | ### bool mustRevalidate() Returns true if the response must be revalidated by caches. This method indicates that the response must not be served stale by a cache in any circumstance without first revalidating with the origin. When present, the TTL of the response should not be overridden to be greater than the value provided by the origin. #### Return Value | | | | --- | --- | | bool | | ### DateTimeInterface|null getDate() Returns the Date header as a DateTime instance. #### Return Value | | | | --- | --- | | DateTimeInterface|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When the header is not parseable | ### $this setDate([DateTimeInterface](http://php.net/DateTimeInterface) $date) Sets the Date header. #### Parameters | | | | | --- | --- | --- | | [DateTimeInterface](http://php.net/DateTimeInterface) | $date | | #### Return Value | | | | --- | --- | | $this | | ### int getAge() Returns the age of the response in seconds. #### Return Value | | | | --- | --- | | int | | ### $this expire() Marks the response stale by setting the Age header to be equal to the maximum age of the response. #### Return Value | | | | --- | --- | | $this | | ### DateTimeInterface|null getExpires() Returns the value of the Expires header as a DateTime instance. #### Return Value | | | | --- | --- | | DateTimeInterface|null | | ### $this setExpires([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Expires HTTP header with a DateTime instance. Passing null as value will remove the header. #### Parameters | | | | | --- | --- | --- | | [DateTimeInterface](http://php.net/DateTimeInterface) | $date | | #### Return Value | | | | --- | --- | | $this | | ### int|null getMaxAge() Returns the number of seconds after the time specified in the response's Date header when the response should no longer be considered fresh. First, it checks for a s-maxage directive, then a max-age directive, and then it falls back on an expires header. It returns null when no maximum age can be established. #### Return Value | | | | --- | --- | | int|null | | ### $this setMaxAge(int $value) Sets the number of seconds after which the response should no longer be considered fresh. This methods sets the Cache-Control max-age directive. #### Parameters | | | | | --- | --- | --- | | int | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this setSharedMaxAge(int $value) Sets the number of seconds after which the response should no longer be considered fresh by shared caches. This methods sets the Cache-Control s-maxage directive. #### Parameters | | | | | --- | --- | --- | | int | $value | | #### Return Value | | | | --- | --- | | $this | | ### int|null getTtl() Returns the response's time-to-live in seconds. It returns null when no freshness information is present in the response. When the responses TTL is <= 0, the response may not be served from cache without first revalidating with the origin. #### Return Value | | | | --- | --- | | int|null | | ### $this setTtl(int $seconds) Sets the response's time-to-live for shared caches in seconds. This method adjusts the Cache-Control/s-maxage directive. #### Parameters | | | | | --- | --- | --- | | int | $seconds | | #### Return Value | | | | --- | --- | | $this | | ### $this setClientTtl(int $seconds) Sets the response's time-to-live for private/client caches in seconds. This method adjusts the Cache-Control/max-age directive. #### Parameters | | | | | --- | --- | --- | | int | $seconds | | #### Return Value | | | | --- | --- | | $this | | ### DateTimeInterface|null getLastModified() Returns the Last-Modified HTTP header as a DateTime instance. #### Return Value | | | | --- | --- | | DateTimeInterface|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When the HTTP header is not parseable | ### $this setLastModified([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Last-Modified HTTP header with a DateTime instance. Passing null as value will remove the header. #### Parameters | | | | | --- | --- | --- | | [DateTimeInterface](http://php.net/DateTimeInterface) | $date | | #### Return Value | | | | --- | --- | | $this | | ### string|null getEtag() Returns the literal value of the ETag HTTP header. #### Return Value | | | | --- | --- | | string|null | | ### $this setEtag(string $etag = null, bool $weak = false) Sets the ETag value. #### Parameters | | | | | --- | --- | --- | | string | $etag | The ETag unique identifier or null to remove the header | | bool | $weak | Whether you want a weak ETag or not | #### Return Value | | | | --- | --- | | $this | | ### $this setCache(array $options) Sets the response's cache headers (validation and/or expiration). Available options are: etag, last\_modified, max\_age, s\_maxage, private, public and immutable. #### Parameters | | | | | --- | --- | --- | | array | $options | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### $this setNotModified() Modifies the response so that it conforms to the rules defined for a 304 status code. This sets the status, removes the body, and discards any headers that MUST NOT be included in 304 responses. #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | <http://tools.ietf.org/html/rfc2616#section-10.3.5> | | ### bool hasVary() Returns true if the response includes a Vary header. #### Return Value | | | | --- | --- | | bool | | ### array getVary() Returns an array of header names given in the Vary header. #### Return Value | | | | --- | --- | | array | | ### $this setVary(string|array $headers, bool $replace = true) Sets the Vary header. #### Parameters | | | | | --- | --- | --- | | string|array | $headers | | | bool | $replace | Whether to replace the actual value or not (true by default) | #### Return Value | | | | --- | --- | | $this | | ### bool isNotModified([Request](request "Symfony\Component\HttpFoundation\Request") $request) Determines if the Response validators (ETag, Last-Modified) match a conditional value specified in the Request. If the Response is not modified, it sets the status code to 304 and removes the actual content by calling the setNotModified() method. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | bool | true if the Response validators match the Request, false otherwise | ### bool isInvalid() Is response invalid? #### Return Value | | | | --- | --- | | bool | | #### See also | | | | --- | --- | | <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html> | | ### bool isInformational() Is response informative? #### Return Value | | | | --- | --- | | bool | | ### bool isSuccessful() Is response successful? #### Return Value | | | | --- | --- | | bool | | ### bool isRedirection() Is the response a redirect? #### Return Value | | | | --- | --- | | bool | | ### bool isClientError() Is there a client error? #### Return Value | | | | --- | --- | | bool | | ### bool isServerError() Was there a server side error? #### Return Value | | | | --- | --- | | bool | | ### bool isOk() Is the response OK? #### Return Value | | | | --- | --- | | bool | | ### bool isForbidden() Is the response forbidden? #### Return Value | | | | --- | --- | | bool | | ### bool isNotFound() Is the response a not found error? #### Return Value | | | | --- | --- | | bool | | ### bool isRedirect(string $location = null) Is the response a redirect of some form? #### Parameters | | | | | --- | --- | --- | | string | $location | | #### Return Value | | | | --- | --- | | bool | | ### bool isEmpty() Is the response empty? #### Return Value | | | | --- | --- | | bool | | ### static closeOutputBuffers(int $targetLevel, bool $flush) Cleans or flushes output buffers up to target level. Resulting level can be greater than target level if a non-removable buffer has been encountered. #### Parameters | | | | | --- | --- | --- | | int | $targetLevel | | | bool | $flush | | ### protected ensureIEOverSSLCompatibility([Request](request "Symfony\Component\HttpFoundation\Request") $request) Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### See also | | | | --- | --- | | <http://support.microsoft.com/kb/323308> | | ### $this setFile([SplFileInfo](http://php.net/SplFileInfo)|string $file, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) Sets the file to stream. #### Parameters | | | | | --- | --- | --- | | [SplFileInfo](http://php.net/SplFileInfo)|string | $file | The file to stream | | string | $contentDisposition | | | bool | $autoEtag | | | bool | $autoLastModified | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [FileException](file/exception/fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") | | ### [File](file/file "Symfony\Component\HttpFoundation\File\File") getFile() Gets the file. #### Return Value | | | | --- | --- | | [File](file/file "Symfony\Component\HttpFoundation\File\File") | The file to stream | ### setAutoLastModified() Automatically sets the Last-Modified header according the file modification date. ### setAutoEtag() Automatically sets the ETag header according to the checksum of the file. ### $this setContentDisposition(string $disposition, string $filename = '', string $filenameFallback = '') Sets the Content-Disposition header with the given filename. #### Parameters | | | | | --- | --- | --- | | string | $disposition | ResponseHeaderBag::DISPOSITION\_INLINE or ResponseHeaderBag::DISPOSITION\_ATTACHMENT | | string | $filename | Optionally use this UTF-8 encoded filename instead of the real name of the file | | string | $filenameFallback | A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename | #### Return Value | | | | --- | --- | | $this | | ### static trustXSendfileTypeHeader() Trust X-Sendfile-Type header. ### $this deleteFileAfterSend(bool $shouldDelete = true) If this is set to true, the file will be unlinked after the request is send Note: If the X-Sendfile header is used, the deleteFileAfterSend setting will not be used. #### Parameters | | | | | --- | --- | --- | | bool | $shouldDelete | | #### Return Value | | | | --- | --- | | $this | |
programming_docs
symfony RequestMatcher RequestMatcher =============== class **RequestMatcher** implements [RequestMatcherInterface](requestmatcherinterface "Symfony\Component\HttpFoundation\RequestMatcherInterface") RequestMatcher compares a pre-defined set of checks against a Request instance. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path = null, string $host = null, string|string[]|null $methods = null, string|string[]|null $ips = null, array $attributes = array(), string|string[]|null $schemes = null) | | | | [matchScheme](#method_matchScheme)(string|string[]|null $scheme) Adds a check for the HTTP scheme. | | | | [matchHost](#method_matchHost)(string|null $regexp) Adds a check for the URL host name. | | | | [matchPath](#method_matchPath)(string|null $regexp) Adds a check for the URL path info. | | | | [matchIp](#method_matchIp)(string $ip) Adds a check for the client IP. | | | | [matchIps](#method_matchIps)(string|string[]|null $ips) Adds a check for the client IP. | | | | [matchMethod](#method_matchMethod)(string|string[]|null $method) Adds a check for the HTTP method. | | | | [matchAttribute](#method_matchAttribute)(string $key, string $regexp) Adds a check for request attribute. | | | bool | [matches](#method_matches)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Decides whether the rule(s) implemented by the strategy matches the supplied request. | | Details ------- ### \_\_construct(string $path = null, string $host = null, string|string[]|null $methods = null, string|string[]|null $ips = null, array $attributes = array(), string|string[]|null $schemes = null) #### Parameters | | | | | --- | --- | --- | | string | $path | | | string | $host | | | string|string[]|null | $methods | | | string|string[]|null | $ips | | | array | $attributes | | | string|string[]|null | $schemes | | ### matchScheme(string|string[]|null $scheme) Adds a check for the HTTP scheme. #### Parameters | | | | | --- | --- | --- | | string|string[]|null | $scheme | An HTTP scheme or an array of HTTP schemes | ### matchHost(string|null $regexp) Adds a check for the URL host name. #### Parameters | | | | | --- | --- | --- | | string|null | $regexp | A Regexp | ### matchPath(string|null $regexp) Adds a check for the URL path info. #### Parameters | | | | | --- | --- | --- | | string|null | $regexp | A Regexp | ### matchIp(string $ip) Adds a check for the client IP. #### Parameters | | | | | --- | --- | --- | | string | $ip | A specific IP address or a range specified using IP/netmask like 192.168.1.0/24 | ### matchIps(string|string[]|null $ips) Adds a check for the client IP. #### Parameters | | | | | --- | --- | --- | | string|string[]|null | $ips | A specific IP address or a range specified using IP/netmask like 192.168.1.0/24 | ### matchMethod(string|string[]|null $method) Adds a check for the HTTP method. #### Parameters | | | | | --- | --- | --- | | string|string[]|null | $method | An HTTP method or an array of HTTP methods | ### matchAttribute(string $key, string $regexp) Adds a check for request attribute. #### Parameters | | | | | --- | --- | --- | | string | $key | The request attribute name | | string | $regexp | A Regexp | ### bool matches([Request](request "Symfony\Component\HttpFoundation\Request") $request) Decides whether the rule(s) implemented by the strategy matches the supplied request. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | bool | true if the request matches, false otherwise | symfony ExpressionRequestMatcher ExpressionRequestMatcher ========================= class **ExpressionRequestMatcher** extends [RequestMatcher](requestmatcher "Symfony\Component\HttpFoundation\RequestMatcher") ExpressionRequestMatcher uses an expression to match a Request. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path = null, string $host = null, string|string[]|null $methods = null, string|string[]|null $ips = null, array $attributes = array(), string|string[]|null $schemes = null) | from [RequestMatcher](requestmatcher#method___construct "Symfony\Component\HttpFoundation\RequestMatcher") | | | [matchScheme](#method_matchScheme)(string|string[]|null $scheme) Adds a check for the HTTP scheme. | from [RequestMatcher](requestmatcher#method_matchScheme "Symfony\Component\HttpFoundation\RequestMatcher") | | | [matchHost](#method_matchHost)(string|null $regexp) Adds a check for the URL host name. | from [RequestMatcher](requestmatcher#method_matchHost "Symfony\Component\HttpFoundation\RequestMatcher") | | | [matchPath](#method_matchPath)(string|null $regexp) Adds a check for the URL path info. | from [RequestMatcher](requestmatcher#method_matchPath "Symfony\Component\HttpFoundation\RequestMatcher") | | | [matchIp](#method_matchIp)(string $ip) Adds a check for the client IP. | from [RequestMatcher](requestmatcher#method_matchIp "Symfony\Component\HttpFoundation\RequestMatcher") | | | [matchIps](#method_matchIps)(string|string[]|null $ips) Adds a check for the client IP. | from [RequestMatcher](requestmatcher#method_matchIps "Symfony\Component\HttpFoundation\RequestMatcher") | | | [matchMethod](#method_matchMethod)(string|string[]|null $method) Adds a check for the HTTP method. | from [RequestMatcher](requestmatcher#method_matchMethod "Symfony\Component\HttpFoundation\RequestMatcher") | | | [matchAttribute](#method_matchAttribute)(string $key, string $regexp) Adds a check for request attribute. | from [RequestMatcher](requestmatcher#method_matchAttribute "Symfony\Component\HttpFoundation\RequestMatcher") | | bool | [matches](#method_matches)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Decides whether the rule(s) implemented by the strategy matches the supplied request. | | | | [setExpression](#method_setExpression)([ExpressionLanguage](../expressionlanguage/expressionlanguage "Symfony\Component\ExpressionLanguage\ExpressionLanguage") $language, $expression) | | Details ------- ### \_\_construct(string $path = null, string $host = null, string|string[]|null $methods = null, string|string[]|null $ips = null, array $attributes = array(), string|string[]|null $schemes = null) #### Parameters | | | | | --- | --- | --- | | string | $path | | | string | $host | | | string|string[]|null | $methods | | | string|string[]|null | $ips | | | array | $attributes | | | string|string[]|null | $schemes | | ### matchScheme(string|string[]|null $scheme) Adds a check for the HTTP scheme. #### Parameters | | | | | --- | --- | --- | | string|string[]|null | $scheme | An HTTP scheme or an array of HTTP schemes | ### matchHost(string|null $regexp) Adds a check for the URL host name. #### Parameters | | | | | --- | --- | --- | | string|null | $regexp | A Regexp | ### matchPath(string|null $regexp) Adds a check for the URL path info. #### Parameters | | | | | --- | --- | --- | | string|null | $regexp | A Regexp | ### matchIp(string $ip) Adds a check for the client IP. #### Parameters | | | | | --- | --- | --- | | string | $ip | A specific IP address or a range specified using IP/netmask like 192.168.1.0/24 | ### matchIps(string|string[]|null $ips) Adds a check for the client IP. #### Parameters | | | | | --- | --- | --- | | string|string[]|null | $ips | A specific IP address or a range specified using IP/netmask like 192.168.1.0/24 | ### matchMethod(string|string[]|null $method) Adds a check for the HTTP method. #### Parameters | | | | | --- | --- | --- | | string|string[]|null | $method | An HTTP method or an array of HTTP methods | ### matchAttribute(string $key, string $regexp) Adds a check for request attribute. #### Parameters | | | | | --- | --- | --- | | string | $key | The request attribute name | | string | $regexp | A Regexp | ### bool matches([Request](request "Symfony\Component\HttpFoundation\Request") $request) Decides whether the rule(s) implemented by the strategy matches the supplied request. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | bool | true if the request matches, false otherwise | ### setExpression([ExpressionLanguage](../expressionlanguage/expressionlanguage "Symfony\Component\ExpressionLanguage\ExpressionLanguage") $language, $expression) #### Parameters | | | | | --- | --- | --- | | [ExpressionLanguage](../expressionlanguage/expressionlanguage "Symfony\Component\ExpressionLanguage\ExpressionLanguage") | $language | | | | $expression | | symfony AcceptHeaderItem AcceptHeaderItem ================= class **AcceptHeaderItem** Represents an Accept-\* header item. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $value, array $attributes = array()) | | | static [AcceptHeaderItem](acceptheaderitem "Symfony\Component\HttpFoundation\AcceptHeaderItem") | [fromString](#method_fromString)(string $itemValue) Builds an AcceptHeaderInstance instance from a string. | | | string | [\_\_toString](#method___toString)() Returns header value's string representation. | | | $this | [setValue](#method_setValue)(string $value) Set the item value. | | | string | [getValue](#method_getValue)() Returns the item value. | | | $this | [setQuality](#method_setQuality)(float $quality) Set the item quality. | | | float | [getQuality](#method_getQuality)() Returns the item quality. | | | $this | [setIndex](#method_setIndex)(int $index) Set the item index. | | | int | [getIndex](#method_getIndex)() Returns the item index. | | | bool | [hasAttribute](#method_hasAttribute)(string $name) Tests if an attribute exists. | | | mixed | [getAttribute](#method_getAttribute)(string $name, mixed $default = null) Returns an attribute by its name. | | | array | [getAttributes](#method_getAttributes)() Returns all attributes. | | | $this | [setAttribute](#method_setAttribute)(string $name, string $value) Set an attribute. | | Details ------- ### \_\_construct(string $value, array $attributes = array()) #### Parameters | | | | | --- | --- | --- | | string | $value | | | array | $attributes | | ### static [AcceptHeaderItem](acceptheaderitem "Symfony\Component\HttpFoundation\AcceptHeaderItem") fromString(string $itemValue) Builds an AcceptHeaderInstance instance from a string. #### Parameters | | | | | --- | --- | --- | | string | $itemValue | | #### Return Value | | | | --- | --- | | [AcceptHeaderItem](acceptheaderitem "Symfony\Component\HttpFoundation\AcceptHeaderItem") | | ### string \_\_toString() Returns header value's string representation. #### Return Value | | | | --- | --- | | string | | ### $this setValue(string $value) Set the item value. #### Parameters | | | | | --- | --- | --- | | string | $value | | #### Return Value | | | | --- | --- | | $this | | ### string getValue() Returns the item value. #### Return Value | | | | --- | --- | | string | | ### $this setQuality(float $quality) Set the item quality. #### Parameters | | | | | --- | --- | --- | | float | $quality | | #### Return Value | | | | --- | --- | | $this | | ### float getQuality() Returns the item quality. #### Return Value | | | | --- | --- | | float | | ### $this setIndex(int $index) Set the item index. #### Parameters | | | | | --- | --- | --- | | int | $index | | #### Return Value | | | | --- | --- | | $this | | ### int getIndex() Returns the item index. #### Return Value | | | | --- | --- | | int | | ### bool hasAttribute(string $name) Tests if an attribute exists. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | bool | | ### mixed getAttribute(string $name, mixed $default = null) Returns an attribute by its name. #### Parameters | | | | | --- | --- | --- | | string | $name | | | mixed | $default | | #### Return Value | | | | --- | --- | | mixed | | ### array getAttributes() Returns all attributes. #### Return Value | | | | --- | --- | | array | | ### $this setAttribute(string $name, string $value) Set an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | | | string | $value | | #### Return Value | | | | --- | --- | | $this | | symfony Response Response ========= class **Response** Response represents an HTTP response. Constants --------- | | | | --- | --- | | HTTP\_CONTINUE | | | HTTP\_SWITCHING\_PROTOCOLS | | | HTTP\_PROCESSING | | | HTTP\_EARLY\_HINTS | | | HTTP\_OK | | | HTTP\_CREATED | | | HTTP\_ACCEPTED | | | HTTP\_NON\_AUTHORITATIVE\_INFORMATION | | | HTTP\_NO\_CONTENT | | | HTTP\_RESET\_CONTENT | | | HTTP\_PARTIAL\_CONTENT | | | HTTP\_MULTI\_STATUS | | | HTTP\_ALREADY\_REPORTED | | | HTTP\_IM\_USED | | | HTTP\_MULTIPLE\_CHOICES | | | HTTP\_MOVED\_PERMANENTLY | | | HTTP\_FOUND | | | HTTP\_SEE\_OTHER | | | HTTP\_NOT\_MODIFIED | | | HTTP\_USE\_PROXY | | | HTTP\_RESERVED | | | HTTP\_TEMPORARY\_REDIRECT | | | HTTP\_PERMANENTLY\_REDIRECT | | | HTTP\_BAD\_REQUEST | | | HTTP\_UNAUTHORIZED | | | HTTP\_PAYMENT\_REQUIRED | | | HTTP\_FORBIDDEN | | | HTTP\_NOT\_FOUND | | | HTTP\_METHOD\_NOT\_ALLOWED | | | HTTP\_NOT\_ACCEPTABLE | | | HTTP\_PROXY\_AUTHENTICATION\_REQUIRED | | | HTTP\_REQUEST\_TIMEOUT | | | HTTP\_CONFLICT | | | HTTP\_GONE | | | HTTP\_LENGTH\_REQUIRED | | | HTTP\_PRECONDITION\_FAILED | | | HTTP\_REQUEST\_ENTITY\_TOO\_LARGE | | | HTTP\_REQUEST\_URI\_TOO\_LONG | | | HTTP\_UNSUPPORTED\_MEDIA\_TYPE | | | HTTP\_REQUESTED\_RANGE\_NOT\_SATISFIABLE | | | HTTP\_EXPECTATION\_FAILED | | | HTTP\_I\_AM\_A\_TEAPOT | | | HTTP\_MISDIRECTED\_REQUEST | | | HTTP\_UNPROCESSABLE\_ENTITY | | | HTTP\_LOCKED | | | HTTP\_FAILED\_DEPENDENCY | | | HTTP\_RESERVED\_FOR\_WEBDAV\_ADVANCED\_COLLECTIONS\_EXPIRED\_PROPOSAL | | | HTTP\_TOO\_EARLY | | | HTTP\_UPGRADE\_REQUIRED | | | HTTP\_PRECONDITION\_REQUIRED | | | HTTP\_TOO\_MANY\_REQUESTS | | | HTTP\_REQUEST\_HEADER\_FIELDS\_TOO\_LARGE | | | HTTP\_UNAVAILABLE\_FOR\_LEGAL\_REASONS | | | HTTP\_INTERNAL\_SERVER\_ERROR | | | HTTP\_NOT\_IMPLEMENTED | | | HTTP\_BAD\_GATEWAY | | | HTTP\_SERVICE\_UNAVAILABLE | | | HTTP\_GATEWAY\_TIMEOUT | | | HTTP\_VERSION\_NOT\_SUPPORTED | | | HTTP\_VARIANT\_ALSO\_NEGOTIATES\_EXPERIMENTAL | | | HTTP\_INSUFFICIENT\_STORAGE | | | HTTP\_LOOP\_DETECTED | | | HTTP\_NOT\_EXTENDED | | | HTTP\_NETWORK\_AUTHENTICATION\_REQUIRED | | Properties ---------- | | | | | | --- | --- | --- | --- | | [ResponseHeaderBag](responseheaderbag "Symfony\Component\HttpFoundation\ResponseHeaderBag") | $headers | | | | protected string | $content | | | | protected string | $version | | | | protected int | $statusCode | | | | protected string | $statusText | | | | protected string | $charset | | | | static array | $statusTexts | Status codes translation table. | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)($content = '', int $status = 200, array $headers = array()) | | | static [Response](response "Symfony\Component\HttpFoundation\Response") | [create](#method_create)(mixed $content = '', int $status = 200, array $headers = array()) Factory method for chainability. | | | string | [\_\_toString](#method___toString)() Returns the Response as an HTTP string. | | | | [\_\_clone](#method___clone)() Clones the current Response instance. | | | $this | [prepare](#method_prepare)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Prepares the Response before it is sent to the client. | | | $this | [sendHeaders](#method_sendHeaders)() Sends HTTP headers. | | | $this | [sendContent](#method_sendContent)() Sends content for the current web response. | | | $this | [send](#method_send)() Sends HTTP headers and content. | | | $this | [setContent](#method_setContent)(mixed $content) Sets the response content. | | | string | [getContent](#method_getContent)() Gets the current response content. | | | $this | [setProtocolVersion](#method_setProtocolVersion)(string $version) Sets the HTTP protocol version (1.0 or 1.1). | | | string | [getProtocolVersion](#method_getProtocolVersion)() Gets the HTTP protocol version. | | | $this | [setStatusCode](#method_setStatusCode)(int $code, $text = null) Sets the response status code. | | | int | [getStatusCode](#method_getStatusCode)() Retrieves the status code for the current web response. | | | $this | [setCharset](#method_setCharset)(string $charset) Sets the response charset. | | | string|null | [getCharset](#method_getCharset)() Retrieves the response charset. | | | bool | [isCacheable](#method_isCacheable)() Returns true if the response may safely be kept in a shared (surrogate) cache. | | | bool | [isFresh](#method_isFresh)() Returns true if the response is "fresh". | | | bool | [isValidateable](#method_isValidateable)() Returns true if the response includes headers that can be used to validate the response with the origin server using a conditional GET request. | | | $this | [setPrivate](#method_setPrivate)() Marks the response as "private". | | | $this | [setPublic](#method_setPublic)() Marks the response as "public". | | | $this | [setImmutable](#method_setImmutable)(bool $immutable = true) Marks the response as "immutable". | | | bool | [isImmutable](#method_isImmutable)() Returns true if the response is marked as "immutable". | | | bool | [mustRevalidate](#method_mustRevalidate)() Returns true if the response must be revalidated by caches. | | | DateTimeInterface|null | [getDate](#method_getDate)() Returns the Date header as a DateTime instance. | | | $this | [setDate](#method_setDate)([DateTimeInterface](http://php.net/DateTimeInterface) $date) Sets the Date header. | | | int | [getAge](#method_getAge)() Returns the age of the response in seconds. | | | $this | [expire](#method_expire)() Marks the response stale by setting the Age header to be equal to the maximum age of the response. | | | DateTimeInterface|null | [getExpires](#method_getExpires)() Returns the value of the Expires header as a DateTime instance. | | | $this | [setExpires](#method_setExpires)([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Expires HTTP header with a DateTime instance. | | | int|null | [getMaxAge](#method_getMaxAge)() Returns the number of seconds after the time specified in the response's Date header when the response should no longer be considered fresh. | | | $this | [setMaxAge](#method_setMaxAge)(int $value) Sets the number of seconds after which the response should no longer be considered fresh. | | | $this | [setSharedMaxAge](#method_setSharedMaxAge)(int $value) Sets the number of seconds after which the response should no longer be considered fresh by shared caches. | | | int|null | [getTtl](#method_getTtl)() Returns the response's time-to-live in seconds. | | | $this | [setTtl](#method_setTtl)(int $seconds) Sets the response's time-to-live for shared caches in seconds. | | | $this | [setClientTtl](#method_setClientTtl)(int $seconds) Sets the response's time-to-live for private/client caches in seconds. | | | DateTimeInterface|null | [getLastModified](#method_getLastModified)() Returns the Last-Modified HTTP header as a DateTime instance. | | | $this | [setLastModified](#method_setLastModified)([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Last-Modified HTTP header with a DateTime instance. | | | string|null | [getEtag](#method_getEtag)() Returns the literal value of the ETag HTTP header. | | | $this | [setEtag](#method_setEtag)(string $etag = null, bool $weak = false) Sets the ETag value. | | | $this | [setCache](#method_setCache)(array $options) Sets the response's cache headers (validation and/or expiration). | | | $this | [setNotModified](#method_setNotModified)() Modifies the response so that it conforms to the rules defined for a 304 status code. | | | bool | [hasVary](#method_hasVary)() Returns true if the response includes a Vary header. | | | array | [getVary](#method_getVary)() Returns an array of header names given in the Vary header. | | | $this | [setVary](#method_setVary)(string|array $headers, bool $replace = true) Sets the Vary header. | | | bool | [isNotModified](#method_isNotModified)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Determines if the Response validators (ETag, Last-Modified) match a conditional value specified in the Request. | | | bool | [isInvalid](#method_isInvalid)() Is response invalid? | | | bool | [isInformational](#method_isInformational)() Is response informative? | | | bool | [isSuccessful](#method_isSuccessful)() Is response successful? | | | bool | [isRedirection](#method_isRedirection)() Is the response a redirect? | | | bool | [isClientError](#method_isClientError)() Is there a client error? | | | bool | [isServerError](#method_isServerError)() Was there a server side error? | | | bool | [isOk](#method_isOk)() Is the response OK? | | | bool | [isForbidden](#method_isForbidden)() Is the response forbidden? | | | bool | [isNotFound](#method_isNotFound)() Is the response a not found error? | | | bool | [isRedirect](#method_isRedirect)(string $location = null) Is the response a redirect of some form? | | | bool | [isEmpty](#method_isEmpty)() Is the response empty? | | | static | [closeOutputBuffers](#method_closeOutputBuffers)(int $targetLevel, bool $flush) Cleans or flushes output buffers up to target level. | | | | [ensureIEOverSSLCompatibility](#method_ensureIEOverSSLCompatibility)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9. | | Details ------- ### \_\_construct($content = '', int $status = 200, array $headers = array()) #### Parameters | | | | | --- | --- | --- | | | $content | | | int | $status | | | array | $headers | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When the HTTP status code is not valid | ### static [Response](response "Symfony\Component\HttpFoundation\Response") create(mixed $content = '', int $status = 200, array $headers = array()) Factory method for chainability. Example: ``` return Response::create($body, 200) ->setSharedMaxAge(300); ``` #### Parameters | | | | | --- | --- | --- | | mixed | $content | The response content, see setContent() | | int | $status | The response status code | | array | $headers | An array of response headers | #### Return Value | | | | --- | --- | | [Response](response "Symfony\Component\HttpFoundation\Response") | | ### string \_\_toString() Returns the Response as an HTTP string. The string representation of the Response is the same as the one that will be sent to the client only if the prepare() method has been called before. #### Return Value | | | | --- | --- | | string | The Response as an HTTP string | #### See also | | | | --- | --- | | prepare() | | ### \_\_clone() Clones the current Response instance. ### $this prepare([Request](request "Symfony\Component\HttpFoundation\Request") $request) Prepares the Response before it is sent to the client. This method tweaks the Response to ensure that it is compliant with RFC 2616. Most of the changes are based on the Request that is "associated" with this Response. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | $this | | ### $this sendHeaders() Sends HTTP headers. #### Return Value | | | | --- | --- | | $this | | ### $this sendContent() Sends content for the current web response. #### Return Value | | | | --- | --- | | $this | | ### $this send() Sends HTTP headers and content. #### Return Value | | | | --- | --- | | $this | | ### $this setContent(mixed $content) Sets the response content. Valid types are strings, numbers, null, and objects that implement a \_\_toString() method. #### Parameters | | | | | --- | --- | --- | | mixed | $content | Content that can be cast to string | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [UnexpectedValueException](http://php.net/UnexpectedValueException) | | ### string getContent() Gets the current response content. #### Return Value | | | | --- | --- | | string | Content | ### $this setProtocolVersion(string $version) Sets the HTTP protocol version (1.0 or 1.1). #### Parameters | | | | | --- | --- | --- | | string | $version | | #### Return Value | | | | --- | --- | | $this | | ### string getProtocolVersion() Gets the HTTP protocol version. #### Return Value | | | | --- | --- | | string | | ### $this setStatusCode(int $code, $text = null) Sets the response status code. If the status text is null it will be automatically populated for the known status codes and left empty otherwise. #### Parameters | | | | | --- | --- | --- | | int | $code | | | | $text | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When the HTTP status code is not valid | ### int getStatusCode() Retrieves the status code for the current web response. #### Return Value | | | | --- | --- | | int | | ### $this setCharset(string $charset) Sets the response charset. #### Parameters | | | | | --- | --- | --- | | string | $charset | | #### Return Value | | | | --- | --- | | $this | | ### string|null getCharset() Retrieves the response charset. #### Return Value | | | | --- | --- | | string|null | | ### bool isCacheable() Returns true if the response may safely be kept in a shared (surrogate) cache. Responses marked "private" with an explicit Cache-Control directive are considered uncacheable. Responses with neither a freshness lifetime (Expires, max-age) nor cache validator (Last-Modified, ETag) are considered uncacheable because there is no way to tell when or how to remove them from the cache. Note that RFC 7231 and RFC 7234 possibly allow for a more permissive implementation, for example "status codes that are defined as cacheable by default [...] can be reused by a cache with heuristic expiration unless otherwise indicated" (https://tools.ietf.org/html/rfc7231#section-6.1) #### Return Value | | | | --- | --- | | bool | | ### bool isFresh() Returns true if the response is "fresh". Fresh responses may be served from cache without any interaction with the origin. A response is considered fresh when it includes a Cache-Control/max-age indicator or Expires header and the calculated age is less than the freshness lifetime. #### Return Value | | | | --- | --- | | bool | | ### bool isValidateable() Returns true if the response includes headers that can be used to validate the response with the origin server using a conditional GET request. #### Return Value | | | | --- | --- | | bool | | ### $this setPrivate() Marks the response as "private". It makes the response ineligible for serving other clients. #### Return Value | | | | --- | --- | | $this | | ### $this setPublic() Marks the response as "public". It makes the response eligible for serving other clients. #### Return Value | | | | --- | --- | | $this | | ### $this setImmutable(bool $immutable = true) Marks the response as "immutable". #### Parameters | | | | | --- | --- | --- | | bool | $immutable | | #### Return Value | | | | --- | --- | | $this | | ### bool isImmutable() Returns true if the response is marked as "immutable". #### Return Value | | | | --- | --- | | bool | | ### bool mustRevalidate() Returns true if the response must be revalidated by caches. This method indicates that the response must not be served stale by a cache in any circumstance without first revalidating with the origin. When present, the TTL of the response should not be overridden to be greater than the value provided by the origin. #### Return Value | | | | --- | --- | | bool | | ### DateTimeInterface|null getDate() Returns the Date header as a DateTime instance. #### Return Value | | | | --- | --- | | DateTimeInterface|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When the header is not parseable | ### $this setDate([DateTimeInterface](http://php.net/DateTimeInterface) $date) Sets the Date header. #### Parameters | | | | | --- | --- | --- | | [DateTimeInterface](http://php.net/DateTimeInterface) | $date | | #### Return Value | | | | --- | --- | | $this | | ### int getAge() Returns the age of the response in seconds. #### Return Value | | | | --- | --- | | int | | ### $this expire() Marks the response stale by setting the Age header to be equal to the maximum age of the response. #### Return Value | | | | --- | --- | | $this | | ### DateTimeInterface|null getExpires() Returns the value of the Expires header as a DateTime instance. #### Return Value | | | | --- | --- | | DateTimeInterface|null | | ### $this setExpires([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Expires HTTP header with a DateTime instance. Passing null as value will remove the header. #### Parameters | | | | | --- | --- | --- | | [DateTimeInterface](http://php.net/DateTimeInterface) | $date | | #### Return Value | | | | --- | --- | | $this | | ### int|null getMaxAge() Returns the number of seconds after the time specified in the response's Date header when the response should no longer be considered fresh. First, it checks for a s-maxage directive, then a max-age directive, and then it falls back on an expires header. It returns null when no maximum age can be established. #### Return Value | | | | --- | --- | | int|null | | ### $this setMaxAge(int $value) Sets the number of seconds after which the response should no longer be considered fresh. This methods sets the Cache-Control max-age directive. #### Parameters | | | | | --- | --- | --- | | int | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this setSharedMaxAge(int $value) Sets the number of seconds after which the response should no longer be considered fresh by shared caches. This methods sets the Cache-Control s-maxage directive. #### Parameters | | | | | --- | --- | --- | | int | $value | | #### Return Value | | | | --- | --- | | $this | | ### int|null getTtl() Returns the response's time-to-live in seconds. It returns null when no freshness information is present in the response. When the responses TTL is <= 0, the response may not be served from cache without first revalidating with the origin. #### Return Value | | | | --- | --- | | int|null | | ### $this setTtl(int $seconds) Sets the response's time-to-live for shared caches in seconds. This method adjusts the Cache-Control/s-maxage directive. #### Parameters | | | | | --- | --- | --- | | int | $seconds | | #### Return Value | | | | --- | --- | | $this | | ### $this setClientTtl(int $seconds) Sets the response's time-to-live for private/client caches in seconds. This method adjusts the Cache-Control/max-age directive. #### Parameters | | | | | --- | --- | --- | | int | $seconds | | #### Return Value | | | | --- | --- | | $this | | ### DateTimeInterface|null getLastModified() Returns the Last-Modified HTTP header as a DateTime instance. #### Return Value | | | | --- | --- | | DateTimeInterface|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When the HTTP header is not parseable | ### $this setLastModified([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Last-Modified HTTP header with a DateTime instance. Passing null as value will remove the header. #### Parameters | | | | | --- | --- | --- | | [DateTimeInterface](http://php.net/DateTimeInterface) | $date | | #### Return Value | | | | --- | --- | | $this | | ### string|null getEtag() Returns the literal value of the ETag HTTP header. #### Return Value | | | | --- | --- | | string|null | | ### $this setEtag(string $etag = null, bool $weak = false) Sets the ETag value. #### Parameters | | | | | --- | --- | --- | | string | $etag | The ETag unique identifier or null to remove the header | | bool | $weak | Whether you want a weak ETag or not | #### Return Value | | | | --- | --- | | $this | | ### $this setCache(array $options) Sets the response's cache headers (validation and/or expiration). Available options are: etag, last\_modified, max\_age, s\_maxage, private, public and immutable. #### Parameters | | | | | --- | --- | --- | | array | $options | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### $this setNotModified() Modifies the response so that it conforms to the rules defined for a 304 status code. This sets the status, removes the body, and discards any headers that MUST NOT be included in 304 responses. #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | <http://tools.ietf.org/html/rfc2616#section-10.3.5> | | ### bool hasVary() Returns true if the response includes a Vary header. #### Return Value | | | | --- | --- | | bool | | ### array getVary() Returns an array of header names given in the Vary header. #### Return Value | | | | --- | --- | | array | | ### $this setVary(string|array $headers, bool $replace = true) Sets the Vary header. #### Parameters | | | | | --- | --- | --- | | string|array | $headers | | | bool | $replace | Whether to replace the actual value or not (true by default) | #### Return Value | | | | --- | --- | | $this | | ### bool isNotModified([Request](request "Symfony\Component\HttpFoundation\Request") $request) Determines if the Response validators (ETag, Last-Modified) match a conditional value specified in the Request. If the Response is not modified, it sets the status code to 304 and removes the actual content by calling the setNotModified() method. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | bool | true if the Response validators match the Request, false otherwise | ### bool isInvalid() Is response invalid? #### Return Value | | | | --- | --- | | bool | | #### See also | | | | --- | --- | | <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html> | | ### bool isInformational() Is response informative? #### Return Value | | | | --- | --- | | bool | | ### bool isSuccessful() Is response successful? #### Return Value | | | | --- | --- | | bool | | ### bool isRedirection() Is the response a redirect? #### Return Value | | | | --- | --- | | bool | | ### bool isClientError() Is there a client error? #### Return Value | | | | --- | --- | | bool | | ### bool isServerError() Was there a server side error? #### Return Value | | | | --- | --- | | bool | | ### bool isOk() Is the response OK? #### Return Value | | | | --- | --- | | bool | | ### bool isForbidden() Is the response forbidden? #### Return Value | | | | --- | --- | | bool | | ### bool isNotFound() Is the response a not found error? #### Return Value | | | | --- | --- | | bool | | ### bool isRedirect(string $location = null) Is the response a redirect of some form? #### Parameters | | | | | --- | --- | --- | | string | $location | | #### Return Value | | | | --- | --- | | bool | | ### bool isEmpty() Is the response empty? #### Return Value | | | | --- | --- | | bool | | ### static closeOutputBuffers(int $targetLevel, bool $flush) Cleans or flushes output buffers up to target level. Resulting level can be greater than target level if a non-removable buffer has been encountered. #### Parameters | | | | | --- | --- | --- | | int | $targetLevel | | | bool | $flush | | ### protected ensureIEOverSSLCompatibility([Request](request "Symfony\Component\HttpFoundation\Request") $request) Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### See also | | | | --- | --- | | <http://support.microsoft.com/kb/323308> | |
programming_docs
symfony Symfony\Component\HttpFoundation\Exception Symfony\Component\HttpFoundation\Exception ========================================== Classes ------- | | | | --- | --- | | [ConflictingHeadersException](exception/conflictingheadersexception "Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException") | The HTTP request contains headers with conflicting information. | | [SuspiciousOperationException](exception/suspiciousoperationexception "Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException") | Raised when a user has performed an operation that should be considered suspicious from a security perspective. | Interfaces ---------- | | | | --- | --- | | *[RequestExceptionInterface](exception/requestexceptioninterface "Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface")* | Interface for Request exceptions. | symfony ServerBag ServerBag ========== class **ServerBag** extends [ParameterBag](parameterbag "Symfony\Component\HttpFoundation\ParameterBag") ServerBag is a container for HTTP headers from the $\_SERVER variable. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $parameters | Parameter storage. | from [ParameterBag](parameterbag#property_parameters "Symfony\Component\HttpFoundation\ParameterBag") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $parameters = array()) | from [ParameterBag](parameterbag#method___construct "Symfony\Component\HttpFoundation\ParameterBag") | | array | [all](#method_all)() Returns the parameters. | from [ParameterBag](parameterbag#method_all "Symfony\Component\HttpFoundation\ParameterBag") | | array | [keys](#method_keys)() Returns the parameter keys. | from [ParameterBag](parameterbag#method_keys "Symfony\Component\HttpFoundation\ParameterBag") | | | [replace](#method_replace)(array $parameters = array()) Replaces the current parameters by a new set. | from [ParameterBag](parameterbag#method_replace "Symfony\Component\HttpFoundation\ParameterBag") | | | [add](#method_add)(array $parameters = array()) Adds parameters. | from [ParameterBag](parameterbag#method_add "Symfony\Component\HttpFoundation\ParameterBag") | | mixed | [get](#method_get)(string $key, mixed $default = null) Returns a parameter by name. | from [ParameterBag](parameterbag#method_get "Symfony\Component\HttpFoundation\ParameterBag") | | | [set](#method_set)(string $key, mixed $value) Sets a parameter by name. | from [ParameterBag](parameterbag#method_set "Symfony\Component\HttpFoundation\ParameterBag") | | bool | [has](#method_has)(string $key) Returns true if the parameter is defined. | from [ParameterBag](parameterbag#method_has "Symfony\Component\HttpFoundation\ParameterBag") | | | [remove](#method_remove)(string $key) Removes a parameter. | from [ParameterBag](parameterbag#method_remove "Symfony\Component\HttpFoundation\ParameterBag") | | string | [getAlpha](#method_getAlpha)(string $key, string $default = '') Returns the alphabetic characters of the parameter value. | from [ParameterBag](parameterbag#method_getAlpha "Symfony\Component\HttpFoundation\ParameterBag") | | string | [getAlnum](#method_getAlnum)(string $key, string $default = '') Returns the alphabetic characters and digits of the parameter value. | from [ParameterBag](parameterbag#method_getAlnum "Symfony\Component\HttpFoundation\ParameterBag") | | string | [getDigits](#method_getDigits)(string $key, string $default = '') Returns the digits of the parameter value. | from [ParameterBag](parameterbag#method_getDigits "Symfony\Component\HttpFoundation\ParameterBag") | | int | [getInt](#method_getInt)(string $key, int $default = 0) Returns the parameter value converted to integer. | from [ParameterBag](parameterbag#method_getInt "Symfony\Component\HttpFoundation\ParameterBag") | | bool | [getBoolean](#method_getBoolean)(string $key, mixed $default = false) Returns the parameter value converted to boolean. | from [ParameterBag](parameterbag#method_getBoolean "Symfony\Component\HttpFoundation\ParameterBag") | | mixed | [filter](#method_filter)(string $key, mixed $default = null, int $filter = FILTER\_DEFAULT, mixed $options = array()) Filter key. | from [ParameterBag](parameterbag#method_filter "Symfony\Component\HttpFoundation\ParameterBag") | | [ArrayIterator](http://php.net/ArrayIterator) | [getIterator](#method_getIterator)() Returns an iterator for parameters. | from [ParameterBag](parameterbag#method_getIterator "Symfony\Component\HttpFoundation\ParameterBag") | | int | [count](#method_count)() Returns the number of parameters. | from [ParameterBag](parameterbag#method_count "Symfony\Component\HttpFoundation\ParameterBag") | | array | [getHeaders](#method_getHeaders)() Gets the HTTP headers. | | Details ------- ### \_\_construct(array $parameters = array()) #### Parameters | | | | | --- | --- | --- | | array | $parameters | An array of parameters | ### array all() Returns the parameters. #### Return Value | | | | --- | --- | | array | An array of parameters | ### array keys() Returns the parameter keys. #### Return Value | | | | --- | --- | | array | An array of parameter keys | ### replace(array $parameters = array()) Replaces the current parameters by a new set. #### Parameters | | | | | --- | --- | --- | | array | $parameters | An array of parameters | ### add(array $parameters = array()) Adds parameters. #### Parameters | | | | | --- | --- | --- | | array | $parameters | An array of parameters | ### mixed get(string $key, mixed $default = null) Returns a parameter by name. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | mixed | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | mixed | | ### set(string $key, mixed $value) Sets a parameter by name. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | mixed | $value | The value | ### bool has(string $key) Returns true if the parameter is defined. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | #### Return Value | | | | --- | --- | | bool | true if the parameter exists, false otherwise | ### remove(string $key) Removes a parameter. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | ### string getAlpha(string $key, string $default = '') Returns the alphabetic characters of the parameter value. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | string | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | string | The filtered value | ### string getAlnum(string $key, string $default = '') Returns the alphabetic characters and digits of the parameter value. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | string | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | string | The filtered value | ### string getDigits(string $key, string $default = '') Returns the digits of the parameter value. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | string | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | string | The filtered value | ### int getInt(string $key, int $default = 0) Returns the parameter value converted to integer. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | int | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | int | The filtered value | ### bool getBoolean(string $key, mixed $default = false) Returns the parameter value converted to boolean. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | mixed | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | bool | The filtered value | ### mixed filter(string $key, mixed $default = null, int $filter = FILTER\_DEFAULT, mixed $options = array()) Filter key. #### Parameters | | | | | --- | --- | --- | | string | $key | Key | | mixed | $default | Default = null | | int | $filter | FILTER\_\* constant | | mixed | $options | Filter options | #### Return Value | | | | --- | --- | | mixed | | #### See also | | | | --- | --- | | <http://php.net/manual/en/function.filter-var.php> | | ### [ArrayIterator](http://php.net/ArrayIterator) getIterator() Returns an iterator for parameters. #### Return Value | | | | --- | --- | | [ArrayIterator](http://php.net/ArrayIterator) | An \ArrayIterator instance | ### int count() Returns the number of parameters. #### Return Value | | | | --- | --- | | int | The number of parameters | ### array getHeaders() Gets the HTTP headers. #### Return Value | | | | --- | --- | | array | | symfony RequestStack RequestStack ============= class **RequestStack** Request stack that controls the lifecycle of requests. Methods ------- | | | | | --- | --- | --- | | | [push](#method_push)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Pushes a Request on the stack. | | | [Request](request "Symfony\Component\HttpFoundation\Request")|null | [pop](#method_pop)() Pops the current request from the stack. | | | [Request](request "Symfony\Component\HttpFoundation\Request")|null | [getCurrentRequest](#method_getCurrentRequest)() | | | [Request](request "Symfony\Component\HttpFoundation\Request")|null | [getMasterRequest](#method_getMasterRequest)() Gets the master Request. | | | [Request](request "Symfony\Component\HttpFoundation\Request")|null | [getParentRequest](#method_getParentRequest)() Returns the parent request of the current. | | Details ------- ### push([Request](request "Symfony\Component\HttpFoundation\Request") $request) Pushes a Request on the stack. This method should generally not be called directly as the stack management should be taken care of by the application itself. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | ### [Request](request "Symfony\Component\HttpFoundation\Request")|null pop() Pops the current request from the stack. This operation lets the current request go out of scope. This method should generally not be called directly as the stack management should be taken care of by the application itself. #### Return Value | | | | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request")|null | | ### [Request](request "Symfony\Component\HttpFoundation\Request")|null getCurrentRequest() #### Return Value | | | | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request")|null | | ### [Request](request "Symfony\Component\HttpFoundation\Request")|null getMasterRequest() Gets the master Request. Be warned that making your code aware of the master request might make it un-compatible with other features of your framework like ESI support. #### Return Value | | | | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request")|null | | ### [Request](request "Symfony\Component\HttpFoundation\Request")|null getParentRequest() Returns the parent request of the current. Be warned that making your code aware of the parent request might make it un-compatible with other features of your framework like ESI support. If current Request is the master request, it returns null. #### Return Value | | | | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request")|null | | symfony RequestMatcherInterface RequestMatcherInterface ======================== interface **RequestMatcherInterface** RequestMatcherInterface is an interface for strategies to match a Request. Methods ------- | | | | | --- | --- | --- | | bool | [matches](#method_matches)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Decides whether the rule(s) implemented by the strategy matches the supplied request. | | Details ------- ### bool matches([Request](request "Symfony\Component\HttpFoundation\Request") $request) Decides whether the rule(s) implemented by the strategy matches the supplied request. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | bool | true if the request matches, false otherwise | symfony JsonResponse JsonResponse ============= class **JsonResponse** extends [Response](response "Symfony\Component\HttpFoundation\Response") Response represents an HTTP response in JSON format. Note that this class does not force the returned JSON content to be an object. It is however recommended that you do return an object as it protects yourself against XSSI and JSON-JavaScript Hijacking. Constants --------- | | | | --- | --- | | HTTP\_CONTINUE | | | HTTP\_SWITCHING\_PROTOCOLS | | | HTTP\_PROCESSING | | | HTTP\_EARLY\_HINTS | | | HTTP\_OK | | | HTTP\_CREATED | | | HTTP\_ACCEPTED | | | HTTP\_NON\_AUTHORITATIVE\_INFORMATION | | | HTTP\_NO\_CONTENT | | | HTTP\_RESET\_CONTENT | | | HTTP\_PARTIAL\_CONTENT | | | HTTP\_MULTI\_STATUS | | | HTTP\_ALREADY\_REPORTED | | | HTTP\_IM\_USED | | | HTTP\_MULTIPLE\_CHOICES | | | HTTP\_MOVED\_PERMANENTLY | | | HTTP\_FOUND | | | HTTP\_SEE\_OTHER | | | HTTP\_NOT\_MODIFIED | | | HTTP\_USE\_PROXY | | | HTTP\_RESERVED | | | HTTP\_TEMPORARY\_REDIRECT | | | HTTP\_PERMANENTLY\_REDIRECT | | | HTTP\_BAD\_REQUEST | | | HTTP\_UNAUTHORIZED | | | HTTP\_PAYMENT\_REQUIRED | | | HTTP\_FORBIDDEN | | | HTTP\_NOT\_FOUND | | | HTTP\_METHOD\_NOT\_ALLOWED | | | HTTP\_NOT\_ACCEPTABLE | | | HTTP\_PROXY\_AUTHENTICATION\_REQUIRED | | | HTTP\_REQUEST\_TIMEOUT | | | HTTP\_CONFLICT | | | HTTP\_GONE | | | HTTP\_LENGTH\_REQUIRED | | | HTTP\_PRECONDITION\_FAILED | | | HTTP\_REQUEST\_ENTITY\_TOO\_LARGE | | | HTTP\_REQUEST\_URI\_TOO\_LONG | | | HTTP\_UNSUPPORTED\_MEDIA\_TYPE | | | HTTP\_REQUESTED\_RANGE\_NOT\_SATISFIABLE | | | HTTP\_EXPECTATION\_FAILED | | | HTTP\_I\_AM\_A\_TEAPOT | | | HTTP\_MISDIRECTED\_REQUEST | | | HTTP\_UNPROCESSABLE\_ENTITY | | | HTTP\_LOCKED | | | HTTP\_FAILED\_DEPENDENCY | | | HTTP\_RESERVED\_FOR\_WEBDAV\_ADVANCED\_COLLECTIONS\_EXPIRED\_PROPOSAL | | | HTTP\_TOO\_EARLY | | | HTTP\_UPGRADE\_REQUIRED | | | HTTP\_PRECONDITION\_REQUIRED | | | HTTP\_TOO\_MANY\_REQUESTS | | | HTTP\_REQUEST\_HEADER\_FIELDS\_TOO\_LARGE | | | HTTP\_UNAVAILABLE\_FOR\_LEGAL\_REASONS | | | HTTP\_INTERNAL\_SERVER\_ERROR | | | HTTP\_NOT\_IMPLEMENTED | | | HTTP\_BAD\_GATEWAY | | | HTTP\_SERVICE\_UNAVAILABLE | | | HTTP\_GATEWAY\_TIMEOUT | | | HTTP\_VERSION\_NOT\_SUPPORTED | | | HTTP\_VARIANT\_ALSO\_NEGOTIATES\_EXPERIMENTAL | | | HTTP\_INSUFFICIENT\_STORAGE | | | HTTP\_LOOP\_DETECTED | | | HTTP\_NOT\_EXTENDED | | | HTTP\_NETWORK\_AUTHENTICATION\_REQUIRED | | | DEFAULT\_ENCODING\_OPTIONS | | Properties ---------- | | | | | | --- | --- | --- | --- | | [ResponseHeaderBag](responseheaderbag "Symfony\Component\HttpFoundation\ResponseHeaderBag") | $headers | | from [Response](response#property_headers "Symfony\Component\HttpFoundation\Response") | | protected string | $content | | from [Response](response#property_content "Symfony\Component\HttpFoundation\Response") | | protected string | $version | | from [Response](response#property_version "Symfony\Component\HttpFoundation\Response") | | protected int | $statusCode | | from [Response](response#property_statusCode "Symfony\Component\HttpFoundation\Response") | | protected string | $statusText | | from [Response](response#property_statusText "Symfony\Component\HttpFoundation\Response") | | protected string | $charset | | from [Response](response#property_charset "Symfony\Component\HttpFoundation\Response") | | static array | $statusTexts | Status codes translation table. | from [Response](response#property_statusTexts "Symfony\Component\HttpFoundation\Response") | | protected | $data | | | | protected | $callback | | | | protected | $encodingOptions | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(mixed $data = null, int $status = 200, array $headers = array(), bool $json = false) | | | static [Response](response "Symfony\Component\HttpFoundation\Response") | [create](#method_create)(mixed $data = null, int $status = 200, array $headers = array()) Factory method for chainability. | | | string | [\_\_toString](#method___toString)() Returns the Response as an HTTP string. | from [Response](response#method___toString "Symfony\Component\HttpFoundation\Response") | | | [\_\_clone](#method___clone)() Clones the current Response instance. | from [Response](response#method___clone "Symfony\Component\HttpFoundation\Response") | | $this | [prepare](#method_prepare)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Prepares the Response before it is sent to the client. | from [Response](response#method_prepare "Symfony\Component\HttpFoundation\Response") | | $this | [sendHeaders](#method_sendHeaders)() Sends HTTP headers. | from [Response](response#method_sendHeaders "Symfony\Component\HttpFoundation\Response") | | $this | [sendContent](#method_sendContent)() Sends content for the current web response. | from [Response](response#method_sendContent "Symfony\Component\HttpFoundation\Response") | | $this | [send](#method_send)() Sends HTTP headers and content. | from [Response](response#method_send "Symfony\Component\HttpFoundation\Response") | | $this | [setContent](#method_setContent)(mixed $content) Sets the response content. | from [Response](response#method_setContent "Symfony\Component\HttpFoundation\Response") | | string | [getContent](#method_getContent)() Gets the current response content. | from [Response](response#method_getContent "Symfony\Component\HttpFoundation\Response") | | $this | [setProtocolVersion](#method_setProtocolVersion)(string $version) Sets the HTTP protocol version (1.0 or 1.1). | from [Response](response#method_setProtocolVersion "Symfony\Component\HttpFoundation\Response") | | string | [getProtocolVersion](#method_getProtocolVersion)() Gets the HTTP protocol version. | from [Response](response#method_getProtocolVersion "Symfony\Component\HttpFoundation\Response") | | $this | [setStatusCode](#method_setStatusCode)(int $code, $text = null) Sets the response status code. | from [Response](response#method_setStatusCode "Symfony\Component\HttpFoundation\Response") | | int | [getStatusCode](#method_getStatusCode)() Retrieves the status code for the current web response. | from [Response](response#method_getStatusCode "Symfony\Component\HttpFoundation\Response") | | $this | [setCharset](#method_setCharset)(string $charset) Sets the response charset. | from [Response](response#method_setCharset "Symfony\Component\HttpFoundation\Response") | | string|null | [getCharset](#method_getCharset)() Retrieves the response charset. | from [Response](response#method_getCharset "Symfony\Component\HttpFoundation\Response") | | bool | [isCacheable](#method_isCacheable)() Returns true if the response may safely be kept in a shared (surrogate) cache. | from [Response](response#method_isCacheable "Symfony\Component\HttpFoundation\Response") | | bool | [isFresh](#method_isFresh)() Returns true if the response is "fresh". | from [Response](response#method_isFresh "Symfony\Component\HttpFoundation\Response") | | bool | [isValidateable](#method_isValidateable)() Returns true if the response includes headers that can be used to validate the response with the origin server using a conditional GET request. | from [Response](response#method_isValidateable "Symfony\Component\HttpFoundation\Response") | | $this | [setPrivate](#method_setPrivate)() Marks the response as "private". | from [Response](response#method_setPrivate "Symfony\Component\HttpFoundation\Response") | | $this | [setPublic](#method_setPublic)() Marks the response as "public". | from [Response](response#method_setPublic "Symfony\Component\HttpFoundation\Response") | | $this | [setImmutable](#method_setImmutable)(bool $immutable = true) Marks the response as "immutable". | from [Response](response#method_setImmutable "Symfony\Component\HttpFoundation\Response") | | bool | [isImmutable](#method_isImmutable)() Returns true if the response is marked as "immutable". | from [Response](response#method_isImmutable "Symfony\Component\HttpFoundation\Response") | | bool | [mustRevalidate](#method_mustRevalidate)() Returns true if the response must be revalidated by caches. | from [Response](response#method_mustRevalidate "Symfony\Component\HttpFoundation\Response") | | DateTimeInterface|null | [getDate](#method_getDate)() Returns the Date header as a DateTime instance. | from [Response](response#method_getDate "Symfony\Component\HttpFoundation\Response") | | $this | [setDate](#method_setDate)([DateTimeInterface](http://php.net/DateTimeInterface) $date) Sets the Date header. | from [Response](response#method_setDate "Symfony\Component\HttpFoundation\Response") | | int | [getAge](#method_getAge)() Returns the age of the response in seconds. | from [Response](response#method_getAge "Symfony\Component\HttpFoundation\Response") | | $this | [expire](#method_expire)() Marks the response stale by setting the Age header to be equal to the maximum age of the response. | from [Response](response#method_expire "Symfony\Component\HttpFoundation\Response") | | DateTimeInterface|null | [getExpires](#method_getExpires)() Returns the value of the Expires header as a DateTime instance. | from [Response](response#method_getExpires "Symfony\Component\HttpFoundation\Response") | | $this | [setExpires](#method_setExpires)([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Expires HTTP header with a DateTime instance. | from [Response](response#method_setExpires "Symfony\Component\HttpFoundation\Response") | | int|null | [getMaxAge](#method_getMaxAge)() Returns the number of seconds after the time specified in the response's Date header when the response should no longer be considered fresh. | from [Response](response#method_getMaxAge "Symfony\Component\HttpFoundation\Response") | | $this | [setMaxAge](#method_setMaxAge)(int $value) Sets the number of seconds after which the response should no longer be considered fresh. | from [Response](response#method_setMaxAge "Symfony\Component\HttpFoundation\Response") | | $this | [setSharedMaxAge](#method_setSharedMaxAge)(int $value) Sets the number of seconds after which the response should no longer be considered fresh by shared caches. | from [Response](response#method_setSharedMaxAge "Symfony\Component\HttpFoundation\Response") | | int|null | [getTtl](#method_getTtl)() Returns the response's time-to-live in seconds. | from [Response](response#method_getTtl "Symfony\Component\HttpFoundation\Response") | | $this | [setTtl](#method_setTtl)(int $seconds) Sets the response's time-to-live for shared caches in seconds. | from [Response](response#method_setTtl "Symfony\Component\HttpFoundation\Response") | | $this | [setClientTtl](#method_setClientTtl)(int $seconds) Sets the response's time-to-live for private/client caches in seconds. | from [Response](response#method_setClientTtl "Symfony\Component\HttpFoundation\Response") | | DateTimeInterface|null | [getLastModified](#method_getLastModified)() Returns the Last-Modified HTTP header as a DateTime instance. | from [Response](response#method_getLastModified "Symfony\Component\HttpFoundation\Response") | | $this | [setLastModified](#method_setLastModified)([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Last-Modified HTTP header with a DateTime instance. | from [Response](response#method_setLastModified "Symfony\Component\HttpFoundation\Response") | | string|null | [getEtag](#method_getEtag)() Returns the literal value of the ETag HTTP header. | from [Response](response#method_getEtag "Symfony\Component\HttpFoundation\Response") | | $this | [setEtag](#method_setEtag)(string $etag = null, bool $weak = false) Sets the ETag value. | from [Response](response#method_setEtag "Symfony\Component\HttpFoundation\Response") | | $this | [setCache](#method_setCache)(array $options) Sets the response's cache headers (validation and/or expiration). | from [Response](response#method_setCache "Symfony\Component\HttpFoundation\Response") | | $this | [setNotModified](#method_setNotModified)() Modifies the response so that it conforms to the rules defined for a 304 status code. | from [Response](response#method_setNotModified "Symfony\Component\HttpFoundation\Response") | | bool | [hasVary](#method_hasVary)() Returns true if the response includes a Vary header. | from [Response](response#method_hasVary "Symfony\Component\HttpFoundation\Response") | | array | [getVary](#method_getVary)() Returns an array of header names given in the Vary header. | from [Response](response#method_getVary "Symfony\Component\HttpFoundation\Response") | | $this | [setVary](#method_setVary)(string|array $headers, bool $replace = true) Sets the Vary header. | from [Response](response#method_setVary "Symfony\Component\HttpFoundation\Response") | | bool | [isNotModified](#method_isNotModified)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Determines if the Response validators (ETag, Last-Modified) match a conditional value specified in the Request. | from [Response](response#method_isNotModified "Symfony\Component\HttpFoundation\Response") | | bool | [isInvalid](#method_isInvalid)() Is response invalid? | from [Response](response#method_isInvalid "Symfony\Component\HttpFoundation\Response") | | bool | [isInformational](#method_isInformational)() Is response informative? | from [Response](response#method_isInformational "Symfony\Component\HttpFoundation\Response") | | bool | [isSuccessful](#method_isSuccessful)() Is response successful? | from [Response](response#method_isSuccessful "Symfony\Component\HttpFoundation\Response") | | bool | [isRedirection](#method_isRedirection)() Is the response a redirect? | from [Response](response#method_isRedirection "Symfony\Component\HttpFoundation\Response") | | bool | [isClientError](#method_isClientError)() Is there a client error? | from [Response](response#method_isClientError "Symfony\Component\HttpFoundation\Response") | | bool | [isServerError](#method_isServerError)() Was there a server side error? | from [Response](response#method_isServerError "Symfony\Component\HttpFoundation\Response") | | bool | [isOk](#method_isOk)() Is the response OK? | from [Response](response#method_isOk "Symfony\Component\HttpFoundation\Response") | | bool | [isForbidden](#method_isForbidden)() Is the response forbidden? | from [Response](response#method_isForbidden "Symfony\Component\HttpFoundation\Response") | | bool | [isNotFound](#method_isNotFound)() Is the response a not found error? | from [Response](response#method_isNotFound "Symfony\Component\HttpFoundation\Response") | | bool | [isRedirect](#method_isRedirect)(string $location = null) Is the response a redirect of some form? | from [Response](response#method_isRedirect "Symfony\Component\HttpFoundation\Response") | | bool | [isEmpty](#method_isEmpty)() Is the response empty? | from [Response](response#method_isEmpty "Symfony\Component\HttpFoundation\Response") | | static | [closeOutputBuffers](#method_closeOutputBuffers)(int $targetLevel, bool $flush) Cleans or flushes output buffers up to target level. | from [Response](response#method_closeOutputBuffers "Symfony\Component\HttpFoundation\Response") | | | [ensureIEOverSSLCompatibility](#method_ensureIEOverSSLCompatibility)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9. | from [Response](response#method_ensureIEOverSSLCompatibility "Symfony\Component\HttpFoundation\Response") | | static | [fromJsonString](#method_fromJsonString)($data = null, $status = 200, $headers = array()) Make easier the creation of JsonResponse from raw json. | | | $this | [setCallback](#method_setCallback)(string|null $callback = null) Sets the JSONP callback. | | | $this | [setJson](#method_setJson)(string $json) Sets a raw string containing a JSON document to be sent. | | | $this | [setData](#method_setData)(mixed $data = array()) Sets the data to be sent as JSON. | | | int | [getEncodingOptions](#method_getEncodingOptions)() Returns options used while encoding data to JSON. | | | $this | [setEncodingOptions](#method_setEncodingOptions)(int $encodingOptions) Sets options used while encoding data to JSON. | | | $this | [update](#method_update)() Updates the content and headers according to the JSON data and callback. | | Details ------- ### \_\_construct(mixed $data = null, int $status = 200, array $headers = array(), bool $json = false) #### Parameters | | | | | --- | --- | --- | | mixed | $data | The response data | | int | $status | | | array | $headers | | | bool | $json | If the data is already a JSON string | ### static [Response](response "Symfony\Component\HttpFoundation\Response") create(mixed $data = null, int $status = 200, array $headers = array()) Factory method for chainability. Example: ``` return JsonResponse::create($data, 200) ->setSharedMaxAge(300); ``` #### Parameters | | | | | --- | --- | --- | | mixed | $data | The json response data | | int | $status | The response status code | | array | $headers | An array of response headers | #### Return Value | | | | --- | --- | | [Response](response "Symfony\Component\HttpFoundation\Response") | | ### string \_\_toString() Returns the Response as an HTTP string. The string representation of the Response is the same as the one that will be sent to the client only if the prepare() method has been called before. #### Return Value | | | | --- | --- | | string | The Response as an HTTP string | #### See also | | | | --- | --- | | prepare() | | ### \_\_clone() Clones the current Response instance. ### $this prepare([Request](request "Symfony\Component\HttpFoundation\Request") $request) Prepares the Response before it is sent to the client. This method tweaks the Response to ensure that it is compliant with RFC 2616. Most of the changes are based on the Request that is "associated" with this Response. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | $this | | ### $this sendHeaders() Sends HTTP headers. #### Return Value | | | | --- | --- | | $this | | ### $this sendContent() Sends content for the current web response. #### Return Value | | | | --- | --- | | $this | | ### $this send() Sends HTTP headers and content. #### Return Value | | | | --- | --- | | $this | | ### $this setContent(mixed $content) Sets the response content. Valid types are strings, numbers, null, and objects that implement a \_\_toString() method. #### Parameters | | | | | --- | --- | --- | | mixed | $content | Content that can be cast to string | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [UnexpectedValueException](http://php.net/UnexpectedValueException) | | ### string getContent() Gets the current response content. #### Return Value | | | | --- | --- | | string | Content | ### $this setProtocolVersion(string $version) Sets the HTTP protocol version (1.0 or 1.1). #### Parameters | | | | | --- | --- | --- | | string | $version | | #### Return Value | | | | --- | --- | | $this | | ### string getProtocolVersion() Gets the HTTP protocol version. #### Return Value | | | | --- | --- | | string | | ### $this setStatusCode(int $code, $text = null) Sets the response status code. If the status text is null it will be automatically populated for the known status codes and left empty otherwise. #### Parameters | | | | | --- | --- | --- | | int | $code | | | | $text | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When the HTTP status code is not valid | ### int getStatusCode() Retrieves the status code for the current web response. #### Return Value | | | | --- | --- | | int | | ### $this setCharset(string $charset) Sets the response charset. #### Parameters | | | | | --- | --- | --- | | string | $charset | | #### Return Value | | | | --- | --- | | $this | | ### string|null getCharset() Retrieves the response charset. #### Return Value | | | | --- | --- | | string|null | | ### bool isCacheable() Returns true if the response may safely be kept in a shared (surrogate) cache. Responses marked "private" with an explicit Cache-Control directive are considered uncacheable. Responses with neither a freshness lifetime (Expires, max-age) nor cache validator (Last-Modified, ETag) are considered uncacheable because there is no way to tell when or how to remove them from the cache. Note that RFC 7231 and RFC 7234 possibly allow for a more permissive implementation, for example "status codes that are defined as cacheable by default [...] can be reused by a cache with heuristic expiration unless otherwise indicated" (https://tools.ietf.org/html/rfc7231#section-6.1) #### Return Value | | | | --- | --- | | bool | | ### bool isFresh() Returns true if the response is "fresh". Fresh responses may be served from cache without any interaction with the origin. A response is considered fresh when it includes a Cache-Control/max-age indicator or Expires header and the calculated age is less than the freshness lifetime. #### Return Value | | | | --- | --- | | bool | | ### bool isValidateable() Returns true if the response includes headers that can be used to validate the response with the origin server using a conditional GET request. #### Return Value | | | | --- | --- | | bool | | ### $this setPrivate() Marks the response as "private". It makes the response ineligible for serving other clients. #### Return Value | | | | --- | --- | | $this | | ### $this setPublic() Marks the response as "public". It makes the response eligible for serving other clients. #### Return Value | | | | --- | --- | | $this | | ### $this setImmutable(bool $immutable = true) Marks the response as "immutable". #### Parameters | | | | | --- | --- | --- | | bool | $immutable | | #### Return Value | | | | --- | --- | | $this | | ### bool isImmutable() Returns true if the response is marked as "immutable". #### Return Value | | | | --- | --- | | bool | | ### bool mustRevalidate() Returns true if the response must be revalidated by caches. This method indicates that the response must not be served stale by a cache in any circumstance without first revalidating with the origin. When present, the TTL of the response should not be overridden to be greater than the value provided by the origin. #### Return Value | | | | --- | --- | | bool | | ### DateTimeInterface|null getDate() Returns the Date header as a DateTime instance. #### Return Value | | | | --- | --- | | DateTimeInterface|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When the header is not parseable | ### $this setDate([DateTimeInterface](http://php.net/DateTimeInterface) $date) Sets the Date header. #### Parameters | | | | | --- | --- | --- | | [DateTimeInterface](http://php.net/DateTimeInterface) | $date | | #### Return Value | | | | --- | --- | | $this | | ### int getAge() Returns the age of the response in seconds. #### Return Value | | | | --- | --- | | int | | ### $this expire() Marks the response stale by setting the Age header to be equal to the maximum age of the response. #### Return Value | | | | --- | --- | | $this | | ### DateTimeInterface|null getExpires() Returns the value of the Expires header as a DateTime instance. #### Return Value | | | | --- | --- | | DateTimeInterface|null | | ### $this setExpires([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Expires HTTP header with a DateTime instance. Passing null as value will remove the header. #### Parameters | | | | | --- | --- | --- | | [DateTimeInterface](http://php.net/DateTimeInterface) | $date | | #### Return Value | | | | --- | --- | | $this | | ### int|null getMaxAge() Returns the number of seconds after the time specified in the response's Date header when the response should no longer be considered fresh. First, it checks for a s-maxage directive, then a max-age directive, and then it falls back on an expires header. It returns null when no maximum age can be established. #### Return Value | | | | --- | --- | | int|null | | ### $this setMaxAge(int $value) Sets the number of seconds after which the response should no longer be considered fresh. This methods sets the Cache-Control max-age directive. #### Parameters | | | | | --- | --- | --- | | int | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this setSharedMaxAge(int $value) Sets the number of seconds after which the response should no longer be considered fresh by shared caches. This methods sets the Cache-Control s-maxage directive. #### Parameters | | | | | --- | --- | --- | | int | $value | | #### Return Value | | | | --- | --- | | $this | | ### int|null getTtl() Returns the response's time-to-live in seconds. It returns null when no freshness information is present in the response. When the responses TTL is <= 0, the response may not be served from cache without first revalidating with the origin. #### Return Value | | | | --- | --- | | int|null | | ### $this setTtl(int $seconds) Sets the response's time-to-live for shared caches in seconds. This method adjusts the Cache-Control/s-maxage directive. #### Parameters | | | | | --- | --- | --- | | int | $seconds | | #### Return Value | | | | --- | --- | | $this | | ### $this setClientTtl(int $seconds) Sets the response's time-to-live for private/client caches in seconds. This method adjusts the Cache-Control/max-age directive. #### Parameters | | | | | --- | --- | --- | | int | $seconds | | #### Return Value | | | | --- | --- | | $this | | ### DateTimeInterface|null getLastModified() Returns the Last-Modified HTTP header as a DateTime instance. #### Return Value | | | | --- | --- | | DateTimeInterface|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When the HTTP header is not parseable | ### $this setLastModified([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Last-Modified HTTP header with a DateTime instance. Passing null as value will remove the header. #### Parameters | | | | | --- | --- | --- | | [DateTimeInterface](http://php.net/DateTimeInterface) | $date | | #### Return Value | | | | --- | --- | | $this | | ### string|null getEtag() Returns the literal value of the ETag HTTP header. #### Return Value | | | | --- | --- | | string|null | | ### $this setEtag(string $etag = null, bool $weak = false) Sets the ETag value. #### Parameters | | | | | --- | --- | --- | | string | $etag | The ETag unique identifier or null to remove the header | | bool | $weak | Whether you want a weak ETag or not | #### Return Value | | | | --- | --- | | $this | | ### $this setCache(array $options) Sets the response's cache headers (validation and/or expiration). Available options are: etag, last\_modified, max\_age, s\_maxage, private, public and immutable. #### Parameters | | | | | --- | --- | --- | | array | $options | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### $this setNotModified() Modifies the response so that it conforms to the rules defined for a 304 status code. This sets the status, removes the body, and discards any headers that MUST NOT be included in 304 responses. #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | <http://tools.ietf.org/html/rfc2616#section-10.3.5> | | ### bool hasVary() Returns true if the response includes a Vary header. #### Return Value | | | | --- | --- | | bool | | ### array getVary() Returns an array of header names given in the Vary header. #### Return Value | | | | --- | --- | | array | | ### $this setVary(string|array $headers, bool $replace = true) Sets the Vary header. #### Parameters | | | | | --- | --- | --- | | string|array | $headers | | | bool | $replace | Whether to replace the actual value or not (true by default) | #### Return Value | | | | --- | --- | | $this | | ### bool isNotModified([Request](request "Symfony\Component\HttpFoundation\Request") $request) Determines if the Response validators (ETag, Last-Modified) match a conditional value specified in the Request. If the Response is not modified, it sets the status code to 304 and removes the actual content by calling the setNotModified() method. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | bool | true if the Response validators match the Request, false otherwise | ### bool isInvalid() Is response invalid? #### Return Value | | | | --- | --- | | bool | | #### See also | | | | --- | --- | | <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html> | | ### bool isInformational() Is response informative? #### Return Value | | | | --- | --- | | bool | | ### bool isSuccessful() Is response successful? #### Return Value | | | | --- | --- | | bool | | ### bool isRedirection() Is the response a redirect? #### Return Value | | | | --- | --- | | bool | | ### bool isClientError() Is there a client error? #### Return Value | | | | --- | --- | | bool | | ### bool isServerError() Was there a server side error? #### Return Value | | | | --- | --- | | bool | | ### bool isOk() Is the response OK? #### Return Value | | | | --- | --- | | bool | | ### bool isForbidden() Is the response forbidden? #### Return Value | | | | --- | --- | | bool | | ### bool isNotFound() Is the response a not found error? #### Return Value | | | | --- | --- | | bool | | ### bool isRedirect(string $location = null) Is the response a redirect of some form? #### Parameters | | | | | --- | --- | --- | | string | $location | | #### Return Value | | | | --- | --- | | bool | | ### bool isEmpty() Is the response empty? #### Return Value | | | | --- | --- | | bool | | ### static closeOutputBuffers(int $targetLevel, bool $flush) Cleans or flushes output buffers up to target level. Resulting level can be greater than target level if a non-removable buffer has been encountered. #### Parameters | | | | | --- | --- | --- | | int | $targetLevel | | | bool | $flush | | ### protected ensureIEOverSSLCompatibility([Request](request "Symfony\Component\HttpFoundation\Request") $request) Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### See also | | | | --- | --- | | <http://support.microsoft.com/kb/323308> | | ### static fromJsonString($data = null, $status = 200, $headers = array()) Make easier the creation of JsonResponse from raw json. #### Parameters | | | | | --- | --- | --- | | | $data | | | | $status | | | | $headers | | ### $this setCallback(string|null $callback = null) Sets the JSONP callback. #### Parameters | | | | | --- | --- | --- | | string|null | $callback | The JSONP callback or null to use none | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When the callback name is not valid | ### $this setJson(string $json) Sets a raw string containing a JSON document to be sent. #### Parameters | | | | | --- | --- | --- | | string | $json | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### $this setData(mixed $data = array()) Sets the data to be sent as JSON. #### Parameters | | | | | --- | --- | --- | | mixed | $data | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### int getEncodingOptions() Returns options used while encoding data to JSON. #### Return Value | | | | --- | --- | | int | | ### $this setEncodingOptions(int $encodingOptions) Sets options used while encoding data to JSON. #### Parameters | | | | | --- | --- | --- | | int | $encodingOptions | | #### Return Value | | | | --- | --- | | $this | | ### protected $this update() Updates the content and headers according to the JSON data and callback. #### Return Value | | | | --- | --- | | $this | |
programming_docs
symfony AcceptHeader AcceptHeader ============= class **AcceptHeader** Represents an Accept-\* header. An accept header is compound with a list of items, sorted by descending quality. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $items) | | | static [AcceptHeader](acceptheader "Symfony\Component\HttpFoundation\AcceptHeader") | [fromString](#method_fromString)(string $headerValue) Builds an AcceptHeader instance from a string. | | | string | [\_\_toString](#method___toString)() Returns header value's string representation. | | | bool | [has](#method_has)(string $value) Tests if header has given value. | | | [AcceptHeaderItem](acceptheaderitem "Symfony\Component\HttpFoundation\AcceptHeaderItem")|null | [get](#method_get)(string $value) Returns given value's item, if exists. | | | $this | [add](#method_add)([AcceptHeaderItem](acceptheaderitem "Symfony\Component\HttpFoundation\AcceptHeaderItem") $item) Adds an item. | | | [AcceptHeaderItem](acceptheaderitem "Symfony\Component\HttpFoundation\AcceptHeaderItem")[] | [all](#method_all)() Returns all items. | | | [AcceptHeader](acceptheader "Symfony\Component\HttpFoundation\AcceptHeader") | [filter](#method_filter)(string $pattern) Filters items on their value using given regex. | | | [AcceptHeaderItem](acceptheaderitem "Symfony\Component\HttpFoundation\AcceptHeaderItem")|null | [first](#method_first)() Returns first item. | | Details ------- ### \_\_construct(array $items) #### Parameters | | | | | --- | --- | --- | | array | $items | | ### static [AcceptHeader](acceptheader "Symfony\Component\HttpFoundation\AcceptHeader") fromString(string $headerValue) Builds an AcceptHeader instance from a string. #### Parameters | | | | | --- | --- | --- | | string | $headerValue | | #### Return Value | | | | --- | --- | | [AcceptHeader](acceptheader "Symfony\Component\HttpFoundation\AcceptHeader") | | ### string \_\_toString() Returns header value's string representation. #### Return Value | | | | --- | --- | | string | | ### bool has(string $value) Tests if header has given value. #### Parameters | | | | | --- | --- | --- | | string | $value | | #### Return Value | | | | --- | --- | | bool | | ### [AcceptHeaderItem](acceptheaderitem "Symfony\Component\HttpFoundation\AcceptHeaderItem")|null get(string $value) Returns given value's item, if exists. #### Parameters | | | | | --- | --- | --- | | string | $value | | #### Return Value | | | | --- | --- | | [AcceptHeaderItem](acceptheaderitem "Symfony\Component\HttpFoundation\AcceptHeaderItem")|null | | ### $this add([AcceptHeaderItem](acceptheaderitem "Symfony\Component\HttpFoundation\AcceptHeaderItem") $item) Adds an item. #### Parameters | | | | | --- | --- | --- | | [AcceptHeaderItem](acceptheaderitem "Symfony\Component\HttpFoundation\AcceptHeaderItem") | $item | | #### Return Value | | | | --- | --- | | $this | | ### [AcceptHeaderItem](acceptheaderitem "Symfony\Component\HttpFoundation\AcceptHeaderItem")[] all() Returns all items. #### Return Value | | | | --- | --- | | [AcceptHeaderItem](acceptheaderitem "Symfony\Component\HttpFoundation\AcceptHeaderItem")[] | | ### [AcceptHeader](acceptheader "Symfony\Component\HttpFoundation\AcceptHeader") filter(string $pattern) Filters items on their value using given regex. #### Parameters | | | | | --- | --- | --- | | string | $pattern | | #### Return Value | | | | --- | --- | | [AcceptHeader](acceptheader "Symfony\Component\HttpFoundation\AcceptHeader") | | ### [AcceptHeaderItem](acceptheaderitem "Symfony\Component\HttpFoundation\AcceptHeaderItem")|null first() Returns first item. #### Return Value | | | | --- | --- | | [AcceptHeaderItem](acceptheaderitem "Symfony\Component\HttpFoundation\AcceptHeaderItem")|null | | symfony IpUtils IpUtils ======== class **IpUtils** Http utility functions. Methods ------- | | | | | --- | --- | --- | | static bool | [checkIp](#method_checkIp)(string $requestIp, string|array $ips) Checks if an IPv4 or IPv6 address is contained in the list of given IPs or subnets. | | | static bool | [checkIp4](#method_checkIp4)(string $requestIp, string $ip) Compares two IPv4 addresses. | | | static bool | [checkIp6](#method_checkIp6)(string $requestIp, string $ip) Compares two IPv6 addresses. | | Details ------- ### static bool checkIp(string $requestIp, string|array $ips) Checks if an IPv4 or IPv6 address is contained in the list of given IPs or subnets. #### Parameters | | | | | --- | --- | --- | | string | $requestIp | IP to check | | string|array | $ips | List of IPs or subnets (can be a string if only a single one) | #### Return Value | | | | --- | --- | | bool | Whether the IP is valid | ### static bool checkIp4(string $requestIp, string $ip) Compares two IPv4 addresses. In case a subnet is given, it checks if it contains the request IP. #### Parameters | | | | | --- | --- | --- | | string | $requestIp | IPv4 address to check | | string | $ip | IPv4 address or subnet in CIDR notation | #### Return Value | | | | --- | --- | | bool | Whether the request IP matches the IP, or whether the request IP is within the CIDR subnet | ### static bool checkIp6(string $requestIp, string $ip) Compares two IPv6 addresses. In case a subnet is given, it checks if it contains the request IP. #### Parameters | | | | | --- | --- | --- | | string | $requestIp | IPv6 address to check | | string | $ip | IPv6 address or subnet in CIDR notation | #### Return Value | | | | --- | --- | | bool | Whether the IP is valid | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When IPV6 support is not enabled | #### See also | | | | --- | --- | | <https://github.com/dsp/v6tools> | | symfony StreamedResponse StreamedResponse ================= class **StreamedResponse** extends [Response](response "Symfony\Component\HttpFoundation\Response") StreamedResponse represents a streamed HTTP response. A StreamedResponse uses a callback for its content. The callback should use the standard PHP functions like echo to stream the response back to the client. The flush() function can also be used if needed. Constants --------- | | | | --- | --- | | HTTP\_CONTINUE | | | HTTP\_SWITCHING\_PROTOCOLS | | | HTTP\_PROCESSING | | | HTTP\_EARLY\_HINTS | | | HTTP\_OK | | | HTTP\_CREATED | | | HTTP\_ACCEPTED | | | HTTP\_NON\_AUTHORITATIVE\_INFORMATION | | | HTTP\_NO\_CONTENT | | | HTTP\_RESET\_CONTENT | | | HTTP\_PARTIAL\_CONTENT | | | HTTP\_MULTI\_STATUS | | | HTTP\_ALREADY\_REPORTED | | | HTTP\_IM\_USED | | | HTTP\_MULTIPLE\_CHOICES | | | HTTP\_MOVED\_PERMANENTLY | | | HTTP\_FOUND | | | HTTP\_SEE\_OTHER | | | HTTP\_NOT\_MODIFIED | | | HTTP\_USE\_PROXY | | | HTTP\_RESERVED | | | HTTP\_TEMPORARY\_REDIRECT | | | HTTP\_PERMANENTLY\_REDIRECT | | | HTTP\_BAD\_REQUEST | | | HTTP\_UNAUTHORIZED | | | HTTP\_PAYMENT\_REQUIRED | | | HTTP\_FORBIDDEN | | | HTTP\_NOT\_FOUND | | | HTTP\_METHOD\_NOT\_ALLOWED | | | HTTP\_NOT\_ACCEPTABLE | | | HTTP\_PROXY\_AUTHENTICATION\_REQUIRED | | | HTTP\_REQUEST\_TIMEOUT | | | HTTP\_CONFLICT | | | HTTP\_GONE | | | HTTP\_LENGTH\_REQUIRED | | | HTTP\_PRECONDITION\_FAILED | | | HTTP\_REQUEST\_ENTITY\_TOO\_LARGE | | | HTTP\_REQUEST\_URI\_TOO\_LONG | | | HTTP\_UNSUPPORTED\_MEDIA\_TYPE | | | HTTP\_REQUESTED\_RANGE\_NOT\_SATISFIABLE | | | HTTP\_EXPECTATION\_FAILED | | | HTTP\_I\_AM\_A\_TEAPOT | | | HTTP\_MISDIRECTED\_REQUEST | | | HTTP\_UNPROCESSABLE\_ENTITY | | | HTTP\_LOCKED | | | HTTP\_FAILED\_DEPENDENCY | | | HTTP\_RESERVED\_FOR\_WEBDAV\_ADVANCED\_COLLECTIONS\_EXPIRED\_PROPOSAL | | | HTTP\_TOO\_EARLY | | | HTTP\_UPGRADE\_REQUIRED | | | HTTP\_PRECONDITION\_REQUIRED | | | HTTP\_TOO\_MANY\_REQUESTS | | | HTTP\_REQUEST\_HEADER\_FIELDS\_TOO\_LARGE | | | HTTP\_UNAVAILABLE\_FOR\_LEGAL\_REASONS | | | HTTP\_INTERNAL\_SERVER\_ERROR | | | HTTP\_NOT\_IMPLEMENTED | | | HTTP\_BAD\_GATEWAY | | | HTTP\_SERVICE\_UNAVAILABLE | | | HTTP\_GATEWAY\_TIMEOUT | | | HTTP\_VERSION\_NOT\_SUPPORTED | | | HTTP\_VARIANT\_ALSO\_NEGOTIATES\_EXPERIMENTAL | | | HTTP\_INSUFFICIENT\_STORAGE | | | HTTP\_LOOP\_DETECTED | | | HTTP\_NOT\_EXTENDED | | | HTTP\_NETWORK\_AUTHENTICATION\_REQUIRED | | Properties ---------- | | | | | | --- | --- | --- | --- | | [ResponseHeaderBag](responseheaderbag "Symfony\Component\HttpFoundation\ResponseHeaderBag") | $headers | | from [Response](response#property_headers "Symfony\Component\HttpFoundation\Response") | | protected string | $content | | from [Response](response#property_content "Symfony\Component\HttpFoundation\Response") | | protected string | $version | | from [Response](response#property_version "Symfony\Component\HttpFoundation\Response") | | protected int | $statusCode | | from [Response](response#property_statusCode "Symfony\Component\HttpFoundation\Response") | | protected string | $statusText | | from [Response](response#property_statusText "Symfony\Component\HttpFoundation\Response") | | protected string | $charset | | from [Response](response#property_charset "Symfony\Component\HttpFoundation\Response") | | static array | $statusTexts | Status codes translation table. | from [Response](response#property_statusTexts "Symfony\Component\HttpFoundation\Response") | | protected | $callback | | | | protected | $streamed | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(callable $callback = null, int $status = 200, array $headers = array()) | | | static [Response](response "Symfony\Component\HttpFoundation\Response") | [create](#method_create)(callable|null $callback = null, int $status = 200, array $headers = array()) Factory method for chainability. | | | string | [\_\_toString](#method___toString)() Returns the Response as an HTTP string. | from [Response](response#method___toString "Symfony\Component\HttpFoundation\Response") | | | [\_\_clone](#method___clone)() Clones the current Response instance. | from [Response](response#method___clone "Symfony\Component\HttpFoundation\Response") | | $this | [prepare](#method_prepare)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Prepares the Response before it is sent to the client. | from [Response](response#method_prepare "Symfony\Component\HttpFoundation\Response") | | $this | [sendHeaders](#method_sendHeaders)() Sends HTTP headers. | | | $this | [sendContent](#method_sendContent)() Sends content for the current web response. | | | $this | [send](#method_send)() Sends HTTP headers and content. | from [Response](response#method_send "Symfony\Component\HttpFoundation\Response") | | $this | [setContent](#method_setContent)(mixed $content) Sets the response content. | | | string | [getContent](#method_getContent)() Gets the current response content. | | | $this | [setProtocolVersion](#method_setProtocolVersion)(string $version) Sets the HTTP protocol version (1.0 or 1.1). | from [Response](response#method_setProtocolVersion "Symfony\Component\HttpFoundation\Response") | | string | [getProtocolVersion](#method_getProtocolVersion)() Gets the HTTP protocol version. | from [Response](response#method_getProtocolVersion "Symfony\Component\HttpFoundation\Response") | | $this | [setStatusCode](#method_setStatusCode)(int $code, $text = null) Sets the response status code. | from [Response](response#method_setStatusCode "Symfony\Component\HttpFoundation\Response") | | int | [getStatusCode](#method_getStatusCode)() Retrieves the status code for the current web response. | from [Response](response#method_getStatusCode "Symfony\Component\HttpFoundation\Response") | | $this | [setCharset](#method_setCharset)(string $charset) Sets the response charset. | from [Response](response#method_setCharset "Symfony\Component\HttpFoundation\Response") | | string|null | [getCharset](#method_getCharset)() Retrieves the response charset. | from [Response](response#method_getCharset "Symfony\Component\HttpFoundation\Response") | | bool | [isCacheable](#method_isCacheable)() Returns true if the response may safely be kept in a shared (surrogate) cache. | from [Response](response#method_isCacheable "Symfony\Component\HttpFoundation\Response") | | bool | [isFresh](#method_isFresh)() Returns true if the response is "fresh". | from [Response](response#method_isFresh "Symfony\Component\HttpFoundation\Response") | | bool | [isValidateable](#method_isValidateable)() Returns true if the response includes headers that can be used to validate the response with the origin server using a conditional GET request. | from [Response](response#method_isValidateable "Symfony\Component\HttpFoundation\Response") | | $this | [setPrivate](#method_setPrivate)() Marks the response as "private". | from [Response](response#method_setPrivate "Symfony\Component\HttpFoundation\Response") | | $this | [setPublic](#method_setPublic)() Marks the response as "public". | from [Response](response#method_setPublic "Symfony\Component\HttpFoundation\Response") | | $this | [setImmutable](#method_setImmutable)(bool $immutable = true) Marks the response as "immutable". | from [Response](response#method_setImmutable "Symfony\Component\HttpFoundation\Response") | | bool | [isImmutable](#method_isImmutable)() Returns true if the response is marked as "immutable". | from [Response](response#method_isImmutable "Symfony\Component\HttpFoundation\Response") | | bool | [mustRevalidate](#method_mustRevalidate)() Returns true if the response must be revalidated by caches. | from [Response](response#method_mustRevalidate "Symfony\Component\HttpFoundation\Response") | | DateTimeInterface|null | [getDate](#method_getDate)() Returns the Date header as a DateTime instance. | from [Response](response#method_getDate "Symfony\Component\HttpFoundation\Response") | | $this | [setDate](#method_setDate)([DateTimeInterface](http://php.net/DateTimeInterface) $date) Sets the Date header. | from [Response](response#method_setDate "Symfony\Component\HttpFoundation\Response") | | int | [getAge](#method_getAge)() Returns the age of the response in seconds. | from [Response](response#method_getAge "Symfony\Component\HttpFoundation\Response") | | $this | [expire](#method_expire)() Marks the response stale by setting the Age header to be equal to the maximum age of the response. | from [Response](response#method_expire "Symfony\Component\HttpFoundation\Response") | | DateTimeInterface|null | [getExpires](#method_getExpires)() Returns the value of the Expires header as a DateTime instance. | from [Response](response#method_getExpires "Symfony\Component\HttpFoundation\Response") | | $this | [setExpires](#method_setExpires)([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Expires HTTP header with a DateTime instance. | from [Response](response#method_setExpires "Symfony\Component\HttpFoundation\Response") | | int|null | [getMaxAge](#method_getMaxAge)() Returns the number of seconds after the time specified in the response's Date header when the response should no longer be considered fresh. | from [Response](response#method_getMaxAge "Symfony\Component\HttpFoundation\Response") | | $this | [setMaxAge](#method_setMaxAge)(int $value) Sets the number of seconds after which the response should no longer be considered fresh. | from [Response](response#method_setMaxAge "Symfony\Component\HttpFoundation\Response") | | $this | [setSharedMaxAge](#method_setSharedMaxAge)(int $value) Sets the number of seconds after which the response should no longer be considered fresh by shared caches. | from [Response](response#method_setSharedMaxAge "Symfony\Component\HttpFoundation\Response") | | int|null | [getTtl](#method_getTtl)() Returns the response's time-to-live in seconds. | from [Response](response#method_getTtl "Symfony\Component\HttpFoundation\Response") | | $this | [setTtl](#method_setTtl)(int $seconds) Sets the response's time-to-live for shared caches in seconds. | from [Response](response#method_setTtl "Symfony\Component\HttpFoundation\Response") | | $this | [setClientTtl](#method_setClientTtl)(int $seconds) Sets the response's time-to-live for private/client caches in seconds. | from [Response](response#method_setClientTtl "Symfony\Component\HttpFoundation\Response") | | DateTimeInterface|null | [getLastModified](#method_getLastModified)() Returns the Last-Modified HTTP header as a DateTime instance. | from [Response](response#method_getLastModified "Symfony\Component\HttpFoundation\Response") | | $this | [setLastModified](#method_setLastModified)([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Last-Modified HTTP header with a DateTime instance. | from [Response](response#method_setLastModified "Symfony\Component\HttpFoundation\Response") | | string|null | [getEtag](#method_getEtag)() Returns the literal value of the ETag HTTP header. | from [Response](response#method_getEtag "Symfony\Component\HttpFoundation\Response") | | $this | [setEtag](#method_setEtag)(string $etag = null, bool $weak = false) Sets the ETag value. | from [Response](response#method_setEtag "Symfony\Component\HttpFoundation\Response") | | $this | [setCache](#method_setCache)(array $options) Sets the response's cache headers (validation and/or expiration). | from [Response](response#method_setCache "Symfony\Component\HttpFoundation\Response") | | $this | [setNotModified](#method_setNotModified)() Modifies the response so that it conforms to the rules defined for a 304 status code. | from [Response](response#method_setNotModified "Symfony\Component\HttpFoundation\Response") | | bool | [hasVary](#method_hasVary)() Returns true if the response includes a Vary header. | from [Response](response#method_hasVary "Symfony\Component\HttpFoundation\Response") | | array | [getVary](#method_getVary)() Returns an array of header names given in the Vary header. | from [Response](response#method_getVary "Symfony\Component\HttpFoundation\Response") | | $this | [setVary](#method_setVary)(string|array $headers, bool $replace = true) Sets the Vary header. | from [Response](response#method_setVary "Symfony\Component\HttpFoundation\Response") | | bool | [isNotModified](#method_isNotModified)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Determines if the Response validators (ETag, Last-Modified) match a conditional value specified in the Request. | from [Response](response#method_isNotModified "Symfony\Component\HttpFoundation\Response") | | bool | [isInvalid](#method_isInvalid)() Is response invalid? | from [Response](response#method_isInvalid "Symfony\Component\HttpFoundation\Response") | | bool | [isInformational](#method_isInformational)() Is response informative? | from [Response](response#method_isInformational "Symfony\Component\HttpFoundation\Response") | | bool | [isSuccessful](#method_isSuccessful)() Is response successful? | from [Response](response#method_isSuccessful "Symfony\Component\HttpFoundation\Response") | | bool | [isRedirection](#method_isRedirection)() Is the response a redirect? | from [Response](response#method_isRedirection "Symfony\Component\HttpFoundation\Response") | | bool | [isClientError](#method_isClientError)() Is there a client error? | from [Response](response#method_isClientError "Symfony\Component\HttpFoundation\Response") | | bool | [isServerError](#method_isServerError)() Was there a server side error? | from [Response](response#method_isServerError "Symfony\Component\HttpFoundation\Response") | | bool | [isOk](#method_isOk)() Is the response OK? | from [Response](response#method_isOk "Symfony\Component\HttpFoundation\Response") | | bool | [isForbidden](#method_isForbidden)() Is the response forbidden? | from [Response](response#method_isForbidden "Symfony\Component\HttpFoundation\Response") | | bool | [isNotFound](#method_isNotFound)() Is the response a not found error? | from [Response](response#method_isNotFound "Symfony\Component\HttpFoundation\Response") | | bool | [isRedirect](#method_isRedirect)(string $location = null) Is the response a redirect of some form? | from [Response](response#method_isRedirect "Symfony\Component\HttpFoundation\Response") | | bool | [isEmpty](#method_isEmpty)() Is the response empty? | from [Response](response#method_isEmpty "Symfony\Component\HttpFoundation\Response") | | static | [closeOutputBuffers](#method_closeOutputBuffers)(int $targetLevel, bool $flush) Cleans or flushes output buffers up to target level. | from [Response](response#method_closeOutputBuffers "Symfony\Component\HttpFoundation\Response") | | | [ensureIEOverSSLCompatibility](#method_ensureIEOverSSLCompatibility)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9. | from [Response](response#method_ensureIEOverSSLCompatibility "Symfony\Component\HttpFoundation\Response") | | $this | [setCallback](#method_setCallback)(callable $callback) Sets the PHP callback associated with this Response. | | Details ------- ### \_\_construct(callable $callback = null, int $status = 200, array $headers = array()) #### Parameters | | | | | --- | --- | --- | | callable | $callback | A valid PHP callback or null to set it later | | int | $status | | | array | $headers | | ### static [Response](response "Symfony\Component\HttpFoundation\Response") create(callable|null $callback = null, int $status = 200, array $headers = array()) Factory method for chainability. #### Parameters | | | | | --- | --- | --- | | callable|null | $callback | A valid PHP callback or null to set it later | | int | $status | The response status code | | array | $headers | An array of response headers | #### Return Value | | | | --- | --- | | [Response](response "Symfony\Component\HttpFoundation\Response") | | ### string \_\_toString() Returns the Response as an HTTP string. The string representation of the Response is the same as the one that will be sent to the client only if the prepare() method has been called before. #### Return Value | | | | --- | --- | | string | The Response as an HTTP string | #### See also | | | | --- | --- | | prepare() | | ### \_\_clone() Clones the current Response instance. ### $this prepare([Request](request "Symfony\Component\HttpFoundation\Request") $request) Prepares the Response before it is sent to the client. This method tweaks the Response to ensure that it is compliant with RFC 2616. Most of the changes are based on the Request that is "associated" with this Response. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | $this | | ### $this sendHeaders() Sends HTTP headers. #### Return Value | | | | --- | --- | | $this | | ### $this sendContent() Sends content for the current web response. #### Return Value | | | | --- | --- | | $this | | ### $this send() Sends HTTP headers and content. #### Return Value | | | | --- | --- | | $this | | ### $this setContent(mixed $content) Sets the response content. Valid types are strings, numbers, null, and objects that implement a \_\_toString() method. #### Parameters | | | | | --- | --- | --- | | mixed | $content | Content that can be cast to string | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [UnexpectedValueException](http://php.net/UnexpectedValueException) | | ### string getContent() Gets the current response content. #### Return Value | | | | --- | --- | | string | Content | ### $this setProtocolVersion(string $version) Sets the HTTP protocol version (1.0 or 1.1). #### Parameters | | | | | --- | --- | --- | | string | $version | | #### Return Value | | | | --- | --- | | $this | | ### string getProtocolVersion() Gets the HTTP protocol version. #### Return Value | | | | --- | --- | | string | | ### $this setStatusCode(int $code, $text = null) Sets the response status code. If the status text is null it will be automatically populated for the known status codes and left empty otherwise. #### Parameters | | | | | --- | --- | --- | | int | $code | | | | $text | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When the HTTP status code is not valid | ### int getStatusCode() Retrieves the status code for the current web response. #### Return Value | | | | --- | --- | | int | | ### $this setCharset(string $charset) Sets the response charset. #### Parameters | | | | | --- | --- | --- | | string | $charset | | #### Return Value | | | | --- | --- | | $this | | ### string|null getCharset() Retrieves the response charset. #### Return Value | | | | --- | --- | | string|null | | ### bool isCacheable() Returns true if the response may safely be kept in a shared (surrogate) cache. Responses marked "private" with an explicit Cache-Control directive are considered uncacheable. Responses with neither a freshness lifetime (Expires, max-age) nor cache validator (Last-Modified, ETag) are considered uncacheable because there is no way to tell when or how to remove them from the cache. Note that RFC 7231 and RFC 7234 possibly allow for a more permissive implementation, for example "status codes that are defined as cacheable by default [...] can be reused by a cache with heuristic expiration unless otherwise indicated" (https://tools.ietf.org/html/rfc7231#section-6.1) #### Return Value | | | | --- | --- | | bool | | ### bool isFresh() Returns true if the response is "fresh". Fresh responses may be served from cache without any interaction with the origin. A response is considered fresh when it includes a Cache-Control/max-age indicator or Expires header and the calculated age is less than the freshness lifetime. #### Return Value | | | | --- | --- | | bool | | ### bool isValidateable() Returns true if the response includes headers that can be used to validate the response with the origin server using a conditional GET request. #### Return Value | | | | --- | --- | | bool | | ### $this setPrivate() Marks the response as "private". It makes the response ineligible for serving other clients. #### Return Value | | | | --- | --- | | $this | | ### $this setPublic() Marks the response as "public". It makes the response eligible for serving other clients. #### Return Value | | | | --- | --- | | $this | | ### $this setImmutable(bool $immutable = true) Marks the response as "immutable". #### Parameters | | | | | --- | --- | --- | | bool | $immutable | | #### Return Value | | | | --- | --- | | $this | | ### bool isImmutable() Returns true if the response is marked as "immutable". #### Return Value | | | | --- | --- | | bool | | ### bool mustRevalidate() Returns true if the response must be revalidated by caches. This method indicates that the response must not be served stale by a cache in any circumstance without first revalidating with the origin. When present, the TTL of the response should not be overridden to be greater than the value provided by the origin. #### Return Value | | | | --- | --- | | bool | | ### DateTimeInterface|null getDate() Returns the Date header as a DateTime instance. #### Return Value | | | | --- | --- | | DateTimeInterface|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When the header is not parseable | ### $this setDate([DateTimeInterface](http://php.net/DateTimeInterface) $date) Sets the Date header. #### Parameters | | | | | --- | --- | --- | | [DateTimeInterface](http://php.net/DateTimeInterface) | $date | | #### Return Value | | | | --- | --- | | $this | | ### int getAge() Returns the age of the response in seconds. #### Return Value | | | | --- | --- | | int | | ### $this expire() Marks the response stale by setting the Age header to be equal to the maximum age of the response. #### Return Value | | | | --- | --- | | $this | | ### DateTimeInterface|null getExpires() Returns the value of the Expires header as a DateTime instance. #### Return Value | | | | --- | --- | | DateTimeInterface|null | | ### $this setExpires([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Expires HTTP header with a DateTime instance. Passing null as value will remove the header. #### Parameters | | | | | --- | --- | --- | | [DateTimeInterface](http://php.net/DateTimeInterface) | $date | | #### Return Value | | | | --- | --- | | $this | | ### int|null getMaxAge() Returns the number of seconds after the time specified in the response's Date header when the response should no longer be considered fresh. First, it checks for a s-maxage directive, then a max-age directive, and then it falls back on an expires header. It returns null when no maximum age can be established. #### Return Value | | | | --- | --- | | int|null | | ### $this setMaxAge(int $value) Sets the number of seconds after which the response should no longer be considered fresh. This methods sets the Cache-Control max-age directive. #### Parameters | | | | | --- | --- | --- | | int | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this setSharedMaxAge(int $value) Sets the number of seconds after which the response should no longer be considered fresh by shared caches. This methods sets the Cache-Control s-maxage directive. #### Parameters | | | | | --- | --- | --- | | int | $value | | #### Return Value | | | | --- | --- | | $this | | ### int|null getTtl() Returns the response's time-to-live in seconds. It returns null when no freshness information is present in the response. When the responses TTL is <= 0, the response may not be served from cache without first revalidating with the origin. #### Return Value | | | | --- | --- | | int|null | | ### $this setTtl(int $seconds) Sets the response's time-to-live for shared caches in seconds. This method adjusts the Cache-Control/s-maxage directive. #### Parameters | | | | | --- | --- | --- | | int | $seconds | | #### Return Value | | | | --- | --- | | $this | | ### $this setClientTtl(int $seconds) Sets the response's time-to-live for private/client caches in seconds. This method adjusts the Cache-Control/max-age directive. #### Parameters | | | | | --- | --- | --- | | int | $seconds | | #### Return Value | | | | --- | --- | | $this | | ### DateTimeInterface|null getLastModified() Returns the Last-Modified HTTP header as a DateTime instance. #### Return Value | | | | --- | --- | | DateTimeInterface|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When the HTTP header is not parseable | ### $this setLastModified([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Last-Modified HTTP header with a DateTime instance. Passing null as value will remove the header. #### Parameters | | | | | --- | --- | --- | | [DateTimeInterface](http://php.net/DateTimeInterface) | $date | | #### Return Value | | | | --- | --- | | $this | | ### string|null getEtag() Returns the literal value of the ETag HTTP header. #### Return Value | | | | --- | --- | | string|null | | ### $this setEtag(string $etag = null, bool $weak = false) Sets the ETag value. #### Parameters | | | | | --- | --- | --- | | string | $etag | The ETag unique identifier or null to remove the header | | bool | $weak | Whether you want a weak ETag or not | #### Return Value | | | | --- | --- | | $this | | ### $this setCache(array $options) Sets the response's cache headers (validation and/or expiration). Available options are: etag, last\_modified, max\_age, s\_maxage, private, public and immutable. #### Parameters | | | | | --- | --- | --- | | array | $options | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### $this setNotModified() Modifies the response so that it conforms to the rules defined for a 304 status code. This sets the status, removes the body, and discards any headers that MUST NOT be included in 304 responses. #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | <http://tools.ietf.org/html/rfc2616#section-10.3.5> | | ### bool hasVary() Returns true if the response includes a Vary header. #### Return Value | | | | --- | --- | | bool | | ### array getVary() Returns an array of header names given in the Vary header. #### Return Value | | | | --- | --- | | array | | ### $this setVary(string|array $headers, bool $replace = true) Sets the Vary header. #### Parameters | | | | | --- | --- | --- | | string|array | $headers | | | bool | $replace | Whether to replace the actual value or not (true by default) | #### Return Value | | | | --- | --- | | $this | | ### bool isNotModified([Request](request "Symfony\Component\HttpFoundation\Request") $request) Determines if the Response validators (ETag, Last-Modified) match a conditional value specified in the Request. If the Response is not modified, it sets the status code to 304 and removes the actual content by calling the setNotModified() method. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | bool | true if the Response validators match the Request, false otherwise | ### bool isInvalid() Is response invalid? #### Return Value | | | | --- | --- | | bool | | #### See also | | | | --- | --- | | <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html> | | ### bool isInformational() Is response informative? #### Return Value | | | | --- | --- | | bool | | ### bool isSuccessful() Is response successful? #### Return Value | | | | --- | --- | | bool | | ### bool isRedirection() Is the response a redirect? #### Return Value | | | | --- | --- | | bool | | ### bool isClientError() Is there a client error? #### Return Value | | | | --- | --- | | bool | | ### bool isServerError() Was there a server side error? #### Return Value | | | | --- | --- | | bool | | ### bool isOk() Is the response OK? #### Return Value | | | | --- | --- | | bool | | ### bool isForbidden() Is the response forbidden? #### Return Value | | | | --- | --- | | bool | | ### bool isNotFound() Is the response a not found error? #### Return Value | | | | --- | --- | | bool | | ### bool isRedirect(string $location = null) Is the response a redirect of some form? #### Parameters | | | | | --- | --- | --- | | string | $location | | #### Return Value | | | | --- | --- | | bool | | ### bool isEmpty() Is the response empty? #### Return Value | | | | --- | --- | | bool | | ### static closeOutputBuffers(int $targetLevel, bool $flush) Cleans or flushes output buffers up to target level. Resulting level can be greater than target level if a non-removable buffer has been encountered. #### Parameters | | | | | --- | --- | --- | | int | $targetLevel | | | bool | $flush | | ### protected ensureIEOverSSLCompatibility([Request](request "Symfony\Component\HttpFoundation\Request") $request) Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### See also | | | | --- | --- | | <http://support.microsoft.com/kb/323308> | | ### $this setCallback(callable $callback) Sets the PHP callback associated with this Response. #### Parameters | | | | | --- | --- | --- | | callable | $callback | A valid PHP callback | #### Return Value | | | | --- | --- | | $this | |
programming_docs
symfony ApacheRequest ApacheRequest ============== class **ApacheRequest** extends [Request](request "Symfony\Component\HttpFoundation\Request") Request represents an HTTP request from an Apache server. Constants --------- | | | | --- | --- | | HEADER\_FORWARDED | | | HEADER\_X\_FORWARDED\_FOR | | | HEADER\_X\_FORWARDED\_HOST | | | HEADER\_X\_FORWARDED\_PROTO | | | HEADER\_X\_FORWARDED\_PORT | | | HEADER\_X\_FORWARDED\_ALL | | | HEADER\_X\_FORWARDED\_AWS\_ELB | | | METHOD\_HEAD | | | METHOD\_GET | | | METHOD\_POST | | | METHOD\_PUT | | | METHOD\_PATCH | | | METHOD\_DELETE | | | METHOD\_PURGE | | | METHOD\_OPTIONS | | | METHOD\_TRACE | | | METHOD\_CONNECT | | Properties ---------- | | | | | | --- | --- | --- | --- | | static protected string[] | $trustedProxies | | from [Request](request#property_trustedProxies "Symfony\Component\HttpFoundation\Request") | | static protected string[] | $trustedHostPatterns | | from [Request](request#property_trustedHostPatterns "Symfony\Component\HttpFoundation\Request") | | static protected string[] | $trustedHosts | | from [Request](request#property_trustedHosts "Symfony\Component\HttpFoundation\Request") | | static protected | $httpMethodParameterOverride | | from [Request](request#property_httpMethodParameterOverride "Symfony\Component\HttpFoundation\Request") | | [ParameterBag](parameterbag "Symfony\Component\HttpFoundation\ParameterBag") | $attributes | Custom parameters. | from [Request](request#property_attributes "Symfony\Component\HttpFoundation\Request") | | [ParameterBag](parameterbag "Symfony\Component\HttpFoundation\ParameterBag") | $request | Request body parameters ($\_POST). | from [Request](request#property_request "Symfony\Component\HttpFoundation\Request") | | [ParameterBag](parameterbag "Symfony\Component\HttpFoundation\ParameterBag") | $query | Query string parameters ($\_GET). | from [Request](request#property_query "Symfony\Component\HttpFoundation\Request") | | [ServerBag](serverbag "Symfony\Component\HttpFoundation\ServerBag") | $server | Server and execution environment parameters ($\_SERVER). | from [Request](request#property_server "Symfony\Component\HttpFoundation\Request") | | [FileBag](filebag "Symfony\Component\HttpFoundation\FileBag") | $files | Uploaded files ($\_FILES). | from [Request](request#property_files "Symfony\Component\HttpFoundation\Request") | | [ParameterBag](parameterbag "Symfony\Component\HttpFoundation\ParameterBag") | $cookies | Cookies ($\_COOKIE). | from [Request](request#property_cookies "Symfony\Component\HttpFoundation\Request") | | [HeaderBag](headerbag "Symfony\Component\HttpFoundation\HeaderBag") | $headers | Headers (taken from the $\_SERVER). | from [Request](request#property_headers "Symfony\Component\HttpFoundation\Request") | | protected string|resource|false|null | $content | | from [Request](request#property_content "Symfony\Component\HttpFoundation\Request") | | protected array | $languages | | from [Request](request#property_languages "Symfony\Component\HttpFoundation\Request") | | protected array | $charsets | | from [Request](request#property_charsets "Symfony\Component\HttpFoundation\Request") | | protected array | $encodings | | from [Request](request#property_encodings "Symfony\Component\HttpFoundation\Request") | | protected array | $acceptableContentTypes | | from [Request](request#property_acceptableContentTypes "Symfony\Component\HttpFoundation\Request") | | protected string | $pathInfo | | from [Request](request#property_pathInfo "Symfony\Component\HttpFoundation\Request") | | protected string | $requestUri | | from [Request](request#property_requestUri "Symfony\Component\HttpFoundation\Request") | | protected string | $baseUrl | | from [Request](request#property_baseUrl "Symfony\Component\HttpFoundation\Request") | | protected string | $basePath | | from [Request](request#property_basePath "Symfony\Component\HttpFoundation\Request") | | protected string | $method | | from [Request](request#property_method "Symfony\Component\HttpFoundation\Request") | | protected string | $format | | from [Request](request#property_format "Symfony\Component\HttpFoundation\Request") | | protected [SessionInterface](session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface") | $session | | from [Request](request#property_session "Symfony\Component\HttpFoundation\Request") | | protected string | $locale | | from [Request](request#property_locale "Symfony\Component\HttpFoundation\Request") | | protected string | $defaultLocale | | from [Request](request#property_defaultLocale "Symfony\Component\HttpFoundation\Request") | | static protected array | $formats | | from [Request](request#property_formats "Symfony\Component\HttpFoundation\Request") | | static protected | $requestFactory | | from [Request](request#property_requestFactory "Symfony\Component\HttpFoundation\Request") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), string|resource|null $content = null) | from [Request](request#method___construct "Symfony\Component\HttpFoundation\Request") | | | [initialize](#method_initialize)(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), string|resource|null $content = null) Sets the parameters for this request. | from [Request](request#method_initialize "Symfony\Component\HttpFoundation\Request") | | static [Request](request "Symfony\Component\HttpFoundation\Request") | [createFromGlobals](#method_createFromGlobals)() Creates a new request with values from PHP's super globals. | from [Request](request#method_createFromGlobals "Symfony\Component\HttpFoundation\Request") | | static [Request](request "Symfony\Component\HttpFoundation\Request") | [create](#method_create)(string $uri, string $method = 'GET', array $parameters = array(), array $cookies = array(), array $files = array(), array $server = array(), string|resource|null $content = null) Creates a Request based on a given URI and configuration. | from [Request](request#method_create "Symfony\Component\HttpFoundation\Request") | | static | [setFactory](#method_setFactory)(callable|null $callable) Sets a callable able to create a Request instance. | from [Request](request#method_setFactory "Symfony\Component\HttpFoundation\Request") | | [Request](request "Symfony\Component\HttpFoundation\Request") | [duplicate](#method_duplicate)(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) Clones a request and overrides some of its parameters. | from [Request](request#method_duplicate "Symfony\Component\HttpFoundation\Request") | | | [\_\_clone](#method___clone)() Clones the current request. | from [Request](request#method___clone "Symfony\Component\HttpFoundation\Request") | | string | [\_\_toString](#method___toString)() Returns the request as a string. | from [Request](request#method___toString "Symfony\Component\HttpFoundation\Request") | | | [overrideGlobals](#method_overrideGlobals)() Overrides the PHP global variables according to this request instance. | from [Request](request#method_overrideGlobals "Symfony\Component\HttpFoundation\Request") | | static | [setTrustedProxies](#method_setTrustedProxies)(array $proxies, int $trustedHeaderSet) Sets a list of trusted proxies. | from [Request](request#method_setTrustedProxies "Symfony\Component\HttpFoundation\Request") | | static array | [getTrustedProxies](#method_getTrustedProxies)() Gets the list of trusted proxies. | from [Request](request#method_getTrustedProxies "Symfony\Component\HttpFoundation\Request") | | static int | [getTrustedHeaderSet](#method_getTrustedHeaderSet)() Gets the set of trusted headers from trusted proxies. | from [Request](request#method_getTrustedHeaderSet "Symfony\Component\HttpFoundation\Request") | | static | [setTrustedHosts](#method_setTrustedHosts)(array $hostPatterns) Sets a list of trusted host patterns. | from [Request](request#method_setTrustedHosts "Symfony\Component\HttpFoundation\Request") | | static array | [getTrustedHosts](#method_getTrustedHosts)() Gets the list of trusted host patterns. | from [Request](request#method_getTrustedHosts "Symfony\Component\HttpFoundation\Request") | | static string | [normalizeQueryString](#method_normalizeQueryString)(string $qs) Normalizes a query string. | from [Request](request#method_normalizeQueryString "Symfony\Component\HttpFoundation\Request") | | static | [enableHttpMethodParameterOverride](#method_enableHttpMethodParameterOverride)() Enables support for the \_method request parameter to determine the intended HTTP method. | from [Request](request#method_enableHttpMethodParameterOverride "Symfony\Component\HttpFoundation\Request") | | static bool | [getHttpMethodParameterOverride](#method_getHttpMethodParameterOverride)() Checks whether support for the \_method request parameter is enabled. | from [Request](request#method_getHttpMethodParameterOverride "Symfony\Component\HttpFoundation\Request") | | mixed | [get](#method_get)(string $key, mixed $default = null) Gets a "parameter" value from any bag. | from [Request](request#method_get "Symfony\Component\HttpFoundation\Request") | | [SessionInterface](session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface")|null | [getSession](#method_getSession)() Gets the Session. | from [Request](request#method_getSession "Symfony\Component\HttpFoundation\Request") | | bool | [hasPreviousSession](#method_hasPreviousSession)() Whether the request contains a Session which was started in one of the previous requests. | from [Request](request#method_hasPreviousSession "Symfony\Component\HttpFoundation\Request") | | bool | [hasSession](#method_hasSession)() Whether the request contains a Session object. | from [Request](request#method_hasSession "Symfony\Component\HttpFoundation\Request") | | | [setSession](#method_setSession)([SessionInterface](session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface") $session) Sets the Session. | from [Request](request#method_setSession "Symfony\Component\HttpFoundation\Request") | | | [setSessionFactory](#method_setSessionFactory)(callable $factory) | from [Request](request#method_setSessionFactory "Symfony\Component\HttpFoundation\Request") | | array | [getClientIps](#method_getClientIps)() Returns the client IP addresses. | from [Request](request#method_getClientIps "Symfony\Component\HttpFoundation\Request") | | string|null | [getClientIp](#method_getClientIp)() Returns the client IP address. | from [Request](request#method_getClientIp "Symfony\Component\HttpFoundation\Request") | | string | [getScriptName](#method_getScriptName)() Returns current script name. | from [Request](request#method_getScriptName "Symfony\Component\HttpFoundation\Request") | | string | [getPathInfo](#method_getPathInfo)() Returns the path being requested relative to the executed script. | from [Request](request#method_getPathInfo "Symfony\Component\HttpFoundation\Request") | | string | [getBasePath](#method_getBasePath)() Returns the root path from which this request is executed. | from [Request](request#method_getBasePath "Symfony\Component\HttpFoundation\Request") | | string | [getBaseUrl](#method_getBaseUrl)() Returns the root URL from which this request is executed. | from [Request](request#method_getBaseUrl "Symfony\Component\HttpFoundation\Request") | | string | [getScheme](#method_getScheme)() Gets the request's scheme. | from [Request](request#method_getScheme "Symfony\Component\HttpFoundation\Request") | | int|string | [getPort](#method_getPort)() Returns the port on which the request is made. | from [Request](request#method_getPort "Symfony\Component\HttpFoundation\Request") | | string|null | [getUser](#method_getUser)() Returns the user. | from [Request](request#method_getUser "Symfony\Component\HttpFoundation\Request") | | string|null | [getPassword](#method_getPassword)() Returns the password. | from [Request](request#method_getPassword "Symfony\Component\HttpFoundation\Request") | | string | [getUserInfo](#method_getUserInfo)() Gets the user info. | from [Request](request#method_getUserInfo "Symfony\Component\HttpFoundation\Request") | | string | [getHttpHost](#method_getHttpHost)() Returns the HTTP host being requested. | from [Request](request#method_getHttpHost "Symfony\Component\HttpFoundation\Request") | | string | [getRequestUri](#method_getRequestUri)() Returns the requested URI (path and query string). | from [Request](request#method_getRequestUri "Symfony\Component\HttpFoundation\Request") | | string | [getSchemeAndHttpHost](#method_getSchemeAndHttpHost)() Gets the scheme and HTTP host. | from [Request](request#method_getSchemeAndHttpHost "Symfony\Component\HttpFoundation\Request") | | string | [getUri](#method_getUri)() Generates a normalized URI (URL) for the Request. | from [Request](request#method_getUri "Symfony\Component\HttpFoundation\Request") | | string | [getUriForPath](#method_getUriForPath)(string $path) Generates a normalized URI for the given path. | from [Request](request#method_getUriForPath "Symfony\Component\HttpFoundation\Request") | | string | [getRelativeUriForPath](#method_getRelativeUriForPath)(string $path) Returns the path as relative reference from the current Request path. | from [Request](request#method_getRelativeUriForPath "Symfony\Component\HttpFoundation\Request") | | string|null | [getQueryString](#method_getQueryString)() Generates the normalized query string for the Request. | from [Request](request#method_getQueryString "Symfony\Component\HttpFoundation\Request") | | bool | [isSecure](#method_isSecure)() Checks whether the request is secure or not. | from [Request](request#method_isSecure "Symfony\Component\HttpFoundation\Request") | | string | [getHost](#method_getHost)() Returns the host name. | from [Request](request#method_getHost "Symfony\Component\HttpFoundation\Request") | | | [setMethod](#method_setMethod)(string $method) Sets the request method. | from [Request](request#method_setMethod "Symfony\Component\HttpFoundation\Request") | | string | [getMethod](#method_getMethod)() Gets the request "intended" method. | from [Request](request#method_getMethod "Symfony\Component\HttpFoundation\Request") | | string | [getRealMethod](#method_getRealMethod)() Gets the "real" request method. | from [Request](request#method_getRealMethod "Symfony\Component\HttpFoundation\Request") | | string|null | [getMimeType](#method_getMimeType)(string $format) Gets the mime type associated with the format. | from [Request](request#method_getMimeType "Symfony\Component\HttpFoundation\Request") | | static array | [getMimeTypes](#method_getMimeTypes)(string $format) Gets the mime types associated with the format. | from [Request](request#method_getMimeTypes "Symfony\Component\HttpFoundation\Request") | | string|null | [getFormat](#method_getFormat)(string $mimeType) Gets the format associated with the mime type. | from [Request](request#method_getFormat "Symfony\Component\HttpFoundation\Request") | | | [setFormat](#method_setFormat)(string $format, string|array $mimeTypes) Associates a format with mime types. | from [Request](request#method_setFormat "Symfony\Component\HttpFoundation\Request") | | string | [getRequestFormat](#method_getRequestFormat)(string|null $default = 'html') Gets the request format. | from [Request](request#method_getRequestFormat "Symfony\Component\HttpFoundation\Request") | | | [setRequestFormat](#method_setRequestFormat)(string $format) Sets the request format. | from [Request](request#method_setRequestFormat "Symfony\Component\HttpFoundation\Request") | | string|null | [getContentType](#method_getContentType)() Gets the format associated with the request. | from [Request](request#method_getContentType "Symfony\Component\HttpFoundation\Request") | | | [setDefaultLocale](#method_setDefaultLocale)(string $locale) Sets the default locale. | from [Request](request#method_setDefaultLocale "Symfony\Component\HttpFoundation\Request") | | string | [getDefaultLocale](#method_getDefaultLocale)() Get the default locale. | from [Request](request#method_getDefaultLocale "Symfony\Component\HttpFoundation\Request") | | | [setLocale](#method_setLocale)(string $locale) Sets the locale. | from [Request](request#method_setLocale "Symfony\Component\HttpFoundation\Request") | | string | [getLocale](#method_getLocale)() Get the locale. | from [Request](request#method_getLocale "Symfony\Component\HttpFoundation\Request") | | bool | [isMethod](#method_isMethod)(string $method) Checks if the request method is of specified type. | from [Request](request#method_isMethod "Symfony\Component\HttpFoundation\Request") | | bool | [isMethodSafe](#method_isMethodSafe)() Checks whether or not the method is safe. | from [Request](request#method_isMethodSafe "Symfony\Component\HttpFoundation\Request") | | bool | [isMethodIdempotent](#method_isMethodIdempotent)() Checks whether or not the method is idempotent. | from [Request](request#method_isMethodIdempotent "Symfony\Component\HttpFoundation\Request") | | bool | [isMethodCacheable](#method_isMethodCacheable)() Checks whether the method is cacheable or not. | from [Request](request#method_isMethodCacheable "Symfony\Component\HttpFoundation\Request") | | string | [getProtocolVersion](#method_getProtocolVersion)() Returns the protocol version. | from [Request](request#method_getProtocolVersion "Symfony\Component\HttpFoundation\Request") | | string|resource | [getContent](#method_getContent)(bool $asResource = false) Returns the request body content. | from [Request](request#method_getContent "Symfony\Component\HttpFoundation\Request") | | array | [getETags](#method_getETags)() Gets the Etags. | from [Request](request#method_getETags "Symfony\Component\HttpFoundation\Request") | | bool | [isNoCache](#method_isNoCache)() | from [Request](request#method_isNoCache "Symfony\Component\HttpFoundation\Request") | | string|null | [getPreferredLanguage](#method_getPreferredLanguage)(array $locales = null) Returns the preferred language. | from [Request](request#method_getPreferredLanguage "Symfony\Component\HttpFoundation\Request") | | array | [getLanguages](#method_getLanguages)() Gets a list of languages acceptable by the client browser. | from [Request](request#method_getLanguages "Symfony\Component\HttpFoundation\Request") | | array | [getCharsets](#method_getCharsets)() Gets a list of charsets acceptable by the client browser. | from [Request](request#method_getCharsets "Symfony\Component\HttpFoundation\Request") | | array | [getEncodings](#method_getEncodings)() Gets a list of encodings acceptable by the client browser. | from [Request](request#method_getEncodings "Symfony\Component\HttpFoundation\Request") | | array | [getAcceptableContentTypes](#method_getAcceptableContentTypes)() Gets a list of content types acceptable by the client browser. | from [Request](request#method_getAcceptableContentTypes "Symfony\Component\HttpFoundation\Request") | | bool | [isXmlHttpRequest](#method_isXmlHttpRequest)() Returns true if the request is a XMLHttpRequest. | from [Request](request#method_isXmlHttpRequest "Symfony\Component\HttpFoundation\Request") | | | [prepareRequestUri](#method_prepareRequestUri)() | | | string | [prepareBaseUrl](#method_prepareBaseUrl)() Prepares the base URL. | | | string | [prepareBasePath](#method_prepareBasePath)() Prepares the base path. | from [Request](request#method_prepareBasePath "Symfony\Component\HttpFoundation\Request") | | string | [preparePathInfo](#method_preparePathInfo)() Prepares the path info. | from [Request](request#method_preparePathInfo "Symfony\Component\HttpFoundation\Request") | | static | [initializeFormats](#method_initializeFormats)() Initializes HTTP request formats. | from [Request](request#method_initializeFormats "Symfony\Component\HttpFoundation\Request") | | bool | [isFromTrustedProxy](#method_isFromTrustedProxy)() Indicates whether this request originated from a trusted proxy. | from [Request](request#method_isFromTrustedProxy "Symfony\Component\HttpFoundation\Request") | Details ------- ### \_\_construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), string|resource|null $content = null) #### Parameters | | | | | --- | --- | --- | | array | $query | The GET parameters | | array | $request | The POST parameters | | array | $attributes | The request attributes (parameters parsed from the PATH\_INFO, ...) | | array | $cookies | The COOKIE parameters | | array | $files | The FILES parameters | | array | $server | The SERVER parameters | | string|resource|null | $content | The raw body data | ### initialize(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), string|resource|null $content = null) Sets the parameters for this request. This method also re-initializes all properties. #### Parameters | | | | | --- | --- | --- | | array | $query | The GET parameters | | array | $request | The POST parameters | | array | $attributes | The request attributes (parameters parsed from the PATH\_INFO, ...) | | array | $cookies | The COOKIE parameters | | array | $files | The FILES parameters | | array | $server | The SERVER parameters | | string|resource|null | $content | The raw body data | ### static [Request](request "Symfony\Component\HttpFoundation\Request") createFromGlobals() Creates a new request with values from PHP's super globals. #### Return Value | | | | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | | ### static [Request](request "Symfony\Component\HttpFoundation\Request") create(string $uri, string $method = 'GET', array $parameters = array(), array $cookies = array(), array $files = array(), array $server = array(), string|resource|null $content = null) Creates a Request based on a given URI and configuration. The information contained in the URI always take precedence over the other information (server and parameters). #### Parameters | | | | | --- | --- | --- | | string | $uri | The URI | | string | $method | The HTTP method | | array | $parameters | The query (GET) or request (POST) parameters | | array | $cookies | The request cookies ($\_COOKIE) | | array | $files | The request files ($\_FILES) | | array | $server | The server parameters ($\_SERVER) | | string|resource|null | $content | The raw body data | #### Return Value | | | | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | | ### static setFactory(callable|null $callable) Sets a callable able to create a Request instance. This is mainly useful when you need to override the Request class to keep BC with an existing system. It should not be used for any other purpose. #### Parameters | | | | | --- | --- | --- | | callable|null | $callable | A PHP callable | ### [Request](request "Symfony\Component\HttpFoundation\Request") duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) Clones a request and overrides some of its parameters. #### Parameters | | | | | --- | --- | --- | | array | $query | The GET parameters | | array | $request | The POST parameters | | array | $attributes | The request attributes (parameters parsed from the PATH\_INFO, ...) | | array | $cookies | The COOKIE parameters | | array | $files | The FILES parameters | | array | $server | The SERVER parameters | #### Return Value | | | | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | | ### \_\_clone() Clones the current request. Note that the session is not cloned as duplicated requests are most of the time sub-requests of the main one. ### string \_\_toString() Returns the request as a string. #### Return Value | | | | --- | --- | | string | The request | ### overrideGlobals() Overrides the PHP global variables according to this request instance. It overrides $\_GET, $\_POST, $\_REQUEST, $\_SERVER, $\_COOKIE. $\_FILES is never overridden, see rfc1867 ### static setTrustedProxies(array $proxies, int $trustedHeaderSet) Sets a list of trusted proxies. You should only list the reverse proxies that you manage directly. #### Parameters | | | | | --- | --- | --- | | array | $proxies | A list of trusted proxies | | int | $trustedHeaderSet | A bit field of Request::HEADER\_\*, to set which headers to trust from your proxies | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When $trustedHeaderSet is invalid | ### static array getTrustedProxies() Gets the list of trusted proxies. #### Return Value | | | | --- | --- | | array | An array of trusted proxies | ### static int getTrustedHeaderSet() Gets the set of trusted headers from trusted proxies. #### Return Value | | | | --- | --- | | int | A bit field of Request::HEADER\_\* that defines which headers are trusted from your proxies | ### static setTrustedHosts(array $hostPatterns) Sets a list of trusted host patterns. You should only list the hosts you manage using regexs. #### Parameters | | | | | --- | --- | --- | | array | $hostPatterns | A list of trusted host patterns | ### static array getTrustedHosts() Gets the list of trusted host patterns. #### Return Value | | | | --- | --- | | array | An array of trusted host patterns | ### static string normalizeQueryString(string $qs) Normalizes a query string. It builds a normalized query string, where keys/value pairs are alphabetized, have consistent escaping and unneeded delimiters are removed. #### Parameters | | | | | --- | --- | --- | | string | $qs | Query string | #### Return Value | | | | --- | --- | | string | A normalized query string for the Request | ### static enableHttpMethodParameterOverride() Enables support for the \_method request parameter to determine the intended HTTP method. Be warned that enabling this feature might lead to CSRF issues in your code. Check that you are using CSRF tokens when required. If the HTTP method parameter override is enabled, an html-form with method "POST" can be altered and used to send a "PUT" or "DELETE" request via the \_method request parameter. If these methods are not protected against CSRF, this presents a possible vulnerability. The HTTP method can only be overridden when the real HTTP method is POST. ### static bool getHttpMethodParameterOverride() Checks whether support for the \_method request parameter is enabled. #### Return Value | | | | --- | --- | | bool | True when the \_method request parameter is enabled, false otherwise | ### mixed get(string $key, mixed $default = null) Gets a "parameter" value from any bag. This method is mainly useful for libraries that want to provide some flexibility. If you don't need the flexibility in controllers, it is better to explicitly get request parameters from the appropriate public property instead (attributes, query, request). Order of precedence: PATH (routing placeholders or custom attributes), GET, BODY #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | mixed | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | mixed | | ### [SessionInterface](session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface")|null getSession() Gets the Session. #### Return Value | | | | --- | --- | | [SessionInterface](session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface")|null | The session | ### bool hasPreviousSession() Whether the request contains a Session which was started in one of the previous requests. #### Return Value | | | | --- | --- | | bool | | ### bool hasSession() Whether the request contains a Session object. This method does not give any information about the state of the session object, like whether the session is started or not. It is just a way to check if this Request is associated with a Session instance. #### Return Value | | | | --- | --- | | bool | true when the Request contains a Session object, false otherwise | ### setSession([SessionInterface](session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface") $session) Sets the Session. #### Parameters | | | | | --- | --- | --- | | [SessionInterface](session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface") | $session | The Session | ### setSessionFactory(callable $factory) #### Parameters | | | | | --- | --- | --- | | callable | $factory | | ### array getClientIps() Returns the client IP addresses. In the returned array the most trusted IP address is first, and the least trusted one last. The "real" client IP address is the last one, but this is also the least trusted one. Trusted proxies are stripped. Use this method carefully; you should use getClientIp() instead. #### Return Value | | | | --- | --- | | array | The client IP addresses | #### See also | | | | --- | --- | | getClientIp() | | ### string|null getClientIp() Returns the client IP address. This method can read the client IP address from the "X-Forwarded-For" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-For" header value is a comma+space separated list of IP addresses, the left-most being the original client, and each successive proxy that passed the request adding the IP address where it received the request from. #### Return Value | | | | --- | --- | | string|null | The client IP address | #### See also | | | | --- | --- | | getClientIps() | | | <http://en.wikipedia.org/wiki/X-Forwarded-For> | | ### string getScriptName() Returns current script name. #### Return Value | | | | --- | --- | | string | | ### string getPathInfo() Returns the path being requested relative to the executed script. The path info always starts with a /. Suppose this request is instantiated from /mysite on localhost: * http://localhost/mysite returns an empty string * http://localhost/mysite/about returns '/about' * http://localhost/mysite/enco%20ded returns '/enco%20ded' * http://localhost/mysite/about?var=1 returns '/about' #### Return Value | | | | --- | --- | | string | The raw path (i.e. not urldecoded) | ### string getBasePath() Returns the root path from which this request is executed. Suppose that an index.php file instantiates this request object: * http://localhost/index.php returns an empty string * http://localhost/index.php/page returns an empty string * http://localhost/web/index.php returns '/web' * http://localhost/we%20b/index.php returns '/we%20b' #### Return Value | | | | --- | --- | | string | The raw path (i.e. not urldecoded) | ### string getBaseUrl() Returns the root URL from which this request is executed. The base URL never ends with a /. This is similar to getBasePath(), except that it also includes the script filename (e.g. index.php) if one exists. #### Return Value | | | | --- | --- | | string | The raw URL (i.e. not urldecoded) | ### string getScheme() Gets the request's scheme. #### Return Value | | | | --- | --- | | string | | ### int|string getPort() Returns the port on which the request is made. This method can read the client port from the "X-Forwarded-Port" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-Port" header must contain the client port. #### Return Value | | | | --- | --- | | int|string | can be a string if fetched from the server bag | ### string|null getUser() Returns the user. #### Return Value | | | | --- | --- | | string|null | | ### string|null getPassword() Returns the password. #### Return Value | | | | --- | --- | | string|null | | ### string getUserInfo() Gets the user info. #### Return Value | | | | --- | --- | | string | A user name and, optionally, scheme-specific information about how to gain authorization to access the server | ### string getHttpHost() Returns the HTTP host being requested. The port name will be appended to the host if it's non-standard. #### Return Value | | | | --- | --- | | string | | ### string getRequestUri() Returns the requested URI (path and query string). #### Return Value | | | | --- | --- | | string | The raw URI (i.e. not URI decoded) | ### string getSchemeAndHttpHost() Gets the scheme and HTTP host. If the URL was called with basic authentication, the user and the password are not added to the generated string. #### Return Value | | | | --- | --- | | string | The scheme and HTTP host | ### string getUri() Generates a normalized URI (URL) for the Request. #### Return Value | | | | --- | --- | | string | A normalized URI (URL) for the Request | #### See also | | | | --- | --- | | getQueryString() | | ### string getUriForPath(string $path) Generates a normalized URI for the given path. #### Parameters | | | | | --- | --- | --- | | string | $path | A path to use instead of the current one | #### Return Value | | | | --- | --- | | string | The normalized URI for the path | ### string getRelativeUriForPath(string $path) Returns the path as relative reference from the current Request path. Only the URIs path component (no schema, host etc.) is relevant and must be given. Both paths must be absolute and not contain relative parts. Relative URLs from one resource to another are useful when generating self-contained downloadable document archives. Furthermore, they can be used to reduce the link size in documents. Example target paths, given a base path of "/a/b/c/d": - "/a/b/c/d" -> "" - "/a/b/c/" -> "./" - "/a/b/" -> "../" - "/a/b/c/other" -> "other" - "/a/x/y" -> "../../x/y" #### Parameters | | | | | --- | --- | --- | | string | $path | The target path | #### Return Value | | | | --- | --- | | string | The relative target path | ### string|null getQueryString() Generates the normalized query string for the Request. It builds a normalized query string, where keys/value pairs are alphabetized and have consistent escaping. #### Return Value | | | | --- | --- | | string|null | A normalized query string for the Request | ### bool isSecure() Checks whether the request is secure or not. This method can read the client protocol from the "X-Forwarded-Proto" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-Proto" header must contain the protocol: "https" or "http". #### Return Value | | | | --- | --- | | bool | | ### string getHost() Returns the host name. This method can read the client host name from the "X-Forwarded-Host" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-Host" header must contain the client host name. #### Return Value | | | | --- | --- | | string | | #### Exceptions | | | | --- | --- | | [SuspiciousOperationException](exception/suspiciousoperationexception "Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException") | when the host name is invalid or not trusted | ### setMethod(string $method) Sets the request method. #### Parameters | | | | | --- | --- | --- | | string | $method | | ### string getMethod() Gets the request "intended" method. If the X-HTTP-Method-Override header is set, and if the method is a POST, then it is used to determine the "real" intended HTTP method. The \_method request parameter can also be used to determine the HTTP method, but only if enableHttpMethodParameterOverride() has been called. The method is always an uppercased string. #### Return Value | | | | --- | --- | | string | The request method | #### See also | | | | --- | --- | | getRealMethod() | | ### string getRealMethod() Gets the "real" request method. #### Return Value | | | | --- | --- | | string | The request method | #### See also | | | | --- | --- | | getMethod() | | ### string|null getMimeType(string $format) Gets the mime type associated with the format. #### Parameters | | | | | --- | --- | --- | | string | $format | The format | #### Return Value | | | | --- | --- | | string|null | The associated mime type (null if not found) | ### static array getMimeTypes(string $format) Gets the mime types associated with the format. #### Parameters | | | | | --- | --- | --- | | string | $format | The format | #### Return Value | | | | --- | --- | | array | The associated mime types | ### string|null getFormat(string $mimeType) Gets the format associated with the mime type. #### Parameters | | | | | --- | --- | --- | | string | $mimeType | The associated mime type | #### Return Value | | | | --- | --- | | string|null | The format (null if not found) | ### setFormat(string $format, string|array $mimeTypes) Associates a format with mime types. #### Parameters | | | | | --- | --- | --- | | string | $format | The format | | string|array | $mimeTypes | The associated mime types (the preferred one must be the first as it will be used as the content type) | ### string getRequestFormat(string|null $default = 'html') Gets the request format. Here is the process to determine the format: * format defined by the user (with setRequestFormat()) * \_format request attribute * $default #### Parameters | | | | | --- | --- | --- | | string|null | $default | The default format | #### Return Value | | | | --- | --- | | string | The request format | ### setRequestFormat(string $format) Sets the request format. #### Parameters | | | | | --- | --- | --- | | string | $format | The request format | ### string|null getContentType() Gets the format associated with the request. #### Return Value | | | | --- | --- | | string|null | The format (null if no content type is present) | ### setDefaultLocale(string $locale) Sets the default locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | | ### string getDefaultLocale() Get the default locale. #### Return Value | | | | --- | --- | | string | | ### setLocale(string $locale) Sets the locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | | ### string getLocale() Get the locale. #### Return Value | | | | --- | --- | | string | | ### bool isMethod(string $method) Checks if the request method is of specified type. #### Parameters | | | | | --- | --- | --- | | string | $method | Uppercase request method (GET, POST etc) | #### Return Value | | | | --- | --- | | bool | | ### bool isMethodSafe() Checks whether or not the method is safe. #### Return Value | | | | --- | --- | | bool | | #### See also | | | | --- | --- | | <https://tools.ietf.org/html/rfc7231#section-4.2.1> | | ### bool isMethodIdempotent() Checks whether or not the method is idempotent. #### Return Value | | | | --- | --- | | bool | | ### bool isMethodCacheable() Checks whether the method is cacheable or not. #### Return Value | | | | --- | --- | | bool | | #### See also | | | | --- | --- | | <https://tools.ietf.org/html/rfc7231#section-4.2.3> | | ### string getProtocolVersion() Returns the protocol version. If the application is behind a proxy, the protocol version used in the requests between the client and the proxy and between the proxy and the server might be different. This returns the former (from the "Via" header) if the proxy is trusted (see "setTrustedProxies()"), otherwise it returns the latter (from the "SERVER\_PROTOCOL" server parameter). #### Return Value | | | | --- | --- | | string | | ### string|resource getContent(bool $asResource = false) Returns the request body content. #### Parameters | | | | | --- | --- | --- | | bool | $asResource | If true, a resource will be returned | #### Return Value | | | | --- | --- | | string|resource | The request body content or a resource to read the body stream | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | | ### array getETags() Gets the Etags. #### Return Value | | | | --- | --- | | array | The entity tags | ### bool isNoCache() #### Return Value | | | | --- | --- | | bool | | ### string|null getPreferredLanguage(array $locales = null) Returns the preferred language. #### Parameters | | | | | --- | --- | --- | | array | $locales | An array of ordered available locales | #### Return Value | | | | --- | --- | | string|null | The preferred locale | ### array getLanguages() Gets a list of languages acceptable by the client browser. #### Return Value | | | | --- | --- | | array | Languages ordered in the user browser preferences | ### array getCharsets() Gets a list of charsets acceptable by the client browser. #### Return Value | | | | --- | --- | | array | List of charsets in preferable order | ### array getEncodings() Gets a list of encodings acceptable by the client browser. #### Return Value | | | | --- | --- | | array | List of encodings in preferable order | ### array getAcceptableContentTypes() Gets a list of content types acceptable by the client browser. #### Return Value | | | | --- | --- | | array | List of content types in preferable order | ### bool isXmlHttpRequest() Returns true if the request is a XMLHttpRequest. It works if your JavaScript library sets an X-Requested-With HTTP header. It is known to work with common JavaScript frameworks: #### Return Value | | | | --- | --- | | bool | true if the request is an XMLHttpRequest, false otherwise | #### See also | | | | --- | --- | | <http://en.wikipedia.org/wiki/List_of_Ajax_frameworks#JavaScript> | | ### protected prepareRequestUri() ### protected string prepareBaseUrl() Prepares the base URL. #### Return Value | | | | --- | --- | | string | | ### protected string prepareBasePath() Prepares the base path. #### Return Value | | | | --- | --- | | string | base path | ### protected string preparePathInfo() Prepares the path info. #### Return Value | | | | --- | --- | | string | path info | ### static protected initializeFormats() Initializes HTTP request formats. ### bool isFromTrustedProxy() Indicates whether this request originated from a trusted proxy. This can be useful to determine whether or not to trust the contents of a proxy-specific header. #### Return Value | | | | --- | --- | | bool | true if the request came from a trusted proxy, false otherwise |
programming_docs
symfony HeaderBag HeaderBag ========== class **HeaderBag** implements [IteratorAggregate](http://php.net/IteratorAggregate), [Countable](http://php.net/Countable) HeaderBag is a container for HTTP headers. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $headers | | | | protected | $cacheControl | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $headers = array()) | | | string | [\_\_toString](#method___toString)() Returns the headers as a string. | | | array | [all](#method_all)() Returns the headers. | | | array | [keys](#method_keys)() Returns the parameter keys. | | | | [replace](#method_replace)(array $headers = array()) Replaces the current HTTP headers by a new set. | | | | [add](#method_add)(array $headers) Adds new headers the current HTTP headers set. | | | string|string[]|null | [get](#method_get)(string $key, string|string[]|null $default = null, bool $first = true) Returns a header value by name. | | | | [set](#method_set)(string $key, string|string[] $values, bool $replace = true) Sets a header by name. | | | bool | [has](#method_has)(string $key) Returns true if the HTTP header is defined. | | | bool | [contains](#method_contains)(string $key, string $value) Returns true if the given HTTP header contains the given value. | | | | [remove](#method_remove)(string $key) Removes a header. | | | [DateTime](http://php.net/DateTime)|null | [getDate](#method_getDate)(string $key, [DateTime](http://php.net/DateTime) $default = null) Returns the HTTP header value converted to a date. | | | | [addCacheControlDirective](#method_addCacheControlDirective)(string $key, mixed $value = true) Adds a custom Cache-Control directive. | | | bool | [hasCacheControlDirective](#method_hasCacheControlDirective)(string $key) Returns true if the Cache-Control directive is defined. | | | mixed|null | [getCacheControlDirective](#method_getCacheControlDirective)(string $key) Returns a Cache-Control directive value by name. | | | | [removeCacheControlDirective](#method_removeCacheControlDirective)(string $key) Removes a Cache-Control directive. | | | [ArrayIterator](http://php.net/ArrayIterator) | [getIterator](#method_getIterator)() Returns an iterator for headers. | | | int | [count](#method_count)() Returns the number of headers. | | | | [getCacheControlHeader](#method_getCacheControlHeader)() | | | array | [parseCacheControl](#method_parseCacheControl)(string $header) Parses a Cache-Control HTTP header. | | Details ------- ### \_\_construct(array $headers = array()) #### Parameters | | | | | --- | --- | --- | | array | $headers | An array of HTTP headers | ### string \_\_toString() Returns the headers as a string. #### Return Value | | | | --- | --- | | string | The headers | ### array all() Returns the headers. #### Return Value | | | | --- | --- | | array | An array of headers | ### array keys() Returns the parameter keys. #### Return Value | | | | --- | --- | | array | An array of parameter keys | ### replace(array $headers = array()) Replaces the current HTTP headers by a new set. #### Parameters | | | | | --- | --- | --- | | array | $headers | An array of HTTP headers | ### add(array $headers) Adds new headers the current HTTP headers set. #### Parameters | | | | | --- | --- | --- | | array | $headers | An array of HTTP headers | ### string|string[]|null get(string $key, string|string[]|null $default = null, bool $first = true) Returns a header value by name. #### Parameters | | | | | --- | --- | --- | | string | $key | The header name | | string|string[]|null | $default | The default value | | bool | $first | Whether to return the first value or all header values | #### Return Value | | | | --- | --- | | string|string[]|null | The first header value or default value if $first is true, an array of values otherwise | ### set(string $key, string|string[] $values, bool $replace = true) Sets a header by name. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | string|string[] | $values | The value or an array of values | | bool | $replace | Whether to replace the actual value or not (true by default) | ### bool has(string $key) Returns true if the HTTP header is defined. #### Parameters | | | | | --- | --- | --- | | string | $key | The HTTP header | #### Return Value | | | | --- | --- | | bool | true if the parameter exists, false otherwise | ### bool contains(string $key, string $value) Returns true if the given HTTP header contains the given value. #### Parameters | | | | | --- | --- | --- | | string | $key | The HTTP header name | | string | $value | The HTTP value | #### Return Value | | | | --- | --- | | bool | true if the value is contained in the header, false otherwise | ### remove(string $key) Removes a header. #### Parameters | | | | | --- | --- | --- | | string | $key | The HTTP header name | ### [DateTime](http://php.net/DateTime)|null getDate(string $key, [DateTime](http://php.net/DateTime) $default = null) Returns the HTTP header value converted to a date. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | [DateTime](http://php.net/DateTime) | $default | The default value | #### Return Value | | | | --- | --- | | [DateTime](http://php.net/DateTime)|null | The parsed DateTime or the default value if the header does not exist | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When the HTTP header is not parseable | ### addCacheControlDirective(string $key, mixed $value = true) Adds a custom Cache-Control directive. #### Parameters | | | | | --- | --- | --- | | string | $key | The Cache-Control directive name | | mixed | $value | The Cache-Control directive value | ### bool hasCacheControlDirective(string $key) Returns true if the Cache-Control directive is defined. #### Parameters | | | | | --- | --- | --- | | string | $key | The Cache-Control directive | #### Return Value | | | | --- | --- | | bool | true if the directive exists, false otherwise | ### mixed|null getCacheControlDirective(string $key) Returns a Cache-Control directive value by name. #### Parameters | | | | | --- | --- | --- | | string | $key | The directive name | #### Return Value | | | | --- | --- | | mixed|null | The directive value if defined, null otherwise | ### removeCacheControlDirective(string $key) Removes a Cache-Control directive. #### Parameters | | | | | --- | --- | --- | | string | $key | The Cache-Control directive | ### [ArrayIterator](http://php.net/ArrayIterator) getIterator() Returns an iterator for headers. #### Return Value | | | | --- | --- | | [ArrayIterator](http://php.net/ArrayIterator) | An \ArrayIterator instance | ### int count() Returns the number of headers. #### Return Value | | | | --- | --- | | int | The number of headers | ### protected getCacheControlHeader() ### protected array parseCacheControl(string $header) Parses a Cache-Control HTTP header. #### Parameters | | | | | --- | --- | --- | | string | $header | The value of the Cache-Control HTTP header | #### Return Value | | | | --- | --- | | array | An array representing the attribute values | symfony Symfony\Component\HttpFoundation\File Symfony\Component\HttpFoundation\File ===================================== Namespaces ---------- [Symfony\Component\HttpFoundation\File\Exception](file/exception)[Symfony\Component\HttpFoundation\File\MimeType](file/mimetype) Classes ------- | | | | --- | --- | | [File](file/file "Symfony\Component\HttpFoundation\File\File") | A file in the file system. | | [Stream](file/stream "Symfony\Component\HttpFoundation\File\Stream") | A PHP stream of unknown size. | | [UploadedFile](file/uploadedfile "Symfony\Component\HttpFoundation\File\UploadedFile") | A file uploaded through a form. | symfony ParameterBag ParameterBag ============= class **ParameterBag** implements [IteratorAggregate](http://php.net/IteratorAggregate), [Countable](http://php.net/Countable) ParameterBag is a container for key/value pairs. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $parameters | Parameter storage. | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $parameters = array()) | | | array | [all](#method_all)() Returns the parameters. | | | array | [keys](#method_keys)() Returns the parameter keys. | | | | [replace](#method_replace)(array $parameters = array()) Replaces the current parameters by a new set. | | | | [add](#method_add)(array $parameters = array()) Adds parameters. | | | mixed | [get](#method_get)(string $key, mixed $default = null) Returns a parameter by name. | | | | [set](#method_set)(string $key, mixed $value) Sets a parameter by name. | | | bool | [has](#method_has)(string $key) Returns true if the parameter is defined. | | | | [remove](#method_remove)(string $key) Removes a parameter. | | | string | [getAlpha](#method_getAlpha)(string $key, string $default = '') Returns the alphabetic characters of the parameter value. | | | string | [getAlnum](#method_getAlnum)(string $key, string $default = '') Returns the alphabetic characters and digits of the parameter value. | | | string | [getDigits](#method_getDigits)(string $key, string $default = '') Returns the digits of the parameter value. | | | int | [getInt](#method_getInt)(string $key, int $default = 0) Returns the parameter value converted to integer. | | | bool | [getBoolean](#method_getBoolean)(string $key, mixed $default = false) Returns the parameter value converted to boolean. | | | mixed | [filter](#method_filter)(string $key, mixed $default = null, int $filter = FILTER\_DEFAULT, mixed $options = array()) Filter key. | | | [ArrayIterator](http://php.net/ArrayIterator) | [getIterator](#method_getIterator)() Returns an iterator for parameters. | | | int | [count](#method_count)() Returns the number of parameters. | | Details ------- ### \_\_construct(array $parameters = array()) #### Parameters | | | | | --- | --- | --- | | array | $parameters | An array of parameters | ### array all() Returns the parameters. #### Return Value | | | | --- | --- | | array | An array of parameters | ### array keys() Returns the parameter keys. #### Return Value | | | | --- | --- | | array | An array of parameter keys | ### replace(array $parameters = array()) Replaces the current parameters by a new set. #### Parameters | | | | | --- | --- | --- | | array | $parameters | An array of parameters | ### add(array $parameters = array()) Adds parameters. #### Parameters | | | | | --- | --- | --- | | array | $parameters | An array of parameters | ### mixed get(string $key, mixed $default = null) Returns a parameter by name. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | mixed | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | mixed | | ### set(string $key, mixed $value) Sets a parameter by name. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | mixed | $value | The value | ### bool has(string $key) Returns true if the parameter is defined. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | #### Return Value | | | | --- | --- | | bool | true if the parameter exists, false otherwise | ### remove(string $key) Removes a parameter. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | ### string getAlpha(string $key, string $default = '') Returns the alphabetic characters of the parameter value. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | string | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | string | The filtered value | ### string getAlnum(string $key, string $default = '') Returns the alphabetic characters and digits of the parameter value. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | string | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | string | The filtered value | ### string getDigits(string $key, string $default = '') Returns the digits of the parameter value. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | string | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | string | The filtered value | ### int getInt(string $key, int $default = 0) Returns the parameter value converted to integer. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | int | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | int | The filtered value | ### bool getBoolean(string $key, mixed $default = false) Returns the parameter value converted to boolean. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | mixed | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | bool | The filtered value | ### mixed filter(string $key, mixed $default = null, int $filter = FILTER\_DEFAULT, mixed $options = array()) Filter key. #### Parameters | | | | | --- | --- | --- | | string | $key | Key | | mixed | $default | Default = null | | int | $filter | FILTER\_\* constant | | mixed | $options | Filter options | #### Return Value | | | | --- | --- | | mixed | | #### See also | | | | --- | --- | | <http://php.net/manual/en/function.filter-var.php> | | ### [ArrayIterator](http://php.net/ArrayIterator) getIterator() Returns an iterator for parameters. #### Return Value | | | | --- | --- | | [ArrayIterator](http://php.net/ArrayIterator) | An \ArrayIterator instance | ### int count() Returns the number of parameters. #### Return Value | | | | --- | --- | | int | The number of parameters | symfony ResponseHeaderBag ResponseHeaderBag ================== class **ResponseHeaderBag** extends [HeaderBag](headerbag "Symfony\Component\HttpFoundation\HeaderBag") ResponseHeaderBag is a container for Response HTTP headers. Constants --------- | | | | --- | --- | | COOKIES\_FLAT | | | COOKIES\_ARRAY | | | DISPOSITION\_ATTACHMENT | | | DISPOSITION\_INLINE | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $headers | | from [HeaderBag](headerbag#property_headers "Symfony\Component\HttpFoundation\HeaderBag") | | protected | $cacheControl | | from [HeaderBag](headerbag#property_cacheControl "Symfony\Component\HttpFoundation\HeaderBag") | | protected | $computedCacheControl | | | | protected | $cookies | | | | protected | $headerNames | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $headers = array()) | | | string | [\_\_toString](#method___toString)() Returns the headers as a string. | from [HeaderBag](headerbag#method___toString "Symfony\Component\HttpFoundation\HeaderBag") | | array | [all](#method_all)() Returns the headers. | | | array | [keys](#method_keys)() Returns the parameter keys. | from [HeaderBag](headerbag#method_keys "Symfony\Component\HttpFoundation\HeaderBag") | | | [replace](#method_replace)(array $headers = array()) Replaces the current HTTP headers by a new set. | | | | [add](#method_add)(array $headers) Adds new headers the current HTTP headers set. | from [HeaderBag](headerbag#method_add "Symfony\Component\HttpFoundation\HeaderBag") | | string|string[]|null | [get](#method_get)(string $key, string|string[]|null $default = null, bool $first = true) Returns a header value by name. | from [HeaderBag](headerbag#method_get "Symfony\Component\HttpFoundation\HeaderBag") | | | [set](#method_set)(string $key, string|string[] $values, bool $replace = true) Sets a header by name. | | | bool | [has](#method_has)(string $key) Returns true if the HTTP header is defined. | from [HeaderBag](headerbag#method_has "Symfony\Component\HttpFoundation\HeaderBag") | | bool | [contains](#method_contains)(string $key, string $value) Returns true if the given HTTP header contains the given value. | from [HeaderBag](headerbag#method_contains "Symfony\Component\HttpFoundation\HeaderBag") | | | [remove](#method_remove)(string $key) Removes a header. | | | [DateTime](http://php.net/DateTime)|null | [getDate](#method_getDate)(string $key, [DateTime](http://php.net/DateTime) $default = null) Returns the HTTP header value converted to a date. | from [HeaderBag](headerbag#method_getDate "Symfony\Component\HttpFoundation\HeaderBag") | | | [addCacheControlDirective](#method_addCacheControlDirective)(string $key, mixed $value = true) Adds a custom Cache-Control directive. | from [HeaderBag](headerbag#method_addCacheControlDirective "Symfony\Component\HttpFoundation\HeaderBag") | | bool | [hasCacheControlDirective](#method_hasCacheControlDirective)(string $key) Returns true if the Cache-Control directive is defined. | | | mixed|null | [getCacheControlDirective](#method_getCacheControlDirective)(string $key) Returns a Cache-Control directive value by name. | | | | [removeCacheControlDirective](#method_removeCacheControlDirective)(string $key) Removes a Cache-Control directive. | from [HeaderBag](headerbag#method_removeCacheControlDirective "Symfony\Component\HttpFoundation\HeaderBag") | | [ArrayIterator](http://php.net/ArrayIterator) | [getIterator](#method_getIterator)() Returns an iterator for headers. | from [HeaderBag](headerbag#method_getIterator "Symfony\Component\HttpFoundation\HeaderBag") | | int | [count](#method_count)() Returns the number of headers. | from [HeaderBag](headerbag#method_count "Symfony\Component\HttpFoundation\HeaderBag") | | | [getCacheControlHeader](#method_getCacheControlHeader)() | from [HeaderBag](headerbag#method_getCacheControlHeader "Symfony\Component\HttpFoundation\HeaderBag") | | array | [parseCacheControl](#method_parseCacheControl)(string $header) Parses a Cache-Control HTTP header. | from [HeaderBag](headerbag#method_parseCacheControl "Symfony\Component\HttpFoundation\HeaderBag") | | array | [allPreserveCase](#method_allPreserveCase)() Returns the headers, with original capitalizations. | | | | [allPreserveCaseWithoutCookies](#method_allPreserveCaseWithoutCookies)() | | | | [setCookie](#method_setCookie)([Cookie](cookie "Symfony\Component\HttpFoundation\Cookie") $cookie) | | | | [removeCookie](#method_removeCookie)(string $name, string $path = '/', string $domain = null) Removes a cookie from the array, but does not unset it in the browser. | | | [Cookie](cookie "Symfony\Component\HttpFoundation\Cookie")[] | [getCookies](#method_getCookies)(string $format = self::COOKIES\_FLAT) Returns an array with all cookies. | | | | [clearCookie](#method_clearCookie)(string $name, string $path = '/', string $domain = null, bool $secure = false, bool $httpOnly = true) Clears a cookie in the browser. | | | string | [makeDisposition](#method_makeDisposition)(string $disposition, string $filename, string $filenameFallback = '') Generates a HTTP Content-Disposition field-value. | | | string | [computeCacheControlValue](#method_computeCacheControlValue)() Returns the calculated value of the cache-control header. | | Details ------- ### \_\_construct(array $headers = array()) #### Parameters | | | | | --- | --- | --- | | array | $headers | An array of HTTP headers | ### string \_\_toString() Returns the headers as a string. #### Return Value | | | | --- | --- | | string | The headers | ### array all() Returns the headers. #### Return Value | | | | --- | --- | | array | An array of headers | ### array keys() Returns the parameter keys. #### Return Value | | | | --- | --- | | array | An array of parameter keys | ### replace(array $headers = array()) Replaces the current HTTP headers by a new set. #### Parameters | | | | | --- | --- | --- | | array | $headers | An array of HTTP headers | ### add(array $headers) Adds new headers the current HTTP headers set. #### Parameters | | | | | --- | --- | --- | | array | $headers | An array of HTTP headers | ### string|string[]|null get(string $key, string|string[]|null $default = null, bool $first = true) Returns a header value by name. #### Parameters | | | | | --- | --- | --- | | string | $key | The header name | | string|string[]|null | $default | The default value | | bool | $first | Whether to return the first value or all header values | #### Return Value | | | | --- | --- | | string|string[]|null | The first header value or default value if $first is true, an array of values otherwise | ### set(string $key, string|string[] $values, bool $replace = true) Sets a header by name. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | string|string[] | $values | The value or an array of values | | bool | $replace | Whether to replace the actual value or not (true by default) | ### bool has(string $key) Returns true if the HTTP header is defined. #### Parameters | | | | | --- | --- | --- | | string | $key | The HTTP header | #### Return Value | | | | --- | --- | | bool | true if the parameter exists, false otherwise | ### bool contains(string $key, string $value) Returns true if the given HTTP header contains the given value. #### Parameters | | | | | --- | --- | --- | | string | $key | The HTTP header name | | string | $value | The HTTP value | #### Return Value | | | | --- | --- | | bool | true if the value is contained in the header, false otherwise | ### remove(string $key) Removes a header. #### Parameters | | | | | --- | --- | --- | | string | $key | The HTTP header name | ### [DateTime](http://php.net/DateTime)|null getDate(string $key, [DateTime](http://php.net/DateTime) $default = null) Returns the HTTP header value converted to a date. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | [DateTime](http://php.net/DateTime) | $default | The default value | #### Return Value | | | | --- | --- | | [DateTime](http://php.net/DateTime)|null | The parsed DateTime or the default value if the header does not exist | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When the HTTP header is not parseable | ### addCacheControlDirective(string $key, mixed $value = true) Adds a custom Cache-Control directive. #### Parameters | | | | | --- | --- | --- | | string | $key | The Cache-Control directive name | | mixed | $value | The Cache-Control directive value | ### bool hasCacheControlDirective(string $key) Returns true if the Cache-Control directive is defined. #### Parameters | | | | | --- | --- | --- | | string | $key | The Cache-Control directive | #### Return Value | | | | --- | --- | | bool | true if the directive exists, false otherwise | ### mixed|null getCacheControlDirective(string $key) Returns a Cache-Control directive value by name. #### Parameters | | | | | --- | --- | --- | | string | $key | The directive name | #### Return Value | | | | --- | --- | | mixed|null | The directive value if defined, null otherwise | ### removeCacheControlDirective(string $key) Removes a Cache-Control directive. #### Parameters | | | | | --- | --- | --- | | string | $key | The Cache-Control directive | ### [ArrayIterator](http://php.net/ArrayIterator) getIterator() Returns an iterator for headers. #### Return Value | | | | --- | --- | | [ArrayIterator](http://php.net/ArrayIterator) | An \ArrayIterator instance | ### int count() Returns the number of headers. #### Return Value | | | | --- | --- | | int | The number of headers | ### protected getCacheControlHeader() ### protected array parseCacheControl(string $header) Parses a Cache-Control HTTP header. #### Parameters | | | | | --- | --- | --- | | string | $header | The value of the Cache-Control HTTP header | #### Return Value | | | | --- | --- | | array | An array representing the attribute values | ### array allPreserveCase() Returns the headers, with original capitalizations. #### Return Value | | | | --- | --- | | array | An array of headers | ### allPreserveCaseWithoutCookies() ### setCookie([Cookie](cookie "Symfony\Component\HttpFoundation\Cookie") $cookie) #### Parameters | | | | | --- | --- | --- | | [Cookie](cookie "Symfony\Component\HttpFoundation\Cookie") | $cookie | | ### removeCookie(string $name, string $path = '/', string $domain = null) Removes a cookie from the array, but does not unset it in the browser. #### Parameters | | | | | --- | --- | --- | | string | $name | | | string | $path | | | string | $domain | | ### [Cookie](cookie "Symfony\Component\HttpFoundation\Cookie")[] getCookies(string $format = self::COOKIES\_FLAT) Returns an array with all cookies. #### Parameters | | | | | --- | --- | --- | | string | $format | | #### Return Value | | | | --- | --- | | [Cookie](cookie "Symfony\Component\HttpFoundation\Cookie")[] | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When the $format is invalid | ### clearCookie(string $name, string $path = '/', string $domain = null, bool $secure = false, bool $httpOnly = true) Clears a cookie in the browser. #### Parameters | | | | | --- | --- | --- | | string | $name | | | string | $path | | | string | $domain | | | bool | $secure | | | bool | $httpOnly | | ### string makeDisposition(string $disposition, string $filename, string $filenameFallback = '') Generates a HTTP Content-Disposition field-value. #### Parameters | | | | | --- | --- | --- | | string | $disposition | One of "inline" or "attachment" | | string | $filename | A unicode string | | string | $filenameFallback | A string containing only ASCII characters that is semantically equivalent to $filename. If the filename is already ASCII, it can be omitted, or just copied from $filename | #### Return Value | | | | --- | --- | | string | A string suitable for use as a Content-Disposition field-value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | #### See also | | | | --- | --- | | RFC | 6266 | ### protected string computeCacheControlValue() Returns the calculated value of the cache-control header. This considers several other headers and calculates or modifies the cache-control header to a sensible, conservative value. #### Return Value | | | | --- | --- | | string | |
programming_docs
symfony FileBag FileBag ======== class **FileBag** extends [ParameterBag](parameterbag "Symfony\Component\HttpFoundation\ParameterBag") FileBag is a container for uploaded files. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $parameters | Parameter storage. | from [ParameterBag](parameterbag#property_parameters "Symfony\Component\HttpFoundation\ParameterBag") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $parameters = array()) | | | array | [all](#method_all)() Returns the parameters. | from [ParameterBag](parameterbag#method_all "Symfony\Component\HttpFoundation\ParameterBag") | | array | [keys](#method_keys)() Returns the parameter keys. | from [ParameterBag](parameterbag#method_keys "Symfony\Component\HttpFoundation\ParameterBag") | | | [replace](#method_replace)(array $files = array()) Replaces the current parameters by a new set. | | | | [add](#method_add)(array $files = array()) Adds parameters. | | | mixed | [get](#method_get)(string $key, mixed $default = null) Returns a parameter by name. | from [ParameterBag](parameterbag#method_get "Symfony\Component\HttpFoundation\ParameterBag") | | | [set](#method_set)(string $key, mixed $value) Sets a parameter by name. | | | bool | [has](#method_has)(string $key) Returns true if the parameter is defined. | from [ParameterBag](parameterbag#method_has "Symfony\Component\HttpFoundation\ParameterBag") | | | [remove](#method_remove)(string $key) Removes a parameter. | from [ParameterBag](parameterbag#method_remove "Symfony\Component\HttpFoundation\ParameterBag") | | string | [getAlpha](#method_getAlpha)(string $key, string $default = '') Returns the alphabetic characters of the parameter value. | from [ParameterBag](parameterbag#method_getAlpha "Symfony\Component\HttpFoundation\ParameterBag") | | string | [getAlnum](#method_getAlnum)(string $key, string $default = '') Returns the alphabetic characters and digits of the parameter value. | from [ParameterBag](parameterbag#method_getAlnum "Symfony\Component\HttpFoundation\ParameterBag") | | string | [getDigits](#method_getDigits)(string $key, string $default = '') Returns the digits of the parameter value. | from [ParameterBag](parameterbag#method_getDigits "Symfony\Component\HttpFoundation\ParameterBag") | | int | [getInt](#method_getInt)(string $key, int $default = 0) Returns the parameter value converted to integer. | from [ParameterBag](parameterbag#method_getInt "Symfony\Component\HttpFoundation\ParameterBag") | | bool | [getBoolean](#method_getBoolean)(string $key, mixed $default = false) Returns the parameter value converted to boolean. | from [ParameterBag](parameterbag#method_getBoolean "Symfony\Component\HttpFoundation\ParameterBag") | | mixed | [filter](#method_filter)(string $key, mixed $default = null, int $filter = FILTER\_DEFAULT, mixed $options = array()) Filter key. | from [ParameterBag](parameterbag#method_filter "Symfony\Component\HttpFoundation\ParameterBag") | | [ArrayIterator](http://php.net/ArrayIterator) | [getIterator](#method_getIterator)() Returns an iterator for parameters. | from [ParameterBag](parameterbag#method_getIterator "Symfony\Component\HttpFoundation\ParameterBag") | | int | [count](#method_count)() Returns the number of parameters. | from [ParameterBag](parameterbag#method_count "Symfony\Component\HttpFoundation\ParameterBag") | | [UploadedFile](file/uploadedfile "Symfony\Component\HttpFoundation\File\UploadedFile")[]|[UploadedFile](file/uploadedfile "Symfony\Component\HttpFoundation\File\UploadedFile")|null | [convertFileInformation](#method_convertFileInformation)(array|[UploadedFile](file/uploadedfile "Symfony\Component\HttpFoundation\File\UploadedFile") $file) Converts uploaded files to UploadedFile instances. | | | array | [fixPhpFilesArray](#method_fixPhpFilesArray)($data) Fixes a malformed PHP $\_FILES array. | | Details ------- ### \_\_construct(array $parameters = array()) #### Parameters | | | | | --- | --- | --- | | array | $parameters | An array of parameters | ### array all() Returns the parameters. #### Return Value | | | | --- | --- | | array | An array of parameters | ### array keys() Returns the parameter keys. #### Return Value | | | | --- | --- | | array | An array of parameter keys | ### replace(array $files = array()) Replaces the current parameters by a new set. #### Parameters | | | | | --- | --- | --- | | array | $files | | ### add(array $files = array()) Adds parameters. #### Parameters | | | | | --- | --- | --- | | array | $files | | ### mixed get(string $key, mixed $default = null) Returns a parameter by name. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | mixed | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | mixed | | ### set(string $key, mixed $value) Sets a parameter by name. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | mixed | $value | The value | ### bool has(string $key) Returns true if the parameter is defined. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | #### Return Value | | | | --- | --- | | bool | true if the parameter exists, false otherwise | ### remove(string $key) Removes a parameter. #### Parameters | | | | | --- | --- | --- | | string | $key | The key | ### string getAlpha(string $key, string $default = '') Returns the alphabetic characters of the parameter value. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | string | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | string | The filtered value | ### string getAlnum(string $key, string $default = '') Returns the alphabetic characters and digits of the parameter value. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | string | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | string | The filtered value | ### string getDigits(string $key, string $default = '') Returns the digits of the parameter value. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | string | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | string | The filtered value | ### int getInt(string $key, int $default = 0) Returns the parameter value converted to integer. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | int | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | int | The filtered value | ### bool getBoolean(string $key, mixed $default = false) Returns the parameter value converted to boolean. #### Parameters | | | | | --- | --- | --- | | string | $key | The parameter key | | mixed | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | bool | The filtered value | ### mixed filter(string $key, mixed $default = null, int $filter = FILTER\_DEFAULT, mixed $options = array()) Filter key. #### Parameters | | | | | --- | --- | --- | | string | $key | Key | | mixed | $default | Default = null | | int | $filter | FILTER\_\* constant | | mixed | $options | Filter options | #### Return Value | | | | --- | --- | | mixed | | #### See also | | | | --- | --- | | <http://php.net/manual/en/function.filter-var.php> | | ### [ArrayIterator](http://php.net/ArrayIterator) getIterator() Returns an iterator for parameters. #### Return Value | | | | --- | --- | | [ArrayIterator](http://php.net/ArrayIterator) | An \ArrayIterator instance | ### int count() Returns the number of parameters. #### Return Value | | | | --- | --- | | int | The number of parameters | ### protected [UploadedFile](file/uploadedfile "Symfony\Component\HttpFoundation\File\UploadedFile")[]|[UploadedFile](file/uploadedfile "Symfony\Component\HttpFoundation\File\UploadedFile")|null convertFileInformation(array|[UploadedFile](file/uploadedfile "Symfony\Component\HttpFoundation\File\UploadedFile") $file) Converts uploaded files to UploadedFile instances. #### Parameters | | | | | --- | --- | --- | | array|[UploadedFile](file/uploadedfile "Symfony\Component\HttpFoundation\File\UploadedFile") | $file | A (multi-dimensional) array of uploaded file information | #### Return Value | | | | --- | --- | | [UploadedFile](file/uploadedfile "Symfony\Component\HttpFoundation\File\UploadedFile")[]|[UploadedFile](file/uploadedfile "Symfony\Component\HttpFoundation\File\UploadedFile")|null | A (multi-dimensional) array of UploadedFile instances | ### protected array fixPhpFilesArray($data) Fixes a malformed PHP $\_FILES array. PHP has a bug that the format of the $\_FILES array differs, depending on whether the uploaded file fields had normal field names or array-like field names ("normal" vs. "parent[child]"). This method fixes the array to look like the "normal" $\_FILES array. It's safe to pass an already converted array, in which case this method just returns the original array unmodified. #### Parameters | | | | | --- | --- | --- | | | $data | | #### Return Value | | | | --- | --- | | array | | symfony RedirectResponse RedirectResponse ================= class **RedirectResponse** extends [Response](response "Symfony\Component\HttpFoundation\Response") RedirectResponse represents an HTTP response doing a redirect. Constants --------- | | | | --- | --- | | HTTP\_CONTINUE | | | HTTP\_SWITCHING\_PROTOCOLS | | | HTTP\_PROCESSING | | | HTTP\_EARLY\_HINTS | | | HTTP\_OK | | | HTTP\_CREATED | | | HTTP\_ACCEPTED | | | HTTP\_NON\_AUTHORITATIVE\_INFORMATION | | | HTTP\_NO\_CONTENT | | | HTTP\_RESET\_CONTENT | | | HTTP\_PARTIAL\_CONTENT | | | HTTP\_MULTI\_STATUS | | | HTTP\_ALREADY\_REPORTED | | | HTTP\_IM\_USED | | | HTTP\_MULTIPLE\_CHOICES | | | HTTP\_MOVED\_PERMANENTLY | | | HTTP\_FOUND | | | HTTP\_SEE\_OTHER | | | HTTP\_NOT\_MODIFIED | | | HTTP\_USE\_PROXY | | | HTTP\_RESERVED | | | HTTP\_TEMPORARY\_REDIRECT | | | HTTP\_PERMANENTLY\_REDIRECT | | | HTTP\_BAD\_REQUEST | | | HTTP\_UNAUTHORIZED | | | HTTP\_PAYMENT\_REQUIRED | | | HTTP\_FORBIDDEN | | | HTTP\_NOT\_FOUND | | | HTTP\_METHOD\_NOT\_ALLOWED | | | HTTP\_NOT\_ACCEPTABLE | | | HTTP\_PROXY\_AUTHENTICATION\_REQUIRED | | | HTTP\_REQUEST\_TIMEOUT | | | HTTP\_CONFLICT | | | HTTP\_GONE | | | HTTP\_LENGTH\_REQUIRED | | | HTTP\_PRECONDITION\_FAILED | | | HTTP\_REQUEST\_ENTITY\_TOO\_LARGE | | | HTTP\_REQUEST\_URI\_TOO\_LONG | | | HTTP\_UNSUPPORTED\_MEDIA\_TYPE | | | HTTP\_REQUESTED\_RANGE\_NOT\_SATISFIABLE | | | HTTP\_EXPECTATION\_FAILED | | | HTTP\_I\_AM\_A\_TEAPOT | | | HTTP\_MISDIRECTED\_REQUEST | | | HTTP\_UNPROCESSABLE\_ENTITY | | | HTTP\_LOCKED | | | HTTP\_FAILED\_DEPENDENCY | | | HTTP\_RESERVED\_FOR\_WEBDAV\_ADVANCED\_COLLECTIONS\_EXPIRED\_PROPOSAL | | | HTTP\_TOO\_EARLY | | | HTTP\_UPGRADE\_REQUIRED | | | HTTP\_PRECONDITION\_REQUIRED | | | HTTP\_TOO\_MANY\_REQUESTS | | | HTTP\_REQUEST\_HEADER\_FIELDS\_TOO\_LARGE | | | HTTP\_UNAVAILABLE\_FOR\_LEGAL\_REASONS | | | HTTP\_INTERNAL\_SERVER\_ERROR | | | HTTP\_NOT\_IMPLEMENTED | | | HTTP\_BAD\_GATEWAY | | | HTTP\_SERVICE\_UNAVAILABLE | | | HTTP\_GATEWAY\_TIMEOUT | | | HTTP\_VERSION\_NOT\_SUPPORTED | | | HTTP\_VARIANT\_ALSO\_NEGOTIATES\_EXPERIMENTAL | | | HTTP\_INSUFFICIENT\_STORAGE | | | HTTP\_LOOP\_DETECTED | | | HTTP\_NOT\_EXTENDED | | | HTTP\_NETWORK\_AUTHENTICATION\_REQUIRED | | Properties ---------- | | | | | | --- | --- | --- | --- | | [ResponseHeaderBag](responseheaderbag "Symfony\Component\HttpFoundation\ResponseHeaderBag") | $headers | | from [Response](response#property_headers "Symfony\Component\HttpFoundation\Response") | | protected string | $content | | from [Response](response#property_content "Symfony\Component\HttpFoundation\Response") | | protected string | $version | | from [Response](response#property_version "Symfony\Component\HttpFoundation\Response") | | protected int | $statusCode | | from [Response](response#property_statusCode "Symfony\Component\HttpFoundation\Response") | | protected string | $statusText | | from [Response](response#property_statusText "Symfony\Component\HttpFoundation\Response") | | protected string | $charset | | from [Response](response#property_charset "Symfony\Component\HttpFoundation\Response") | | static array | $statusTexts | Status codes translation table. | from [Response](response#property_statusTexts "Symfony\Component\HttpFoundation\Response") | | protected | $targetUrl | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|null $url, int $status = 302, array $headers = array()) Creates a redirect response so that it conforms to the rules defined for a redirect status code. | | | static [Response](response "Symfony\Component\HttpFoundation\Response") | [create](#method_create)(string $url = '', int $status = 302, array $headers = array()) Factory method for chainability. | | | string | [\_\_toString](#method___toString)() Returns the Response as an HTTP string. | from [Response](response#method___toString "Symfony\Component\HttpFoundation\Response") | | | [\_\_clone](#method___clone)() Clones the current Response instance. | from [Response](response#method___clone "Symfony\Component\HttpFoundation\Response") | | $this | [prepare](#method_prepare)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Prepares the Response before it is sent to the client. | from [Response](response#method_prepare "Symfony\Component\HttpFoundation\Response") | | $this | [sendHeaders](#method_sendHeaders)() Sends HTTP headers. | from [Response](response#method_sendHeaders "Symfony\Component\HttpFoundation\Response") | | $this | [sendContent](#method_sendContent)() Sends content for the current web response. | from [Response](response#method_sendContent "Symfony\Component\HttpFoundation\Response") | | $this | [send](#method_send)() Sends HTTP headers and content. | from [Response](response#method_send "Symfony\Component\HttpFoundation\Response") | | $this | [setContent](#method_setContent)(mixed $content) Sets the response content. | from [Response](response#method_setContent "Symfony\Component\HttpFoundation\Response") | | string | [getContent](#method_getContent)() Gets the current response content. | from [Response](response#method_getContent "Symfony\Component\HttpFoundation\Response") | | $this | [setProtocolVersion](#method_setProtocolVersion)(string $version) Sets the HTTP protocol version (1.0 or 1.1). | from [Response](response#method_setProtocolVersion "Symfony\Component\HttpFoundation\Response") | | string | [getProtocolVersion](#method_getProtocolVersion)() Gets the HTTP protocol version. | from [Response](response#method_getProtocolVersion "Symfony\Component\HttpFoundation\Response") | | $this | [setStatusCode](#method_setStatusCode)(int $code, $text = null) Sets the response status code. | from [Response](response#method_setStatusCode "Symfony\Component\HttpFoundation\Response") | | int | [getStatusCode](#method_getStatusCode)() Retrieves the status code for the current web response. | from [Response](response#method_getStatusCode "Symfony\Component\HttpFoundation\Response") | | $this | [setCharset](#method_setCharset)(string $charset) Sets the response charset. | from [Response](response#method_setCharset "Symfony\Component\HttpFoundation\Response") | | string|null | [getCharset](#method_getCharset)() Retrieves the response charset. | from [Response](response#method_getCharset "Symfony\Component\HttpFoundation\Response") | | bool | [isCacheable](#method_isCacheable)() Returns true if the response may safely be kept in a shared (surrogate) cache. | from [Response](response#method_isCacheable "Symfony\Component\HttpFoundation\Response") | | bool | [isFresh](#method_isFresh)() Returns true if the response is "fresh". | from [Response](response#method_isFresh "Symfony\Component\HttpFoundation\Response") | | bool | [isValidateable](#method_isValidateable)() Returns true if the response includes headers that can be used to validate the response with the origin server using a conditional GET request. | from [Response](response#method_isValidateable "Symfony\Component\HttpFoundation\Response") | | $this | [setPrivate](#method_setPrivate)() Marks the response as "private". | from [Response](response#method_setPrivate "Symfony\Component\HttpFoundation\Response") | | $this | [setPublic](#method_setPublic)() Marks the response as "public". | from [Response](response#method_setPublic "Symfony\Component\HttpFoundation\Response") | | $this | [setImmutable](#method_setImmutable)(bool $immutable = true) Marks the response as "immutable". | from [Response](response#method_setImmutable "Symfony\Component\HttpFoundation\Response") | | bool | [isImmutable](#method_isImmutable)() Returns true if the response is marked as "immutable". | from [Response](response#method_isImmutable "Symfony\Component\HttpFoundation\Response") | | bool | [mustRevalidate](#method_mustRevalidate)() Returns true if the response must be revalidated by caches. | from [Response](response#method_mustRevalidate "Symfony\Component\HttpFoundation\Response") | | DateTimeInterface|null | [getDate](#method_getDate)() Returns the Date header as a DateTime instance. | from [Response](response#method_getDate "Symfony\Component\HttpFoundation\Response") | | $this | [setDate](#method_setDate)([DateTimeInterface](http://php.net/DateTimeInterface) $date) Sets the Date header. | from [Response](response#method_setDate "Symfony\Component\HttpFoundation\Response") | | int | [getAge](#method_getAge)() Returns the age of the response in seconds. | from [Response](response#method_getAge "Symfony\Component\HttpFoundation\Response") | | $this | [expire](#method_expire)() Marks the response stale by setting the Age header to be equal to the maximum age of the response. | from [Response](response#method_expire "Symfony\Component\HttpFoundation\Response") | | DateTimeInterface|null | [getExpires](#method_getExpires)() Returns the value of the Expires header as a DateTime instance. | from [Response](response#method_getExpires "Symfony\Component\HttpFoundation\Response") | | $this | [setExpires](#method_setExpires)([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Expires HTTP header with a DateTime instance. | from [Response](response#method_setExpires "Symfony\Component\HttpFoundation\Response") | | int|null | [getMaxAge](#method_getMaxAge)() Returns the number of seconds after the time specified in the response's Date header when the response should no longer be considered fresh. | from [Response](response#method_getMaxAge "Symfony\Component\HttpFoundation\Response") | | $this | [setMaxAge](#method_setMaxAge)(int $value) Sets the number of seconds after which the response should no longer be considered fresh. | from [Response](response#method_setMaxAge "Symfony\Component\HttpFoundation\Response") | | $this | [setSharedMaxAge](#method_setSharedMaxAge)(int $value) Sets the number of seconds after which the response should no longer be considered fresh by shared caches. | from [Response](response#method_setSharedMaxAge "Symfony\Component\HttpFoundation\Response") | | int|null | [getTtl](#method_getTtl)() Returns the response's time-to-live in seconds. | from [Response](response#method_getTtl "Symfony\Component\HttpFoundation\Response") | | $this | [setTtl](#method_setTtl)(int $seconds) Sets the response's time-to-live for shared caches in seconds. | from [Response](response#method_setTtl "Symfony\Component\HttpFoundation\Response") | | $this | [setClientTtl](#method_setClientTtl)(int $seconds) Sets the response's time-to-live for private/client caches in seconds. | from [Response](response#method_setClientTtl "Symfony\Component\HttpFoundation\Response") | | DateTimeInterface|null | [getLastModified](#method_getLastModified)() Returns the Last-Modified HTTP header as a DateTime instance. | from [Response](response#method_getLastModified "Symfony\Component\HttpFoundation\Response") | | $this | [setLastModified](#method_setLastModified)([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Last-Modified HTTP header with a DateTime instance. | from [Response](response#method_setLastModified "Symfony\Component\HttpFoundation\Response") | | string|null | [getEtag](#method_getEtag)() Returns the literal value of the ETag HTTP header. | from [Response](response#method_getEtag "Symfony\Component\HttpFoundation\Response") | | $this | [setEtag](#method_setEtag)(string $etag = null, bool $weak = false) Sets the ETag value. | from [Response](response#method_setEtag "Symfony\Component\HttpFoundation\Response") | | $this | [setCache](#method_setCache)(array $options) Sets the response's cache headers (validation and/or expiration). | from [Response](response#method_setCache "Symfony\Component\HttpFoundation\Response") | | $this | [setNotModified](#method_setNotModified)() Modifies the response so that it conforms to the rules defined for a 304 status code. | from [Response](response#method_setNotModified "Symfony\Component\HttpFoundation\Response") | | bool | [hasVary](#method_hasVary)() Returns true if the response includes a Vary header. | from [Response](response#method_hasVary "Symfony\Component\HttpFoundation\Response") | | array | [getVary](#method_getVary)() Returns an array of header names given in the Vary header. | from [Response](response#method_getVary "Symfony\Component\HttpFoundation\Response") | | $this | [setVary](#method_setVary)(string|array $headers, bool $replace = true) Sets the Vary header. | from [Response](response#method_setVary "Symfony\Component\HttpFoundation\Response") | | bool | [isNotModified](#method_isNotModified)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Determines if the Response validators (ETag, Last-Modified) match a conditional value specified in the Request. | from [Response](response#method_isNotModified "Symfony\Component\HttpFoundation\Response") | | bool | [isInvalid](#method_isInvalid)() Is response invalid? | from [Response](response#method_isInvalid "Symfony\Component\HttpFoundation\Response") | | bool | [isInformational](#method_isInformational)() Is response informative? | from [Response](response#method_isInformational "Symfony\Component\HttpFoundation\Response") | | bool | [isSuccessful](#method_isSuccessful)() Is response successful? | from [Response](response#method_isSuccessful "Symfony\Component\HttpFoundation\Response") | | bool | [isRedirection](#method_isRedirection)() Is the response a redirect? | from [Response](response#method_isRedirection "Symfony\Component\HttpFoundation\Response") | | bool | [isClientError](#method_isClientError)() Is there a client error? | from [Response](response#method_isClientError "Symfony\Component\HttpFoundation\Response") | | bool | [isServerError](#method_isServerError)() Was there a server side error? | from [Response](response#method_isServerError "Symfony\Component\HttpFoundation\Response") | | bool | [isOk](#method_isOk)() Is the response OK? | from [Response](response#method_isOk "Symfony\Component\HttpFoundation\Response") | | bool | [isForbidden](#method_isForbidden)() Is the response forbidden? | from [Response](response#method_isForbidden "Symfony\Component\HttpFoundation\Response") | | bool | [isNotFound](#method_isNotFound)() Is the response a not found error? | from [Response](response#method_isNotFound "Symfony\Component\HttpFoundation\Response") | | bool | [isRedirect](#method_isRedirect)(string $location = null) Is the response a redirect of some form? | from [Response](response#method_isRedirect "Symfony\Component\HttpFoundation\Response") | | bool | [isEmpty](#method_isEmpty)() Is the response empty? | from [Response](response#method_isEmpty "Symfony\Component\HttpFoundation\Response") | | static | [closeOutputBuffers](#method_closeOutputBuffers)(int $targetLevel, bool $flush) Cleans or flushes output buffers up to target level. | from [Response](response#method_closeOutputBuffers "Symfony\Component\HttpFoundation\Response") | | | [ensureIEOverSSLCompatibility](#method_ensureIEOverSSLCompatibility)([Request](request "Symfony\Component\HttpFoundation\Request") $request) Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9. | from [Response](response#method_ensureIEOverSSLCompatibility "Symfony\Component\HttpFoundation\Response") | | string | [getTargetUrl](#method_getTargetUrl)() Returns the target URL. | | | $this | [setTargetUrl](#method_setTargetUrl)(string $url) Sets the redirect target of this response. | | Details ------- ### \_\_construct(string|null $url, int $status = 302, array $headers = array()) Creates a redirect response so that it conforms to the rules defined for a redirect status code. #### Parameters | | | | | --- | --- | --- | | string|null | $url | The URL to redirect to. The URL should be a full URL, with schema etc., but practically every browser redirects on paths only as well | | int | $status | | | array | $headers | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | #### See also | | | | --- | --- | | <http://tools.ietf.org/html/rfc2616#section-10.3> | | ### static [Response](response "Symfony\Component\HttpFoundation\Response") create(string $url = '', int $status = 302, array $headers = array()) Factory method for chainability. #### Parameters | | | | | --- | --- | --- | | string | $url | The url to redirect to | | int | $status | The response status code | | array | $headers | An array of response headers | #### Return Value | | | | --- | --- | | [Response](response "Symfony\Component\HttpFoundation\Response") | | ### string \_\_toString() Returns the Response as an HTTP string. The string representation of the Response is the same as the one that will be sent to the client only if the prepare() method has been called before. #### Return Value | | | | --- | --- | | string | The Response as an HTTP string | #### See also | | | | --- | --- | | prepare() | | ### \_\_clone() Clones the current Response instance. ### $this prepare([Request](request "Symfony\Component\HttpFoundation\Request") $request) Prepares the Response before it is sent to the client. This method tweaks the Response to ensure that it is compliant with RFC 2616. Most of the changes are based on the Request that is "associated" with this Response. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | $this | | ### $this sendHeaders() Sends HTTP headers. #### Return Value | | | | --- | --- | | $this | | ### $this sendContent() Sends content for the current web response. #### Return Value | | | | --- | --- | | $this | | ### $this send() Sends HTTP headers and content. #### Return Value | | | | --- | --- | | $this | | ### $this setContent(mixed $content) Sets the response content. Valid types are strings, numbers, null, and objects that implement a \_\_toString() method. #### Parameters | | | | | --- | --- | --- | | mixed | $content | Content that can be cast to string | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [UnexpectedValueException](http://php.net/UnexpectedValueException) | | ### string getContent() Gets the current response content. #### Return Value | | | | --- | --- | | string | Content | ### $this setProtocolVersion(string $version) Sets the HTTP protocol version (1.0 or 1.1). #### Parameters | | | | | --- | --- | --- | | string | $version | | #### Return Value | | | | --- | --- | | $this | | ### string getProtocolVersion() Gets the HTTP protocol version. #### Return Value | | | | --- | --- | | string | | ### $this setStatusCode(int $code, $text = null) Sets the response status code. If the status text is null it will be automatically populated for the known status codes and left empty otherwise. #### Parameters | | | | | --- | --- | --- | | int | $code | | | | $text | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When the HTTP status code is not valid | ### int getStatusCode() Retrieves the status code for the current web response. #### Return Value | | | | --- | --- | | int | | ### $this setCharset(string $charset) Sets the response charset. #### Parameters | | | | | --- | --- | --- | | string | $charset | | #### Return Value | | | | --- | --- | | $this | | ### string|null getCharset() Retrieves the response charset. #### Return Value | | | | --- | --- | | string|null | | ### bool isCacheable() Returns true if the response may safely be kept in a shared (surrogate) cache. Responses marked "private" with an explicit Cache-Control directive are considered uncacheable. Responses with neither a freshness lifetime (Expires, max-age) nor cache validator (Last-Modified, ETag) are considered uncacheable because there is no way to tell when or how to remove them from the cache. Note that RFC 7231 and RFC 7234 possibly allow for a more permissive implementation, for example "status codes that are defined as cacheable by default [...] can be reused by a cache with heuristic expiration unless otherwise indicated" (https://tools.ietf.org/html/rfc7231#section-6.1) #### Return Value | | | | --- | --- | | bool | | ### bool isFresh() Returns true if the response is "fresh". Fresh responses may be served from cache without any interaction with the origin. A response is considered fresh when it includes a Cache-Control/max-age indicator or Expires header and the calculated age is less than the freshness lifetime. #### Return Value | | | | --- | --- | | bool | | ### bool isValidateable() Returns true if the response includes headers that can be used to validate the response with the origin server using a conditional GET request. #### Return Value | | | | --- | --- | | bool | | ### $this setPrivate() Marks the response as "private". It makes the response ineligible for serving other clients. #### Return Value | | | | --- | --- | | $this | | ### $this setPublic() Marks the response as "public". It makes the response eligible for serving other clients. #### Return Value | | | | --- | --- | | $this | | ### $this setImmutable(bool $immutable = true) Marks the response as "immutable". #### Parameters | | | | | --- | --- | --- | | bool | $immutable | | #### Return Value | | | | --- | --- | | $this | | ### bool isImmutable() Returns true if the response is marked as "immutable". #### Return Value | | | | --- | --- | | bool | | ### bool mustRevalidate() Returns true if the response must be revalidated by caches. This method indicates that the response must not be served stale by a cache in any circumstance without first revalidating with the origin. When present, the TTL of the response should not be overridden to be greater than the value provided by the origin. #### Return Value | | | | --- | --- | | bool | | ### DateTimeInterface|null getDate() Returns the Date header as a DateTime instance. #### Return Value | | | | --- | --- | | DateTimeInterface|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When the header is not parseable | ### $this setDate([DateTimeInterface](http://php.net/DateTimeInterface) $date) Sets the Date header. #### Parameters | | | | | --- | --- | --- | | [DateTimeInterface](http://php.net/DateTimeInterface) | $date | | #### Return Value | | | | --- | --- | | $this | | ### int getAge() Returns the age of the response in seconds. #### Return Value | | | | --- | --- | | int | | ### $this expire() Marks the response stale by setting the Age header to be equal to the maximum age of the response. #### Return Value | | | | --- | --- | | $this | | ### DateTimeInterface|null getExpires() Returns the value of the Expires header as a DateTime instance. #### Return Value | | | | --- | --- | | DateTimeInterface|null | | ### $this setExpires([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Expires HTTP header with a DateTime instance. Passing null as value will remove the header. #### Parameters | | | | | --- | --- | --- | | [DateTimeInterface](http://php.net/DateTimeInterface) | $date | | #### Return Value | | | | --- | --- | | $this | | ### int|null getMaxAge() Returns the number of seconds after the time specified in the response's Date header when the response should no longer be considered fresh. First, it checks for a s-maxage directive, then a max-age directive, and then it falls back on an expires header. It returns null when no maximum age can be established. #### Return Value | | | | --- | --- | | int|null | | ### $this setMaxAge(int $value) Sets the number of seconds after which the response should no longer be considered fresh. This methods sets the Cache-Control max-age directive. #### Parameters | | | | | --- | --- | --- | | int | $value | | #### Return Value | | | | --- | --- | | $this | | ### $this setSharedMaxAge(int $value) Sets the number of seconds after which the response should no longer be considered fresh by shared caches. This methods sets the Cache-Control s-maxage directive. #### Parameters | | | | | --- | --- | --- | | int | $value | | #### Return Value | | | | --- | --- | | $this | | ### int|null getTtl() Returns the response's time-to-live in seconds. It returns null when no freshness information is present in the response. When the responses TTL is <= 0, the response may not be served from cache without first revalidating with the origin. #### Return Value | | | | --- | --- | | int|null | | ### $this setTtl(int $seconds) Sets the response's time-to-live for shared caches in seconds. This method adjusts the Cache-Control/s-maxage directive. #### Parameters | | | | | --- | --- | --- | | int | $seconds | | #### Return Value | | | | --- | --- | | $this | | ### $this setClientTtl(int $seconds) Sets the response's time-to-live for private/client caches in seconds. This method adjusts the Cache-Control/max-age directive. #### Parameters | | | | | --- | --- | --- | | int | $seconds | | #### Return Value | | | | --- | --- | | $this | | ### DateTimeInterface|null getLastModified() Returns the Last-Modified HTTP header as a DateTime instance. #### Return Value | | | | --- | --- | | DateTimeInterface|null | | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | When the HTTP header is not parseable | ### $this setLastModified([DateTimeInterface](http://php.net/DateTimeInterface) $date = null) Sets the Last-Modified HTTP header with a DateTime instance. Passing null as value will remove the header. #### Parameters | | | | | --- | --- | --- | | [DateTimeInterface](http://php.net/DateTimeInterface) | $date | | #### Return Value | | | | --- | --- | | $this | | ### string|null getEtag() Returns the literal value of the ETag HTTP header. #### Return Value | | | | --- | --- | | string|null | | ### $this setEtag(string $etag = null, bool $weak = false) Sets the ETag value. #### Parameters | | | | | --- | --- | --- | | string | $etag | The ETag unique identifier or null to remove the header | | bool | $weak | Whether you want a weak ETag or not | #### Return Value | | | | --- | --- | | $this | | ### $this setCache(array $options) Sets the response's cache headers (validation and/or expiration). Available options are: etag, last\_modified, max\_age, s\_maxage, private, public and immutable. #### Parameters | | | | | --- | --- | --- | | array | $options | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### $this setNotModified() Modifies the response so that it conforms to the rules defined for a 304 status code. This sets the status, removes the body, and discards any headers that MUST NOT be included in 304 responses. #### Return Value | | | | --- | --- | | $this | | #### See also | | | | --- | --- | | <http://tools.ietf.org/html/rfc2616#section-10.3.5> | | ### bool hasVary() Returns true if the response includes a Vary header. #### Return Value | | | | --- | --- | | bool | | ### array getVary() Returns an array of header names given in the Vary header. #### Return Value | | | | --- | --- | | array | | ### $this setVary(string|array $headers, bool $replace = true) Sets the Vary header. #### Parameters | | | | | --- | --- | --- | | string|array | $headers | | | bool | $replace | Whether to replace the actual value or not (true by default) | #### Return Value | | | | --- | --- | | $this | | ### bool isNotModified([Request](request "Symfony\Component\HttpFoundation\Request") $request) Determines if the Response validators (ETag, Last-Modified) match a conditional value specified in the Request. If the Response is not modified, it sets the status code to 304 and removes the actual content by calling the setNotModified() method. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | bool | true if the Response validators match the Request, false otherwise | ### bool isInvalid() Is response invalid? #### Return Value | | | | --- | --- | | bool | | #### See also | | | | --- | --- | | <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html> | | ### bool isInformational() Is response informative? #### Return Value | | | | --- | --- | | bool | | ### bool isSuccessful() Is response successful? #### Return Value | | | | --- | --- | | bool | | ### bool isRedirection() Is the response a redirect? #### Return Value | | | | --- | --- | | bool | | ### bool isClientError() Is there a client error? #### Return Value | | | | --- | --- | | bool | | ### bool isServerError() Was there a server side error? #### Return Value | | | | --- | --- | | bool | | ### bool isOk() Is the response OK? #### Return Value | | | | --- | --- | | bool | | ### bool isForbidden() Is the response forbidden? #### Return Value | | | | --- | --- | | bool | | ### bool isNotFound() Is the response a not found error? #### Return Value | | | | --- | --- | | bool | | ### bool isRedirect(string $location = null) Is the response a redirect of some form? #### Parameters | | | | | --- | --- | --- | | string | $location | | #### Return Value | | | | --- | --- | | bool | | ### bool isEmpty() Is the response empty? #### Return Value | | | | --- | --- | | bool | | ### static closeOutputBuffers(int $targetLevel, bool $flush) Cleans or flushes output buffers up to target level. Resulting level can be greater than target level if a non-removable buffer has been encountered. #### Parameters | | | | | --- | --- | --- | | int | $targetLevel | | | bool | $flush | | ### protected ensureIEOverSSLCompatibility([Request](request "Symfony\Component\HttpFoundation\Request") $request) Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9. #### Parameters | | | | | --- | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | $request | | #### See also | | | | --- | --- | | <http://support.microsoft.com/kb/323308> | | ### string getTargetUrl() Returns the target URL. #### Return Value | | | | --- | --- | | string | target URL | ### $this setTargetUrl(string $url) Sets the redirect target of this response. #### Parameters | | | | | --- | --- | --- | | string | $url | The URL to redirect to | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | |
programming_docs
symfony Cookie Cookie ======= class **Cookie** Represents a cookie. Constants --------- | | | | --- | --- | | SAMESITE\_LAX | | | SAMESITE\_STRICT | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $name | | | | protected | $value | | | | protected | $domain | | | | protected | $expire | | | | protected | $path | | | | protected | $secure | | | | protected | $httpOnly | | | Methods ------- | | | | | --- | --- | --- | | static [Cookie](cookie "Symfony\Component\HttpFoundation\Cookie") | [fromString](#method_fromString)(string $cookie, bool $decode = false) Creates cookie from raw header string. | | | | [\_\_construct](#method___construct)(string $name, string $value = null, int|string|[DateTimeInterface](http://php.net/DateTimeInterface) $expire = 0, string|null $path = '/', string $domain = null, bool $secure = false, bool $httpOnly = true, bool $raw = false, string $sameSite = null) | | | string | [\_\_toString](#method___toString)() Returns the cookie as a string. | | | string | [getName](#method_getName)() Gets the name of the cookie. | | | string|null | [getValue](#method_getValue)() Gets the value of the cookie. | | | string|null | [getDomain](#method_getDomain)() Gets the domain that the cookie is available to. | | | int | [getExpiresTime](#method_getExpiresTime)() Gets the time the cookie expires. | | | int | [getMaxAge](#method_getMaxAge)() Gets the max-age attribute. | | | string | [getPath](#method_getPath)() Gets the path on the server in which the cookie will be available on. | | | bool | [isSecure](#method_isSecure)() Checks whether the cookie should only be transmitted over a secure HTTPS connection from the client. | | | bool | [isHttpOnly](#method_isHttpOnly)() Checks whether the cookie will be made accessible only through the HTTP protocol. | | | bool | [isCleared](#method_isCleared)() Whether this cookie is about to be cleared. | | | bool | [isRaw](#method_isRaw)() Checks if the cookie value should be sent with no url encoding. | | | string|null | [getSameSite](#method_getSameSite)() Gets the SameSite attribute. | | Details ------- ### static [Cookie](cookie "Symfony\Component\HttpFoundation\Cookie") fromString(string $cookie, bool $decode = false) Creates cookie from raw header string. #### Parameters | | | | | --- | --- | --- | | string | $cookie | | | bool | $decode | | #### Return Value | | | | --- | --- | | [Cookie](cookie "Symfony\Component\HttpFoundation\Cookie") | | ### \_\_construct(string $name, string $value = null, int|string|[DateTimeInterface](http://php.net/DateTimeInterface) $expire = 0, string|null $path = '/', string $domain = null, bool $secure = false, bool $httpOnly = true, bool $raw = false, string $sameSite = null) #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the cookie | | string | $value | The value of the cookie | | int|string|[DateTimeInterface](http://php.net/DateTimeInterface) | $expire | The time the cookie expires | | string|null | $path | The path on the server in which the cookie will be available on | | string | $domain | The domain that the cookie is available to | | bool | $secure | Whether the cookie should only be transmitted over a secure HTTPS connection from the client | | bool | $httpOnly | Whether the cookie will be made accessible only through the HTTP protocol | | bool | $raw | Whether the cookie value should be sent with no url encoding | | string | $sameSite | Whether the cookie will be available for cross-site requests | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### string \_\_toString() Returns the cookie as a string. #### Return Value | | | | --- | --- | | string | The cookie | ### string getName() Gets the name of the cookie. #### Return Value | | | | --- | --- | | string | | ### string|null getValue() Gets the value of the cookie. #### Return Value | | | | --- | --- | | string|null | | ### string|null getDomain() Gets the domain that the cookie is available to. #### Return Value | | | | --- | --- | | string|null | | ### int getExpiresTime() Gets the time the cookie expires. #### Return Value | | | | --- | --- | | int | | ### int getMaxAge() Gets the max-age attribute. #### Return Value | | | | --- | --- | | int | | ### string getPath() Gets the path on the server in which the cookie will be available on. #### Return Value | | | | --- | --- | | string | | ### bool isSecure() Checks whether the cookie should only be transmitted over a secure HTTPS connection from the client. #### Return Value | | | | --- | --- | | bool | | ### bool isHttpOnly() Checks whether the cookie will be made accessible only through the HTTP protocol. #### Return Value | | | | --- | --- | | bool | | ### bool isCleared() Whether this cookie is about to be cleared. #### Return Value | | | | --- | --- | | bool | | ### bool isRaw() Checks if the cookie value should be sent with no url encoding. #### Return Value | | | | --- | --- | | bool | | ### string|null getSameSite() Gets the SameSite attribute. #### Return Value | | | | --- | --- | | string|null | | symfony Symfony\Component\HttpFoundation\Session Symfony\Component\HttpFoundation\Session ======================================== Namespaces ---------- [Symfony\Component\HttpFoundation\Session\Attribute](session/attribute)[Symfony\Component\HttpFoundation\Session\Flash](session/flash)[Symfony\Component\HttpFoundation\Session\Storage](session/storage) Classes ------- | | | | --- | --- | | [Session](session/session "Symfony\Component\HttpFoundation\Session\Session") | | | [SessionBagProxy](session/sessionbagproxy "Symfony\Component\HttpFoundation\Session\SessionBagProxy") | | Interfaces ---------- | | | | --- | --- | | *[SessionBagInterface](session/sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface")* | Session Bag store. | | *[SessionInterface](session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface")* | Interface for the session. | symfony HeaderUtils HeaderUtils ============ class **HeaderUtils** HTTP header utility functions. Methods ------- | | | | | --- | --- | --- | | static array | [split](#method_split)(string $header, string $separators) Splits an HTTP header by one or more separators. | | | static array | [combine](#method_combine)(array $parts) Combines an array of arrays into one associative array. | | | static string | [toString](#method_toString)(array $assoc, string $separator) Joins an associative array into a string for use in an HTTP header. | | | static string | [quote](#method_quote)(string $s) Encodes a string as a quoted string, if necessary. | | | static string | [unquote](#method_unquote)(string $s) Decodes a quoted string. | | Details ------- ### static array split(string $header, string $separators) Splits an HTTP header by one or more separators. Example: ``` HeaderUtils::split("da, en-gb;q=0.8", ",;") // => array(array('da'), array('en-gb', 'q=0.8')) ``` #### Parameters | | | | | --- | --- | --- | | string | $header | HTTP header value | | string | $separators | List of characters to split on, ordered by precedence, e.g. ",", ";=", or ",;=" | #### Return Value | | | | --- | --- | | array | Nested array with as many levels as there are characters in $separators | ### static array combine(array $parts) Combines an array of arrays into one associative array. Each of the nested arrays should have one or two elements. The first value will be used as the keys in the associative array, and the second will be used as the values, or true if the nested array only contains one element. Array keys are lowercased. Example: ``` HeaderUtils::combine(array(array("foo", "abc"), array("bar"))) // => array("foo" => "abc", "bar" => true) ``` #### Parameters | | | | | --- | --- | --- | | array | $parts | | #### Return Value | | | | --- | --- | | array | | ### static string toString(array $assoc, string $separator) Joins an associative array into a string for use in an HTTP header. The key and value of each entry are joined with "=", and all entries are joined with the specified separator and an additional space (for readability). Values are quoted if necessary. Example: ``` HeaderUtils::toString(array("foo" => "abc", "bar" => true, "baz" => "a b c"), ",") // => 'foo=abc, bar, baz="a b c"' ``` #### Parameters | | | | | --- | --- | --- | | array | $assoc | | | string | $separator | | #### Return Value | | | | --- | --- | | string | | ### static string quote(string $s) Encodes a string as a quoted string, if necessary. If a string contains characters not allowed by the "token" construct in the HTTP specification, it is backslash-escaped and enclosed in quotes to match the "quoted-string" construct. #### Parameters | | | | | --- | --- | --- | | string | $s | | #### Return Value | | | | --- | --- | | string | | ### static string unquote(string $s) Decodes a quoted string. If passed an unquoted string that matches the "token" construct (as defined in the HTTP specification), it is passed through verbatimly. #### Parameters | | | | | --- | --- | --- | | string | $s | | #### Return Value | | | | --- | --- | | string | | symfony Request Request ======== class **Request** Request represents an HTTP request. The methods dealing with URL accept / return a raw path (% encoded): \* getBasePath \* getBaseUrl \* getPathInfo \* getRequestUri \* getUri \* getUriForPath Constants --------- | | | | --- | --- | | HEADER\_FORWARDED | | | HEADER\_X\_FORWARDED\_FOR | | | HEADER\_X\_FORWARDED\_HOST | | | HEADER\_X\_FORWARDED\_PROTO | | | HEADER\_X\_FORWARDED\_PORT | | | HEADER\_X\_FORWARDED\_ALL | | | HEADER\_X\_FORWARDED\_AWS\_ELB | | | METHOD\_HEAD | | | METHOD\_GET | | | METHOD\_POST | | | METHOD\_PUT | | | METHOD\_PATCH | | | METHOD\_DELETE | | | METHOD\_PURGE | | | METHOD\_OPTIONS | | | METHOD\_TRACE | | | METHOD\_CONNECT | | Properties ---------- | | | | | | --- | --- | --- | --- | | static protected string[] | $trustedProxies | | | | static protected string[] | $trustedHostPatterns | | | | static protected string[] | $trustedHosts | | | | static protected | $httpMethodParameterOverride | | | | [ParameterBag](parameterbag "Symfony\Component\HttpFoundation\ParameterBag") | $attributes | Custom parameters. | | | [ParameterBag](parameterbag "Symfony\Component\HttpFoundation\ParameterBag") | $request | Request body parameters ($\_POST). | | | [ParameterBag](parameterbag "Symfony\Component\HttpFoundation\ParameterBag") | $query | Query string parameters ($\_GET). | | | [ServerBag](serverbag "Symfony\Component\HttpFoundation\ServerBag") | $server | Server and execution environment parameters ($\_SERVER). | | | [FileBag](filebag "Symfony\Component\HttpFoundation\FileBag") | $files | Uploaded files ($\_FILES). | | | [ParameterBag](parameterbag "Symfony\Component\HttpFoundation\ParameterBag") | $cookies | Cookies ($\_COOKIE). | | | [HeaderBag](headerbag "Symfony\Component\HttpFoundation\HeaderBag") | $headers | Headers (taken from the $\_SERVER). | | | protected string|resource|false|null | $content | | | | protected array | $languages | | | | protected array | $charsets | | | | protected array | $encodings | | | | protected array | $acceptableContentTypes | | | | protected string | $pathInfo | | | | protected string | $requestUri | | | | protected string | $baseUrl | | | | protected string | $basePath | | | | protected string | $method | | | | protected string | $format | | | | protected [SessionInterface](session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface") | $session | | | | protected string | $locale | | | | protected string | $defaultLocale | | | | static protected array | $formats | | | | static protected | $requestFactory | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), string|resource|null $content = null) | | | | [initialize](#method_initialize)(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), string|resource|null $content = null) Sets the parameters for this request. | | | static [Request](request "Symfony\Component\HttpFoundation\Request") | [createFromGlobals](#method_createFromGlobals)() Creates a new request with values from PHP's super globals. | | | static [Request](request "Symfony\Component\HttpFoundation\Request") | [create](#method_create)(string $uri, string $method = 'GET', array $parameters = array(), array $cookies = array(), array $files = array(), array $server = array(), string|resource|null $content = null) Creates a Request based on a given URI and configuration. | | | static | [setFactory](#method_setFactory)(callable|null $callable) Sets a callable able to create a Request instance. | | | [Request](request "Symfony\Component\HttpFoundation\Request") | [duplicate](#method_duplicate)(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) Clones a request and overrides some of its parameters. | | | | [\_\_clone](#method___clone)() Clones the current request. | | | string | [\_\_toString](#method___toString)() Returns the request as a string. | | | | [overrideGlobals](#method_overrideGlobals)() Overrides the PHP global variables according to this request instance. | | | static | [setTrustedProxies](#method_setTrustedProxies)(array $proxies, int $trustedHeaderSet) Sets a list of trusted proxies. | | | static array | [getTrustedProxies](#method_getTrustedProxies)() Gets the list of trusted proxies. | | | static int | [getTrustedHeaderSet](#method_getTrustedHeaderSet)() Gets the set of trusted headers from trusted proxies. | | | static | [setTrustedHosts](#method_setTrustedHosts)(array $hostPatterns) Sets a list of trusted host patterns. | | | static array | [getTrustedHosts](#method_getTrustedHosts)() Gets the list of trusted host patterns. | | | static string | [normalizeQueryString](#method_normalizeQueryString)(string $qs) Normalizes a query string. | | | static | [enableHttpMethodParameterOverride](#method_enableHttpMethodParameterOverride)() Enables support for the \_method request parameter to determine the intended HTTP method. | | | static bool | [getHttpMethodParameterOverride](#method_getHttpMethodParameterOverride)() Checks whether support for the \_method request parameter is enabled. | | | mixed | [get](#method_get)(string $key, mixed $default = null) Gets a "parameter" value from any bag. | | | [SessionInterface](session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface")|null | [getSession](#method_getSession)() Gets the Session. | | | bool | [hasPreviousSession](#method_hasPreviousSession)() Whether the request contains a Session which was started in one of the previous requests. | | | bool | [hasSession](#method_hasSession)() Whether the request contains a Session object. | | | | [setSession](#method_setSession)([SessionInterface](session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface") $session) Sets the Session. | | | | [setSessionFactory](#method_setSessionFactory)(callable $factory) | | | array | [getClientIps](#method_getClientIps)() Returns the client IP addresses. | | | string|null | [getClientIp](#method_getClientIp)() Returns the client IP address. | | | string | [getScriptName](#method_getScriptName)() Returns current script name. | | | string | [getPathInfo](#method_getPathInfo)() Returns the path being requested relative to the executed script. | | | string | [getBasePath](#method_getBasePath)() Returns the root path from which this request is executed. | | | string | [getBaseUrl](#method_getBaseUrl)() Returns the root URL from which this request is executed. | | | string | [getScheme](#method_getScheme)() Gets the request's scheme. | | | int|string | [getPort](#method_getPort)() Returns the port on which the request is made. | | | string|null | [getUser](#method_getUser)() Returns the user. | | | string|null | [getPassword](#method_getPassword)() Returns the password. | | | string | [getUserInfo](#method_getUserInfo)() Gets the user info. | | | string | [getHttpHost](#method_getHttpHost)() Returns the HTTP host being requested. | | | string | [getRequestUri](#method_getRequestUri)() Returns the requested URI (path and query string). | | | string | [getSchemeAndHttpHost](#method_getSchemeAndHttpHost)() Gets the scheme and HTTP host. | | | string | [getUri](#method_getUri)() Generates a normalized URI (URL) for the Request. | | | string | [getUriForPath](#method_getUriForPath)(string $path) Generates a normalized URI for the given path. | | | string | [getRelativeUriForPath](#method_getRelativeUriForPath)(string $path) Returns the path as relative reference from the current Request path. | | | string|null | [getQueryString](#method_getQueryString)() Generates the normalized query string for the Request. | | | bool | [isSecure](#method_isSecure)() Checks whether the request is secure or not. | | | string | [getHost](#method_getHost)() Returns the host name. | | | | [setMethod](#method_setMethod)(string $method) Sets the request method. | | | string | [getMethod](#method_getMethod)() Gets the request "intended" method. | | | string | [getRealMethod](#method_getRealMethod)() Gets the "real" request method. | | | string|null | [getMimeType](#method_getMimeType)(string $format) Gets the mime type associated with the format. | | | static array | [getMimeTypes](#method_getMimeTypes)(string $format) Gets the mime types associated with the format. | | | string|null | [getFormat](#method_getFormat)(string $mimeType) Gets the format associated with the mime type. | | | | [setFormat](#method_setFormat)(string $format, string|array $mimeTypes) Associates a format with mime types. | | | string | [getRequestFormat](#method_getRequestFormat)(string|null $default = 'html') Gets the request format. | | | | [setRequestFormat](#method_setRequestFormat)(string $format) Sets the request format. | | | string|null | [getContentType](#method_getContentType)() Gets the format associated with the request. | | | | [setDefaultLocale](#method_setDefaultLocale)(string $locale) Sets the default locale. | | | string | [getDefaultLocale](#method_getDefaultLocale)() Get the default locale. | | | | [setLocale](#method_setLocale)(string $locale) Sets the locale. | | | string | [getLocale](#method_getLocale)() Get the locale. | | | bool | [isMethod](#method_isMethod)(string $method) Checks if the request method is of specified type. | | | bool | [isMethodSafe](#method_isMethodSafe)() Checks whether or not the method is safe. | | | bool | [isMethodIdempotent](#method_isMethodIdempotent)() Checks whether or not the method is idempotent. | | | bool | [isMethodCacheable](#method_isMethodCacheable)() Checks whether the method is cacheable or not. | | | string | [getProtocolVersion](#method_getProtocolVersion)() Returns the protocol version. | | | string|resource | [getContent](#method_getContent)(bool $asResource = false) Returns the request body content. | | | array | [getETags](#method_getETags)() Gets the Etags. | | | bool | [isNoCache](#method_isNoCache)() | | | string|null | [getPreferredLanguage](#method_getPreferredLanguage)(array $locales = null) Returns the preferred language. | | | array | [getLanguages](#method_getLanguages)() Gets a list of languages acceptable by the client browser. | | | array | [getCharsets](#method_getCharsets)() Gets a list of charsets acceptable by the client browser. | | | array | [getEncodings](#method_getEncodings)() Gets a list of encodings acceptable by the client browser. | | | array | [getAcceptableContentTypes](#method_getAcceptableContentTypes)() Gets a list of content types acceptable by the client browser. | | | bool | [isXmlHttpRequest](#method_isXmlHttpRequest)() Returns true if the request is a XMLHttpRequest. | | | | [prepareRequestUri](#method_prepareRequestUri)() | | | string | [prepareBaseUrl](#method_prepareBaseUrl)() Prepares the base URL. | | | string | [prepareBasePath](#method_prepareBasePath)() Prepares the base path. | | | string | [preparePathInfo](#method_preparePathInfo)() Prepares the path info. | | | static | [initializeFormats](#method_initializeFormats)() Initializes HTTP request formats. | | | bool | [isFromTrustedProxy](#method_isFromTrustedProxy)() Indicates whether this request originated from a trusted proxy. | | Details ------- ### \_\_construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), string|resource|null $content = null) #### Parameters | | | | | --- | --- | --- | | array | $query | The GET parameters | | array | $request | The POST parameters | | array | $attributes | The request attributes (parameters parsed from the PATH\_INFO, ...) | | array | $cookies | The COOKIE parameters | | array | $files | The FILES parameters | | array | $server | The SERVER parameters | | string|resource|null | $content | The raw body data | ### initialize(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), string|resource|null $content = null) Sets the parameters for this request. This method also re-initializes all properties. #### Parameters | | | | | --- | --- | --- | | array | $query | The GET parameters | | array | $request | The POST parameters | | array | $attributes | The request attributes (parameters parsed from the PATH\_INFO, ...) | | array | $cookies | The COOKIE parameters | | array | $files | The FILES parameters | | array | $server | The SERVER parameters | | string|resource|null | $content | The raw body data | ### static [Request](request "Symfony\Component\HttpFoundation\Request") createFromGlobals() Creates a new request with values from PHP's super globals. #### Return Value | | | | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | | ### static [Request](request "Symfony\Component\HttpFoundation\Request") create(string $uri, string $method = 'GET', array $parameters = array(), array $cookies = array(), array $files = array(), array $server = array(), string|resource|null $content = null) Creates a Request based on a given URI and configuration. The information contained in the URI always take precedence over the other information (server and parameters). #### Parameters | | | | | --- | --- | --- | | string | $uri | The URI | | string | $method | The HTTP method | | array | $parameters | The query (GET) or request (POST) parameters | | array | $cookies | The request cookies ($\_COOKIE) | | array | $files | The request files ($\_FILES) | | array | $server | The server parameters ($\_SERVER) | | string|resource|null | $content | The raw body data | #### Return Value | | | | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | | ### static setFactory(callable|null $callable) Sets a callable able to create a Request instance. This is mainly useful when you need to override the Request class to keep BC with an existing system. It should not be used for any other purpose. #### Parameters | | | | | --- | --- | --- | | callable|null | $callable | A PHP callable | ### [Request](request "Symfony\Component\HttpFoundation\Request") duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) Clones a request and overrides some of its parameters. #### Parameters | | | | | --- | --- | --- | | array | $query | The GET parameters | | array | $request | The POST parameters | | array | $attributes | The request attributes (parameters parsed from the PATH\_INFO, ...) | | array | $cookies | The COOKIE parameters | | array | $files | The FILES parameters | | array | $server | The SERVER parameters | #### Return Value | | | | --- | --- | | [Request](request "Symfony\Component\HttpFoundation\Request") | | ### \_\_clone() Clones the current request. Note that the session is not cloned as duplicated requests are most of the time sub-requests of the main one. ### string \_\_toString() Returns the request as a string. #### Return Value | | | | --- | --- | | string | The request | ### overrideGlobals() Overrides the PHP global variables according to this request instance. It overrides $\_GET, $\_POST, $\_REQUEST, $\_SERVER, $\_COOKIE. $\_FILES is never overridden, see rfc1867 ### static setTrustedProxies(array $proxies, int $trustedHeaderSet) Sets a list of trusted proxies. You should only list the reverse proxies that you manage directly. #### Parameters | | | | | --- | --- | --- | | array | $proxies | A list of trusted proxies | | int | $trustedHeaderSet | A bit field of Request::HEADER\_\*, to set which headers to trust from your proxies | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When $trustedHeaderSet is invalid | ### static array getTrustedProxies() Gets the list of trusted proxies. #### Return Value | | | | --- | --- | | array | An array of trusted proxies | ### static int getTrustedHeaderSet() Gets the set of trusted headers from trusted proxies. #### Return Value | | | | --- | --- | | int | A bit field of Request::HEADER\_\* that defines which headers are trusted from your proxies | ### static setTrustedHosts(array $hostPatterns) Sets a list of trusted host patterns. You should only list the hosts you manage using regexs. #### Parameters | | | | | --- | --- | --- | | array | $hostPatterns | A list of trusted host patterns | ### static array getTrustedHosts() Gets the list of trusted host patterns. #### Return Value | | | | --- | --- | | array | An array of trusted host patterns | ### static string normalizeQueryString(string $qs) Normalizes a query string. It builds a normalized query string, where keys/value pairs are alphabetized, have consistent escaping and unneeded delimiters are removed. #### Parameters | | | | | --- | --- | --- | | string | $qs | Query string | #### Return Value | | | | --- | --- | | string | A normalized query string for the Request | ### static enableHttpMethodParameterOverride() Enables support for the \_method request parameter to determine the intended HTTP method. Be warned that enabling this feature might lead to CSRF issues in your code. Check that you are using CSRF tokens when required. If the HTTP method parameter override is enabled, an html-form with method "POST" can be altered and used to send a "PUT" or "DELETE" request via the \_method request parameter. If these methods are not protected against CSRF, this presents a possible vulnerability. The HTTP method can only be overridden when the real HTTP method is POST. ### static bool getHttpMethodParameterOverride() Checks whether support for the \_method request parameter is enabled. #### Return Value | | | | --- | --- | | bool | True when the \_method request parameter is enabled, false otherwise | ### mixed get(string $key, mixed $default = null) Gets a "parameter" value from any bag. This method is mainly useful for libraries that want to provide some flexibility. If you don't need the flexibility in controllers, it is better to explicitly get request parameters from the appropriate public property instead (attributes, query, request). Order of precedence: PATH (routing placeholders or custom attributes), GET, BODY #### Parameters | | | | | --- | --- | --- | | string | $key | The key | | mixed | $default | The default value if the parameter key does not exist | #### Return Value | | | | --- | --- | | mixed | | ### [SessionInterface](session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface")|null getSession() Gets the Session. #### Return Value | | | | --- | --- | | [SessionInterface](session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface")|null | The session | ### bool hasPreviousSession() Whether the request contains a Session which was started in one of the previous requests. #### Return Value | | | | --- | --- | | bool | | ### bool hasSession() Whether the request contains a Session object. This method does not give any information about the state of the session object, like whether the session is started or not. It is just a way to check if this Request is associated with a Session instance. #### Return Value | | | | --- | --- | | bool | true when the Request contains a Session object, false otherwise | ### setSession([SessionInterface](session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface") $session) Sets the Session. #### Parameters | | | | | --- | --- | --- | | [SessionInterface](session/sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface") | $session | The Session | ### setSessionFactory(callable $factory) #### Parameters | | | | | --- | --- | --- | | callable | $factory | | ### array getClientIps() Returns the client IP addresses. In the returned array the most trusted IP address is first, and the least trusted one last. The "real" client IP address is the last one, but this is also the least trusted one. Trusted proxies are stripped. Use this method carefully; you should use getClientIp() instead. #### Return Value | | | | --- | --- | | array | The client IP addresses | #### See also | | | | --- | --- | | getClientIp() | | ### string|null getClientIp() Returns the client IP address. This method can read the client IP address from the "X-Forwarded-For" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-For" header value is a comma+space separated list of IP addresses, the left-most being the original client, and each successive proxy that passed the request adding the IP address where it received the request from. #### Return Value | | | | --- | --- | | string|null | The client IP address | #### See also | | | | --- | --- | | getClientIps() | | | <http://en.wikipedia.org/wiki/X-Forwarded-For> | | ### string getScriptName() Returns current script name. #### Return Value | | | | --- | --- | | string | | ### string getPathInfo() Returns the path being requested relative to the executed script. The path info always starts with a /. Suppose this request is instantiated from /mysite on localhost: * http://localhost/mysite returns an empty string * http://localhost/mysite/about returns '/about' * http://localhost/mysite/enco%20ded returns '/enco%20ded' * http://localhost/mysite/about?var=1 returns '/about' #### Return Value | | | | --- | --- | | string | The raw path (i.e. not urldecoded) | ### string getBasePath() Returns the root path from which this request is executed. Suppose that an index.php file instantiates this request object: * http://localhost/index.php returns an empty string * http://localhost/index.php/page returns an empty string * http://localhost/web/index.php returns '/web' * http://localhost/we%20b/index.php returns '/we%20b' #### Return Value | | | | --- | --- | | string | The raw path (i.e. not urldecoded) | ### string getBaseUrl() Returns the root URL from which this request is executed. The base URL never ends with a /. This is similar to getBasePath(), except that it also includes the script filename (e.g. index.php) if one exists. #### Return Value | | | | --- | --- | | string | The raw URL (i.e. not urldecoded) | ### string getScheme() Gets the request's scheme. #### Return Value | | | | --- | --- | | string | | ### int|string getPort() Returns the port on which the request is made. This method can read the client port from the "X-Forwarded-Port" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-Port" header must contain the client port. #### Return Value | | | | --- | --- | | int|string | can be a string if fetched from the server bag | ### string|null getUser() Returns the user. #### Return Value | | | | --- | --- | | string|null | | ### string|null getPassword() Returns the password. #### Return Value | | | | --- | --- | | string|null | | ### string getUserInfo() Gets the user info. #### Return Value | | | | --- | --- | | string | A user name and, optionally, scheme-specific information about how to gain authorization to access the server | ### string getHttpHost() Returns the HTTP host being requested. The port name will be appended to the host if it's non-standard. #### Return Value | | | | --- | --- | | string | | ### string getRequestUri() Returns the requested URI (path and query string). #### Return Value | | | | --- | --- | | string | The raw URI (i.e. not URI decoded) | ### string getSchemeAndHttpHost() Gets the scheme and HTTP host. If the URL was called with basic authentication, the user and the password are not added to the generated string. #### Return Value | | | | --- | --- | | string | The scheme and HTTP host | ### string getUri() Generates a normalized URI (URL) for the Request. #### Return Value | | | | --- | --- | | string | A normalized URI (URL) for the Request | #### See also | | | | --- | --- | | getQueryString() | | ### string getUriForPath(string $path) Generates a normalized URI for the given path. #### Parameters | | | | | --- | --- | --- | | string | $path | A path to use instead of the current one | #### Return Value | | | | --- | --- | | string | The normalized URI for the path | ### string getRelativeUriForPath(string $path) Returns the path as relative reference from the current Request path. Only the URIs path component (no schema, host etc.) is relevant and must be given. Both paths must be absolute and not contain relative parts. Relative URLs from one resource to another are useful when generating self-contained downloadable document archives. Furthermore, they can be used to reduce the link size in documents. Example target paths, given a base path of "/a/b/c/d": - "/a/b/c/d" -> "" - "/a/b/c/" -> "./" - "/a/b/" -> "../" - "/a/b/c/other" -> "other" - "/a/x/y" -> "../../x/y" #### Parameters | | | | | --- | --- | --- | | string | $path | The target path | #### Return Value | | | | --- | --- | | string | The relative target path | ### string|null getQueryString() Generates the normalized query string for the Request. It builds a normalized query string, where keys/value pairs are alphabetized and have consistent escaping. #### Return Value | | | | --- | --- | | string|null | A normalized query string for the Request | ### bool isSecure() Checks whether the request is secure or not. This method can read the client protocol from the "X-Forwarded-Proto" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-Proto" header must contain the protocol: "https" or "http". #### Return Value | | | | --- | --- | | bool | | ### string getHost() Returns the host name. This method can read the client host name from the "X-Forwarded-Host" header when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-Host" header must contain the client host name. #### Return Value | | | | --- | --- | | string | | #### Exceptions | | | | --- | --- | | [SuspiciousOperationException](exception/suspiciousoperationexception "Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException") | when the host name is invalid or not trusted | ### setMethod(string $method) Sets the request method. #### Parameters | | | | | --- | --- | --- | | string | $method | | ### string getMethod() Gets the request "intended" method. If the X-HTTP-Method-Override header is set, and if the method is a POST, then it is used to determine the "real" intended HTTP method. The \_method request parameter can also be used to determine the HTTP method, but only if enableHttpMethodParameterOverride() has been called. The method is always an uppercased string. #### Return Value | | | | --- | --- | | string | The request method | #### See also | | | | --- | --- | | getRealMethod() | | ### string getRealMethod() Gets the "real" request method. #### Return Value | | | | --- | --- | | string | The request method | #### See also | | | | --- | --- | | getMethod() | | ### string|null getMimeType(string $format) Gets the mime type associated with the format. #### Parameters | | | | | --- | --- | --- | | string | $format | The format | #### Return Value | | | | --- | --- | | string|null | The associated mime type (null if not found) | ### static array getMimeTypes(string $format) Gets the mime types associated with the format. #### Parameters | | | | | --- | --- | --- | | string | $format | The format | #### Return Value | | | | --- | --- | | array | The associated mime types | ### string|null getFormat(string $mimeType) Gets the format associated with the mime type. #### Parameters | | | | | --- | --- | --- | | string | $mimeType | The associated mime type | #### Return Value | | | | --- | --- | | string|null | The format (null if not found) | ### setFormat(string $format, string|array $mimeTypes) Associates a format with mime types. #### Parameters | | | | | --- | --- | --- | | string | $format | The format | | string|array | $mimeTypes | The associated mime types (the preferred one must be the first as it will be used as the content type) | ### string getRequestFormat(string|null $default = 'html') Gets the request format. Here is the process to determine the format: * format defined by the user (with setRequestFormat()) * \_format request attribute * $default #### Parameters | | | | | --- | --- | --- | | string|null | $default | The default format | #### Return Value | | | | --- | --- | | string | The request format | ### setRequestFormat(string $format) Sets the request format. #### Parameters | | | | | --- | --- | --- | | string | $format | The request format | ### string|null getContentType() Gets the format associated with the request. #### Return Value | | | | --- | --- | | string|null | The format (null if no content type is present) | ### setDefaultLocale(string $locale) Sets the default locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | | ### string getDefaultLocale() Get the default locale. #### Return Value | | | | --- | --- | | string | | ### setLocale(string $locale) Sets the locale. #### Parameters | | | | | --- | --- | --- | | string | $locale | | ### string getLocale() Get the locale. #### Return Value | | | | --- | --- | | string | | ### bool isMethod(string $method) Checks if the request method is of specified type. #### Parameters | | | | | --- | --- | --- | | string | $method | Uppercase request method (GET, POST etc) | #### Return Value | | | | --- | --- | | bool | | ### bool isMethodSafe() Checks whether or not the method is safe. #### Return Value | | | | --- | --- | | bool | | #### See also | | | | --- | --- | | <https://tools.ietf.org/html/rfc7231#section-4.2.1> | | ### bool isMethodIdempotent() Checks whether or not the method is idempotent. #### Return Value | | | | --- | --- | | bool | | ### bool isMethodCacheable() Checks whether the method is cacheable or not. #### Return Value | | | | --- | --- | | bool | | #### See also | | | | --- | --- | | <https://tools.ietf.org/html/rfc7231#section-4.2.3> | | ### string getProtocolVersion() Returns the protocol version. If the application is behind a proxy, the protocol version used in the requests between the client and the proxy and between the proxy and the server might be different. This returns the former (from the "Via" header) if the proxy is trusted (see "setTrustedProxies()"), otherwise it returns the latter (from the "SERVER\_PROTOCOL" server parameter). #### Return Value | | | | --- | --- | | string | | ### string|resource getContent(bool $asResource = false) Returns the request body content. #### Parameters | | | | | --- | --- | --- | | bool | $asResource | If true, a resource will be returned | #### Return Value | | | | --- | --- | | string|resource | The request body content or a resource to read the body stream | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | | ### array getETags() Gets the Etags. #### Return Value | | | | --- | --- | | array | The entity tags | ### bool isNoCache() #### Return Value | | | | --- | --- | | bool | | ### string|null getPreferredLanguage(array $locales = null) Returns the preferred language. #### Parameters | | | | | --- | --- | --- | | array | $locales | An array of ordered available locales | #### Return Value | | | | --- | --- | | string|null | The preferred locale | ### array getLanguages() Gets a list of languages acceptable by the client browser. #### Return Value | | | | --- | --- | | array | Languages ordered in the user browser preferences | ### array getCharsets() Gets a list of charsets acceptable by the client browser. #### Return Value | | | | --- | --- | | array | List of charsets in preferable order | ### array getEncodings() Gets a list of encodings acceptable by the client browser. #### Return Value | | | | --- | --- | | array | List of encodings in preferable order | ### array getAcceptableContentTypes() Gets a list of content types acceptable by the client browser. #### Return Value | | | | --- | --- | | array | List of content types in preferable order | ### bool isXmlHttpRequest() Returns true if the request is a XMLHttpRequest. It works if your JavaScript library sets an X-Requested-With HTTP header. It is known to work with common JavaScript frameworks: #### Return Value | | | | --- | --- | | bool | true if the request is an XMLHttpRequest, false otherwise | #### See also | | | | --- | --- | | <http://en.wikipedia.org/wiki/List_of_Ajax_frameworks#JavaScript> | | ### protected prepareRequestUri() ### protected string prepareBaseUrl() Prepares the base URL. #### Return Value | | | | --- | --- | | string | | ### protected string prepareBasePath() Prepares the base path. #### Return Value | | | | --- | --- | | string | base path | ### protected string preparePathInfo() Prepares the path info. #### Return Value | | | | --- | --- | | string | path info | ### static protected initializeFormats() Initializes HTTP request formats. ### bool isFromTrustedProxy() Indicates whether this request originated from a trusted proxy. This can be useful to determine whether or not to trust the contents of a proxy-specific header. #### Return Value | | | | --- | --- | | bool | true if the request came from a trusted proxy, false otherwise |
programming_docs
symfony Symfony\Component\HttpFoundation\File\Exception Symfony\Component\HttpFoundation\File\Exception =============================================== Classes ------- | | | | --- | --- | | [AccessDeniedException](exception/accessdeniedexception "Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException") | Thrown when the access on a file was denied. | | [CannotWriteFileException](exception/cannotwritefileexception "Symfony\Component\HttpFoundation\File\Exception\CannotWriteFileException") | Thrown when an UPLOAD\_ERR\_CANT\_WRITE error occurred with UploadedFile. | | [ExtensionFileException](exception/extensionfileexception "Symfony\Component\HttpFoundation\File\Exception\ExtensionFileException") | Thrown when an UPLOAD\_ERR\_EXTENSION error occurred with UploadedFile. | | [FileException](exception/fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") | Thrown when an error occurred in the component File. | | [FileNotFoundException](exception/filenotfoundexception "Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException") | Thrown when a file was not found. | | [FormSizeFileException](exception/formsizefileexception "Symfony\Component\HttpFoundation\File\Exception\FormSizeFileException") | Thrown when an UPLOAD\_ERR\_FORM\_SIZE error occurred with UploadedFile. | | [IniSizeFileException](exception/inisizefileexception "Symfony\Component\HttpFoundation\File\Exception\IniSizeFileException") | Thrown when an UPLOAD\_ERR\_INI\_SIZE error occurred with UploadedFile. | | [NoFileException](exception/nofileexception "Symfony\Component\HttpFoundation\File\Exception\NoFileException") | Thrown when an UPLOAD\_ERR\_NO\_FILE error occurred with UploadedFile. | | [NoTmpDirFileException](exception/notmpdirfileexception "Symfony\Component\HttpFoundation\File\Exception\NoTmpDirFileException") | Thrown when an UPLOAD\_ERR\_NO\_TMP\_DIR error occurred with UploadedFile. | | [PartialFileException](exception/partialfileexception "Symfony\Component\HttpFoundation\File\Exception\PartialFileException") | Thrown when an UPLOAD\_ERR\_PARTIAL error occurred with UploadedFile. | | [UnexpectedTypeException](exception/unexpectedtypeexception "Symfony\Component\HttpFoundation\File\Exception\UnexpectedTypeException") | | | [UploadException](exception/uploadexception "Symfony\Component\HttpFoundation\File\Exception\UploadException") | Thrown when an error occurred during file upload. | symfony UploadedFile UploadedFile ============= class **UploadedFile** extends [File](file "Symfony\Component\HttpFoundation\File\File") A file uploaded through a form. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path, string $originalName, string $mimeType = null, int $error = null, bool $test = false) Accepts the information of the uploaded file as provided by the PHP global $\_FILES. | | | string|null | [guessExtension](#method_guessExtension)() Returns the extension based on the mime type. | from [File](file#method_guessExtension "Symfony\Component\HttpFoundation\File\File") | | string|null | [getMimeType](#method_getMimeType)() Returns the mime type of the file. | from [File](file#method_getMimeType "Symfony\Component\HttpFoundation\File\File") | | [File](file "Symfony\Component\HttpFoundation\File\File") | [move](#method_move)(string $directory, string $name = null) Moves the file to a new location. | | | | [getTargetFile](#method_getTargetFile)($directory, $name = null) | from [File](file#method_getTargetFile "Symfony\Component\HttpFoundation\File\File") | | string | [getName](#method_getName)(string $name) Returns locale independent base name of the given path. | from [File](file#method_getName "Symfony\Component\HttpFoundation\File\File") | | string|null | [getClientOriginalName](#method_getClientOriginalName)() Returns the original file name. | | | string | [getClientOriginalExtension](#method_getClientOriginalExtension)() Returns the original file extension. | | | string|null | [getClientMimeType](#method_getClientMimeType)() Returns the file mime type. | | | string|null | [guessClientExtension](#method_guessClientExtension)() Returns the extension based on the client mime type. | | | int|null | [getClientSize](#method_getClientSize)() deprecated Returns the file size. | | | int | [getError](#method_getError)() Returns the upload error. | | | bool | [isValid](#method_isValid)() Returns whether the file was uploaded successfully. | | | static int | [getMaxFilesize](#method_getMaxFilesize)() Returns the maximum size of an uploaded file as configured in php.ini. | | | string | [getErrorMessage](#method_getErrorMessage)() Returns an informative upload error message. | | Details ------- ### \_\_construct(string $path, string $originalName, string $mimeType = null, int $error = null, bool $test = false) Accepts the information of the uploaded file as provided by the PHP global $\_FILES. The file object is only created when the uploaded file is valid (i.e. when the isValid() method returns true). Otherwise the only methods that could be called on an UploadedFile instance are: * getClientOriginalName, * getClientMimeType, * isValid, * getError. Calling any other method on an non-valid instance will cause an unpredictable result. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the file | | string | $originalName | The original file name of the uploaded file | | string | $mimeType | The type of the file as provided by PHP; null defaults to application/octet-stream | | int | $error | The error constant of the upload (one of PHP's UPLOAD\_ERR\_XXX constants); null defaults to UPLOAD\_ERR\_OK | | bool | $test | Whether the test mode is active Local files are used in test mode hence the code should not enforce HTTP uploads | #### Exceptions | | | | --- | --- | | [FileException](exception/fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") | If file\_uploads is disabled | | [FileNotFoundException](exception/filenotfoundexception "Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException") | If the file does not exist | ### string|null guessExtension() Returns the extension based on the mime type. If the mime type is unknown, returns null. This method uses the mime type as guessed by getMimeType() to guess the file extension. #### Return Value | | | | --- | --- | | string|null | The guessed extension or null if it cannot be guessed | #### See also | | | | --- | --- | | [ExtensionGuesser](mimetype/extensionguesser "Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser") | | | getMimeType() | | ### string|null getMimeType() Returns the mime type of the file. The mime type is guessed using a MimeTypeGuesser instance, which uses finfo(), mime\_content\_type() and the system binary "file" (in this order), depending on which of those are available. #### Return Value | | | | --- | --- | | string|null | The guessed mime type (e.g. "application/pdf") | #### See also | | | | --- | --- | | [MimeTypeGuesser](mimetype/mimetypeguesser "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser") | | ### [File](file "Symfony\Component\HttpFoundation\File\File") move(string $directory, string $name = null) Moves the file to a new location. #### Parameters | | | | | --- | --- | --- | | string | $directory | The destination folder | | string | $name | The new file name | #### Return Value | | | | --- | --- | | [File](file "Symfony\Component\HttpFoundation\File\File") | A File object representing the new file | #### Exceptions | | | | --- | --- | | [FileException](exception/fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") | if, for any reason, the file could not have been moved | ### protected getTargetFile($directory, $name = null) #### Parameters | | | | | --- | --- | --- | | | $directory | | | | $name | | ### protected string getName(string $name) Returns locale independent base name of the given path. #### Parameters | | | | | --- | --- | --- | | string | $name | The new file name | #### Return Value | | | | --- | --- | | string | containing | ### string|null getClientOriginalName() Returns the original file name. It is extracted from the request from which the file has been uploaded. Then it should not be considered as a safe value. #### Return Value | | | | --- | --- | | string|null | The original name | ### string getClientOriginalExtension() Returns the original file extension. It is extracted from the original file name that was uploaded. Then it should not be considered as a safe value. #### Return Value | | | | --- | --- | | string | The extension | ### string|null getClientMimeType() Returns the file mime type. The client mime type is extracted from the request from which the file was uploaded, so it should not be considered as a safe value. For a trusted mime type, use getMimeType() instead (which guesses the mime type based on the file content). #### Return Value | | | | --- | --- | | string|null | The mime type | #### See also | | | | --- | --- | | getMimeType() | | ### string|null guessClientExtension() Returns the extension based on the client mime type. If the mime type is unknown, returns null. This method uses the mime type as guessed by getClientMimeType() to guess the file extension. As such, the extension returned by this method cannot be trusted. For a trusted extension, use guessExtension() instead (which guesses the extension based on the guessed mime type for the file). #### Return Value | | | | --- | --- | | string|null | The guessed extension or null if it cannot be guessed | #### See also | | | | --- | --- | | guessExtension() | | | getClientMimeType() | | ### int|null getClientSize() deprecated deprecated | since | Symfony 4.1, use getSize() instead. | Returns the file size. It is extracted from the request from which the file has been uploaded. Then it should not be considered as a safe value. #### Return Value | | | | --- | --- | | int|null | The file sizes | ### int getError() Returns the upload error. If the upload was successful, the constant UPLOAD\_ERR\_OK is returned. Otherwise one of the other UPLOAD\_ERR\_XXX constants is returned. #### Return Value | | | | --- | --- | | int | The upload error | ### bool isValid() Returns whether the file was uploaded successfully. #### Return Value | | | | --- | --- | | bool | True if the file has been uploaded with HTTP and no error occurred | ### static int getMaxFilesize() Returns the maximum size of an uploaded file as configured in php.ini. #### Return Value | | | | --- | --- | | int | The maximum size of an uploaded file in bytes | ### string getErrorMessage() Returns an informative upload error message. #### Return Value | | | | --- | --- | | string | The error message regarding the specified error code | symfony Stream Stream ======= class **Stream** extends [File](file "Symfony\Component\HttpFoundation\File\File") A PHP stream of unknown size. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path, bool $checkPath = true) Constructs a new file from the given path. | from [File](file#method___construct "Symfony\Component\HttpFoundation\File\File") | | string|null | [guessExtension](#method_guessExtension)() Returns the extension based on the mime type. | from [File](file#method_guessExtension "Symfony\Component\HttpFoundation\File\File") | | string|null | [getMimeType](#method_getMimeType)() Returns the mime type of the file. | from [File](file#method_getMimeType "Symfony\Component\HttpFoundation\File\File") | | [File](file "Symfony\Component\HttpFoundation\File\File") | [move](#method_move)(string $directory, string $name = null) Moves the file to a new location. | from [File](file#method_move "Symfony\Component\HttpFoundation\File\File") | | | [getTargetFile](#method_getTargetFile)($directory, $name = null) | from [File](file#method_getTargetFile "Symfony\Component\HttpFoundation\File\File") | | string | [getName](#method_getName)(string $name) Returns locale independent base name of the given path. | from [File](file#method_getName "Symfony\Component\HttpFoundation\File\File") | | | [getSize](#method_getSize)() {@inheritdoc} | | Details ------- ### \_\_construct(string $path, bool $checkPath = true) Constructs a new file from the given path. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the file | | bool | $checkPath | Whether to check the path or not | #### Exceptions | | | | --- | --- | | [FileNotFoundException](exception/filenotfoundexception "Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException") | If the given path is not a file | ### string|null guessExtension() Returns the extension based on the mime type. If the mime type is unknown, returns null. This method uses the mime type as guessed by getMimeType() to guess the file extension. #### Return Value | | | | --- | --- | | string|null | The guessed extension or null if it cannot be guessed | #### See also | | | | --- | --- | | [ExtensionGuesser](mimetype/extensionguesser "Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser") | | | getMimeType() | | ### string|null getMimeType() Returns the mime type of the file. The mime type is guessed using a MimeTypeGuesser instance, which uses finfo(), mime\_content\_type() and the system binary "file" (in this order), depending on which of those are available. #### Return Value | | | | --- | --- | | string|null | The guessed mime type (e.g. "application/pdf") | #### See also | | | | --- | --- | | [MimeTypeGuesser](mimetype/mimetypeguesser "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser") | | ### [File](file "Symfony\Component\HttpFoundation\File\File") move(string $directory, string $name = null) Moves the file to a new location. #### Parameters | | | | | --- | --- | --- | | string | $directory | The destination folder | | string | $name | The new file name | #### Return Value | | | | --- | --- | | [File](file "Symfony\Component\HttpFoundation\File\File") | A File object representing the new file | #### Exceptions | | | | --- | --- | | [FileException](exception/fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") | if the target file could not be created | ### protected getTargetFile($directory, $name = null) #### Parameters | | | | | --- | --- | --- | | | $directory | | | | $name | | ### protected string getName(string $name) Returns locale independent base name of the given path. #### Parameters | | | | | --- | --- | --- | | string | $name | The new file name | #### Return Value | | | | --- | --- | | string | containing | ### getSize() {@inheritdoc} symfony File File ===== class **File** extends [SplFileInfo](http://php.net/SplFileInfo) A file in the file system. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path, bool $checkPath = true) Constructs a new file from the given path. | | | string|null | [guessExtension](#method_guessExtension)() Returns the extension based on the mime type. | | | string|null | [getMimeType](#method_getMimeType)() Returns the mime type of the file. | | | [File](file "Symfony\Component\HttpFoundation\File\File") | [move](#method_move)(string $directory, string $name = null) Moves the file to a new location. | | | | [getTargetFile](#method_getTargetFile)($directory, $name = null) | | | string | [getName](#method_getName)(string $name) Returns locale independent base name of the given path. | | Details ------- ### \_\_construct(string $path, bool $checkPath = true) Constructs a new file from the given path. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the file | | bool | $checkPath | Whether to check the path or not | #### Exceptions | | | | --- | --- | | [FileNotFoundException](exception/filenotfoundexception "Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException") | If the given path is not a file | ### string|null guessExtension() Returns the extension based on the mime type. If the mime type is unknown, returns null. This method uses the mime type as guessed by getMimeType() to guess the file extension. #### Return Value | | | | --- | --- | | string|null | The guessed extension or null if it cannot be guessed | #### See also | | | | --- | --- | | [ExtensionGuesser](mimetype/extensionguesser "Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser") | | | getMimeType() | | ### string|null getMimeType() Returns the mime type of the file. The mime type is guessed using a MimeTypeGuesser instance, which uses finfo(), mime\_content\_type() and the system binary "file" (in this order), depending on which of those are available. #### Return Value | | | | --- | --- | | string|null | The guessed mime type (e.g. "application/pdf") | #### See also | | | | --- | --- | | [MimeTypeGuesser](mimetype/mimetypeguesser "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser") | | ### [File](file "Symfony\Component\HttpFoundation\File\File") move(string $directory, string $name = null) Moves the file to a new location. #### Parameters | | | | | --- | --- | --- | | string | $directory | The destination folder | | string | $name | The new file name | #### Return Value | | | | --- | --- | | [File](file "Symfony\Component\HttpFoundation\File\File") | A File object representing the new file | #### Exceptions | | | | --- | --- | | [FileException](exception/fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") | if the target file could not be created | ### protected getTargetFile($directory, $name = null) #### Parameters | | | | | --- | --- | --- | | | $directory | | | | $name | | ### protected string getName(string $name) Returns locale independent base name of the given path. #### Parameters | | | | | --- | --- | --- | | string | $name | The new file name | #### Return Value | | | | --- | --- | | string | containing | symfony Symfony\Component\HttpFoundation\File\MimeType Symfony\Component\HttpFoundation\File\MimeType ============================================== Classes ------- | | | | --- | --- | | [ExtensionGuesser](mimetype/extensionguesser "Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser") | A singleton mime type to file extension guesser. | | [FileBinaryMimeTypeGuesser](mimetype/filebinarymimetypeguesser "Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser") | Guesses the mime type with the binary "file" (only available on \*nix). | | [FileinfoMimeTypeGuesser](mimetype/fileinfomimetypeguesser "Symfony\Component\HttpFoundation\File\MimeType\FileinfoMimeTypeGuesser") | Guesses the mime type using the PECL extension FileInfo. | | [MimeTypeExtensionGuesser](mimetype/mimetypeextensionguesser "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeExtensionGuesser") | Provides a best-guess mapping of mime type to file extension. | | [MimeTypeGuesser](mimetype/mimetypeguesser "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser") | A singleton mime type guesser. | Interfaces ---------- | | | | --- | --- | | *[ExtensionGuesserInterface](mimetype/extensionguesserinterface "Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesserInterface")* | Guesses the file extension corresponding to a given mime type. | | *[MimeTypeGuesserInterface](mimetype/mimetypeguesserinterface "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface")* | Guesses the mime type of a file. |
programming_docs
symfony FileBinaryMimeTypeGuesser FileBinaryMimeTypeGuesser ========================== class **FileBinaryMimeTypeGuesser** implements [MimeTypeGuesserInterface](mimetypeguesserinterface "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface") Guesses the mime type with the binary "file" (only available on \*nix). Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $cmd = 'file -b --mime %s 2>/dev/null') The $cmd pattern must contain a "%s" string that will be replaced with the file name to guess. | | | static bool | [isSupported](#method_isSupported)() Returns whether this guesser is supported on the current OS. | | | string | [guess](#method_guess)(string $path) Guesses the mime type of the file with the given path. | | Details ------- ### \_\_construct(string $cmd = 'file -b --mime %s 2>/dev/null') The $cmd pattern must contain a "%s" string that will be replaced with the file name to guess. The command output must start with the mime type of the file. #### Parameters | | | | | --- | --- | --- | | string | $cmd | The command to run to get the mime type of a file | ### static bool isSupported() Returns whether this guesser is supported on the current OS. #### Return Value | | | | --- | --- | | bool | | ### string guess(string $path) Guesses the mime type of the file with the given path. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the file | #### Return Value | | | | --- | --- | | string | The mime type or NULL, if none could be guessed | #### Exceptions | | | | --- | --- | | [FileNotFoundException](../exception/filenotfoundexception "Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException") | If the file does not exist | | [AccessDeniedException](../exception/accessdeniedexception "Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException") | If the file could not be read | symfony MimeTypeGuesserInterface MimeTypeGuesserInterface ========================= interface **MimeTypeGuesserInterface** Guesses the mime type of a file. Methods ------- | | | | | --- | --- | --- | | string | [guess](#method_guess)(string $path) Guesses the mime type of the file with the given path. | | Details ------- ### string guess(string $path) Guesses the mime type of the file with the given path. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the file | #### Return Value | | | | --- | --- | | string | The mime type or NULL, if none could be guessed | #### Exceptions | | | | --- | --- | | [FileNotFoundException](../exception/filenotfoundexception "Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException") | If the file does not exist | | [AccessDeniedException](../exception/accessdeniedexception "Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException") | If the file could not be read | symfony ExtensionGuesserInterface ExtensionGuesserInterface ========================== interface **ExtensionGuesserInterface** Guesses the file extension corresponding to a given mime type. Methods ------- | | | | | --- | --- | --- | | string | [guess](#method_guess)(string $mimeType) Makes a best guess for a file extension, given a mime type. | | Details ------- ### string guess(string $mimeType) Makes a best guess for a file extension, given a mime type. #### Parameters | | | | | --- | --- | --- | | string | $mimeType | The mime type | #### Return Value | | | | --- | --- | | string | The guessed extension or NULL, if none could be guessed | symfony MimeTypeExtensionGuesser MimeTypeExtensionGuesser ========================= class **MimeTypeExtensionGuesser** implements [ExtensionGuesserInterface](extensionguesserinterface "Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesserInterface") Provides a best-guess mapping of mime type to file extension. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $defaultExtensions | A map of mime types and their default extensions. | | Methods ------- | | | | | --- | --- | --- | | string | [guess](#method_guess)(string $mimeType) Makes a best guess for a file extension, given a mime type. | | Details ------- ### string guess(string $mimeType) Makes a best guess for a file extension, given a mime type. #### Parameters | | | | | --- | --- | --- | | string | $mimeType | The mime type | #### Return Value | | | | --- | --- | | string | The guessed extension or NULL, if none could be guessed | symfony FileinfoMimeTypeGuesser FileinfoMimeTypeGuesser ======================== class **FileinfoMimeTypeGuesser** implements [MimeTypeGuesserInterface](mimetypeguesserinterface "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface") Guesses the mime type using the PECL extension FileInfo. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $magicFile = null) | | | static bool | [isSupported](#method_isSupported)() Returns whether this guesser is supported on the current OS/PHP setup. | | | string | [guess](#method_guess)(string $path) Guesses the mime type of the file with the given path. | | Details ------- ### \_\_construct(string $magicFile = null) #### Parameters | | | | | --- | --- | --- | | string | $magicFile | A magic file to use with the finfo instance | #### See also | | | | --- | --- | | <http://www.php.net/manual/en/function.finfo-open.php> | | ### static bool isSupported() Returns whether this guesser is supported on the current OS/PHP setup. #### Return Value | | | | --- | --- | | bool | | ### string guess(string $path) Guesses the mime type of the file with the given path. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the file | #### Return Value | | | | --- | --- | | string | The mime type or NULL, if none could be guessed | #### Exceptions | | | | --- | --- | | [FileNotFoundException](../exception/filenotfoundexception "Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException") | If the file does not exist | | [AccessDeniedException](../exception/accessdeniedexception "Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException") | If the file could not be read | symfony MimeTypeGuesser MimeTypeGuesser ================ class **MimeTypeGuesser** implements [MimeTypeGuesserInterface](mimetypeguesserinterface "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface") A singleton mime type guesser. By default, all mime type guessers provided by the framework are installed (if available on the current OS/PHP setup). You can register custom guessers by calling the register() method on the singleton instance. Custom guessers are always called before any default ones. ``` $guesser = MimeTypeGuesser::getInstance(); $guesser->register(new MyCustomMimeTypeGuesser()); ``` If you want to change the order of the default guessers, just re-register your preferred one as a custom one. The last registered guesser is preferred over previously registered ones. Re-registering a built-in guesser also allows you to configure it: ``` $guesser = MimeTypeGuesser::getInstance(); $guesser->register(new FileinfoMimeTypeGuesser('/path/to/magic/file')); ``` Properties ---------- | | | | | | --- | --- | --- | --- | | protected array | $guessers | All registered MimeTypeGuesserInterface instances. | | Methods ------- | | | | | --- | --- | --- | | static [MimeTypeGuesser](mimetypeguesser "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser") | [getInstance](#method_getInstance)() Returns the singleton instance. | | | static | [reset](#method_reset)() Resets the singleton instance. | | | | [register](#method_register)([MimeTypeGuesserInterface](mimetypeguesserinterface "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface") $guesser) Registers a new mime type guesser. | | | string | [guess](#method_guess)(string $path) Tries to guess the mime type of the given file. | | Details ------- ### static [MimeTypeGuesser](mimetypeguesser "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser") getInstance() Returns the singleton instance. #### Return Value | | | | --- | --- | | [MimeTypeGuesser](mimetypeguesser "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser") | | ### static reset() Resets the singleton instance. ### register([MimeTypeGuesserInterface](mimetypeguesserinterface "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface") $guesser) Registers a new mime type guesser. When guessing, this guesser is preferred over previously registered ones. #### Parameters | | | | | --- | --- | --- | | [MimeTypeGuesserInterface](mimetypeguesserinterface "Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface") | $guesser | | ### string guess(string $path) Tries to guess the mime type of the given file. The file is passed to each registered mime type guesser in reverse order of their registration (last registered is queried first). Once a guesser returns a value that is not NULL, this method terminates and returns the value. #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the file | #### Return Value | | | | --- | --- | | string | The mime type or NULL, if none could be guessed | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | | | [FileNotFoundException](../exception/filenotfoundexception "Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException") | | | [AccessDeniedException](../exception/accessdeniedexception "Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException") | | symfony ExtensionGuesser ExtensionGuesser ================= class **ExtensionGuesser** implements [ExtensionGuesserInterface](extensionguesserinterface "Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesserInterface") A singleton mime type to file extension guesser. A default guesser is provided. You can register custom guessers by calling the register() method on the singleton instance: ``` $guesser = ExtensionGuesser::getInstance(); $guesser->register(new MyCustomExtensionGuesser()); ``` The last registered guesser is preferred over previously registered ones. Properties ---------- | | | | | | --- | --- | --- | --- | | protected array | $guessers | All registered ExtensionGuesserInterface instances. | | Methods ------- | | | | | --- | --- | --- | | static [ExtensionGuesser](extensionguesser "Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser") | [getInstance](#method_getInstance)() Returns the singleton instance. | | | | [register](#method_register)([ExtensionGuesserInterface](extensionguesserinterface "Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesserInterface") $guesser) Registers a new extension guesser. | | | string | [guess](#method_guess)(string $mimeType) Tries to guess the extension. | | Details ------- ### static [ExtensionGuesser](extensionguesser "Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser") getInstance() Returns the singleton instance. #### Return Value | | | | --- | --- | | [ExtensionGuesser](extensionguesser "Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser") | | ### register([ExtensionGuesserInterface](extensionguesserinterface "Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesserInterface") $guesser) Registers a new extension guesser. When guessing, this guesser is preferred over previously registered ones. #### Parameters | | | | | --- | --- | --- | | [ExtensionGuesserInterface](extensionguesserinterface "Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesserInterface") | $guesser | | ### string guess(string $mimeType) Tries to guess the extension. The mime type is passed to each registered mime type guesser in reverse order of their registration (last registered is queried first). Once a guesser returns a value that is not NULL, this method terminates and returns the value. #### Parameters | | | | | --- | --- | --- | | string | $mimeType | The mime type | #### Return Value | | | | --- | --- | | string | The guessed extension or NULL, if none could be guessed | symfony FormSizeFileException FormSizeFileException ====================== class **FormSizeFileException** extends [FileException](fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") Thrown when an UPLOAD\_ERR\_FORM\_SIZE error occurred with UploadedFile. symfony FileException FileException ============== class **FileException** extends [RuntimeException](http://php.net/RuntimeException) Thrown when an error occurred in the component File. symfony CannotWriteFileException CannotWriteFileException ========================= class **CannotWriteFileException** extends [FileException](fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") Thrown when an UPLOAD\_ERR\_CANT\_WRITE error occurred with UploadedFile. symfony IniSizeFileException IniSizeFileException ===================== class **IniSizeFileException** extends [FileException](fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") Thrown when an UPLOAD\_ERR\_INI\_SIZE error occurred with UploadedFile. symfony UploadException UploadException ================ class **UploadException** extends [FileException](fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") Thrown when an error occurred during file upload. symfony ExtensionFileException ExtensionFileException ======================= class **ExtensionFileException** extends [FileException](fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") Thrown when an UPLOAD\_ERR\_EXTENSION error occurred with UploadedFile. symfony FileNotFoundException FileNotFoundException ====================== class **FileNotFoundException** extends [FileException](fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") Thrown when a file was not found. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path) | | Details ------- ### \_\_construct(string $path) #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the file that was not found | symfony NoTmpDirFileException NoTmpDirFileException ====================== class **NoTmpDirFileException** extends [FileException](fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") Thrown when an UPLOAD\_ERR\_NO\_TMP\_DIR error occurred with UploadedFile. symfony NoFileException NoFileException ================ class **NoFileException** extends [FileException](fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") Thrown when an UPLOAD\_ERR\_NO\_FILE error occurred with UploadedFile. symfony AccessDeniedException AccessDeniedException ====================== class **AccessDeniedException** extends [FileException](fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") Thrown when the access on a file was denied. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $path) | | Details ------- ### \_\_construct(string $path) #### Parameters | | | | | --- | --- | --- | | string | $path | The path to the accessed file | symfony UnexpectedTypeException UnexpectedTypeException ======================== class **UnexpectedTypeException** extends [FileException](fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)($value, string $expectedType) | | Details ------- ### \_\_construct($value, string $expectedType) #### Parameters | | | | | --- | --- | --- | | | $value | | | string | $expectedType | | symfony PartialFileException PartialFileException ===================== class **PartialFileException** extends [FileException](fileexception "Symfony\Component\HttpFoundation\File\Exception\FileException") Thrown when an UPLOAD\_ERR\_PARTIAL error occurred with UploadedFile. symfony SuspiciousOperationException SuspiciousOperationException ============================= class **SuspiciousOperationException** extends [UnexpectedValueException](http://php.net/UnexpectedValueException) implements [RequestExceptionInterface](requestexceptioninterface "Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface") Raised when a user has performed an operation that should be considered suspicious from a security perspective. symfony RequestExceptionInterface RequestExceptionInterface ========================== interface **RequestExceptionInterface** Interface for Request exceptions. Exceptions implementing this interface should trigger an HTTP 400 response in the application code. symfony ConflictingHeadersException ConflictingHeadersException ============================ class **ConflictingHeadersException** extends [UnexpectedValueException](http://php.net/UnexpectedValueException) implements [RequestExceptionInterface](requestexceptioninterface "Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface") The HTTP request contains headers with conflicting information. symfony SessionBagInterface SessionBagInterface ==================== interface **SessionBagInterface** Session Bag store. Methods ------- | | | | | --- | --- | --- | | string | [getName](#method_getName)() Gets this bag's name. | | | | [initialize](#method_initialize)(array $array) Initializes the Bag. | | | string | [getStorageKey](#method_getStorageKey)() Gets the storage key for this bag. | | | mixed | [clear](#method_clear)() Clears out data from bag. | | Details ------- ### string getName() Gets this bag's name. #### Return Value | | | | --- | --- | | string | | ### initialize(array $array) Initializes the Bag. #### Parameters | | | | | --- | --- | --- | | array | $array | | ### string getStorageKey() Gets the storage key for this bag. #### Return Value | | | | --- | --- | | string | | ### mixed clear() Clears out data from bag. #### Return Value | | | | --- | --- | | mixed | Whatever data was contained | symfony Symfony\Component\HttpFoundation\Session\Storage Symfony\Component\HttpFoundation\Session\Storage ================================================ Namespaces ---------- [Symfony\Component\HttpFoundation\Session\Storage\Handler](storage/handler)[Symfony\Component\HttpFoundation\Session\Storage\Proxy](storage/proxy) Classes ------- | | | | --- | --- | | [MetadataBag](storage/metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | Metadata container. | | [MockArraySessionStorage](storage/mockarraysessionstorage "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | MockArraySessionStorage mocks the session for unit tests. | | [MockFileSessionStorage](storage/mockfilesessionstorage "Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage") | MockFileSessionStorage is used to mock sessions for functional testing when done in a single PHP process. | | [NativeSessionStorage](storage/nativesessionstorage "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | This provides a base class for session attribute storage. | | [PhpBridgeSessionStorage](storage/phpbridgesessionstorage "Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage") | Allows session to be started by PHP and managed by Symfony. | Interfaces ---------- | | | | --- | --- | | *[SessionStorageInterface](storage/sessionstorageinterface "Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface")* | StorageInterface. |
programming_docs
symfony Symfony\Component\HttpFoundation\Session\Flash Symfony\Component\HttpFoundation\Session\Flash ============================================== Classes ------- | | | | --- | --- | | [AutoExpireFlashBag](flash/autoexpireflashbag "Symfony\Component\HttpFoundation\Session\Flash\AutoExpireFlashBag") | AutoExpireFlashBag flash message container. | | [FlashBag](flash/flashbag "Symfony\Component\HttpFoundation\Session\Flash\FlashBag") | FlashBag flash message container. | Interfaces ---------- | | | | --- | --- | | *[FlashBagInterface](flash/flashbaginterface "Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface")* | FlashBagInterface. | symfony SessionInterface SessionInterface ================= interface **SessionInterface** Interface for the session. Methods ------- | | | | | --- | --- | --- | | bool | [start](#method_start)() Starts the session storage. | | | string | [getId](#method_getId)() Returns the session ID. | | | | [setId](#method_setId)(string $id) Sets the session ID. | | | mixed | [getName](#method_getName)() Returns the session name. | | | | [setName](#method_setName)(string $name) Sets the session name. | | | bool | [invalidate](#method_invalidate)(int $lifetime = null) Invalidates the current session. | | | bool | [migrate](#method_migrate)(bool $destroy = false, int $lifetime = null) Migrates the current session to a new session id while maintaining all session attributes. | | | | [save](#method_save)() Force the session to be saved and closed. | | | bool | [has](#method_has)(string $name) Checks if an attribute is defined. | | | mixed | [get](#method_get)(string $name, mixed $default = null) Returns an attribute. | | | | [set](#method_set)(string $name, mixed $value) Sets an attribute. | | | array | [all](#method_all)() Returns attributes. | | | | [replace](#method_replace)(array $attributes) Sets attributes. | | | mixed | [remove](#method_remove)(string $name) Removes an attribute. | | | | [clear](#method_clear)() Clears all attributes. | | | bool | [isStarted](#method_isStarted)() Checks if the session was started. | | | | [registerBag](#method_registerBag)([SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") $bag) Registers a SessionBagInterface with the session. | | | [SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | [getBag](#method_getBag)(string $name) Gets a bag instance by name. | | | [MetadataBag](storage/metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | [getMetadataBag](#method_getMetadataBag)() Gets session meta. | | Details ------- ### bool start() Starts the session storage. #### Return Value | | | | --- | --- | | bool | True if session started | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if session fails to start | ### string getId() Returns the session ID. #### Return Value | | | | --- | --- | | string | The session ID | ### setId(string $id) Sets the session ID. #### Parameters | | | | | --- | --- | --- | | string | $id | | ### mixed getName() Returns the session name. #### Return Value | | | | --- | --- | | mixed | The session name | ### setName(string $name) Sets the session name. #### Parameters | | | | | --- | --- | --- | | string | $name | | ### bool invalidate(int $lifetime = null) Invalidates the current session. Clears all session attributes and flashes and regenerates the session and deletes the old session from persistence. #### Parameters | | | | | --- | --- | --- | | int | $lifetime | Sets the cookie lifetime for the session cookie. A null value will leave the system settings unchanged, 0 sets the cookie to expire with browser session. Time is in seconds, and is not a Unix timestamp. | #### Return Value | | | | --- | --- | | bool | True if session invalidated, false if error | ### bool migrate(bool $destroy = false, int $lifetime = null) Migrates the current session to a new session id while maintaining all session attributes. #### Parameters | | | | | --- | --- | --- | | bool | $destroy | Whether to delete the old session or leave it to garbage collection | | int | $lifetime | Sets the cookie lifetime for the session cookie. A null value will leave the system settings unchanged, 0 sets the cookie to expire with browser session. Time is in seconds, and is not a Unix timestamp. | #### Return Value | | | | --- | --- | | bool | True if session migrated, false if error | ### save() Force the session to be saved and closed. This method is generally not required for real sessions as the session will be automatically saved at the end of code execution. ### bool has(string $name) Checks if an attribute is defined. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | bool | true if the attribute is defined, false otherwise | ### mixed get(string $name, mixed $default = null) Returns an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | | mixed | $default | The default value if not found | #### Return Value | | | | --- | --- | | mixed | | ### set(string $name, mixed $value) Sets an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | | | mixed | $value | | ### array all() Returns attributes. #### Return Value | | | | --- | --- | | array | Attributes | ### replace(array $attributes) Sets attributes. #### Parameters | | | | | --- | --- | --- | | array | $attributes | Attributes | ### mixed remove(string $name) Removes an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | mixed | The removed value or null when it does not exist | ### clear() Clears all attributes. ### bool isStarted() Checks if the session was started. #### Return Value | | | | --- | --- | | bool | | ### registerBag([SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") $bag) Registers a SessionBagInterface with the session. #### Parameters | | | | | --- | --- | --- | | [SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | $bag | | ### [SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") getBag(string $name) Gets a bag instance by name. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | [SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | | ### [MetadataBag](storage/metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") getMetadataBag() Gets session meta. #### Return Value | | | | --- | --- | | [MetadataBag](storage/metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | | symfony Symfony\Component\HttpFoundation\Session\Attribute Symfony\Component\HttpFoundation\Session\Attribute ================================================== Classes ------- | | | | --- | --- | | [AttributeBag](attribute/attributebag "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag") | This class relates to session attribute storage. | | [NamespacedAttributeBag](attribute/namespacedattributebag "Symfony\Component\HttpFoundation\Session\Attribute\NamespacedAttributeBag") | This class provides structured storage of session attributes using a name spacing character in the key. | Interfaces ---------- | | | | --- | --- | | *[AttributeBagInterface](attribute/attributebaginterface "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface")* | Attributes store. | symfony Session Session ======== class **Session** implements [SessionInterface](sessioninterface "Symfony\Component\HttpFoundation\Session\SessionInterface"), [IteratorAggregate](http://php.net/IteratorAggregate), [Countable](http://php.net/Countable) Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $storage | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([SessionStorageInterface](storage/sessionstorageinterface "Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface") $storage = null, [AttributeBagInterface](attribute/attributebaginterface "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface") $attributes = null, [FlashBagInterface](flash/flashbaginterface "Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface") $flashes = null) | | | bool | [start](#method_start)() Starts the session storage. | | | bool | [has](#method_has)(string $name) Checks if an attribute is defined. | | | mixed | [get](#method_get)(string $name, mixed $default = null) Returns an attribute. | | | | [set](#method_set)(string $name, mixed $value) Sets an attribute. | | | array | [all](#method_all)() Returns attributes. | | | | [replace](#method_replace)(array $attributes) Sets attributes. | | | mixed | [remove](#method_remove)(string $name) Removes an attribute. | | | | [clear](#method_clear)() Clears all attributes. | | | bool | [isStarted](#method_isStarted)() Checks if the session was started. | | | [ArrayIterator](http://php.net/ArrayIterator) | [getIterator](#method_getIterator)() Returns an iterator for attributes. | | | int | [count](#method_count)() Returns the number of attributes. | | | int | [getUsageIndex](#method_getUsageIndex)() | | | bool | [isEmpty](#method_isEmpty)() | | | bool | [invalidate](#method_invalidate)(int $lifetime = null) Invalidates the current session. | | | bool | [migrate](#method_migrate)(bool $destroy = false, int $lifetime = null) Migrates the current session to a new session id while maintaining all session attributes. | | | | [save](#method_save)() Force the session to be saved and closed. | | | string | [getId](#method_getId)() Returns the session ID. | | | | [setId](#method_setId)(string $id) Sets the session ID. | | | mixed | [getName](#method_getName)() Returns the session name. | | | | [setName](#method_setName)(string $name) Sets the session name. | | | [MetadataBag](storage/metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | [getMetadataBag](#method_getMetadataBag)() Gets session meta. | | | | [registerBag](#method_registerBag)([SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") $bag) Registers a SessionBagInterface with the session. | | | [SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | [getBag](#method_getBag)(string $name) Gets a bag instance by name. | | | [FlashBagInterface](flash/flashbaginterface "Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface") | [getFlashBag](#method_getFlashBag)() Gets the flashbag interface. | | Details ------- ### \_\_construct([SessionStorageInterface](storage/sessionstorageinterface "Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface") $storage = null, [AttributeBagInterface](attribute/attributebaginterface "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface") $attributes = null, [FlashBagInterface](flash/flashbaginterface "Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface") $flashes = null) #### Parameters | | | | | --- | --- | --- | | [SessionStorageInterface](storage/sessionstorageinterface "Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface") | $storage | A SessionStorageInterface instance | | [AttributeBagInterface](attribute/attributebaginterface "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface") | $attributes | An AttributeBagInterface instance, (defaults null for default AttributeBag) | | [FlashBagInterface](flash/flashbaginterface "Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface") | $flashes | A FlashBagInterface instance (defaults null for default FlashBag) | ### bool start() Starts the session storage. #### Return Value | | | | --- | --- | | bool | True if session started | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if session fails to start | ### bool has(string $name) Checks if an attribute is defined. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | bool | true if the attribute is defined, false otherwise | ### mixed get(string $name, mixed $default = null) Returns an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | | mixed | $default | The default value if not found | #### Return Value | | | | --- | --- | | mixed | | ### set(string $name, mixed $value) Sets an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | | | mixed | $value | | ### array all() Returns attributes. #### Return Value | | | | --- | --- | | array | Attributes | ### replace(array $attributes) Sets attributes. #### Parameters | | | | | --- | --- | --- | | array | $attributes | Attributes | ### mixed remove(string $name) Removes an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | mixed | The removed value or null when it does not exist | ### clear() Clears all attributes. ### bool isStarted() Checks if the session was started. #### Return Value | | | | --- | --- | | bool | | ### [ArrayIterator](http://php.net/ArrayIterator) getIterator() Returns an iterator for attributes. #### Return Value | | | | --- | --- | | [ArrayIterator](http://php.net/ArrayIterator) | An \ArrayIterator instance | ### int count() Returns the number of attributes. #### Return Value | | | | --- | --- | | int | The number of attributes | ### int getUsageIndex() #### Return Value | | | | --- | --- | | int | | ### bool isEmpty() #### Return Value | | | | --- | --- | | bool | | ### bool invalidate(int $lifetime = null) Invalidates the current session. Clears all session attributes and flashes and regenerates the session and deletes the old session from persistence. #### Parameters | | | | | --- | --- | --- | | int | $lifetime | Sets the cookie lifetime for the session cookie. A null value will leave the system settings unchanged, 0 sets the cookie to expire with browser session. Time is in seconds, and is not a Unix timestamp. | #### Return Value | | | | --- | --- | | bool | True if session invalidated, false if error | ### bool migrate(bool $destroy = false, int $lifetime = null) Migrates the current session to a new session id while maintaining all session attributes. #### Parameters | | | | | --- | --- | --- | | bool | $destroy | Whether to delete the old session or leave it to garbage collection | | int | $lifetime | Sets the cookie lifetime for the session cookie. A null value will leave the system settings unchanged, 0 sets the cookie to expire with browser session. Time is in seconds, and is not a Unix timestamp. | #### Return Value | | | | --- | --- | | bool | True if session migrated, false if error | ### save() Force the session to be saved and closed. This method is generally not required for real sessions as the session will be automatically saved at the end of code execution. ### string getId() Returns the session ID. #### Return Value | | | | --- | --- | | string | The session ID | ### setId(string $id) Sets the session ID. #### Parameters | | | | | --- | --- | --- | | string | $id | | ### mixed getName() Returns the session name. #### Return Value | | | | --- | --- | | mixed | The session name | ### setName(string $name) Sets the session name. #### Parameters | | | | | --- | --- | --- | | string | $name | | ### [MetadataBag](storage/metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") getMetadataBag() Gets session meta. #### Return Value | | | | --- | --- | | [MetadataBag](storage/metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | | ### registerBag([SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") $bag) Registers a SessionBagInterface with the session. #### Parameters | | | | | --- | --- | --- | | [SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | $bag | | ### [SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") getBag(string $name) Gets a bag instance by name. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | [SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | | ### [FlashBagInterface](flash/flashbaginterface "Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface") getFlashBag() Gets the flashbag interface. #### Return Value | | | | --- | --- | | [FlashBagInterface](flash/flashbaginterface "Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface") | | symfony SessionBagProxy SessionBagProxy ================ class **SessionBagProxy** implements [SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") $bag, array $data, $usageIndex) | | | [SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | [getBag](#method_getBag)() | | | bool | [isEmpty](#method_isEmpty)() | | | string | [getName](#method_getName)() Gets this bag's name. | | | | [initialize](#method_initialize)(array $array) Initializes the Bag. | | | string | [getStorageKey](#method_getStorageKey)() Gets the storage key for this bag. | | | mixed | [clear](#method_clear)() Clears out data from bag. | | Details ------- ### \_\_construct([SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") $bag, array $data, $usageIndex) #### Parameters | | | | | --- | --- | --- | | [SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | $bag | | | array | $data | | | | $usageIndex | | ### [SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") getBag() #### Return Value | | | | --- | --- | | [SessionBagInterface](sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | | ### bool isEmpty() #### Return Value | | | | --- | --- | | bool | | ### string getName() Gets this bag's name. #### Return Value | | | | --- | --- | | string | | ### initialize(array $array) Initializes the Bag. #### Parameters | | | | | --- | --- | --- | | array | $array | | ### string getStorageKey() Gets the storage key for this bag. #### Return Value | | | | --- | --- | | string | | ### mixed clear() Clears out data from bag. #### Return Value | | | | --- | --- | | mixed | Whatever data was contained |
programming_docs
symfony NamespacedAttributeBag NamespacedAttributeBag ======================= class **NamespacedAttributeBag** extends [AttributeBag](attributebag "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag") This class provides structured storage of session attributes using a name spacing character in the key. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $attributes | | from [AttributeBag](attributebag#property_attributes "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $storageKey = '\_sf2\_attributes', string $namespaceCharacter = '/') | | | string | [getName](#method_getName)() Gets this bag's name. | from [AttributeBag](attributebag#method_getName "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag") | | | [setName](#method_setName)($name) | from [AttributeBag](attributebag#method_setName "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag") | | | [initialize](#method_initialize)(array $attributes) Initializes the Bag. | from [AttributeBag](attributebag#method_initialize "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag") | | string | [getStorageKey](#method_getStorageKey)() Gets the storage key for this bag. | from [AttributeBag](attributebag#method_getStorageKey "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag") | | bool | [has](#method_has)(string $name) Checks if an attribute is defined. | | | mixed | [get](#method_get)(string $name, mixed $default = null) Returns an attribute. | | | | [set](#method_set)(string $name, mixed $value) Sets an attribute. | | | array | [all](#method_all)() Returns attributes. | from [AttributeBag](attributebag#method_all "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag") | | | [replace](#method_replace)(array $attributes) Sets attributes. | from [AttributeBag](attributebag#method_replace "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag") | | mixed | [remove](#method_remove)(string $name) Removes an attribute. | | | mixed | [clear](#method_clear)() Clears out data from bag. | from [AttributeBag](attributebag#method_clear "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag") | | [ArrayIterator](http://php.net/ArrayIterator) | [getIterator](#method_getIterator)() Returns an iterator for attributes. | from [AttributeBag](attributebag#method_getIterator "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag") | | int | [count](#method_count)() Returns the number of attributes. | from [AttributeBag](attributebag#method_count "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag") | | array | [resolveAttributePath](#method_resolveAttributePath)(string $name, bool $writeContext = false) Resolves a path in attributes property and returns it as a reference. | | | string | [resolveKey](#method_resolveKey)(string $name) Resolves the key from the name. | | Details ------- ### \_\_construct(string $storageKey = '\_sf2\_attributes', string $namespaceCharacter = '/') #### Parameters | | | | | --- | --- | --- | | string | $storageKey | The key used to store attributes in the session | | string | $namespaceCharacter | Namespace character to use in keys | ### string getName() Gets this bag's name. #### Return Value | | | | --- | --- | | string | | ### setName($name) #### Parameters | | | | | --- | --- | --- | | | $name | | ### initialize(array $attributes) Initializes the Bag. #### Parameters | | | | | --- | --- | --- | | array | $attributes | | ### string getStorageKey() Gets the storage key for this bag. #### Return Value | | | | --- | --- | | string | | ### bool has(string $name) Checks if an attribute is defined. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | bool | true if the attribute is defined, false otherwise | ### mixed get(string $name, mixed $default = null) Returns an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | | mixed | $default | The default value if not found | #### Return Value | | | | --- | --- | | mixed | | ### set(string $name, mixed $value) Sets an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | | | mixed | $value | | ### array all() Returns attributes. #### Return Value | | | | --- | --- | | array | Attributes | ### replace(array $attributes) Sets attributes. #### Parameters | | | | | --- | --- | --- | | array | $attributes | Attributes | ### mixed remove(string $name) Removes an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | mixed | The removed value or null when it does not exist | ### mixed clear() Clears out data from bag. #### Return Value | | | | --- | --- | | mixed | Whatever data was contained | ### [ArrayIterator](http://php.net/ArrayIterator) getIterator() Returns an iterator for attributes. #### Return Value | | | | --- | --- | | [ArrayIterator](http://php.net/ArrayIterator) | An \ArrayIterator instance | ### int count() Returns the number of attributes. #### Return Value | | | | --- | --- | | int | The number of attributes | ### protected array resolveAttributePath(string $name, bool $writeContext = false) Resolves a path in attributes property and returns it as a reference. This method allows structured namespacing of session attributes. #### Parameters | | | | | --- | --- | --- | | string | $name | Key name | | bool | $writeContext | Write context, default false | #### Return Value | | | | --- | --- | | array | | ### protected string resolveKey(string $name) Resolves the key from the name. This is the last part in a dot separated string. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | string | | symfony AttributeBag AttributeBag ============= class **AttributeBag** implements [AttributeBagInterface](attributebaginterface "Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface"), [IteratorAggregate](http://php.net/IteratorAggregate), [Countable](http://php.net/Countable) This class relates to session attribute storage. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $attributes | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $storageKey = '\_sf2\_attributes') | | | string | [getName](#method_getName)() Gets this bag's name. | | | | [setName](#method_setName)($name) | | | | [initialize](#method_initialize)(array $attributes) Initializes the Bag. | | | string | [getStorageKey](#method_getStorageKey)() Gets the storage key for this bag. | | | bool | [has](#method_has)(string $name) Checks if an attribute is defined. | | | mixed | [get](#method_get)(string $name, mixed $default = null) Returns an attribute. | | | | [set](#method_set)(string $name, mixed $value) Sets an attribute. | | | array | [all](#method_all)() Returns attributes. | | | | [replace](#method_replace)(array $attributes) Sets attributes. | | | mixed | [remove](#method_remove)(string $name) Removes an attribute. | | | mixed | [clear](#method_clear)() Clears out data from bag. | | | [ArrayIterator](http://php.net/ArrayIterator) | [getIterator](#method_getIterator)() Returns an iterator for attributes. | | | int | [count](#method_count)() Returns the number of attributes. | | Details ------- ### \_\_construct(string $storageKey = '\_sf2\_attributes') #### Parameters | | | | | --- | --- | --- | | string | $storageKey | The key used to store attributes in the session | ### string getName() Gets this bag's name. #### Return Value | | | | --- | --- | | string | | ### setName($name) #### Parameters | | | | | --- | --- | --- | | | $name | | ### initialize(array $attributes) Initializes the Bag. #### Parameters | | | | | --- | --- | --- | | array | $attributes | | ### string getStorageKey() Gets the storage key for this bag. #### Return Value | | | | --- | --- | | string | | ### bool has(string $name) Checks if an attribute is defined. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | bool | true if the attribute is defined, false otherwise | ### mixed get(string $name, mixed $default = null) Returns an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | | mixed | $default | The default value if not found | #### Return Value | | | | --- | --- | | mixed | | ### set(string $name, mixed $value) Sets an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | | | mixed | $value | | ### array all() Returns attributes. #### Return Value | | | | --- | --- | | array | Attributes | ### replace(array $attributes) Sets attributes. #### Parameters | | | | | --- | --- | --- | | array | $attributes | Attributes | ### mixed remove(string $name) Removes an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | mixed | The removed value or null when it does not exist | ### mixed clear() Clears out data from bag. #### Return Value | | | | --- | --- | | mixed | Whatever data was contained | ### [ArrayIterator](http://php.net/ArrayIterator) getIterator() Returns an iterator for attributes. #### Return Value | | | | --- | --- | | [ArrayIterator](http://php.net/ArrayIterator) | An \ArrayIterator instance | ### int count() Returns the number of attributes. #### Return Value | | | | --- | --- | | int | The number of attributes | symfony AttributeBagInterface AttributeBagInterface ====================== interface **AttributeBagInterface** implements [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") Attributes store. Methods ------- | | | | | --- | --- | --- | | string | [getName](#method_getName)() Gets this bag's name. | from [SessionBagInterface](../sessionbaginterface#method_getName "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | | | [initialize](#method_initialize)(array $array) Initializes the Bag. | from [SessionBagInterface](../sessionbaginterface#method_initialize "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | | string | [getStorageKey](#method_getStorageKey)() Gets the storage key for this bag. | from [SessionBagInterface](../sessionbaginterface#method_getStorageKey "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | | mixed | [clear](#method_clear)() Clears out data from bag. | from [SessionBagInterface](../sessionbaginterface#method_clear "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | | bool | [has](#method_has)(string $name) Checks if an attribute is defined. | | | mixed | [get](#method_get)(string $name, mixed $default = null) Returns an attribute. | | | | [set](#method_set)(string $name, mixed $value) Sets an attribute. | | | array | [all](#method_all)() Returns attributes. | | | | [replace](#method_replace)(array $attributes) Sets attributes. | | | mixed | [remove](#method_remove)(string $name) Removes an attribute. | | Details ------- ### string getName() Gets this bag's name. #### Return Value | | | | --- | --- | | string | | ### initialize(array $array) Initializes the Bag. #### Parameters | | | | | --- | --- | --- | | array | $array | | ### string getStorageKey() Gets the storage key for this bag. #### Return Value | | | | --- | --- | | string | | ### mixed clear() Clears out data from bag. #### Return Value | | | | --- | --- | | mixed | Whatever data was contained | ### bool has(string $name) Checks if an attribute is defined. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | #### Return Value | | | | --- | --- | | bool | true if the attribute is defined, false otherwise | ### mixed get(string $name, mixed $default = null) Returns an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | The attribute name | | mixed | $default | The default value if not found | #### Return Value | | | | --- | --- | | mixed | | ### set(string $name, mixed $value) Sets an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | | | mixed | $value | | ### array all() Returns attributes. #### Return Value | | | | --- | --- | | array | Attributes | ### replace(array $attributes) Sets attributes. #### Parameters | | | | | --- | --- | --- | | array | $attributes | Attributes | ### mixed remove(string $name) Removes an attribute. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | mixed | The removed value or null when it does not exist | symfony NativeSessionStorage NativeSessionStorage ===================== class **NativeSessionStorage** implements [SessionStorageInterface](sessionstorageinterface "Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface") This provides a base class for session attribute storage. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface")[] | $bags | | | | protected bool | $started | | | | protected bool | $closed | | | | protected [AbstractProxy](proxy/abstractproxy "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy")|[SessionHandlerInterface](http://php.net/SessionHandlerInterface) | $saveHandler | | | | protected [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | $metadataBag | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $options = array(), [SessionHandlerInterface](http://php.net/SessionHandlerInterface)|null $handler = null, [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") $metaBag = null) Depending on how you want the storage driver to behave you probably want to override this constructor entirely. | | | [AbstractProxy](proxy/abstractproxy "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy")|[SessionHandlerInterface](http://php.net/SessionHandlerInterface) | [getSaveHandler](#method_getSaveHandler)() Gets the save handler instance. | | | bool | [start](#method_start)() Starts the session. | | | string | [getId](#method_getId)() Returns the session ID. | | | | [setId](#method_setId)(string $id) Sets the session ID. | | | mixed | [getName](#method_getName)() Returns the session name. | | | | [setName](#method_setName)(string $name) Sets the session name. | | | bool | [regenerate](#method_regenerate)(bool $destroy = false, int $lifetime = null) Regenerates id that represents this storage. | | | | [save](#method_save)() Force the session to be saved and closed. | | | | [clear](#method_clear)() Clear all session data in memory. | | | | [registerBag](#method_registerBag)([SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") $bag) Registers a SessionBagInterface for use. | | | [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | [getBag](#method_getBag)(string $name) Gets a SessionBagInterface by name. | | | | [setMetadataBag](#method_setMetadataBag)([MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") $metaBag = null) | | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | [getMetadataBag](#method_getMetadataBag)() Gets the MetadataBag. | | | bool | [isStarted](#method_isStarted)() Checks if the session is started. | | | | [setOptions](#method_setOptions)(array $options) Sets session.\* ini variables. | | | | [setSaveHandler](#method_setSaveHandler)([SessionHandlerInterface](http://php.net/SessionHandlerInterface)|null $saveHandler = null) Registers session save handler as a PHP session handler. | | | | [loadSession](#method_loadSession)(array $session = null) Load the session with attributes. | | Details ------- ### \_\_construct(array $options = array(), [SessionHandlerInterface](http://php.net/SessionHandlerInterface)|null $handler = null, [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") $metaBag = null) Depending on how you want the storage driver to behave you probably want to override this constructor entirely. List of options for $options array with their defaults. #### Parameters | | | | | --- | --- | --- | | array | $options | Session configuration options | | [SessionHandlerInterface](http://php.net/SessionHandlerInterface)|null | $handler | | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | $metaBag | MetadataBag | #### See also | | | | --- | --- | | <http://php.net/session.configuration> | for options but we omit 'session.' from the beginning of the keys for convenience. ("auto\_start", is not supported as it tells PHP to start a session before PHP starts to execute user-land code. Setting during runtime has no effect). cache\_limiter, "" (use "0" to prevent headers from being sent entirely). cache\_expire, "0" cookie\_domain, "" cookie\_httponly, "" cookie\_lifetime, "0" cookie\_path, "/" cookie\_secure, "" gc\_divisor, "100" gc\_maxlifetime, "1440" gc\_probability, "1" lazy\_write, "1" name, "PHPSESSID" referer\_check, "" serialize\_handler, "php" use\_strict\_mode, "0" use\_cookies, "1" use\_only\_cookies, "1" use\_trans\_sid, "0" upload\_progress.enabled, "1" upload\_progress.cleanup, "1" upload\_progress.prefix, "upload\_progress\_" upload\_progress.name, "PHP\_SESSION\_UPLOAD\_PROGRESS" upload\_progress.freq, "1%" upload\_progress.min-freq, "1" url\_rewriter.tags, "a=href,area=href,frame=src,form=,fieldset=" sid\_length, "32" sid\_bits\_per\_character, "5" trans\_sid\_hosts, $\_SERVER['HTTP\_HOST'] trans\_sid\_tags, "a=href,area=href,frame=src,form=" | ### [AbstractProxy](proxy/abstractproxy "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy")|[SessionHandlerInterface](http://php.net/SessionHandlerInterface) getSaveHandler() Gets the save handler instance. #### Return Value | | | | --- | --- | | [AbstractProxy](proxy/abstractproxy "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy")|[SessionHandlerInterface](http://php.net/SessionHandlerInterface) | | ### bool start() Starts the session. #### Return Value | | | | --- | --- | | bool | True if started | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if something goes wrong starting the session | ### string getId() Returns the session ID. #### Return Value | | | | --- | --- | | string | The session ID or empty | ### setId(string $id) Sets the session ID. #### Parameters | | | | | --- | --- | --- | | string | $id | | ### mixed getName() Returns the session name. #### Return Value | | | | --- | --- | | mixed | The session name | ### setName(string $name) Sets the session name. #### Parameters | | | | | --- | --- | --- | | string | $name | | ### bool regenerate(bool $destroy = false, int $lifetime = null) Regenerates id that represents this storage. This method must invoke session\_regenerate\_id($destroy) unless this interface is used for a storage object designed for unit or functional testing where a real PHP session would interfere with testing. Note regenerate+destroy should not clear the session data in memory only delete the session data from persistent storage. Care: When regenerating the session ID no locking is involved in PHP's session design. See https://bugs.php.net/bug.php?id=61470 for a discussion. So you must make sure the regenerated session is saved BEFORE sending the headers with the new ID. Symfony's HttpKernel offers a listener for this. See Symfony\Component\HttpKernel\EventListener\SaveSessionListener. Otherwise session data could get lost again for concurrent requests with the new ID. One result could be that you get logged out after just logging in. #### Parameters | | | | | --- | --- | --- | | bool | $destroy | Destroy session when regenerating? | | int | $lifetime | Sets the cookie lifetime for the session cookie. A null value will leave the system settings unchanged, 0 sets the cookie to expire with browser session. Time is in seconds, and is not a Unix timestamp. | #### Return Value | | | | --- | --- | | bool | True if session regenerated, false if error | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | If an error occurs while regenerating this storage | ### save() Force the session to be saved and closed. This method must invoke session\_write\_close() unless this interface is used for a storage object design for unit or functional testing where a real PHP session would interfere with testing, in which case it should actually persist the session data if required. #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the session is saved without being started, or if the session is already closed | ### clear() Clear all session data in memory. ### registerBag([SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") $bag) Registers a SessionBagInterface for use. #### Parameters | | | | | --- | --- | --- | | [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | $bag | | ### [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") getBag(string $name) Gets a SessionBagInterface by name. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | If the bag does not exist | ### setMetadataBag([MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") $metaBag = null) #### Parameters | | | | | --- | --- | --- | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | $metaBag | | ### [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") getMetadataBag() Gets the MetadataBag. #### Return Value | | | | --- | --- | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | | ### bool isStarted() Checks if the session is started. #### Return Value | | | | --- | --- | | bool | True if started, false otherwise | ### setOptions(array $options) Sets session.\* ini variables. For convenience we omit 'session.' from the beginning of the keys. Explicitly ignores other ini keys. #### Parameters | | | | | --- | --- | --- | | array | $options | Session ini directives array(key => value) | #### See also | | | | --- | --- | | <http://php.net/session.configuration> | | ### setSaveHandler([SessionHandlerInterface](http://php.net/SessionHandlerInterface)|null $saveHandler = null) Registers session save handler as a PHP session handler. To use internal PHP session save handlers, override this method using ini\_set with session.save\_handler and session.save\_path e.g. ``` ini_set('session.save_handler', 'files'); ini_set('session.save_path', '/tmp'); ``` or pass in a \SessionHandler instance which configures session.save\_handler in the constructor, for a template see NativeFileSessionHandler or use handlers in composer package drak/native-session #### Parameters | | | | | --- | --- | --- | | [SessionHandlerInterface](http://php.net/SessionHandlerInterface)|null | $saveHandler | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | #### See also | | | | --- | --- | | <http://php.net/session-set-save-handler> | | | <http://php.net/sessionhandlerinterface> | | | <http://php.net/sessionhandler> | | | <http://github.com/drak/NativeSession> | | ### protected loadSession(array $session = null) Load the session with attributes. After starting the session, PHP retrieves the session from whatever handlers are set to (either PHP's internal, or a custom save handler set with session\_set\_save\_handler()). PHP takes the return value from the read() handler, unserializes it and populates $\_SESSION with the result automatically. #### Parameters | | | | | --- | --- | --- | | array | $session | |
programming_docs
symfony MetadataBag MetadataBag ============ class **MetadataBag** implements [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") Metadata container. Adds metadata to the session. Constants --------- | | | | --- | --- | | CREATED | | | UPDATED | | | LIFETIME | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected array | $meta | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $storageKey = '\_sf2\_meta', int $updateThreshold = 0) | | | | [initialize](#method_initialize)(array $array) Initializes the Bag. | | | int | [getLifetime](#method_getLifetime)() Gets the lifetime that the session cookie was set with. | | | | [stampNew](#method_stampNew)(int $lifetime = null) Stamps a new session's metadata. | | | string | [getStorageKey](#method_getStorageKey)() Gets the storage key for this bag. | | | int | [getCreated](#method_getCreated)() Gets the created timestamp metadata. | | | int | [getLastUsed](#method_getLastUsed)() Gets the last used metadata. | | | mixed | [clear](#method_clear)() Clears out data from bag. | | | string | [getName](#method_getName)() Gets this bag's name. | | | | [setName](#method_setName)(string $name) Sets name. | | Details ------- ### \_\_construct(string $storageKey = '\_sf2\_meta', int $updateThreshold = 0) #### Parameters | | | | | --- | --- | --- | | string | $storageKey | The key used to store bag in the session | | int | $updateThreshold | The time to wait between two UPDATED updates | ### initialize(array $array) Initializes the Bag. #### Parameters | | | | | --- | --- | --- | | array | $array | | ### int getLifetime() Gets the lifetime that the session cookie was set with. #### Return Value | | | | --- | --- | | int | | ### stampNew(int $lifetime = null) Stamps a new session's metadata. #### Parameters | | | | | --- | --- | --- | | int | $lifetime | Sets the cookie lifetime for the session cookie. A null value will leave the system settings unchanged, 0 sets the cookie to expire with browser session. Time is in seconds, and is not a Unix timestamp. | ### string getStorageKey() Gets the storage key for this bag. #### Return Value | | | | --- | --- | | string | | ### int getCreated() Gets the created timestamp metadata. #### Return Value | | | | --- | --- | | int | Unix timestamp | ### int getLastUsed() Gets the last used metadata. #### Return Value | | | | --- | --- | | int | Unix timestamp | ### mixed clear() Clears out data from bag. #### Return Value | | | | --- | --- | | mixed | Whatever data was contained | ### string getName() Gets this bag's name. #### Return Value | | | | --- | --- | | string | | ### setName(string $name) Sets name. #### Parameters | | | | | --- | --- | --- | | string | $name | | symfony Symfony\Component\HttpFoundation\Session\Storage\Handler Symfony\Component\HttpFoundation\Session\Storage\Handler ======================================================== Classes ------- | | | | --- | --- | | [AbstractSessionHandler](handler/abstractsessionhandler "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | This abstract session handler provides a generic implementation of the PHP 7.0 SessionUpdateTimestampHandlerInterface, enabling strict and lazy session handling. | | [MemcachedSessionHandler](handler/memcachedsessionhandler "Symfony\Component\HttpFoundation\Session\Storage\Handler\MemcachedSessionHandler") | Memcached based session storage handler based on the Memcached class provided by the PHP memcached extension. | | [MigratingSessionHandler](handler/migratingsessionhandler "Symfony\Component\HttpFoundation\Session\Storage\Handler\MigratingSessionHandler") | Migrating session handler for migrating from one handler to another. It reads from the current handler and writes both the current and new ones. | | [MongoDbSessionHandler](handler/mongodbsessionhandler "Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandler") | Session handler using the mongodb/mongodb package and MongoDB driver extension. | | [NativeFileSessionHandler](handler/nativefilesessionhandler "Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler") | Native session handler using PHP's built in file storage. | | [NullSessionHandler](handler/nullsessionhandler "Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler") | Can be used in unit testing or in a situations where persisted sessions are not desired. | | [PdoSessionHandler](handler/pdosessionhandler "Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler") | Session handler using a PDO connection to read and write data. | | [RedisSessionHandler](handler/redissessionhandler "Symfony\Component\HttpFoundation\Session\Storage\Handler\RedisSessionHandler") | Redis based session storage handler based on the Redis class provided by the PHP redis extension. | | [StrictSessionHandler](handler/strictsessionhandler "Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler") | Adds basic `SessionUpdateTimestampHandlerInterface` behaviors to another `SessionHandlerInterface`. | symfony Symfony\Component\HttpFoundation\Session\Storage\Proxy Symfony\Component\HttpFoundation\Session\Storage\Proxy ====================================================== Classes ------- | | | | --- | --- | | [AbstractProxy](proxy/abstractproxy "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy") | | | [SessionHandlerProxy](proxy/sessionhandlerproxy "Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy") | | symfony MockArraySessionStorage MockArraySessionStorage ======================== class **MockArraySessionStorage** implements [SessionStorageInterface](sessionstorageinterface "Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface") MockArraySessionStorage mocks the session for unit tests. No PHP session is actually started since a session can be initialized and shutdown only once per PHP execution cycle. When doing functional testing, you should use MockFileSessionStorage instead. Properties ---------- | | | | | | --- | --- | --- | --- | | protected string | $id | | | | protected string | $name | | | | protected bool | $started | | | | protected bool | $closed | | | | protected array | $data | | | | protected [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | $metadataBag | | | | protected array|[SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface")[] | $bags | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $name = 'MOCKSESSID', [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") $metaBag = null) | | | | [setSessionData](#method_setSessionData)(array $array) | | | bool | [start](#method_start)() Starts the session. | | | bool | [regenerate](#method_regenerate)(bool $destroy = false, int $lifetime = null) Regenerates id that represents this storage. | | | string | [getId](#method_getId)() Returns the session ID. | | | | [setId](#method_setId)(string $id) Sets the session ID. | | | mixed | [getName](#method_getName)() Returns the session name. | | | | [setName](#method_setName)(string $name) Sets the session name. | | | | [save](#method_save)() Force the session to be saved and closed. | | | | [clear](#method_clear)() Clear all session data in memory. | | | | [registerBag](#method_registerBag)([SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") $bag) Registers a SessionBagInterface for use. | | | [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | [getBag](#method_getBag)(string $name) Gets a SessionBagInterface by name. | | | bool | [isStarted](#method_isStarted)() Checks if the session is started. | | | | [setMetadataBag](#method_setMetadataBag)([MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") $bag = null) | | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | [getMetadataBag](#method_getMetadataBag)() Gets the MetadataBag. | | | string | [generateId](#method_generateId)() Generates a session ID. | | | | [loadSession](#method_loadSession)() | | Details ------- ### \_\_construct(string $name = 'MOCKSESSID', [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") $metaBag = null) #### Parameters | | | | | --- | --- | --- | | string | $name | | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | $metaBag | | ### setSessionData(array $array) #### Parameters | | | | | --- | --- | --- | | array | $array | | ### bool start() Starts the session. #### Return Value | | | | --- | --- | | bool | True if started | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if something goes wrong starting the session | ### bool regenerate(bool $destroy = false, int $lifetime = null) Regenerates id that represents this storage. This method must invoke session\_regenerate\_id($destroy) unless this interface is used for a storage object designed for unit or functional testing where a real PHP session would interfere with testing. Note regenerate+destroy should not clear the session data in memory only delete the session data from persistent storage. Care: When regenerating the session ID no locking is involved in PHP's session design. See https://bugs.php.net/bug.php?id=61470 for a discussion. So you must make sure the regenerated session is saved BEFORE sending the headers with the new ID. Symfony's HttpKernel offers a listener for this. See Symfony\Component\HttpKernel\EventListener\SaveSessionListener. Otherwise session data could get lost again for concurrent requests with the new ID. One result could be that you get logged out after just logging in. #### Parameters | | | | | --- | --- | --- | | bool | $destroy | Destroy session when regenerating? | | int | $lifetime | Sets the cookie lifetime for the session cookie. A null value will leave the system settings unchanged, 0 sets the cookie to expire with browser session. Time is in seconds, and is not a Unix timestamp. | #### Return Value | | | | --- | --- | | bool | True if session regenerated, false if error | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | If an error occurs while regenerating this storage | ### string getId() Returns the session ID. #### Return Value | | | | --- | --- | | string | The session ID or empty | ### setId(string $id) Sets the session ID. #### Parameters | | | | | --- | --- | --- | | string | $id | | ### mixed getName() Returns the session name. #### Return Value | | | | --- | --- | | mixed | The session name | ### setName(string $name) Sets the session name. #### Parameters | | | | | --- | --- | --- | | string | $name | | ### save() Force the session to be saved and closed. This method must invoke session\_write\_close() unless this interface is used for a storage object design for unit or functional testing where a real PHP session would interfere with testing, in which case it should actually persist the session data if required. #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the session is saved without being started, or if the session is already closed | ### clear() Clear all session data in memory. ### registerBag([SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") $bag) Registers a SessionBagInterface for use. #### Parameters | | | | | --- | --- | --- | | [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | $bag | | ### [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") getBag(string $name) Gets a SessionBagInterface by name. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | If the bag does not exist | ### bool isStarted() Checks if the session is started. #### Return Value | | | | --- | --- | | bool | True if started, false otherwise | ### setMetadataBag([MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") $bag = null) #### Parameters | | | | | --- | --- | --- | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | $bag | | ### [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") getMetadataBag() Gets the MetadataBag. #### Return Value | | | | --- | --- | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | | ### protected string generateId() Generates a session ID. This doesn't need to be particularly cryptographically secure since this is just a mock. #### Return Value | | | | --- | --- | | string | | ### protected loadSession() symfony SessionStorageInterface SessionStorageInterface ======================== interface **SessionStorageInterface** StorageInterface. Methods ------- | | | | | --- | --- | --- | | bool | [start](#method_start)() Starts the session. | | | bool | [isStarted](#method_isStarted)() Checks if the session is started. | | | string | [getId](#method_getId)() Returns the session ID. | | | | [setId](#method_setId)(string $id) Sets the session ID. | | | mixed | [getName](#method_getName)() Returns the session name. | | | | [setName](#method_setName)(string $name) Sets the session name. | | | bool | [regenerate](#method_regenerate)(bool $destroy = false, int $lifetime = null) Regenerates id that represents this storage. | | | | [save](#method_save)() Force the session to be saved and closed. | | | | [clear](#method_clear)() Clear all session data in memory. | | | [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | [getBag](#method_getBag)(string $name) Gets a SessionBagInterface by name. | | | | [registerBag](#method_registerBag)([SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") $bag) Registers a SessionBagInterface for use. | | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | [getMetadataBag](#method_getMetadataBag)() | | Details ------- ### bool start() Starts the session. #### Return Value | | | | --- | --- | | bool | True if started | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if something goes wrong starting the session | ### bool isStarted() Checks if the session is started. #### Return Value | | | | --- | --- | | bool | True if started, false otherwise | ### string getId() Returns the session ID. #### Return Value | | | | --- | --- | | string | The session ID or empty | ### setId(string $id) Sets the session ID. #### Parameters | | | | | --- | --- | --- | | string | $id | | ### mixed getName() Returns the session name. #### Return Value | | | | --- | --- | | mixed | The session name | ### setName(string $name) Sets the session name. #### Parameters | | | | | --- | --- | --- | | string | $name | | ### bool regenerate(bool $destroy = false, int $lifetime = null) Regenerates id that represents this storage. This method must invoke session\_regenerate\_id($destroy) unless this interface is used for a storage object designed for unit or functional testing where a real PHP session would interfere with testing. Note regenerate+destroy should not clear the session data in memory only delete the session data from persistent storage. Care: When regenerating the session ID no locking is involved in PHP's session design. See https://bugs.php.net/bug.php?id=61470 for a discussion. So you must make sure the regenerated session is saved BEFORE sending the headers with the new ID. Symfony's HttpKernel offers a listener for this. See Symfony\Component\HttpKernel\EventListener\SaveSessionListener. Otherwise session data could get lost again for concurrent requests with the new ID. One result could be that you get logged out after just logging in. #### Parameters | | | | | --- | --- | --- | | bool | $destroy | Destroy session when regenerating? | | int | $lifetime | Sets the cookie lifetime for the session cookie. A null value will leave the system settings unchanged, 0 sets the cookie to expire with browser session. Time is in seconds, and is not a Unix timestamp. | #### Return Value | | | | --- | --- | | bool | True if session regenerated, false if error | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | If an error occurs while regenerating this storage | ### save() Force the session to be saved and closed. This method must invoke session\_write\_close() unless this interface is used for a storage object design for unit or functional testing where a real PHP session would interfere with testing, in which case it should actually persist the session data if required. #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the session is saved without being started, or if the session is already closed | ### clear() Clear all session data in memory. ### [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") getBag(string $name) Gets a SessionBagInterface by name. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | If the bag does not exist | ### registerBag([SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") $bag) Registers a SessionBagInterface for use. #### Parameters | | | | | --- | --- | --- | | [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | $bag | | ### [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") getMetadataBag() #### Return Value | | | | --- | --- | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | | symfony MockFileSessionStorage MockFileSessionStorage ======================= class **MockFileSessionStorage** extends [MockArraySessionStorage](mockarraysessionstorage "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") MockFileSessionStorage is used to mock sessions for functional testing when done in a single PHP process. No PHP session is actually started since a session can be initialized and shutdown only once per PHP execution cycle and this class does not pollute any session related globals, including session\_*() functions or session.* PHP ini directives. Properties ---------- | | | | | | --- | --- | --- | --- | | protected string | $id | | from [MockArraySessionStorage](mockarraysessionstorage#property_id "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | protected string | $name | | from [MockArraySessionStorage](mockarraysessionstorage#property_name "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | protected bool | $started | | from [MockArraySessionStorage](mockarraysessionstorage#property_started "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | protected bool | $closed | | from [MockArraySessionStorage](mockarraysessionstorage#property_closed "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | protected array | $data | | from [MockArraySessionStorage](mockarraysessionstorage#property_data "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | protected [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | $metadataBag | | from [MockArraySessionStorage](mockarraysessionstorage#property_metadataBag "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | protected array|[SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface")[] | $bags | | from [MockArraySessionStorage](mockarraysessionstorage#property_bags "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $savePath = null, string $name = 'MOCKSESSID', [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") $metaBag = null) | | | | [setSessionData](#method_setSessionData)(array $array) | from [MockArraySessionStorage](mockarraysessionstorage#method_setSessionData "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | bool | [start](#method_start)() Starts the session. | | | bool | [regenerate](#method_regenerate)(bool $destroy = false, int $lifetime = null) Regenerates id that represents this storage. | | | string | [getId](#method_getId)() Returns the session ID. | from [MockArraySessionStorage](mockarraysessionstorage#method_getId "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | | [setId](#method_setId)(string $id) Sets the session ID. | from [MockArraySessionStorage](mockarraysessionstorage#method_setId "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | mixed | [getName](#method_getName)() Returns the session name. | from [MockArraySessionStorage](mockarraysessionstorage#method_getName "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | | [setName](#method_setName)(string $name) Sets the session name. | from [MockArraySessionStorage](mockarraysessionstorage#method_setName "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | | [save](#method_save)() Force the session to be saved and closed. | | | | [clear](#method_clear)() Clear all session data in memory. | from [MockArraySessionStorage](mockarraysessionstorage#method_clear "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | | [registerBag](#method_registerBag)([SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") $bag) Registers a SessionBagInterface for use. | from [MockArraySessionStorage](mockarraysessionstorage#method_registerBag "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | [getBag](#method_getBag)(string $name) Gets a SessionBagInterface by name. | from [MockArraySessionStorage](mockarraysessionstorage#method_getBag "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | bool | [isStarted](#method_isStarted)() Checks if the session is started. | from [MockArraySessionStorage](mockarraysessionstorage#method_isStarted "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | | [setMetadataBag](#method_setMetadataBag)([MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") $bag = null) | from [MockArraySessionStorage](mockarraysessionstorage#method_setMetadataBag "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | [getMetadataBag](#method_getMetadataBag)() Gets the MetadataBag. | from [MockArraySessionStorage](mockarraysessionstorage#method_getMetadataBag "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | string | [generateId](#method_generateId)() Generates a session ID. | from [MockArraySessionStorage](mockarraysessionstorage#method_generateId "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | | | [loadSession](#method_loadSession)() | from [MockArraySessionStorage](mockarraysessionstorage#method_loadSession "Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage") | Details ------- ### \_\_construct(string $savePath = null, string $name = 'MOCKSESSID', [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") $metaBag = null) #### Parameters | | | | | --- | --- | --- | | string | $savePath | Path of directory to save session files | | string | $name | | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | $metaBag | | ### setSessionData(array $array) #### Parameters | | | | | --- | --- | --- | | array | $array | | ### bool start() Starts the session. #### Return Value | | | | --- | --- | | bool | True if started | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if something goes wrong starting the session | ### bool regenerate(bool $destroy = false, int $lifetime = null) Regenerates id that represents this storage. This method must invoke session\_regenerate\_id($destroy) unless this interface is used for a storage object designed for unit or functional testing where a real PHP session would interfere with testing. Note regenerate+destroy should not clear the session data in memory only delete the session data from persistent storage. Care: When regenerating the session ID no locking is involved in PHP's session design. See https://bugs.php.net/bug.php?id=61470 for a discussion. So you must make sure the regenerated session is saved BEFORE sending the headers with the new ID. Symfony's HttpKernel offers a listener for this. See Symfony\Component\HttpKernel\EventListener\SaveSessionListener. Otherwise session data could get lost again for concurrent requests with the new ID. One result could be that you get logged out after just logging in. #### Parameters | | | | | --- | --- | --- | | bool | $destroy | Destroy session when regenerating? | | int | $lifetime | Sets the cookie lifetime for the session cookie. A null value will leave the system settings unchanged, 0 sets the cookie to expire with browser session. Time is in seconds, and is not a Unix timestamp. | #### Return Value | | | | --- | --- | | bool | True if session regenerated, false if error | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | If an error occurs while regenerating this storage | ### string getId() Returns the session ID. #### Return Value | | | | --- | --- | | string | The session ID or empty | ### setId(string $id) Sets the session ID. #### Parameters | | | | | --- | --- | --- | | string | $id | | ### mixed getName() Returns the session name. #### Return Value | | | | --- | --- | | mixed | The session name | ### setName(string $name) Sets the session name. #### Parameters | | | | | --- | --- | --- | | string | $name | | ### save() Force the session to be saved and closed. This method must invoke session\_write\_close() unless this interface is used for a storage object design for unit or functional testing where a real PHP session would interfere with testing, in which case it should actually persist the session data if required. #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the session is saved without being started, or if the session is already closed | ### clear() Clear all session data in memory. ### registerBag([SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") $bag) Registers a SessionBagInterface for use. #### Parameters | | | | | --- | --- | --- | | [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | $bag | | ### [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") getBag(string $name) Gets a SessionBagInterface by name. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | If the bag does not exist | ### bool isStarted() Checks if the session is started. #### Return Value | | | | --- | --- | | bool | True if started, false otherwise | ### setMetadataBag([MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") $bag = null) #### Parameters | | | | | --- | --- | --- | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | $bag | | ### [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") getMetadataBag() Gets the MetadataBag. #### Return Value | | | | --- | --- | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | | ### protected string generateId() Generates a session ID. This doesn't need to be particularly cryptographically secure since this is just a mock. #### Return Value | | | | --- | --- | | string | | ### protected loadSession()
programming_docs
symfony PhpBridgeSessionStorage PhpBridgeSessionStorage ======================== class **PhpBridgeSessionStorage** extends [NativeSessionStorage](nativesessionstorage "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") Allows session to be started by PHP and managed by Symfony. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface")[] | $bags | | from [NativeSessionStorage](nativesessionstorage#property_bags "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | protected bool | $started | | from [NativeSessionStorage](nativesessionstorage#property_started "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | protected bool | $closed | | from [NativeSessionStorage](nativesessionstorage#property_closed "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | protected [AbstractProxy](proxy/abstractproxy "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy")|[SessionHandlerInterface](http://php.net/SessionHandlerInterface) | $saveHandler | | from [NativeSessionStorage](nativesessionstorage#property_saveHandler "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | protected [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | $metadataBag | | from [NativeSessionStorage](nativesessionstorage#property_metadataBag "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([SessionHandlerInterface](http://php.net/SessionHandlerInterface)|null $handler = null, [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") $metaBag = null) | | | [AbstractProxy](proxy/abstractproxy "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy")|[SessionHandlerInterface](http://php.net/SessionHandlerInterface) | [getSaveHandler](#method_getSaveHandler)() Gets the save handler instance. | from [NativeSessionStorage](nativesessionstorage#method_getSaveHandler "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | bool | [start](#method_start)() Starts the session. | | | string | [getId](#method_getId)() Returns the session ID. | from [NativeSessionStorage](nativesessionstorage#method_getId "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | | [setId](#method_setId)(string $id) Sets the session ID. | from [NativeSessionStorage](nativesessionstorage#method_setId "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | mixed | [getName](#method_getName)() Returns the session name. | from [NativeSessionStorage](nativesessionstorage#method_getName "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | | [setName](#method_setName)(string $name) Sets the session name. | from [NativeSessionStorage](nativesessionstorage#method_setName "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | bool | [regenerate](#method_regenerate)(bool $destroy = false, int $lifetime = null) Regenerates id that represents this storage. | from [NativeSessionStorage](nativesessionstorage#method_regenerate "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | | [save](#method_save)() Force the session to be saved and closed. | from [NativeSessionStorage](nativesessionstorage#method_save "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | | [clear](#method_clear)() Clear all session data in memory. | | | | [registerBag](#method_registerBag)([SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") $bag) Registers a SessionBagInterface for use. | from [NativeSessionStorage](nativesessionstorage#method_registerBag "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | [getBag](#method_getBag)(string $name) Gets a SessionBagInterface by name. | from [NativeSessionStorage](nativesessionstorage#method_getBag "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | | [setMetadataBag](#method_setMetadataBag)([MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") $metaBag = null) | from [NativeSessionStorage](nativesessionstorage#method_setMetadataBag "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | [getMetadataBag](#method_getMetadataBag)() Gets the MetadataBag. | from [NativeSessionStorage](nativesessionstorage#method_getMetadataBag "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | bool | [isStarted](#method_isStarted)() Checks if the session is started. | from [NativeSessionStorage](nativesessionstorage#method_isStarted "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | | [setOptions](#method_setOptions)(array $options) Sets session.\* ini variables. | from [NativeSessionStorage](nativesessionstorage#method_setOptions "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | | [setSaveHandler](#method_setSaveHandler)([SessionHandlerInterface](http://php.net/SessionHandlerInterface)|null $saveHandler = null) Registers session save handler as a PHP session handler. | from [NativeSessionStorage](nativesessionstorage#method_setSaveHandler "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | | | [loadSession](#method_loadSession)(array $session = null) Load the session with attributes. | from [NativeSessionStorage](nativesessionstorage#method_loadSession "Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage") | Details ------- ### \_\_construct([SessionHandlerInterface](http://php.net/SessionHandlerInterface)|null $handler = null, [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") $metaBag = null) #### Parameters | | | | | --- | --- | --- | | [SessionHandlerInterface](http://php.net/SessionHandlerInterface)|null | $handler | | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | $metaBag | MetadataBag | ### [AbstractProxy](proxy/abstractproxy "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy")|[SessionHandlerInterface](http://php.net/SessionHandlerInterface) getSaveHandler() Gets the save handler instance. #### Return Value | | | | --- | --- | | [AbstractProxy](proxy/abstractproxy "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy")|[SessionHandlerInterface](http://php.net/SessionHandlerInterface) | | ### bool start() Starts the session. #### Return Value | | | | --- | --- | | bool | True if started | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if something goes wrong starting the session | ### string getId() Returns the session ID. #### Return Value | | | | --- | --- | | string | The session ID or empty | ### setId(string $id) Sets the session ID. #### Parameters | | | | | --- | --- | --- | | string | $id | | ### mixed getName() Returns the session name. #### Return Value | | | | --- | --- | | mixed | The session name | ### setName(string $name) Sets the session name. #### Parameters | | | | | --- | --- | --- | | string | $name | | ### bool regenerate(bool $destroy = false, int $lifetime = null) Regenerates id that represents this storage. This method must invoke session\_regenerate\_id($destroy) unless this interface is used for a storage object designed for unit or functional testing where a real PHP session would interfere with testing. Note regenerate+destroy should not clear the session data in memory only delete the session data from persistent storage. Care: When regenerating the session ID no locking is involved in PHP's session design. See https://bugs.php.net/bug.php?id=61470 for a discussion. So you must make sure the regenerated session is saved BEFORE sending the headers with the new ID. Symfony's HttpKernel offers a listener for this. See Symfony\Component\HttpKernel\EventListener\SaveSessionListener. Otherwise session data could get lost again for concurrent requests with the new ID. One result could be that you get logged out after just logging in. #### Parameters | | | | | --- | --- | --- | | bool | $destroy | Destroy session when regenerating? | | int | $lifetime | Sets the cookie lifetime for the session cookie. A null value will leave the system settings unchanged, 0 sets the cookie to expire with browser session. Time is in seconds, and is not a Unix timestamp. | #### Return Value | | | | --- | --- | | bool | True if session regenerated, false if error | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | If an error occurs while regenerating this storage | ### save() Force the session to be saved and closed. This method must invoke session\_write\_close() unless this interface is used for a storage object design for unit or functional testing where a real PHP session would interfere with testing, in which case it should actually persist the session data if required. #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | if the session is saved without being started, or if the session is already closed | ### clear() Clear all session data in memory. ### registerBag([SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") $bag) Registers a SessionBagInterface for use. #### Parameters | | | | | --- | --- | --- | | [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | $bag | | ### [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") getBag(string $name) Gets a SessionBagInterface by name. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | If the bag does not exist | ### setMetadataBag([MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") $metaBag = null) #### Parameters | | | | | --- | --- | --- | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | $metaBag | | ### [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") getMetadataBag() Gets the MetadataBag. #### Return Value | | | | --- | --- | | [MetadataBag](metadatabag "Symfony\Component\HttpFoundation\Session\Storage\MetadataBag") | | ### bool isStarted() Checks if the session is started. #### Return Value | | | | --- | --- | | bool | True if started, false otherwise | ### setOptions(array $options) Sets session.\* ini variables. For convenience we omit 'session.' from the beginning of the keys. Explicitly ignores other ini keys. #### Parameters | | | | | --- | --- | --- | | array | $options | Session ini directives array(key => value) | #### See also | | | | --- | --- | | <http://php.net/session.configuration> | | ### setSaveHandler([SessionHandlerInterface](http://php.net/SessionHandlerInterface)|null $saveHandler = null) Registers session save handler as a PHP session handler. To use internal PHP session save handlers, override this method using ini\_set with session.save\_handler and session.save\_path e.g. ``` ini_set('session.save_handler', 'files'); ini_set('session.save_path', '/tmp'); ``` or pass in a \SessionHandler instance which configures session.save\_handler in the constructor, for a template see NativeFileSessionHandler or use handlers in composer package drak/native-session #### Parameters | | | | | --- | --- | --- | | [SessionHandlerInterface](http://php.net/SessionHandlerInterface)|null | $saveHandler | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | #### See also | | | | --- | --- | | <http://php.net/session-set-save-handler> | | | <http://php.net/sessionhandlerinterface> | | | <http://php.net/sessionhandler> | | | <http://github.com/drak/NativeSession> | | ### protected loadSession(array $session = null) Load the session with attributes. After starting the session, PHP retrieves the session from whatever handlers are set to (either PHP's internal, or a custom save handler set with session\_set\_save\_handler()). PHP takes the return value from the read() handler, unserializes it and populates $\_SESSION with the result automatically. #### Parameters | | | | | --- | --- | --- | | array | $session | | symfony AbstractSessionHandler AbstractSessionHandler ======================= abstract class **AbstractSessionHandler** implements [SessionHandlerInterface](http://php.net/SessionHandlerInterface), [SessionUpdateTimestampHandlerInterface](http://php.net/SessionUpdateTimestampHandlerInterface) This abstract session handler provides a generic implementation of the PHP 7.0 SessionUpdateTimestampHandlerInterface, enabling strict and lazy session handling. Methods ------- | | | | | --- | --- | --- | | | [open](#method_open)($savePath, $sessionName) {@inheritdoc} | | | string | [doRead](#method_doRead)(string $sessionId) | | | bool | [doWrite](#method_doWrite)(string $sessionId, string $data) | | | bool | [doDestroy](#method_doDestroy)(string $sessionId) | | | | [validateId](#method_validateId)($sessionId) {@inheritdoc} | | | | [read](#method_read)($sessionId) {@inheritdoc} | | | | [write](#method_write)($sessionId, $data) {@inheritdoc} | | | | [destroy](#method_destroy)($sessionId) {@inheritdoc} | | Details ------- ### open($savePath, $sessionName) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $savePath | | | | $sessionName | | ### abstract protected string doRead(string $sessionId) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | #### Return Value | | | | --- | --- | | string | | ### abstract protected bool doWrite(string $sessionId, string $data) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | | string | $data | | #### Return Value | | | | --- | --- | | bool | | ### abstract protected bool doDestroy(string $sessionId) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | #### Return Value | | | | --- | --- | | bool | | ### validateId($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### read($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### write($sessionId, $data) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $data | | ### destroy($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | symfony MongoDbSessionHandler MongoDbSessionHandler ====================== class **MongoDbSessionHandler** extends [AbstractSessionHandler](abstractsessionhandler "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") Session handler using the mongodb/mongodb package and MongoDB driver extension. Methods ------- | | | | | --- | --- | --- | | | [open](#method_open)($savePath, $sessionName) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_open "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | string | [doRead](#method_doRead)(string $sessionId) | | | bool | [doWrite](#method_doWrite)(string $sessionId, string $data) | | | bool | [doDestroy](#method_doDestroy)(string $sessionId) | | | | [validateId](#method_validateId)($sessionId) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_validateId "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [read](#method_read)($sessionId) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_read "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [write](#method_write)($sessionId, $data) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_write "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [destroy](#method_destroy)($sessionId) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_destroy "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [\_\_construct](#method___construct)(Client $mongo, array $options) Constructor. | | | | [close](#method_close)() {@inheritdoc} | | | | [gc](#method_gc)($maxlifetime) {@inheritdoc} | | | | [updateTimestamp](#method_updateTimestamp)($sessionId, $data) {@inheritdoc} | | | Client | [getMongo](#method_getMongo)() | | Details ------- ### open($savePath, $sessionName) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $savePath | | | | $sessionName | | ### protected string doRead(string $sessionId) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | #### Return Value | | | | --- | --- | | string | | ### protected bool doWrite(string $sessionId, string $data) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | | string | $data | | #### Return Value | | | | --- | --- | | bool | | ### protected bool doDestroy(string $sessionId) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | #### Return Value | | | | --- | --- | | bool | | ### validateId($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### read($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### write($sessionId, $data) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $data | | ### destroy($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### \_\_construct(Client $mongo, array $options) Constructor. List of available options: \* database: The name of the database [required] \* collection: The name of the collection [required] \* id\_field: The field name for storing the session id [default: \_id] \* data\_field: The field name for storing the session data [default: data] \* time\_field: The field name for storing the timestamp [default: time] \* expiry\_field: The field name for storing the expiry-timestamp [default: expires\_at]. It is strongly recommended to put an index on the `expiry_field` for garbage-collection. Alternatively it's possible to automatically expire the sessions in the database as described below: A TTL collections can be used on MongoDB 2.2+ to cleanup expired sessions automatically. Such an index can for example look like this: ``` db.<session-collection>.ensureIndex( { "<expiry-field>": 1 }, { "expireAfterSeconds": 0 } ) ``` More details on: http://docs.mongodb.org/manual/tutorial/expire-data/ If you use such an index, you can drop `gc_probability` to 0 since no garbage-collection is required. #### Parameters | | | | | --- | --- | --- | | Client | $mongo | A MongoDB\Client instance | | array | $options | An associative array of field options | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When "database" or "collection" not provided | ### close() {@inheritdoc} ### gc($maxlifetime) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $maxlifetime | | ### updateTimestamp($sessionId, $data) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $data | | ### protected Client getMongo() #### Return Value | | | | --- | --- | | Client | |
programming_docs
symfony PdoSessionHandler PdoSessionHandler ================== class **PdoSessionHandler** extends [AbstractSessionHandler](abstractsessionhandler "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") Session handler using a PDO connection to read and write data. It works with MySQL, PostgreSQL, Oracle, SQL Server and SQLite and implements different locking strategies to handle concurrent access to the same session. Locking is necessary to prevent loss of data due to race conditions and to keep the session data consistent between read() and write(). With locking, requests for the same session will wait until the other one finished writing. For this reason it's best practice to close a session as early as possible to improve concurrency. PHPs internal files session handler also implements locking. Attention: Since SQLite does not support row level locks but locks the whole database, it means only one session can be accessed at a time. Even different sessions would wait for another to finish. So saving session in SQLite should only be considered for development or prototypes. Session data is a binary string that can contain non-printable characters like the null byte. For this reason it must be saved in a binary column in the database like BLOB in MySQL. Saving it in a character column could corrupt the data. You can use createTable() to initialize a correctly defined table. Constants --------- | | | | --- | --- | | LOCK\_NONE | *No locking is done. This means sessions are prone to loss of data due to race conditions of concurrent requests to the same session. The last session write will win in this case. It might be useful when you implement your own logic to deal with this like an optimistic approach.* | | LOCK\_ADVISORY | *Creates an application-level lock on a session. The disadvantage is that the lock is not enforced by the database and thus other, unaware parts of the application could still concurrently modify the session. The advantage is it does not require a transaction.* This mode is not available for SQLite and not yet implemented for oci and sqlsrv. | | LOCK\_TRANSACTIONAL | *Issues a real row lock. Since it uses a transaction between opening and closing a session, you have to be careful when you use same database connection that you also use for your application logic. This mode is the default because it's the only reliable solution across DBMSs.* | Methods ------- | | | | | --- | --- | --- | | | [open](#method_open)($savePath, $sessionName) {@inheritdoc} | | | string | [doRead](#method_doRead)(string $sessionId) Reads the session data in respect to the different locking strategies. | | | bool | [doWrite](#method_doWrite)(string $sessionId, string $data) | | | bool | [doDestroy](#method_doDestroy)(string $sessionId) | | | | [validateId](#method_validateId)($sessionId) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_validateId "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [read](#method_read)($sessionId) {@inheritdoc} | | | | [write](#method_write)($sessionId, $data) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_write "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [destroy](#method_destroy)($sessionId) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_destroy "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [\_\_construct](#method___construct)([PDO](http://php.net/PDO)|string|null $pdoOrDsn = null, array $options = array()) You can either pass an existing database connection as PDO instance or pass a DSN string that will be used to lazy-connect to the database when the session is actually used. Furthermore it's possible to pass null which will then use the session.save\_path ini setting as PDO DSN parameter. | | | | [createTable](#method_createTable)() Creates the table to store sessions which can be called once for setup. | | | bool | [isSessionExpired](#method_isSessionExpired)() Returns true when the current session exists but expired according to session.gc\_maxlifetime. | | | | [gc](#method_gc)($maxlifetime) {@inheritdoc} | | | | [updateTimestamp](#method_updateTimestamp)($sessionId, $data) {@inheritdoc} | | | | [close](#method_close)() {@inheritdoc} | | | [PDO](http://php.net/PDO) | [getConnection](#method_getConnection)() Return a PDO instance. | | Details ------- ### open($savePath, $sessionName) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $savePath | | | | $sessionName | | ### protected string doRead(string $sessionId) Reads the session data in respect to the different locking strategies. We need to make sure we do not return session data that is already considered garbage according to the session.gc\_maxlifetime setting because gc() is called after read() and only sometimes. #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | #### Return Value | | | | --- | --- | | string | | ### protected bool doWrite(string $sessionId, string $data) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | | string | $data | | #### Return Value | | | | --- | --- | | bool | | ### protected bool doDestroy(string $sessionId) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | #### Return Value | | | | --- | --- | | bool | | ### validateId($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### read($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### write($sessionId, $data) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $data | | ### destroy($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### \_\_construct([PDO](http://php.net/PDO)|string|null $pdoOrDsn = null, array $options = array()) You can either pass an existing database connection as PDO instance or pass a DSN string that will be used to lazy-connect to the database when the session is actually used. Furthermore it's possible to pass null which will then use the session.save\_path ini setting as PDO DSN parameter. List of available options: \* db\_table: The name of the table [default: sessions] \* db\_id\_col: The column where to store the session id [default: sess\_id] \* db\_data\_col: The column where to store the session data [default: sess\_data] \* db\_lifetime\_col: The column where to store the lifetime [default: sess\_lifetime] \* db\_time\_col: The column where to store the timestamp [default: sess\_time] \* db\_username: The username when lazy-connect [default: ''] \* db\_password: The password when lazy-connect [default: ''] \* db\_connection\_options: An array of driver-specific connection options [default: array()] \* lock\_mode: The strategy for locking, see constants [default: LOCK\_TRANSACTIONAL] #### Parameters | | | | | --- | --- | --- | | [PDO](http://php.net/PDO)|string|null | $pdoOrDsn | A \PDO instance or DSN string or URL string or null | | array | $options | An associative array of options | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When PDO error mode is not PDO::ERRMODE\_EXCEPTION | ### createTable() Creates the table to store sessions which can be called once for setup. Session ID is saved in a column of maximum length 128 because that is enough even for a 512 bit configured session.hash\_function like Whirlpool. Session data is saved in a BLOB. One could also use a shorter inlined varbinary column if one was sure the data fits into it. #### Exceptions | | | | --- | --- | | [PDOException](http://php.net/PDOException) | When the table already exists | | [DomainException](http://php.net/DomainException) | When an unsupported PDO driver is used | ### bool isSessionExpired() Returns true when the current session exists but expired according to session.gc\_maxlifetime. Can be used to distinguish between a new session and one that expired due to inactivity. #### Return Value | | | | --- | --- | | bool | Whether current session expired | ### gc($maxlifetime) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $maxlifetime | | ### updateTimestamp($sessionId, $data) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $data | | ### close() {@inheritdoc} ### protected [PDO](http://php.net/PDO) getConnection() Return a PDO instance. #### Return Value | | | | --- | --- | | [PDO](http://php.net/PDO) | | symfony NativeFileSessionHandler NativeFileSessionHandler ========================= class **NativeFileSessionHandler** extends [SessionHandler](http://php.net/SessionHandler) Native session handler using PHP's built in file storage. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $savePath = null) | | Details ------- ### \_\_construct(string $savePath = null) #### Parameters | | | | | --- | --- | --- | | string | $savePath | Path of directory to save session files Default null will leave setting as defined by PHP. '/path', 'N;/path', or 'N;octal-mode;/path | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | On invalid $savePath | | [RuntimeException](http://php.net/RuntimeException) | When failing to create the save directory | #### See also | | | | --- | --- | | <http://php.net/session.configuration.php#ini.session.save-path> | for further details. | symfony NullSessionHandler NullSessionHandler =================== class **NullSessionHandler** extends [AbstractSessionHandler](abstractsessionhandler "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") Can be used in unit testing or in a situations where persisted sessions are not desired. Methods ------- | | | | | --- | --- | --- | | | [open](#method_open)($savePath, $sessionName) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_open "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | string | [doRead](#method_doRead)(string $sessionId) | | | bool | [doWrite](#method_doWrite)(string $sessionId, string $data) | | | bool | [doDestroy](#method_doDestroy)(string $sessionId) | | | | [validateId](#method_validateId)($sessionId) {@inheritdoc} | | | | [read](#method_read)($sessionId) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_read "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [write](#method_write)($sessionId, $data) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_write "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [destroy](#method_destroy)($sessionId) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_destroy "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [close](#method_close)() {@inheritdoc} | | | | [updateTimestamp](#method_updateTimestamp)($sessionId, $data) {@inheritdoc} | | | | [gc](#method_gc)($maxlifetime) {@inheritdoc} | | Details ------- ### open($savePath, $sessionName) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $savePath | | | | $sessionName | | ### protected string doRead(string $sessionId) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | #### Return Value | | | | --- | --- | | string | | ### protected bool doWrite(string $sessionId, string $data) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | | string | $data | | #### Return Value | | | | --- | --- | | bool | | ### protected bool doDestroy(string $sessionId) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | #### Return Value | | | | --- | --- | | bool | | ### validateId($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### read($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### write($sessionId, $data) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $data | | ### destroy($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### close() {@inheritdoc} ### updateTimestamp($sessionId, $data) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $data | | ### gc($maxlifetime) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $maxlifetime | | symfony MemcachedSessionHandler MemcachedSessionHandler ======================== class **MemcachedSessionHandler** extends [AbstractSessionHandler](abstractsessionhandler "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") Memcached based session storage handler based on the Memcached class provided by the PHP memcached extension. Methods ------- | | | | | --- | --- | --- | | | [open](#method_open)($savePath, $sessionName) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_open "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | string | [doRead](#method_doRead)(string $sessionId) | | | bool | [doWrite](#method_doWrite)(string $sessionId, string $data) | | | bool | [doDestroy](#method_doDestroy)(string $sessionId) | | | | [validateId](#method_validateId)($sessionId) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_validateId "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [read](#method_read)($sessionId) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_read "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [write](#method_write)($sessionId, $data) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_write "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [destroy](#method_destroy)($sessionId) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_destroy "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [\_\_construct](#method___construct)(Memcached $memcached, array $options = array()) Constructor. | | | | [close](#method_close)() {@inheritdoc} | | | | [updateTimestamp](#method_updateTimestamp)($sessionId, $data) {@inheritdoc} | | | | [gc](#method_gc)($maxlifetime) {@inheritdoc} | | | Memcached | [getMemcached](#method_getMemcached)() Return a Memcached instance. | | Details ------- ### open($savePath, $sessionName) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $savePath | | | | $sessionName | | ### protected string doRead(string $sessionId) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | #### Return Value | | | | --- | --- | | string | | ### protected bool doWrite(string $sessionId, string $data) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | | string | $data | | #### Return Value | | | | --- | --- | | bool | | ### protected bool doDestroy(string $sessionId) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | #### Return Value | | | | --- | --- | | bool | | ### validateId($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### read($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### write($sessionId, $data) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $data | | ### destroy($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### \_\_construct(Memcached $memcached, array $options = array()) Constructor. List of available options: \* prefix: The prefix to use for the memcached keys in order to avoid collision \* expiretime: The time to live in seconds. #### Parameters | | | | | --- | --- | --- | | Memcached | $memcached | A \Memcached instance | | array | $options | An associative array of Memcached options | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When unsupported options are passed | ### close() {@inheritdoc} ### updateTimestamp($sessionId, $data) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $data | | ### gc($maxlifetime) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $maxlifetime | | ### protected Memcached getMemcached() Return a Memcached instance. #### Return Value | | | | --- | --- | | Memcached | | symfony MigratingSessionHandler MigratingSessionHandler ======================== class **MigratingSessionHandler** implements [SessionHandlerInterface](http://php.net/SessionHandlerInterface), [SessionUpdateTimestampHandlerInterface](http://php.net/SessionUpdateTimestampHandlerInterface) Migrating session handler for migrating from one handler to another. It reads from the current handler and writes both the current and new ones. It ignores errors from the new handler. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([SessionHandlerInterface](http://php.net/SessionHandlerInterface) $currentHandler, [SessionHandlerInterface](http://php.net/SessionHandlerInterface) $writeOnlyHandler) | | | | [close](#method_close)() {@inheritdoc} | | | | [destroy](#method_destroy)($sessionId) {@inheritdoc} | | | | [gc](#method_gc)($maxlifetime) {@inheritdoc} | | | | [open](#method_open)($savePath, $sessionName) {@inheritdoc} | | | | [read](#method_read)($sessionId) {@inheritdoc} | | | | [write](#method_write)($sessionId, $sessionData) {@inheritdoc} | | | | [validateId](#method_validateId)($sessionId) {@inheritdoc} | | | | [updateTimestamp](#method_updateTimestamp)($sessionId, $sessionData) {@inheritdoc} | | Details ------- ### \_\_construct([SessionHandlerInterface](http://php.net/SessionHandlerInterface) $currentHandler, [SessionHandlerInterface](http://php.net/SessionHandlerInterface) $writeOnlyHandler) #### Parameters | | | | | --- | --- | --- | | [SessionHandlerInterface](http://php.net/SessionHandlerInterface) | $currentHandler | | | [SessionHandlerInterface](http://php.net/SessionHandlerInterface) | $writeOnlyHandler | | ### close() {@inheritdoc} ### destroy($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### gc($maxlifetime) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $maxlifetime | | ### open($savePath, $sessionName) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $savePath | | | | $sessionName | | ### read($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### write($sessionId, $sessionData) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $sessionData | | ### validateId($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### updateTimestamp($sessionId, $sessionData) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $sessionData | |
programming_docs
symfony StrictSessionHandler StrictSessionHandler ===================== class **StrictSessionHandler** extends [AbstractSessionHandler](abstractsessionhandler "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") Adds basic `SessionUpdateTimestampHandlerInterface` behaviors to another `SessionHandlerInterface`. Methods ------- | | | | | --- | --- | --- | | | [open](#method_open)($savePath, $sessionName) {@inheritdoc} | | | string | [doRead](#method_doRead)(string $sessionId) | | | bool | [doWrite](#method_doWrite)(string $sessionId, string $data) | | | bool | [doDestroy](#method_doDestroy)(string $sessionId) | | | | [validateId](#method_validateId)($sessionId) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_validateId "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [read](#method_read)($sessionId) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_read "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [write](#method_write)($sessionId, $data) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_write "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [destroy](#method_destroy)($sessionId) {@inheritdoc} | | | | [\_\_construct](#method___construct)([SessionHandlerInterface](http://php.net/SessionHandlerInterface) $handler) | | | | [updateTimestamp](#method_updateTimestamp)($sessionId, $data) {@inheritdoc} | | | | [close](#method_close)() {@inheritdoc} | | | | [gc](#method_gc)($maxlifetime) {@inheritdoc} | | Details ------- ### open($savePath, $sessionName) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $savePath | | | | $sessionName | | ### protected string doRead(string $sessionId) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | #### Return Value | | | | --- | --- | | string | | ### protected bool doWrite(string $sessionId, string $data) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | | string | $data | | #### Return Value | | | | --- | --- | | bool | | ### protected bool doDestroy(string $sessionId) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | #### Return Value | | | | --- | --- | | bool | | ### validateId($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### read($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### write($sessionId, $data) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $data | | ### destroy($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### \_\_construct([SessionHandlerInterface](http://php.net/SessionHandlerInterface) $handler) #### Parameters | | | | | --- | --- | --- | | [SessionHandlerInterface](http://php.net/SessionHandlerInterface) | $handler | | ### updateTimestamp($sessionId, $data) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $data | | ### close() {@inheritdoc} ### gc($maxlifetime) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $maxlifetime | | symfony RedisSessionHandler RedisSessionHandler ==================== class **RedisSessionHandler** extends [AbstractSessionHandler](abstractsessionhandler "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") Redis based session storage handler based on the Redis class provided by the PHP redis extension. Methods ------- | | | | | --- | --- | --- | | | [open](#method_open)($savePath, $sessionName) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_open "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | string | [doRead](#method_doRead)(string $sessionId) | | | bool | [doWrite](#method_doWrite)(string $sessionId, string $data) | | | bool | [doDestroy](#method_doDestroy)(string $sessionId) | | | | [validateId](#method_validateId)($sessionId) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_validateId "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [read](#method_read)($sessionId) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_read "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [write](#method_write)($sessionId, $data) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_write "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [destroy](#method_destroy)($sessionId) {@inheritdoc} | from [AbstractSessionHandler](abstractsessionhandler#method_destroy "Symfony\Component\HttpFoundation\Session\Storage\Handler\AbstractSessionHandler") | | | [\_\_construct](#method___construct)(Redis|RedisArray|RedisCluster|Client|[RedisProxy](../../../../cache/traits/redisproxy "Symfony\Component\Cache\Traits\RedisProxy") $redis, array $options = array()) List of available options: \* prefix: The prefix to use for the keys in order to avoid collision on the Redis server. | | | bool | [close](#method_close)() {@inheritdoc} | | | bool | [gc](#method_gc)($maxlifetime) {@inheritdoc} | | | | [updateTimestamp](#method_updateTimestamp)($sessionId, $data) {@inheritdoc} | | Details ------- ### open($savePath, $sessionName) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $savePath | | | | $sessionName | | ### protected string doRead(string $sessionId) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | #### Return Value | | | | --- | --- | | string | | ### protected bool doWrite(string $sessionId, string $data) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | | string | $data | | #### Return Value | | | | --- | --- | | bool | | ### protected bool doDestroy(string $sessionId) #### Parameters | | | | | --- | --- | --- | | string | $sessionId | | #### Return Value | | | | --- | --- | | bool | | ### validateId($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### read($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### write($sessionId, $data) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $data | | ### destroy($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### \_\_construct(Redis|RedisArray|RedisCluster|Client|[RedisProxy](../../../../cache/traits/redisproxy "Symfony\Component\Cache\Traits\RedisProxy") $redis, array $options = array()) List of available options: \* prefix: The prefix to use for the keys in order to avoid collision on the Redis server. #### Parameters | | | | | --- | --- | --- | | Redis|RedisArray|RedisCluster|Client|[RedisProxy](../../../../cache/traits/redisproxy "Symfony\Component\Cache\Traits\RedisProxy") | $redis | | | array | $options | An associative array of options | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When unsupported client or options are passed | ### bool close() {@inheritdoc} #### Return Value | | | | --- | --- | | bool | | ### bool gc($maxlifetime) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $maxlifetime | | #### Return Value | | | | --- | --- | | bool | | ### updateTimestamp($sessionId, $data) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $data | | symfony AbstractProxy AbstractProxy ============== abstract class **AbstractProxy** Properties ---------- | | | | | | --- | --- | --- | --- | | protected bool | $wrapper | Flag if handler wraps an internal PHP session handler (using \SessionHandler). | | | protected string | $saveHandlerName | | | Methods ------- | | | | | --- | --- | --- | | string | [getSaveHandlerName](#method_getSaveHandlerName)() Gets the session.save\_handler name. | | | bool | [isSessionHandlerInterface](#method_isSessionHandlerInterface)() Is this proxy handler and instance of \SessionHandlerInterface. | | | bool | [isWrapper](#method_isWrapper)() Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. | | | bool | [isActive](#method_isActive)() Has a session started? | | | string | [getId](#method_getId)() Gets the session ID. | | | | [setId](#method_setId)(string $id) Sets the session ID. | | | string | [getName](#method_getName)() Gets the session name. | | | | [setName](#method_setName)(string $name) Sets the session name. | | Details ------- ### string getSaveHandlerName() Gets the session.save\_handler name. #### Return Value | | | | --- | --- | | string | | ### bool isSessionHandlerInterface() Is this proxy handler and instance of \SessionHandlerInterface. #### Return Value | | | | --- | --- | | bool | | ### bool isWrapper() Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. #### Return Value | | | | --- | --- | | bool | | ### bool isActive() Has a session started? #### Return Value | | | | --- | --- | | bool | | ### string getId() Gets the session ID. #### Return Value | | | | --- | --- | | string | | ### setId(string $id) Sets the session ID. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | | ### string getName() Gets the session name. #### Return Value | | | | --- | --- | | string | | ### setName(string $name) Sets the session name. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | | symfony SessionHandlerProxy SessionHandlerProxy ==================== class **SessionHandlerProxy** extends [AbstractProxy](abstractproxy "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy") implements [SessionHandlerInterface](http://php.net/SessionHandlerInterface), [SessionUpdateTimestampHandlerInterface](http://php.net/SessionUpdateTimestampHandlerInterface) Properties ---------- | | | | | | --- | --- | --- | --- | | protected bool | $wrapper | Flag if handler wraps an internal PHP session handler (using \SessionHandler). | from [AbstractProxy](abstractproxy#property_wrapper "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy") | | protected string | $saveHandlerName | | from [AbstractProxy](abstractproxy#property_saveHandlerName "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy") | | protected | $handler | | | Methods ------- | | | | | --- | --- | --- | | string | [getSaveHandlerName](#method_getSaveHandlerName)() Gets the session.save\_handler name. | from [AbstractProxy](abstractproxy#method_getSaveHandlerName "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy") | | bool | [isSessionHandlerInterface](#method_isSessionHandlerInterface)() Is this proxy handler and instance of \SessionHandlerInterface. | from [AbstractProxy](abstractproxy#method_isSessionHandlerInterface "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy") | | bool | [isWrapper](#method_isWrapper)() Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. | from [AbstractProxy](abstractproxy#method_isWrapper "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy") | | bool | [isActive](#method_isActive)() Has a session started? | from [AbstractProxy](abstractproxy#method_isActive "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy") | | string | [getId](#method_getId)() Gets the session ID. | from [AbstractProxy](abstractproxy#method_getId "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy") | | | [setId](#method_setId)(string $id) Sets the session ID. | from [AbstractProxy](abstractproxy#method_setId "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy") | | string | [getName](#method_getName)() Gets the session name. | from [AbstractProxy](abstractproxy#method_getName "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy") | | | [setName](#method_setName)(string $name) Sets the session name. | from [AbstractProxy](abstractproxy#method_setName "Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy") | | | [\_\_construct](#method___construct)([SessionHandlerInterface](http://php.net/SessionHandlerInterface) $handler) | | | [SessionHandlerInterface](http://php.net/SessionHandlerInterface) | [getHandler](#method_getHandler)() | | | | [open](#method_open)($savePath, $sessionName) {@inheritdoc} | | | | [close](#method_close)() {@inheritdoc} | | | | [read](#method_read)($sessionId) {@inheritdoc} | | | | [write](#method_write)($sessionId, $data) {@inheritdoc} | | | | [destroy](#method_destroy)($sessionId) {@inheritdoc} | | | | [gc](#method_gc)($maxlifetime) {@inheritdoc} | | | | [validateId](#method_validateId)($sessionId) {@inheritdoc} | | | | [updateTimestamp](#method_updateTimestamp)($sessionId, $data) {@inheritdoc} | | Details ------- ### string getSaveHandlerName() Gets the session.save\_handler name. #### Return Value | | | | --- | --- | | string | | ### bool isSessionHandlerInterface() Is this proxy handler and instance of \SessionHandlerInterface. #### Return Value | | | | --- | --- | | bool | | ### bool isWrapper() Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. #### Return Value | | | | --- | --- | | bool | | ### bool isActive() Has a session started? #### Return Value | | | | --- | --- | | bool | | ### string getId() Gets the session ID. #### Return Value | | | | --- | --- | | string | | ### setId(string $id) Sets the session ID. #### Parameters | | | | | --- | --- | --- | | string | $id | | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | | ### string getName() Gets the session name. #### Return Value | | | | --- | --- | | string | | ### setName(string $name) Sets the session name. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | | ### \_\_construct([SessionHandlerInterface](http://php.net/SessionHandlerInterface) $handler) #### Parameters | | | | | --- | --- | --- | | [SessionHandlerInterface](http://php.net/SessionHandlerInterface) | $handler | | ### [SessionHandlerInterface](http://php.net/SessionHandlerInterface) getHandler() #### Return Value | | | | --- | --- | | [SessionHandlerInterface](http://php.net/SessionHandlerInterface) | | ### open($savePath, $sessionName) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $savePath | | | | $sessionName | | ### close() {@inheritdoc} ### read($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### write($sessionId, $data) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $data | | ### destroy($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### gc($maxlifetime) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $maxlifetime | | ### validateId($sessionId) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | ### updateTimestamp($sessionId, $data) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $sessionId | | | | $data | | symfony FlashBagInterface FlashBagInterface ================== interface **FlashBagInterface** implements [SessionBagInterface](../sessionbaginterface "Symfony\Component\HttpFoundation\Session\SessionBagInterface") FlashBagInterface. Methods ------- | | | | | --- | --- | --- | | string | [getName](#method_getName)() Gets this bag's name. | from [SessionBagInterface](../sessionbaginterface#method_getName "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | | | [initialize](#method_initialize)(array $array) Initializes the Bag. | from [SessionBagInterface](../sessionbaginterface#method_initialize "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | | string | [getStorageKey](#method_getStorageKey)() Gets the storage key for this bag. | from [SessionBagInterface](../sessionbaginterface#method_getStorageKey "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | | mixed | [clear](#method_clear)() Clears out data from bag. | from [SessionBagInterface](../sessionbaginterface#method_clear "Symfony\Component\HttpFoundation\Session\SessionBagInterface") | | | [add](#method_add)(string $type, mixed $message) Adds a flash message for type. | | | | [set](#method_set)(string $type, string|array $message) Registers a message for a given type. | | | array | [peek](#method_peek)(string $type, array $default = array()) Gets flash messages for a given type. | | | array | [peekAll](#method_peekAll)() Gets all flash messages. | | | array | [get](#method_get)(string $type, array $default = array()) Gets and clears flash from the stack. | | | array | [all](#method_all)() Gets and clears flashes from the stack. | | | | [setAll](#method_setAll)(array $messages) Sets all flash messages. | | | bool | [has](#method_has)(string $type) Has flash messages for a given type? | | | array | [keys](#method_keys)() Returns a list of all defined types. | | Details ------- ### string getName() Gets this bag's name. #### Return Value | | | | --- | --- | | string | | ### initialize(array $array) Initializes the Bag. #### Parameters | | | | | --- | --- | --- | | array | $array | | ### string getStorageKey() Gets the storage key for this bag. #### Return Value | | | | --- | --- | | string | | ### mixed clear() Clears out data from bag. #### Return Value | | | | --- | --- | | mixed | Whatever data was contained | ### add(string $type, mixed $message) Adds a flash message for type. #### Parameters | | | | | --- | --- | --- | | string | $type | | | mixed | $message | | ### set(string $type, string|array $message) Registers a message for a given type. #### Parameters | | | | | --- | --- | --- | | string | $type | | | string|array | $message | | ### array peek(string $type, array $default = array()) Gets flash messages for a given type. #### Parameters | | | | | --- | --- | --- | | string | $type | Message category type | | array | $default | Default value if $type does not exist | #### Return Value | | | | --- | --- | | array | | ### array peekAll() Gets all flash messages. #### Return Value | | | | --- | --- | | array | | ### array get(string $type, array $default = array()) Gets and clears flash from the stack. #### Parameters | | | | | --- | --- | --- | | string | $type | | | array | $default | Default value if $type does not exist | #### Return Value | | | | --- | --- | | array | | ### array all() Gets and clears flashes from the stack. #### Return Value | | | | --- | --- | | array | | ### setAll(array $messages) Sets all flash messages. #### Parameters | | | | | --- | --- | --- | | array | $messages | | ### bool has(string $type) Has flash messages for a given type? #### Parameters | | | | | --- | --- | --- | | string | $type | | #### Return Value | | | | --- | --- | | bool | | ### array keys() Returns a list of all defined types. #### Return Value | | | | --- | --- | | array | |
programming_docs
symfony FlashBag FlashBag ========= class **FlashBag** implements [FlashBagInterface](flashbaginterface "Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface") FlashBag flash message container. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $storageKey = '\_symfony\_flashes') | | | string | [getName](#method_getName)() Gets this bag's name. | | | | [setName](#method_setName)($name) | | | | [initialize](#method_initialize)(array $flashes) Initializes the Bag. | | | | [add](#method_add)(string $type, mixed $message) Adds a flash message for type. | | | array | [peek](#method_peek)(string $type, array $default = array()) Gets flash messages for a given type. | | | array | [peekAll](#method_peekAll)() Gets all flash messages. | | | array | [get](#method_get)(string $type, array $default = array()) Gets and clears flash from the stack. | | | array | [all](#method_all)() Gets and clears flashes from the stack. | | | | [set](#method_set)(string $type, $messages) Registers a message for a given type. | | | | [setAll](#method_setAll)(array $messages) Sets all flash messages. | | | bool | [has](#method_has)(string $type) Has flash messages for a given type? | | | array | [keys](#method_keys)() Returns a list of all defined types. | | | string | [getStorageKey](#method_getStorageKey)() Gets the storage key for this bag. | | | mixed | [clear](#method_clear)() Clears out data from bag. | | Details ------- ### \_\_construct(string $storageKey = '\_symfony\_flashes') #### Parameters | | | | | --- | --- | --- | | string | $storageKey | The key used to store flashes in the session | ### string getName() Gets this bag's name. #### Return Value | | | | --- | --- | | string | | ### setName($name) #### Parameters | | | | | --- | --- | --- | | | $name | | ### initialize(array $flashes) Initializes the Bag. #### Parameters | | | | | --- | --- | --- | | array | $flashes | | ### add(string $type, mixed $message) Adds a flash message for type. #### Parameters | | | | | --- | --- | --- | | string | $type | | | mixed | $message | | ### array peek(string $type, array $default = array()) Gets flash messages for a given type. #### Parameters | | | | | --- | --- | --- | | string | $type | Message category type | | array | $default | Default value if $type does not exist | #### Return Value | | | | --- | --- | | array | | ### array peekAll() Gets all flash messages. #### Return Value | | | | --- | --- | | array | | ### array get(string $type, array $default = array()) Gets and clears flash from the stack. #### Parameters | | | | | --- | --- | --- | | string | $type | | | array | $default | Default value if $type does not exist | #### Return Value | | | | --- | --- | | array | | ### array all() Gets and clears flashes from the stack. #### Return Value | | | | --- | --- | | array | | ### set(string $type, $messages) Registers a message for a given type. #### Parameters | | | | | --- | --- | --- | | string | $type | | | | $messages | | ### setAll(array $messages) Sets all flash messages. #### Parameters | | | | | --- | --- | --- | | array | $messages | | ### bool has(string $type) Has flash messages for a given type? #### Parameters | | | | | --- | --- | --- | | string | $type | | #### Return Value | | | | --- | --- | | bool | | ### array keys() Returns a list of all defined types. #### Return Value | | | | --- | --- | | array | | ### string getStorageKey() Gets the storage key for this bag. #### Return Value | | | | --- | --- | | string | | ### mixed clear() Clears out data from bag. #### Return Value | | | | --- | --- | | mixed | Whatever data was contained | symfony AutoExpireFlashBag AutoExpireFlashBag =================== class **AutoExpireFlashBag** implements [FlashBagInterface](flashbaginterface "Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface") AutoExpireFlashBag flash message container. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $storageKey = '\_symfony\_flashes') | | | string | [getName](#method_getName)() Gets this bag's name. | | | | [setName](#method_setName)($name) | | | | [initialize](#method_initialize)(array $flashes) Initializes the Bag. | | | | [add](#method_add)(string $type, mixed $message) Adds a flash message for type. | | | array | [peek](#method_peek)(string $type, array $default = array()) Gets flash messages for a given type. | | | array | [peekAll](#method_peekAll)() Gets all flash messages. | | | array | [get](#method_get)(string $type, array $default = array()) Gets and clears flash from the stack. | | | array | [all](#method_all)() Gets and clears flashes from the stack. | | | | [setAll](#method_setAll)(array $messages) Sets all flash messages. | | | | [set](#method_set)(string $type, $messages) Registers a message for a given type. | | | bool | [has](#method_has)(string $type) Has flash messages for a given type? | | | array | [keys](#method_keys)() Returns a list of all defined types. | | | string | [getStorageKey](#method_getStorageKey)() Gets the storage key for this bag. | | | mixed | [clear](#method_clear)() Clears out data from bag. | | Details ------- ### \_\_construct(string $storageKey = '\_symfony\_flashes') #### Parameters | | | | | --- | --- | --- | | string | $storageKey | The key used to store flashes in the session | ### string getName() Gets this bag's name. #### Return Value | | | | --- | --- | | string | | ### setName($name) #### Parameters | | | | | --- | --- | --- | | | $name | | ### initialize(array $flashes) Initializes the Bag. #### Parameters | | | | | --- | --- | --- | | array | $flashes | | ### add(string $type, mixed $message) Adds a flash message for type. #### Parameters | | | | | --- | --- | --- | | string | $type | | | mixed | $message | | ### array peek(string $type, array $default = array()) Gets flash messages for a given type. #### Parameters | | | | | --- | --- | --- | | string | $type | Message category type | | array | $default | Default value if $type does not exist | #### Return Value | | | | --- | --- | | array | | ### array peekAll() Gets all flash messages. #### Return Value | | | | --- | --- | | array | | ### array get(string $type, array $default = array()) Gets and clears flash from the stack. #### Parameters | | | | | --- | --- | --- | | string | $type | | | array | $default | Default value if $type does not exist | #### Return Value | | | | --- | --- | | array | | ### array all() Gets and clears flashes from the stack. #### Return Value | | | | --- | --- | | array | | ### setAll(array $messages) Sets all flash messages. #### Parameters | | | | | --- | --- | --- | | array | $messages | | ### set(string $type, $messages) Registers a message for a given type. #### Parameters | | | | | --- | --- | --- | | string | $type | | | | $messages | | ### bool has(string $type) Has flash messages for a given type? #### Parameters | | | | | --- | --- | --- | | string | $type | | #### Return Value | | | | --- | --- | | bool | | ### array keys() Returns a list of all defined types. #### Return Value | | | | --- | --- | | array | | ### string getStorageKey() Gets the storage key for this bag. #### Return Value | | | | --- | --- | | string | | ### mixed clear() Clears out data from bag. #### Return Value | | | | --- | --- | | mixed | Whatever data was contained | symfony ExecutableFinder ExecutableFinder ================= class **ExecutableFinder** Generic executable finder. Methods ------- | | | | | --- | --- | --- | | | [setSuffixes](#method_setSuffixes)(array $suffixes) Replaces default suffixes of executable. | | | | [addSuffix](#method_addSuffix)(string $suffix) Adds new possible suffix to check for executable. | | | string | [find](#method_find)(string $name, string $default = null, array $extraDirs = array()) Finds an executable by name. | | Details ------- ### setSuffixes(array $suffixes) Replaces default suffixes of executable. #### Parameters | | | | | --- | --- | --- | | array | $suffixes | | ### addSuffix(string $suffix) Adds new possible suffix to check for executable. #### Parameters | | | | | --- | --- | --- | | string | $suffix | | ### string find(string $name, string $default = null, array $extraDirs = array()) Finds an executable by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The executable name (without the extension) | | string | $default | The default to return if no executable is found | | array | $extraDirs | Additional dirs to check into | #### Return Value | | | | --- | --- | | string | The executable path or default value | symfony Process Process ======== class **Process** implements [IteratorAggregate](http://php.net/IteratorAggregate) Process is a thin wrapper around proc\_\* functions to easily start independent PHP processes. Constants --------- | | | | --- | --- | | ERR | | | OUT | | | STATUS\_READY | | | STATUS\_STARTED | | | STATUS\_TERMINATED | | | STDIN | | | STDOUT | | | STDERR | | | TIMEOUT\_PRECISION | | | ITER\_NON\_BLOCKING | | | ITER\_KEEP\_OUTPUT | | | ITER\_SKIP\_OUT | | | ITER\_SKIP\_ERR | | Properties ---------- | | | | | | --- | --- | --- | --- | | static | $exitCodes | Exit codes translation table. | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string|array $commandline, string $cwd = null, array $env = null, mixed|null $input = null, float|null $timeout = 60) | | | | [\_\_destruct](#method___destruct)() | | | | [\_\_clone](#method___clone)() | | | int | [run](#method_run)(callable $callback = null, array $env = array()) Runs the process. | | | [Process](process "Symfony\Component\Process\Process") | [mustRun](#method_mustRun)(callable $callback = null, array $env = array()) Runs the process. | | | | [start](#method_start)(callable $callback = null, array $env = array()) Starts the process and returns after writing the input to STDIN. | | | $this | [restart](#method_restart)(callable $callback = null, array $env = array()) Restarts the process. | | | int | [wait](#method_wait)(callable $callback = null) Waits for the process to terminate. | | | int|null | [getPid](#method_getPid)() Returns the Pid (process identifier), if applicable. | | | $this | [signal](#method_signal)(int $signal) Sends a POSIX signal to the process. | | | $this | [disableOutput](#method_disableOutput)() Disables fetching output and error output from the underlying process. | | | $this | [enableOutput](#method_enableOutput)() Enables fetching output and error output from the underlying process. | | | bool | [isOutputDisabled](#method_isOutputDisabled)() Returns true in case the output is disabled, false otherwise. | | | string | [getOutput](#method_getOutput)() Returns the current output of the process (STDOUT). | | | string | [getIncrementalOutput](#method_getIncrementalOutput)() Returns the output incrementally. | | | [Generator](http://php.net/Generator) | [getIterator](#method_getIterator)(int $flags = 0) Returns an iterator to the output of the process, with the output type as keys (Process::OUT/ERR). | | | $this | [clearOutput](#method_clearOutput)() Clears the process output. | | | string | [getErrorOutput](#method_getErrorOutput)() Returns the current error output of the process (STDERR). | | | string | [getIncrementalErrorOutput](#method_getIncrementalErrorOutput)() Returns the errorOutput incrementally. | | | $this | [clearErrorOutput](#method_clearErrorOutput)() Clears the process output. | | | int|null | [getExitCode](#method_getExitCode)() Returns the exit code returned by the process. | | | string|null | [getExitCodeText](#method_getExitCodeText)() Returns a string representation for the exit code returned by the process. | | | bool | [isSuccessful](#method_isSuccessful)() Checks if the process ended successfully. | | | bool | [hasBeenSignaled](#method_hasBeenSignaled)() Returns true if the child process has been terminated by an uncaught signal. | | | int | [getTermSignal](#method_getTermSignal)() Returns the number of the signal that caused the child process to terminate its execution. | | | bool | [hasBeenStopped](#method_hasBeenStopped)() Returns true if the child process has been stopped by a signal. | | | int | [getStopSignal](#method_getStopSignal)() Returns the number of the signal that caused the child process to stop its execution. | | | bool | [isRunning](#method_isRunning)() Checks if the process is currently running. | | | bool | [isStarted](#method_isStarted)() Checks if the process has been started with no regard to the current state. | | | bool | [isTerminated](#method_isTerminated)() Checks if the process is terminated. | | | string | [getStatus](#method_getStatus)() Gets the process status. | | | int | [stop](#method_stop)(int|float $timeout = 10, int $signal = null) Stops the process. | | | | [addOutput](#method_addOutput)(string $line) Adds a line to the STDOUT stream. | | | | [addErrorOutput](#method_addErrorOutput)(string $line) Adds a line to the STDERR stream. | | | string | [getCommandLine](#method_getCommandLine)() Gets the command line to be executed. | | | [Process](process "Symfony\Component\Process\Process") | [setCommandLine](#method_setCommandLine)(string|array $commandline) Sets the command line to be executed. | | | float|null | [getTimeout](#method_getTimeout)() Gets the process timeout (max. runtime). | | | float|null | [getIdleTimeout](#method_getIdleTimeout)() Gets the process idle timeout (max. time since last output). | | | [Process](process "Symfony\Component\Process\Process") | [setTimeout](#method_setTimeout)(int|float|null $timeout) Sets the process timeout (max. runtime). | | | [Process](process "Symfony\Component\Process\Process") | [setIdleTimeout](#method_setIdleTimeout)(int|float|null $timeout) Sets the process idle timeout (max. time since last output). | | | [Process](process "Symfony\Component\Process\Process") | [setTty](#method_setTty)(bool $tty) Enables or disables the TTY mode. | | | bool | [isTty](#method_isTty)() Checks if the TTY mode is enabled. | | | [Process](process "Symfony\Component\Process\Process") | [setPty](#method_setPty)(bool $bool) Sets PTY mode. | | | bool | [isPty](#method_isPty)() Returns PTY state. | | | string|null | [getWorkingDirectory](#method_getWorkingDirectory)() Gets the working directory. | | | [Process](process "Symfony\Component\Process\Process") | [setWorkingDirectory](#method_setWorkingDirectory)(string $cwd) Sets the current working directory. | | | array | [getEnv](#method_getEnv)() Gets the environment variables. | | | [Process](process "Symfony\Component\Process\Process") | [setEnv](#method_setEnv)(array $env) Sets the environment variables. | | | resource|string|[Iterator](http://php.net/Iterator)|null | [getInput](#method_getInput)() Gets the Process input. | | | [Process](process "Symfony\Component\Process\Process") | [setInput](#method_setInput)(string|int|float|bool|resource|[Traversable](http://php.net/Traversable)|null $input) Sets the input. | | | [Process](process "Symfony\Component\Process\Process") | [inheritEnvironmentVariables](#method_inheritEnvironmentVariables)(bool $inheritEnv = true) Sets whether environment variables will be inherited or not. | | | | [checkTimeout](#method_checkTimeout)() Performs a check between the timeout definition and the time the process started. | | | static bool | [isTtySupported](#method_isTtySupported)() Returns whether TTY is supported on the current operating system. | | | static bool | [isPtySupported](#method_isPtySupported)() Returns whether PTY is supported on the current operating system. | | | [Closure](http://php.net/Closure) | [buildCallback](#method_buildCallback)(callable $callback = null) Builds up the callback used by wait(). | | | | [updateStatus](#method_updateStatus)(bool $blocking) Updates the status of the process, reads pipes. | | | bool | [isSigchildEnabled](#method_isSigchildEnabled)() Returns whether PHP has been compiled with the '--enable-sigchild' option or not. | | Details ------- ### \_\_construct(string|array $commandline, string $cwd = null, array $env = null, mixed|null $input = null, float|null $timeout = 60) #### Parameters | | | | | --- | --- | --- | | string|array | $commandline | The command line to run | | string | $cwd | The working directory or null to use the working dir of the current PHP process | | array | $env | The environment variables or null to use the same environment as the current PHP process | | mixed|null | $input | The input as stream resource, scalar or \Traversable, or null for no input | | float|null | $timeout | The timeout in seconds or null to disable | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When proc\_open is not installed | ### \_\_destruct() ### \_\_clone() ### int run(callable $callback = null, array $env = array()) Runs the process. The callback receives the type of output (out or err) and some bytes from the output in real-time. It allows to have feedback from the independent process during execution. The STDOUT and STDERR are also available after the process is finished via the getOutput() and getErrorOutput() methods. #### Parameters | | | | | --- | --- | --- | | callable | $callback | A PHP callback to run whenever there is some output available on STDOUT or STDERR | | array | $env | An array of additional env vars to set when running the process | #### Return Value | | | | --- | --- | | int | The exit status code | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When process can't be launched | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When process stopped after receiving signal | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case a callback is provided and output has been disabled | ### [Process](process "Symfony\Component\Process\Process") mustRun(callable $callback = null, array $env = array()) Runs the process. This is identical to run() except that an exception is thrown if the process exits with a non-zero exit code. #### Parameters | | | | | --- | --- | --- | | callable | $callback | | | array | $env | An array of additional env vars to set when running the process | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | | #### Exceptions | | | | --- | --- | | [ProcessFailedException](exception/processfailedexception "Symfony\Component\Process\Exception\ProcessFailedException") | if the process didn't terminate successfully | ### start(callable $callback = null, array $env = array()) Starts the process and returns after writing the input to STDIN. This method blocks until all STDIN data is sent to the process then it returns while the process runs in the background. The termination of the process can be awaited with wait(). The callback receives the type of output (out or err) and some bytes from the output in real-time while writing the standard input to the process. It allows to have feedback from the independent process during execution. #### Parameters | | | | | --- | --- | --- | | callable | $callback | A PHP callback to run whenever there is some output available on STDOUT or STDERR | | array | $env | An array of additional env vars to set when running the process | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When process can't be launched | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When process is already running | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case a callback is provided and output has been disabled | ### $this restart(callable $callback = null, array $env = array()) Restarts the process. Be warned that the process is cloned before being started. #### Parameters | | | | | --- | --- | --- | | callable | $callback | A PHP callback to run whenever there is some output available on STDOUT or STDERR | | array | $env | An array of additional env vars to set when running the process | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When process can't be launched | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When process is already running | #### See also | | | | --- | --- | | start() | | ### int wait(callable $callback = null) Waits for the process to terminate. The callback receives the type of output (out or err) and some bytes from the output in real-time while writing the standard input to the process. It allows to have feedback from the independent process during execution. #### Parameters | | | | | --- | --- | --- | | callable | $callback | A valid PHP callback | #### Return Value | | | | --- | --- | | int | The exitcode of the process | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When process timed out | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When process stopped after receiving signal | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | When process is not yet started | ### int|null getPid() Returns the Pid (process identifier), if applicable. #### Return Value | | | | --- | --- | | int|null | The process id if running, null otherwise | ### $this signal(int $signal) Sends a POSIX signal to the process. #### Parameters | | | | | --- | --- | --- | | int | $signal | A valid POSIX signal (see http://www.php.net/manual/en/pcntl.constants.php) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not running | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | In case --enable-sigchild is activated and the process can't be killed | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | In case of failure | ### $this disableOutput() Disables fetching output and error output from the underlying process. #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | In case the process is already running | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | if an idle timeout is set | ### $this enableOutput() Enables fetching output and error output from the underlying process. #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | In case the process is already running | ### bool isOutputDisabled() Returns true in case the output is disabled, false otherwise. #### Return Value | | | | --- | --- | | bool | | ### string getOutput() Returns the current output of the process (STDOUT). #### Return Value | | | | --- | --- | | string | The process output | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | in case the output has been disabled | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not started | ### string getIncrementalOutput() Returns the output incrementally. In comparison with the getOutput method which always return the whole output, this one returns the new output since the last call. #### Return Value | | | | --- | --- | | string | The process output since the last call | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | in case the output has been disabled | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not started | ### [Generator](http://php.net/Generator) getIterator(int $flags = 0) Returns an iterator to the output of the process, with the output type as keys (Process::OUT/ERR). #### Parameters | | | | | --- | --- | --- | | int | $flags | A bit field of Process::ITER\_\* flags | #### Return Value | | | | --- | --- | | [Generator](http://php.net/Generator) | | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | in case the output has been disabled | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not started | ### $this clearOutput() Clears the process output. #### Return Value | | | | --- | --- | | $this | | ### string getErrorOutput() Returns the current error output of the process (STDERR). #### Return Value | | | | --- | --- | | string | The process error output | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | in case the output has been disabled | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not started | ### string getIncrementalErrorOutput() Returns the errorOutput incrementally. In comparison with the getErrorOutput method which always return the whole error output, this one returns the new error output since the last call. #### Return Value | | | | --- | --- | | string | The process error output since the last call | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | in case the output has been disabled | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not started | ### $this clearErrorOutput() Clears the process output. #### Return Value | | | | --- | --- | | $this | | ### int|null getExitCode() Returns the exit code returned by the process. #### Return Value | | | | --- | --- | | int|null | The exit status code, null if the Process is not terminated | ### string|null getExitCodeText() Returns a string representation for the exit code returned by the process. This method relies on the Unix exit code status standardization and might not be relevant for other operating systems. #### Return Value | | | | --- | --- | | string|null | A string representation for the exit status code, null if the Process is not terminated | #### See also | | | | --- | --- | | <http://tldp.org/LDP/abs/html/exitcodes.html> | | | <http://en.wikipedia.org/wiki/Unix_signal> | | ### bool isSuccessful() Checks if the process ended successfully. #### Return Value | | | | --- | --- | | bool | true if the process ended successfully, false otherwise | ### bool hasBeenSignaled() Returns true if the child process has been terminated by an uncaught signal. It always returns false on Windows. #### Return Value | | | | --- | --- | | bool | | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not terminated | ### int getTermSignal() Returns the number of the signal that caused the child process to terminate its execution. It is only meaningful if hasBeenSignaled() returns true. #### Return Value | | | | --- | --- | | int | | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | In case --enable-sigchild is activated | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not terminated | ### bool hasBeenStopped() Returns true if the child process has been stopped by a signal. It always returns false on Windows. #### Return Value | | | | --- | --- | | bool | | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not terminated | ### int getStopSignal() Returns the number of the signal that caused the child process to stop its execution. It is only meaningful if hasBeenStopped() returns true. #### Return Value | | | | --- | --- | | int | | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not terminated | ### bool isRunning() Checks if the process is currently running. #### Return Value | | | | --- | --- | | bool | true if the process is currently running, false otherwise | ### bool isStarted() Checks if the process has been started with no regard to the current state. #### Return Value | | | | --- | --- | | bool | true if status is ready, false otherwise | ### bool isTerminated() Checks if the process is terminated. #### Return Value | | | | --- | --- | | bool | true if process is terminated, false otherwise | ### string getStatus() Gets the process status. The status is one of: ready, started, terminated. #### Return Value | | | | --- | --- | | string | The current process status | ### int stop(int|float $timeout = 10, int $signal = null) Stops the process. #### Parameters | | | | | --- | --- | --- | | int|float | $timeout | The timeout in seconds | | int | $signal | A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9) | #### Return Value | | | | --- | --- | | int | The exit-code of the process | ### addOutput(string $line) Adds a line to the STDOUT stream. #### Parameters | | | | | --- | --- | --- | | string | $line | | ### addErrorOutput(string $line) Adds a line to the STDERR stream. #### Parameters | | | | | --- | --- | --- | | string | $line | | ### string getCommandLine() Gets the command line to be executed. #### Return Value | | | | --- | --- | | string | The command to execute | ### [Process](process "Symfony\Component\Process\Process") setCommandLine(string|array $commandline) Sets the command line to be executed. #### Parameters | | | | | --- | --- | --- | | string|array | $commandline | The command to execute | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | The current Process instance | ### float|null getTimeout() Gets the process timeout (max. runtime). #### Return Value | | | | --- | --- | | float|null | The timeout in seconds or null if it's disabled | ### float|null getIdleTimeout() Gets the process idle timeout (max. time since last output). #### Return Value | | | | --- | --- | | float|null | The timeout in seconds or null if it's disabled | ### [Process](process "Symfony\Component\Process\Process") setTimeout(int|float|null $timeout) Sets the process timeout (max. runtime). To disable the timeout, set this value to null. #### Parameters | | | | | --- | --- | --- | | int|float|null | $timeout | The timeout in seconds | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | The current Process instance | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Process\Exception\InvalidArgumentException") | if the timeout is negative | ### [Process](process "Symfony\Component\Process\Process") setIdleTimeout(int|float|null $timeout) Sets the process idle timeout (max. time since last output). To disable the timeout, set this value to null. #### Parameters | | | | | --- | --- | --- | | int|float|null | $timeout | The timeout in seconds | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | The current Process instance | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | if the output is disabled | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Process\Exception\InvalidArgumentException") | if the timeout is negative | ### [Process](process "Symfony\Component\Process\Process") setTty(bool $tty) Enables or disables the TTY mode. #### Parameters | | | | | --- | --- | --- | | bool | $tty | True to enabled and false to disable | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | The current Process instance | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | In case the TTY mode is not supported | ### bool isTty() Checks if the TTY mode is enabled. #### Return Value | | | | --- | --- | | bool | true if the TTY mode is enabled, false otherwise | ### [Process](process "Symfony\Component\Process\Process") setPty(bool $bool) Sets PTY mode. #### Parameters | | | | | --- | --- | --- | | bool | $bool | | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | | ### bool isPty() Returns PTY state. #### Return Value | | | | --- | --- | | bool | | ### string|null getWorkingDirectory() Gets the working directory. #### Return Value | | | | --- | --- | | string|null | The current working directory or null on failure | ### [Process](process "Symfony\Component\Process\Process") setWorkingDirectory(string $cwd) Sets the current working directory. #### Parameters | | | | | --- | --- | --- | | string | $cwd | The new working directory | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | The current Process instance | ### array getEnv() Gets the environment variables. #### Return Value | | | | --- | --- | | array | The current environment variables | ### [Process](process "Symfony\Component\Process\Process") setEnv(array $env) Sets the environment variables. Each environment variable value should be a string. If it is an array, the variable is ignored. If it is false or null, it will be removed when env vars are otherwise inherited. That happens in PHP when 'argv' is registered into the $\_ENV array for instance. #### Parameters | | | | | --- | --- | --- | | array | $env | The new environment variables | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | The current Process instance | ### resource|string|[Iterator](http://php.net/Iterator)|null getInput() Gets the Process input. #### Return Value | | | | --- | --- | | resource|string|[Iterator](http://php.net/Iterator)|null | The Process input | ### [Process](process "Symfony\Component\Process\Process") setInput(string|int|float|bool|resource|[Traversable](http://php.net/Traversable)|null $input) Sets the input. This content will be passed to the underlying process standard input. #### Parameters | | | | | --- | --- | --- | | string|int|float|bool|resource|[Traversable](http://php.net/Traversable)|null | $input | The content | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | The current Process instance | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is running | ### [Process](process "Symfony\Component\Process\Process") inheritEnvironmentVariables(bool $inheritEnv = true) Sets whether environment variables will be inherited or not. #### Parameters | | | | | --- | --- | --- | | bool | $inheritEnv | | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | The current Process instance | ### checkTimeout() Performs a check between the timeout definition and the time the process started. In case you run a background process (with the start method), you should trigger this method regularly to ensure the process timeout #### Exceptions | | | | --- | --- | | [ProcessTimedOutException](exception/processtimedoutexception "Symfony\Component\Process\Exception\ProcessTimedOutException") | In case the timeout was reached | ### static bool isTtySupported() Returns whether TTY is supported on the current operating system. #### Return Value | | | | --- | --- | | bool | | ### static bool isPtySupported() Returns whether PTY is supported on the current operating system. #### Return Value | | | | --- | --- | | bool | | ### protected [Closure](http://php.net/Closure) buildCallback(callable $callback = null) Builds up the callback used by wait(). The callbacks adds all occurred output to the specific buffer and calls the user callback (if present) with the received output. #### Parameters | | | | | --- | --- | --- | | callable | $callback | The user defined PHP callback | #### Return Value | | | | --- | --- | | [Closure](http://php.net/Closure) | A PHP closure | ### protected updateStatus(bool $blocking) Updates the status of the process, reads pipes. #### Parameters | | | | | --- | --- | --- | | bool | $blocking | Whether to use a blocking read call | ### protected bool isSigchildEnabled() Returns whether PHP has been compiled with the '--enable-sigchild' option or not. #### Return Value | | | | --- | --- | | bool | |
programming_docs
symfony Symfony\Component\Process\Exception Symfony\Component\Process\Exception =================================== Classes ------- | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Process\Exception\InvalidArgumentException") | InvalidArgumentException for the Process Component. | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | LogicException for the Process Component. | | [ProcessFailedException](exception/processfailedexception "Symfony\Component\Process\Exception\ProcessFailedException") | Exception for failed processes. | | [ProcessSignaledException](exception/processsignaledexception "Symfony\Component\Process\Exception\ProcessSignaledException") | Exception that is thrown when a process has been signaled. | | [ProcessTimedOutException](exception/processtimedoutexception "Symfony\Component\Process\Exception\ProcessTimedOutException") | Exception that is thrown when a process times out. | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | RuntimeException for the Process Component. | Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\Process\Exception\ExceptionInterface")* | Marker Interface for the Process Component. | symfony InputStream InputStream ============ class **InputStream** implements [IteratorAggregate](http://php.net/IteratorAggregate) Provides a way to continuously write to the input of a Process until the InputStream is closed. Methods ------- | | | | | --- | --- | --- | | | [onEmpty](#method_onEmpty)(callable $onEmpty = null) Sets a callback that is called when the write buffer becomes empty. | | | | [write](#method_write)(resource|string|int|float|bool|[Traversable](http://php.net/Traversable)|null $input) Appends an input to the write buffer. | | | | [close](#method_close)() Closes the write buffer. | | | | [isClosed](#method_isClosed)() Tells whether the write buffer is closed or not. | | | | [getIterator](#method_getIterator)() | | Details ------- ### onEmpty(callable $onEmpty = null) Sets a callback that is called when the write buffer becomes empty. #### Parameters | | | | | --- | --- | --- | | callable | $onEmpty | | ### write(resource|string|int|float|bool|[Traversable](http://php.net/Traversable)|null $input) Appends an input to the write buffer. #### Parameters | | | | | --- | --- | --- | | resource|string|int|float|bool|[Traversable](http://php.net/Traversable)|null | $input | The input to append as scalar, stream resource or \Traversable | ### close() Closes the write buffer. ### isClosed() Tells whether the write buffer is closed or not. ### getIterator() symfony PhpExecutableFinder PhpExecutableFinder ==================== class **PhpExecutableFinder** An executable finder specifically designed for the PHP executable. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)() | | | string|false | [find](#method_find)(bool $includeArgs = true) Finds The PHP executable. | | | array | [findArguments](#method_findArguments)() Finds the PHP executable arguments. | | Details ------- ### \_\_construct() ### string|false find(bool $includeArgs = true) Finds The PHP executable. #### Parameters | | | | | --- | --- | --- | | bool | $includeArgs | Whether or not include command arguments | #### Return Value | | | | --- | --- | | string|false | The PHP executable path or false if it cannot be found | ### array findArguments() Finds the PHP executable arguments. #### Return Value | | | | --- | --- | | array | The PHP executable arguments | symfony Symfony\Component\Process\Pipes Symfony\Component\Process\Pipes =============================== Classes ------- | | | | --- | --- | | [AbstractPipes](pipes/abstractpipes "Symfony\Component\Process\Pipes\AbstractPipes") | | | [UnixPipes](pipes/unixpipes "Symfony\Component\Process\Pipes\UnixPipes") | UnixPipes implementation uses unix pipes as handles. | | [WindowsPipes](pipes/windowspipes "Symfony\Component\Process\Pipes\WindowsPipes") | WindowsPipes implementation uses temporary files as handles. | Interfaces ---------- | | | | --- | --- | | *[PipesInterface](pipes/pipesinterface "Symfony\Component\Process\Pipes\PipesInterface")* | PipesInterface manages descriptors and pipes for the use of proc\_open. | symfony PhpProcess PhpProcess =========== class **PhpProcess** extends [Process](process "Symfony\Component\Process\Process") PhpProcess runs a PHP script in an independent process. $p = new PhpProcess('php echo "foo"; ?'); $p->run(); print $p->getOutput()."\n"; Constants --------- | | | | --- | --- | | ERR | | | OUT | | | STATUS\_READY | | | STATUS\_STARTED | | | STATUS\_TERMINATED | | | STDIN | | | STDOUT | | | STDERR | | | TIMEOUT\_PRECISION | | | ITER\_NON\_BLOCKING | | | ITER\_KEEP\_OUTPUT | | | ITER\_SKIP\_OUT | | | ITER\_SKIP\_ERR | | Properties ---------- | | | | | | --- | --- | --- | --- | | static | $exitCodes | Exit codes translation table. | from [Process](process#property_exitCodes "Symfony\Component\Process\Process") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $script, string $cwd = null, array $env = null, float|null $timeout = 60) | | | | [\_\_destruct](#method___destruct)() | from [Process](process#method___destruct "Symfony\Component\Process\Process") | | | [\_\_clone](#method___clone)() | from [Process](process#method___clone "Symfony\Component\Process\Process") | | int | [run](#method_run)(callable $callback = null, array $env = array()) Runs the process. | from [Process](process#method_run "Symfony\Component\Process\Process") | | [Process](process "Symfony\Component\Process\Process") | [mustRun](#method_mustRun)(callable $callback = null, array $env = array()) Runs the process. | from [Process](process#method_mustRun "Symfony\Component\Process\Process") | | | [start](#method_start)(callable $callback = null, array $env = array()) Starts the process and returns after writing the input to STDIN. | | | $this | [restart](#method_restart)(callable $callback = null, array $env = array()) Restarts the process. | from [Process](process#method_restart "Symfony\Component\Process\Process") | | int | [wait](#method_wait)(callable $callback = null) Waits for the process to terminate. | from [Process](process#method_wait "Symfony\Component\Process\Process") | | int|null | [getPid](#method_getPid)() Returns the Pid (process identifier), if applicable. | from [Process](process#method_getPid "Symfony\Component\Process\Process") | | $this | [signal](#method_signal)(int $signal) Sends a POSIX signal to the process. | from [Process](process#method_signal "Symfony\Component\Process\Process") | | $this | [disableOutput](#method_disableOutput)() Disables fetching output and error output from the underlying process. | from [Process](process#method_disableOutput "Symfony\Component\Process\Process") | | $this | [enableOutput](#method_enableOutput)() Enables fetching output and error output from the underlying process. | from [Process](process#method_enableOutput "Symfony\Component\Process\Process") | | bool | [isOutputDisabled](#method_isOutputDisabled)() Returns true in case the output is disabled, false otherwise. | from [Process](process#method_isOutputDisabled "Symfony\Component\Process\Process") | | string | [getOutput](#method_getOutput)() Returns the current output of the process (STDOUT). | from [Process](process#method_getOutput "Symfony\Component\Process\Process") | | string | [getIncrementalOutput](#method_getIncrementalOutput)() Returns the output incrementally. | from [Process](process#method_getIncrementalOutput "Symfony\Component\Process\Process") | | [Generator](http://php.net/Generator) | [getIterator](#method_getIterator)(int $flags = 0) Returns an iterator to the output of the process, with the output type as keys (Process::OUT/ERR). | from [Process](process#method_getIterator "Symfony\Component\Process\Process") | | $this | [clearOutput](#method_clearOutput)() Clears the process output. | from [Process](process#method_clearOutput "Symfony\Component\Process\Process") | | string | [getErrorOutput](#method_getErrorOutput)() Returns the current error output of the process (STDERR). | from [Process](process#method_getErrorOutput "Symfony\Component\Process\Process") | | string | [getIncrementalErrorOutput](#method_getIncrementalErrorOutput)() Returns the errorOutput incrementally. | from [Process](process#method_getIncrementalErrorOutput "Symfony\Component\Process\Process") | | $this | [clearErrorOutput](#method_clearErrorOutput)() Clears the process output. | from [Process](process#method_clearErrorOutput "Symfony\Component\Process\Process") | | int|null | [getExitCode](#method_getExitCode)() Returns the exit code returned by the process. | from [Process](process#method_getExitCode "Symfony\Component\Process\Process") | | string|null | [getExitCodeText](#method_getExitCodeText)() Returns a string representation for the exit code returned by the process. | from [Process](process#method_getExitCodeText "Symfony\Component\Process\Process") | | bool | [isSuccessful](#method_isSuccessful)() Checks if the process ended successfully. | from [Process](process#method_isSuccessful "Symfony\Component\Process\Process") | | bool | [hasBeenSignaled](#method_hasBeenSignaled)() Returns true if the child process has been terminated by an uncaught signal. | from [Process](process#method_hasBeenSignaled "Symfony\Component\Process\Process") | | int | [getTermSignal](#method_getTermSignal)() Returns the number of the signal that caused the child process to terminate its execution. | from [Process](process#method_getTermSignal "Symfony\Component\Process\Process") | | bool | [hasBeenStopped](#method_hasBeenStopped)() Returns true if the child process has been stopped by a signal. | from [Process](process#method_hasBeenStopped "Symfony\Component\Process\Process") | | int | [getStopSignal](#method_getStopSignal)() Returns the number of the signal that caused the child process to stop its execution. | from [Process](process#method_getStopSignal "Symfony\Component\Process\Process") | | bool | [isRunning](#method_isRunning)() Checks if the process is currently running. | from [Process](process#method_isRunning "Symfony\Component\Process\Process") | | bool | [isStarted](#method_isStarted)() Checks if the process has been started with no regard to the current state. | from [Process](process#method_isStarted "Symfony\Component\Process\Process") | | bool | [isTerminated](#method_isTerminated)() Checks if the process is terminated. | from [Process](process#method_isTerminated "Symfony\Component\Process\Process") | | string | [getStatus](#method_getStatus)() Gets the process status. | from [Process](process#method_getStatus "Symfony\Component\Process\Process") | | int | [stop](#method_stop)(int|float $timeout = 10, int $signal = null) Stops the process. | from [Process](process#method_stop "Symfony\Component\Process\Process") | | | [addOutput](#method_addOutput)(string $line) Adds a line to the STDOUT stream. | from [Process](process#method_addOutput "Symfony\Component\Process\Process") | | | [addErrorOutput](#method_addErrorOutput)(string $line) Adds a line to the STDERR stream. | from [Process](process#method_addErrorOutput "Symfony\Component\Process\Process") | | string | [getCommandLine](#method_getCommandLine)() Gets the command line to be executed. | from [Process](process#method_getCommandLine "Symfony\Component\Process\Process") | | [Process](process "Symfony\Component\Process\Process") | [setCommandLine](#method_setCommandLine)(string|array $commandline) Sets the command line to be executed. | from [Process](process#method_setCommandLine "Symfony\Component\Process\Process") | | float|null | [getTimeout](#method_getTimeout)() Gets the process timeout (max. runtime). | from [Process](process#method_getTimeout "Symfony\Component\Process\Process") | | float|null | [getIdleTimeout](#method_getIdleTimeout)() Gets the process idle timeout (max. time since last output). | from [Process](process#method_getIdleTimeout "Symfony\Component\Process\Process") | | [Process](process "Symfony\Component\Process\Process") | [setTimeout](#method_setTimeout)(int|float|null $timeout) Sets the process timeout (max. runtime). | from [Process](process#method_setTimeout "Symfony\Component\Process\Process") | | [Process](process "Symfony\Component\Process\Process") | [setIdleTimeout](#method_setIdleTimeout)(int|float|null $timeout) Sets the process idle timeout (max. time since last output). | from [Process](process#method_setIdleTimeout "Symfony\Component\Process\Process") | | [Process](process "Symfony\Component\Process\Process") | [setTty](#method_setTty)(bool $tty) Enables or disables the TTY mode. | from [Process](process#method_setTty "Symfony\Component\Process\Process") | | bool | [isTty](#method_isTty)() Checks if the TTY mode is enabled. | from [Process](process#method_isTty "Symfony\Component\Process\Process") | | [Process](process "Symfony\Component\Process\Process") | [setPty](#method_setPty)(bool $bool) Sets PTY mode. | from [Process](process#method_setPty "Symfony\Component\Process\Process") | | bool | [isPty](#method_isPty)() Returns PTY state. | from [Process](process#method_isPty "Symfony\Component\Process\Process") | | string|null | [getWorkingDirectory](#method_getWorkingDirectory)() Gets the working directory. | from [Process](process#method_getWorkingDirectory "Symfony\Component\Process\Process") | | [Process](process "Symfony\Component\Process\Process") | [setWorkingDirectory](#method_setWorkingDirectory)(string $cwd) Sets the current working directory. | from [Process](process#method_setWorkingDirectory "Symfony\Component\Process\Process") | | array | [getEnv](#method_getEnv)() Gets the environment variables. | from [Process](process#method_getEnv "Symfony\Component\Process\Process") | | [Process](process "Symfony\Component\Process\Process") | [setEnv](#method_setEnv)(array $env) Sets the environment variables. | from [Process](process#method_setEnv "Symfony\Component\Process\Process") | | resource|string|[Iterator](http://php.net/Iterator)|null | [getInput](#method_getInput)() Gets the Process input. | from [Process](process#method_getInput "Symfony\Component\Process\Process") | | [Process](process "Symfony\Component\Process\Process") | [setInput](#method_setInput)(string|int|float|bool|resource|[Traversable](http://php.net/Traversable)|null $input) Sets the input. | from [Process](process#method_setInput "Symfony\Component\Process\Process") | | [Process](process "Symfony\Component\Process\Process") | [inheritEnvironmentVariables](#method_inheritEnvironmentVariables)(bool $inheritEnv = true) Sets whether environment variables will be inherited or not. | from [Process](process#method_inheritEnvironmentVariables "Symfony\Component\Process\Process") | | | [checkTimeout](#method_checkTimeout)() Performs a check between the timeout definition and the time the process started. | from [Process](process#method_checkTimeout "Symfony\Component\Process\Process") | | static bool | [isTtySupported](#method_isTtySupported)() Returns whether TTY is supported on the current operating system. | from [Process](process#method_isTtySupported "Symfony\Component\Process\Process") | | static bool | [isPtySupported](#method_isPtySupported)() Returns whether PTY is supported on the current operating system. | from [Process](process#method_isPtySupported "Symfony\Component\Process\Process") | | [Closure](http://php.net/Closure) | [buildCallback](#method_buildCallback)(callable $callback = null) Builds up the callback used by wait(). | from [Process](process#method_buildCallback "Symfony\Component\Process\Process") | | | [updateStatus](#method_updateStatus)(bool $blocking) Updates the status of the process, reads pipes. | from [Process](process#method_updateStatus "Symfony\Component\Process\Process") | | bool | [isSigchildEnabled](#method_isSigchildEnabled)() Returns whether PHP has been compiled with the '--enable-sigchild' option or not. | from [Process](process#method_isSigchildEnabled "Symfony\Component\Process\Process") | | | [setPhpBinary](#method_setPhpBinary)($php) Sets the path to the PHP binary to use. | | Details ------- ### \_\_construct(string $script, string $cwd = null, array $env = null, float|null $timeout = 60) #### Parameters | | | | | --- | --- | --- | | string | $script | The PHP script to run (as a string) | | string | $cwd | The working directory or null to use the working dir of the current PHP process | | array | $env | The environment variables or null to use the same environment as the current PHP process | | float|null | $timeout | The timeout in seconds or null to disable | ### \_\_destruct() ### \_\_clone() ### int run(callable $callback = null, array $env = array()) Runs the process. The callback receives the type of output (out or err) and some bytes from the output in real-time. It allows to have feedback from the independent process during execution. The STDOUT and STDERR are also available after the process is finished via the getOutput() and getErrorOutput() methods. #### Parameters | | | | | --- | --- | --- | | callable | $callback | A PHP callback to run whenever there is some output available on STDOUT or STDERR | | array | $env | An array of additional env vars to set when running the process | #### Return Value | | | | --- | --- | | int | The exit status code | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When process can't be launched | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When process stopped after receiving signal | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case a callback is provided and output has been disabled | ### [Process](process "Symfony\Component\Process\Process") mustRun(callable $callback = null, array $env = array()) Runs the process. This is identical to run() except that an exception is thrown if the process exits with a non-zero exit code. #### Parameters | | | | | --- | --- | --- | | callable | $callback | | | array | $env | An array of additional env vars to set when running the process | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | | #### Exceptions | | | | --- | --- | | [ProcessFailedException](exception/processfailedexception "Symfony\Component\Process\Exception\ProcessFailedException") | if the process didn't terminate successfully | ### start(callable $callback = null, array $env = array()) Starts the process and returns after writing the input to STDIN. This method blocks until all STDIN data is sent to the process then it returns while the process runs in the background. The termination of the process can be awaited with wait(). The callback receives the type of output (out or err) and some bytes from the output in real-time while writing the standard input to the process. It allows to have feedback from the independent process during execution. #### Parameters | | | | | --- | --- | --- | | callable | $callback | A PHP callback to run whenever there is some output available on STDOUT or STDERR | | array | $env | An array of additional env vars to set when running the process | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When process can't be launched | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When process is already running | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case a callback is provided and output has been disabled | ### $this restart(callable $callback = null, array $env = array()) Restarts the process. Be warned that the process is cloned before being started. #### Parameters | | | | | --- | --- | --- | | callable | $callback | A PHP callback to run whenever there is some output available on STDOUT or STDERR | | array | $env | An array of additional env vars to set when running the process | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When process can't be launched | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When process is already running | #### See also | | | | --- | --- | | start() | | ### int wait(callable $callback = null) Waits for the process to terminate. The callback receives the type of output (out or err) and some bytes from the output in real-time while writing the standard input to the process. It allows to have feedback from the independent process during execution. #### Parameters | | | | | --- | --- | --- | | callable | $callback | A valid PHP callback | #### Return Value | | | | --- | --- | | int | The exitcode of the process | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When process timed out | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | When process stopped after receiving signal | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | When process is not yet started | ### int|null getPid() Returns the Pid (process identifier), if applicable. #### Return Value | | | | --- | --- | | int|null | The process id if running, null otherwise | ### $this signal(int $signal) Sends a POSIX signal to the process. #### Parameters | | | | | --- | --- | --- | | int | $signal | A valid POSIX signal (see http://www.php.net/manual/en/pcntl.constants.php) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not running | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | In case --enable-sigchild is activated and the process can't be killed | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | In case of failure | ### $this disableOutput() Disables fetching output and error output from the underlying process. #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | In case the process is already running | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | if an idle timeout is set | ### $this enableOutput() Enables fetching output and error output from the underlying process. #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | In case the process is already running | ### bool isOutputDisabled() Returns true in case the output is disabled, false otherwise. #### Return Value | | | | --- | --- | | bool | | ### string getOutput() Returns the current output of the process (STDOUT). #### Return Value | | | | --- | --- | | string | The process output | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | in case the output has been disabled | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not started | ### string getIncrementalOutput() Returns the output incrementally. In comparison with the getOutput method which always return the whole output, this one returns the new output since the last call. #### Return Value | | | | --- | --- | | string | The process output since the last call | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | in case the output has been disabled | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not started | ### [Generator](http://php.net/Generator) getIterator(int $flags = 0) Returns an iterator to the output of the process, with the output type as keys (Process::OUT/ERR). #### Parameters | | | | | --- | --- | --- | | int | $flags | A bit field of Process::ITER\_\* flags | #### Return Value | | | | --- | --- | | [Generator](http://php.net/Generator) | | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | in case the output has been disabled | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not started | ### $this clearOutput() Clears the process output. #### Return Value | | | | --- | --- | | $this | | ### string getErrorOutput() Returns the current error output of the process (STDERR). #### Return Value | | | | --- | --- | | string | The process error output | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | in case the output has been disabled | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not started | ### string getIncrementalErrorOutput() Returns the errorOutput incrementally. In comparison with the getErrorOutput method which always return the whole error output, this one returns the new error output since the last call. #### Return Value | | | | --- | --- | | string | The process error output since the last call | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | in case the output has been disabled | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not started | ### $this clearErrorOutput() Clears the process output. #### Return Value | | | | --- | --- | | $this | | ### int|null getExitCode() Returns the exit code returned by the process. #### Return Value | | | | --- | --- | | int|null | The exit status code, null if the Process is not terminated | ### string|null getExitCodeText() Returns a string representation for the exit code returned by the process. This method relies on the Unix exit code status standardization and might not be relevant for other operating systems. #### Return Value | | | | --- | --- | | string|null | A string representation for the exit status code, null if the Process is not terminated | #### See also | | | | --- | --- | | <http://tldp.org/LDP/abs/html/exitcodes.html> | | | <http://en.wikipedia.org/wiki/Unix_signal> | | ### bool isSuccessful() Checks if the process ended successfully. #### Return Value | | | | --- | --- | | bool | true if the process ended successfully, false otherwise | ### bool hasBeenSignaled() Returns true if the child process has been terminated by an uncaught signal. It always returns false on Windows. #### Return Value | | | | --- | --- | | bool | | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not terminated | ### int getTermSignal() Returns the number of the signal that caused the child process to terminate its execution. It is only meaningful if hasBeenSignaled() returns true. #### Return Value | | | | --- | --- | | int | | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | In case --enable-sigchild is activated | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not terminated | ### bool hasBeenStopped() Returns true if the child process has been stopped by a signal. It always returns false on Windows. #### Return Value | | | | --- | --- | | bool | | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not terminated | ### int getStopSignal() Returns the number of the signal that caused the child process to stop its execution. It is only meaningful if hasBeenStopped() returns true. #### Return Value | | | | --- | --- | | int | | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is not terminated | ### bool isRunning() Checks if the process is currently running. #### Return Value | | | | --- | --- | | bool | true if the process is currently running, false otherwise | ### bool isStarted() Checks if the process has been started with no regard to the current state. #### Return Value | | | | --- | --- | | bool | true if status is ready, false otherwise | ### bool isTerminated() Checks if the process is terminated. #### Return Value | | | | --- | --- | | bool | true if process is terminated, false otherwise | ### string getStatus() Gets the process status. The status is one of: ready, started, terminated. #### Return Value | | | | --- | --- | | string | The current process status | ### int stop(int|float $timeout = 10, int $signal = null) Stops the process. #### Parameters | | | | | --- | --- | --- | | int|float | $timeout | The timeout in seconds | | int | $signal | A POSIX signal to send in case the process has not stop at timeout, default is SIGKILL (9) | #### Return Value | | | | --- | --- | | int | The exit-code of the process | ### addOutput(string $line) Adds a line to the STDOUT stream. #### Parameters | | | | | --- | --- | --- | | string | $line | | ### addErrorOutput(string $line) Adds a line to the STDERR stream. #### Parameters | | | | | --- | --- | --- | | string | $line | | ### string getCommandLine() Gets the command line to be executed. #### Return Value | | | | --- | --- | | string | The command to execute | ### [Process](process "Symfony\Component\Process\Process") setCommandLine(string|array $commandline) Sets the command line to be executed. #### Parameters | | | | | --- | --- | --- | | string|array | $commandline | The command to execute | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | The current Process instance | ### float|null getTimeout() Gets the process timeout (max. runtime). #### Return Value | | | | --- | --- | | float|null | The timeout in seconds or null if it's disabled | ### float|null getIdleTimeout() Gets the process idle timeout (max. time since last output). #### Return Value | | | | --- | --- | | float|null | The timeout in seconds or null if it's disabled | ### [Process](process "Symfony\Component\Process\Process") setTimeout(int|float|null $timeout) Sets the process timeout (max. runtime). To disable the timeout, set this value to null. #### Parameters | | | | | --- | --- | --- | | int|float|null | $timeout | The timeout in seconds | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | The current Process instance | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Process\Exception\InvalidArgumentException") | if the timeout is negative | ### [Process](process "Symfony\Component\Process\Process") setIdleTimeout(int|float|null $timeout) Sets the process idle timeout (max. time since last output). To disable the timeout, set this value to null. #### Parameters | | | | | --- | --- | --- | | int|float|null | $timeout | The timeout in seconds | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | The current Process instance | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | if the output is disabled | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Process\Exception\InvalidArgumentException") | if the timeout is negative | ### [Process](process "Symfony\Component\Process\Process") setTty(bool $tty) Enables or disables the TTY mode. #### Parameters | | | | | --- | --- | --- | | bool | $tty | True to enabled and false to disable | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | The current Process instance | #### Exceptions | | | | --- | --- | | [RuntimeException](exception/runtimeexception "Symfony\Component\Process\Exception\RuntimeException") | In case the TTY mode is not supported | ### bool isTty() Checks if the TTY mode is enabled. #### Return Value | | | | --- | --- | | bool | true if the TTY mode is enabled, false otherwise | ### [Process](process "Symfony\Component\Process\Process") setPty(bool $bool) Sets PTY mode. #### Parameters | | | | | --- | --- | --- | | bool | $bool | | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | | ### bool isPty() Returns PTY state. #### Return Value | | | | --- | --- | | bool | | ### string|null getWorkingDirectory() Gets the working directory. #### Return Value | | | | --- | --- | | string|null | The current working directory or null on failure | ### [Process](process "Symfony\Component\Process\Process") setWorkingDirectory(string $cwd) Sets the current working directory. #### Parameters | | | | | --- | --- | --- | | string | $cwd | The new working directory | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | The current Process instance | ### array getEnv() Gets the environment variables. #### Return Value | | | | --- | --- | | array | The current environment variables | ### [Process](process "Symfony\Component\Process\Process") setEnv(array $env) Sets the environment variables. Each environment variable value should be a string. If it is an array, the variable is ignored. If it is false or null, it will be removed when env vars are otherwise inherited. That happens in PHP when 'argv' is registered into the $\_ENV array for instance. #### Parameters | | | | | --- | --- | --- | | array | $env | The new environment variables | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | The current Process instance | ### resource|string|[Iterator](http://php.net/Iterator)|null getInput() Gets the Process input. #### Return Value | | | | --- | --- | | resource|string|[Iterator](http://php.net/Iterator)|null | The Process input | ### [Process](process "Symfony\Component\Process\Process") setInput(string|int|float|bool|resource|[Traversable](http://php.net/Traversable)|null $input) Sets the input. This content will be passed to the underlying process standard input. #### Parameters | | | | | --- | --- | --- | | string|int|float|bool|resource|[Traversable](http://php.net/Traversable)|null | $input | The content | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | The current Process instance | #### Exceptions | | | | --- | --- | | [LogicException](exception/logicexception "Symfony\Component\Process\Exception\LogicException") | In case the process is running | ### [Process](process "Symfony\Component\Process\Process") inheritEnvironmentVariables(bool $inheritEnv = true) Sets whether environment variables will be inherited or not. #### Parameters | | | | | --- | --- | --- | | bool | $inheritEnv | | #### Return Value | | | | --- | --- | | [Process](process "Symfony\Component\Process\Process") | The current Process instance | ### checkTimeout() Performs a check between the timeout definition and the time the process started. In case you run a background process (with the start method), you should trigger this method regularly to ensure the process timeout #### Exceptions | | | | --- | --- | | [ProcessTimedOutException](exception/processtimedoutexception "Symfony\Component\Process\Exception\ProcessTimedOutException") | In case the timeout was reached | ### static bool isTtySupported() Returns whether TTY is supported on the current operating system. #### Return Value | | | | --- | --- | | bool | | ### static bool isPtySupported() Returns whether PTY is supported on the current operating system. #### Return Value | | | | --- | --- | | bool | | ### protected [Closure](http://php.net/Closure) buildCallback(callable $callback = null) Builds up the callback used by wait(). The callbacks adds all occurred output to the specific buffer and calls the user callback (if present) with the received output. #### Parameters | | | | | --- | --- | --- | | callable | $callback | The user defined PHP callback | #### Return Value | | | | --- | --- | | [Closure](http://php.net/Closure) | A PHP closure | ### protected updateStatus(bool $blocking) Updates the status of the process, reads pipes. #### Parameters | | | | | --- | --- | --- | | bool | $blocking | Whether to use a blocking read call | ### protected bool isSigchildEnabled() Returns whether PHP has been compiled with the '--enable-sigchild' option or not. #### Return Value | | | | --- | --- | | bool | | ### setPhpBinary($php) Sets the path to the PHP binary to use. #### Parameters | | | | | --- | --- | --- | | | $php | |
programming_docs
symfony ProcessUtils ProcessUtils ============= class **ProcessUtils** ProcessUtils is a bunch of utility methods. This class contains static methods only and is not meant to be instantiated. Methods ------- | | | | | --- | --- | --- | | static mixed | [validateInput](#method_validateInput)(string $caller, mixed $input) Validates and normalizes a Process input. | | Details ------- ### static mixed validateInput(string $caller, mixed $input) Validates and normalizes a Process input. #### Parameters | | | | | --- | --- | --- | | string | $caller | The name of method call that validates the input | | mixed | $input | The input to validate | #### Return Value | | | | --- | --- | | mixed | The validated input | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Process\Exception\InvalidArgumentException") | In case the input is not valid | symfony AbstractPipes AbstractPipes ============== abstract class **AbstractPipes** implements [PipesInterface](pipesinterface "Symfony\Component\Process\Pipes\PipesInterface") Properties ---------- | | | | | | --- | --- | --- | --- | | | $pipes | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(resource|string|int|float|bool|[Iterator](http://php.net/Iterator)|null $input) | | | | [close](#method_close)() Closes file handles and pipes. | | | bool | [hasSystemCallBeenInterrupted](#method_hasSystemCallBeenInterrupted)() Returns true if a system call has been interrupted. | | | | [unblock](#method_unblock)() Unblocks streams. | | | | [write](#method_write)() Writes input to stdin. | | | | [handleError](#method_handleError)($type, $msg) | | Details ------- ### \_\_construct(resource|string|int|float|bool|[Iterator](http://php.net/Iterator)|null $input) #### Parameters | | | | | --- | --- | --- | | resource|string|int|float|bool|[Iterator](http://php.net/Iterator)|null | $input | | ### close() Closes file handles and pipes. ### protected bool hasSystemCallBeenInterrupted() Returns true if a system call has been interrupted. #### Return Value | | | | --- | --- | | bool | | ### protected unblock() Unblocks streams. ### protected write() Writes input to stdin. #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Process\Exception\InvalidArgumentException") | When an input iterator yields a non supported value | ### handleError($type, $msg) #### Parameters | | | | | --- | --- | --- | | | $type | | | | $msg | | symfony WindowsPipes WindowsPipes ============= class **WindowsPipes** extends [AbstractPipes](abstractpipes "Symfony\Component\Process\Pipes\AbstractPipes") WindowsPipes implementation uses temporary files as handles. Properties ---------- | | | | | | --- | --- | --- | --- | | | $pipes | | from [AbstractPipes](abstractpipes#property_pipes "Symfony\Component\Process\Pipes\AbstractPipes") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(resource|string|int|float|bool|[Iterator](http://php.net/Iterator)|null $input, bool $haveReadSupport) | | | | [close](#method_close)() Closes file handles and pipes. | | | bool | [hasSystemCallBeenInterrupted](#method_hasSystemCallBeenInterrupted)() Returns true if a system call has been interrupted. | from [AbstractPipes](abstractpipes#method_hasSystemCallBeenInterrupted "Symfony\Component\Process\Pipes\AbstractPipes") | | | [unblock](#method_unblock)() Unblocks streams. | from [AbstractPipes](abstractpipes#method_unblock "Symfony\Component\Process\Pipes\AbstractPipes") | | | [write](#method_write)() Writes input to stdin. | from [AbstractPipes](abstractpipes#method_write "Symfony\Component\Process\Pipes\AbstractPipes") | | | [handleError](#method_handleError)($type, $msg) | from [AbstractPipes](abstractpipes#method_handleError "Symfony\Component\Process\Pipes\AbstractPipes") | | | [\_\_destruct](#method___destruct)() | | | array | [getDescriptors](#method_getDescriptors)() Returns an array of descriptors for the use of proc\_open. | | | string[] | [getFiles](#method_getFiles)() Returns an array of filenames indexed by their related stream in case these pipes use temporary files. | | | string[] | [readAndWrite](#method_readAndWrite)(bool $blocking, bool $close = false) Reads data in file handles and pipes. | | | bool | [haveReadSupport](#method_haveReadSupport)() Returns if pipes are able to read output. | | | bool | [areOpen](#method_areOpen)() Returns if the current state has open file handles or pipes. | | Details ------- ### \_\_construct(resource|string|int|float|bool|[Iterator](http://php.net/Iterator)|null $input, bool $haveReadSupport) #### Parameters | | | | | --- | --- | --- | | resource|string|int|float|bool|[Iterator](http://php.net/Iterator)|null | $input | | | bool | $haveReadSupport | | ### close() Closes file handles and pipes. ### protected bool hasSystemCallBeenInterrupted() Returns true if a system call has been interrupted. #### Return Value | | | | --- | --- | | bool | | ### protected unblock() Unblocks streams. ### protected write() Writes input to stdin. #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Process\Exception\InvalidArgumentException") | When an input iterator yields a non supported value | ### handleError($type, $msg) #### Parameters | | | | | --- | --- | --- | | | $type | | | | $msg | | ### \_\_destruct() ### array getDescriptors() Returns an array of descriptors for the use of proc\_open. #### Return Value | | | | --- | --- | | array | | ### string[] getFiles() Returns an array of filenames indexed by their related stream in case these pipes use temporary files. #### Return Value | | | | --- | --- | | string[] | | ### string[] readAndWrite(bool $blocking, bool $close = false) Reads data in file handles and pipes. #### Parameters | | | | | --- | --- | --- | | bool | $blocking | Whether to use blocking calls or not | | bool | $close | Whether to close pipes if they've reached EOF | #### Return Value | | | | --- | --- | | string[] | An array of read data indexed by their fd | ### bool haveReadSupport() Returns if pipes are able to read output. #### Return Value | | | | --- | --- | | bool | | ### bool areOpen() Returns if the current state has open file handles or pipes. #### Return Value | | | | --- | --- | | bool | | symfony PipesInterface PipesInterface =============== interface **PipesInterface** PipesInterface manages descriptors and pipes for the use of proc\_open. Constants --------- | | | | --- | --- | | CHUNK\_SIZE | | Methods ------- | | | | | --- | --- | --- | | array | [getDescriptors](#method_getDescriptors)() Returns an array of descriptors for the use of proc\_open. | | | string[] | [getFiles](#method_getFiles)() Returns an array of filenames indexed by their related stream in case these pipes use temporary files. | | | string[] | [readAndWrite](#method_readAndWrite)(bool $blocking, bool $close = false) Reads data in file handles and pipes. | | | bool | [areOpen](#method_areOpen)() Returns if the current state has open file handles or pipes. | | | bool | [haveReadSupport](#method_haveReadSupport)() Returns if pipes are able to read output. | | | | [close](#method_close)() Closes file handles and pipes. | | Details ------- ### array getDescriptors() Returns an array of descriptors for the use of proc\_open. #### Return Value | | | | --- | --- | | array | | ### string[] getFiles() Returns an array of filenames indexed by their related stream in case these pipes use temporary files. #### Return Value | | | | --- | --- | | string[] | | ### string[] readAndWrite(bool $blocking, bool $close = false) Reads data in file handles and pipes. #### Parameters | | | | | --- | --- | --- | | bool | $blocking | Whether to use blocking calls or not | | bool | $close | Whether to close pipes if they've reached EOF | #### Return Value | | | | --- | --- | | string[] | An array of read data indexed by their fd | ### bool areOpen() Returns if the current state has open file handles or pipes. #### Return Value | | | | --- | --- | | bool | | ### bool haveReadSupport() Returns if pipes are able to read output. #### Return Value | | | | --- | --- | | bool | | ### close() Closes file handles and pipes. symfony UnixPipes UnixPipes ========== class **UnixPipes** extends [AbstractPipes](abstractpipes "Symfony\Component\Process\Pipes\AbstractPipes") UnixPipes implementation uses unix pipes as handles. Properties ---------- | | | | | | --- | --- | --- | --- | | | $pipes | | from [AbstractPipes](abstractpipes#property_pipes "Symfony\Component\Process\Pipes\AbstractPipes") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(bool|null $ttyMode, bool $ptyMode, resource|string|int|float|bool|[Iterator](http://php.net/Iterator)|null $input, bool $haveReadSupport) | | | | [close](#method_close)() Closes file handles and pipes. | from [AbstractPipes](abstractpipes#method_close "Symfony\Component\Process\Pipes\AbstractPipes") | | bool | [hasSystemCallBeenInterrupted](#method_hasSystemCallBeenInterrupted)() Returns true if a system call has been interrupted. | from [AbstractPipes](abstractpipes#method_hasSystemCallBeenInterrupted "Symfony\Component\Process\Pipes\AbstractPipes") | | | [unblock](#method_unblock)() Unblocks streams. | from [AbstractPipes](abstractpipes#method_unblock "Symfony\Component\Process\Pipes\AbstractPipes") | | | [write](#method_write)() Writes input to stdin. | from [AbstractPipes](abstractpipes#method_write "Symfony\Component\Process\Pipes\AbstractPipes") | | | [handleError](#method_handleError)($type, $msg) | from [AbstractPipes](abstractpipes#method_handleError "Symfony\Component\Process\Pipes\AbstractPipes") | | | [\_\_destruct](#method___destruct)() | | | array | [getDescriptors](#method_getDescriptors)() Returns an array of descriptors for the use of proc\_open. | | | string[] | [getFiles](#method_getFiles)() Returns an array of filenames indexed by their related stream in case these pipes use temporary files. | | | string[] | [readAndWrite](#method_readAndWrite)(bool $blocking, bool $close = false) Reads data in file handles and pipes. | | | bool | [haveReadSupport](#method_haveReadSupport)() Returns if pipes are able to read output. | | | bool | [areOpen](#method_areOpen)() Returns if the current state has open file handles or pipes. | | Details ------- ### \_\_construct(bool|null $ttyMode, bool $ptyMode, resource|string|int|float|bool|[Iterator](http://php.net/Iterator)|null $input, bool $haveReadSupport) #### Parameters | | | | | --- | --- | --- | | bool|null | $ttyMode | | | bool | $ptyMode | | | resource|string|int|float|bool|[Iterator](http://php.net/Iterator)|null | $input | | | bool | $haveReadSupport | | ### close() Closes file handles and pipes. ### protected bool hasSystemCallBeenInterrupted() Returns true if a system call has been interrupted. #### Return Value | | | | --- | --- | | bool | | ### protected unblock() Unblocks streams. ### protected write() Writes input to stdin. #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Process\Exception\InvalidArgumentException") | When an input iterator yields a non supported value | ### handleError($type, $msg) #### Parameters | | | | | --- | --- | --- | | | $type | | | | $msg | | ### \_\_destruct() ### array getDescriptors() Returns an array of descriptors for the use of proc\_open. #### Return Value | | | | --- | --- | | array | | ### string[] getFiles() Returns an array of filenames indexed by their related stream in case these pipes use temporary files. #### Return Value | | | | --- | --- | | string[] | | ### string[] readAndWrite(bool $blocking, bool $close = false) Reads data in file handles and pipes. #### Parameters | | | | | --- | --- | --- | | bool | $blocking | Whether to use blocking calls or not | | bool | $close | Whether to close pipes if they've reached EOF | #### Return Value | | | | --- | --- | | string[] | An array of read data indexed by their fd | ### bool haveReadSupport() Returns if pipes are able to read output. #### Return Value | | | | --- | --- | | bool | | ### bool areOpen() Returns if the current state has open file handles or pipes. #### Return Value | | | | --- | --- | | bool | | symfony InvalidArgumentException InvalidArgumentException ========================= class **InvalidArgumentException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Process\Exception\ExceptionInterface") InvalidArgumentException for the Process Component. symfony ExceptionInterface ExceptionInterface =================== interface **ExceptionInterface** Marker Interface for the Process Component. symfony LogicException LogicException =============== class **LogicException** extends [LogicException](http://php.net/LogicException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Process\Exception\ExceptionInterface") LogicException for the Process Component. symfony ProcessSignaledException ProcessSignaledException ========================= class **ProcessSignaledException** extends [RuntimeException](runtimeexception "Symfony\Component\Process\Exception\RuntimeException") Exception that is thrown when a process has been signaled. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Process](../process "Symfony\Component\Process\Process") $process) | | | [Process](../process "Symfony\Component\Process\Process") | [getProcess](#method_getProcess)() | | | int | [getSignal](#method_getSignal)() | | Details ------- ### \_\_construct([Process](../process "Symfony\Component\Process\Process") $process) #### Parameters | | | | | --- | --- | --- | | [Process](../process "Symfony\Component\Process\Process") | $process | | ### [Process](../process "Symfony\Component\Process\Process") getProcess() #### Return Value | | | | --- | --- | | [Process](../process "Symfony\Component\Process\Process") | | ### int getSignal() #### Return Value | | | | --- | --- | | int | | symfony ProcessTimedOutException ProcessTimedOutException ========================= class **ProcessTimedOutException** extends [RuntimeException](runtimeexception "Symfony\Component\Process\Exception\RuntimeException") Exception that is thrown when a process times out. Constants --------- | | | | --- | --- | | TYPE\_GENERAL | | | TYPE\_IDLE | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Process](../process "Symfony\Component\Process\Process") $process, int $timeoutType) | | | | [getProcess](#method_getProcess)() | | | | [isGeneralTimeout](#method_isGeneralTimeout)() | | | | [isIdleTimeout](#method_isIdleTimeout)() | | | | [getExceededTimeout](#method_getExceededTimeout)() | | Details ------- ### \_\_construct([Process](../process "Symfony\Component\Process\Process") $process, int $timeoutType) #### Parameters | | | | | --- | --- | --- | | [Process](../process "Symfony\Component\Process\Process") | $process | | | int | $timeoutType | | ### getProcess() ### isGeneralTimeout() ### isIdleTimeout() ### getExceededTimeout() symfony RuntimeException RuntimeException ================= class **RuntimeException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Process\Exception\ExceptionInterface") RuntimeException for the Process Component. symfony ProcessFailedException ProcessFailedException ======================= class **ProcessFailedException** extends [RuntimeException](runtimeexception "Symfony\Component\Process\Exception\RuntimeException") Exception for failed processes. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Process](../process "Symfony\Component\Process\Process") $process) | | | | [getProcess](#method_getProcess)() | | Details ------- ### \_\_construct([Process](../process "Symfony\Component\Process\Process") $process) #### Parameters | | | | | --- | --- | --- | | [Process](../process "Symfony\Component\Process\Process") | $process | | ### getProcess() symfony ExceptionHandler ExceptionHandler ================= class **ExceptionHandler** ExceptionHandler converts an exception to a Response object. It is mostly useful in debug mode to replace the default PHP/XDebug output with something prettier and more useful. As this class is mainly used during Kernel boot, where nothing is yet available, the Response content is always HTML. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(bool $debug = true, string $charset = null, $fileLinkFormat = null) | | | static [ExceptionHandler](exceptionhandler "Symfony\Component\Debug\ExceptionHandler") | [register](#method_register)(bool $debug = true, string|null $charset = null, string|null $fileLinkFormat = null) Registers the exception handler. | | | callable|null | [setHandler](#method_setHandler)(callable $handler = null) Sets a user exception handler. | | | string | [setFileLinkFormat](#method_setFileLinkFormat)(string|[FileLinkFormatter](../httpkernel/debug/filelinkformatter "Symfony\Component\HttpKernel\Debug\FileLinkFormatter") $fileLinkFormat) Sets the format for links to source files. | | | | [handle](#method_handle)([Exception](http://php.net/Exception) $exception) Sends a response for the given Exception. | | | | [sendPhpResponse](#method_sendPhpResponse)([Exception](http://php.net/Exception)|[FlattenException](exception/flattenexception "Symfony\Component\Debug\Exception\FlattenException") $exception) Sends the error associated with the given Exception as a plain PHP response. | | | string | [getHtml](#method_getHtml)([Exception](http://php.net/Exception)|[FlattenException](exception/flattenexception "Symfony\Component\Debug\Exception\FlattenException") $exception) Gets the full HTML content associated with the given exception. | | | string | [getContent](#method_getContent)([FlattenException](exception/flattenexception "Symfony\Component\Debug\Exception\FlattenException") $exception) Gets the HTML content associated with the given exception. | | | string | [getStylesheet](#method_getStylesheet)([FlattenException](exception/flattenexception "Symfony\Component\Debug\Exception\FlattenException") $exception) Gets the stylesheet associated with the given exception. | | Details ------- ### \_\_construct(bool $debug = true, string $charset = null, $fileLinkFormat = null) #### Parameters | | | | | --- | --- | --- | | bool | $debug | | | string | $charset | | | | $fileLinkFormat | | ### static [ExceptionHandler](exceptionhandler "Symfony\Component\Debug\ExceptionHandler") register(bool $debug = true, string|null $charset = null, string|null $fileLinkFormat = null) Registers the exception handler. #### Parameters | | | | | --- | --- | --- | | bool | $debug | Enable/disable debug mode, where the stack trace is displayed | | string|null | $charset | The charset used by exception messages | | string|null | $fileLinkFormat | The IDE link template | #### Return Value | | | | --- | --- | | [ExceptionHandler](exceptionhandler "Symfony\Component\Debug\ExceptionHandler") | | ### callable|null setHandler(callable $handler = null) Sets a user exception handler. #### Parameters | | | | | --- | --- | --- | | callable | $handler | An handler that will be called on Exception | #### Return Value | | | | --- | --- | | callable|null | The previous exception handler if any | ### string setFileLinkFormat(string|[FileLinkFormatter](../httpkernel/debug/filelinkformatter "Symfony\Component\HttpKernel\Debug\FileLinkFormatter") $fileLinkFormat) Sets the format for links to source files. #### Parameters | | | | | --- | --- | --- | | string|[FileLinkFormatter](../httpkernel/debug/filelinkformatter "Symfony\Component\HttpKernel\Debug\FileLinkFormatter") | $fileLinkFormat | The format for links to source files | #### Return Value | | | | --- | --- | | string | The previous file link format | ### handle([Exception](http://php.net/Exception) $exception) Sends a response for the given Exception. To be as fail-safe as possible, the exception is first handled by our simple exception handler, then by the user exception handler. The latter takes precedence and any output from the former is cancelled, if and only if nothing bad happens in this handling path. #### Parameters | | | | | --- | --- | --- | | [Exception](http://php.net/Exception) | $exception | | ### sendPhpResponse([Exception](http://php.net/Exception)|[FlattenException](exception/flattenexception "Symfony\Component\Debug\Exception\FlattenException") $exception) Sends the error associated with the given Exception as a plain PHP response. This method uses plain PHP functions like header() and echo to output the response. #### Parameters | | | | | --- | --- | --- | | [Exception](http://php.net/Exception)|[FlattenException](exception/flattenexception "Symfony\Component\Debug\Exception\FlattenException") | $exception | An \Exception or FlattenException instance | ### string getHtml([Exception](http://php.net/Exception)|[FlattenException](exception/flattenexception "Symfony\Component\Debug\Exception\FlattenException") $exception) Gets the full HTML content associated with the given exception. #### Parameters | | | | | --- | --- | --- | | [Exception](http://php.net/Exception)|[FlattenException](exception/flattenexception "Symfony\Component\Debug\Exception\FlattenException") | $exception | An \Exception or FlattenException instance | #### Return Value | | | | --- | --- | | string | The HTML content as a string | ### string getContent([FlattenException](exception/flattenexception "Symfony\Component\Debug\Exception\FlattenException") $exception) Gets the HTML content associated with the given exception. #### Parameters | | | | | --- | --- | --- | | [FlattenException](exception/flattenexception "Symfony\Component\Debug\Exception\FlattenException") | $exception | | #### Return Value | | | | --- | --- | | string | The content as a string | ### string getStylesheet([FlattenException](exception/flattenexception "Symfony\Component\Debug\Exception\FlattenException") $exception) Gets the stylesheet associated with the given exception. #### Parameters | | | | | --- | --- | --- | | [FlattenException](exception/flattenexception "Symfony\Component\Debug\Exception\FlattenException") | $exception | | #### Return Value | | | | --- | --- | | string | The stylesheet as a string |
programming_docs
symfony Symfony\Component\Debug\Exception Symfony\Component\Debug\Exception ================================= Classes ------- | | | | --- | --- | | [ClassNotFoundException](exception/classnotfoundexception "Symfony\Component\Debug\Exception\ClassNotFoundException") | Class (or Trait or Interface) Not Found Exception. | | [FatalErrorException](exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") | Fatal Error Exception. | | [FatalThrowableError](exception/fatalthrowableerror "Symfony\Component\Debug\Exception\FatalThrowableError") | Fatal Throwable Error. | | [FlattenException](exception/flattenexception "Symfony\Component\Debug\Exception\FlattenException") | FlattenException wraps a PHP Error or Exception to be able to serialize it. | | [OutOfMemoryException](exception/outofmemoryexception "Symfony\Component\Debug\Exception\OutOfMemoryException") | Out of memory exception. | | [SilencedErrorContext](exception/silencederrorcontext "Symfony\Component\Debug\Exception\SilencedErrorContext") | Data Object that represents a Silenced Error. | | [UndefinedFunctionException](exception/undefinedfunctionexception "Symfony\Component\Debug\Exception\UndefinedFunctionException") | Undefined Function Exception. | | [UndefinedMethodException](exception/undefinedmethodexception "Symfony\Component\Debug\Exception\UndefinedMethodException") | Undefined Method Exception. | symfony BufferingLogger BufferingLogger ================ class **BufferingLogger** extends AbstractLogger A buffering logger that stacks logs for later. Methods ------- | | | | | --- | --- | --- | | | [log](#method_log)($level, $message, array $context = array()) | | | | [cleanLogs](#method_cleanLogs)() | | Details ------- ### log($level, $message, array $context = array()) #### Parameters | | | | | --- | --- | --- | | | $level | | | | $message | | | array | $context | | ### cleanLogs() symfony Symfony\Component\Debug\FatalErrorHandler Symfony\Component\Debug\FatalErrorHandler ========================================= Classes ------- | | | | --- | --- | | [ClassNotFoundFatalErrorHandler](fatalerrorhandler/classnotfoundfatalerrorhandler "Symfony\Component\Debug\FatalErrorHandler\ClassNotFoundFatalErrorHandler") | ErrorHandler for classes that do not exist. | | [UndefinedFunctionFatalErrorHandler](fatalerrorhandler/undefinedfunctionfatalerrorhandler "Symfony\Component\Debug\FatalErrorHandler\UndefinedFunctionFatalErrorHandler") | ErrorHandler for undefined functions. | | [UndefinedMethodFatalErrorHandler](fatalerrorhandler/undefinedmethodfatalerrorhandler "Symfony\Component\Debug\FatalErrorHandler\UndefinedMethodFatalErrorHandler") | ErrorHandler for undefined methods. | Interfaces ---------- | | | | --- | --- | | *[FatalErrorHandlerInterface](fatalerrorhandler/fatalerrorhandlerinterface "Symfony\Component\Debug\FatalErrorHandler\FatalErrorHandlerInterface")* | Attempts to convert fatal errors to exceptions. | symfony ErrorHandler ErrorHandler ============= class **ErrorHandler** A generic ErrorHandler for the PHP engine. Provides five bit fields that control how errors are handled: - thrownErrors: errors thrown as \ErrorException - loggedErrors: logged errors, when not @-silenced - scopedErrors: errors thrown or logged with their local context - tracedErrors: errors logged with their stack trace - screamedErrors: never @-silenced errors Each error level can be logged by a dedicated PSR-3 logger object. Screaming only applies to logging. Throwing takes precedence over logging. Uncaught exceptions are logged as E\_ERROR. E\_DEPRECATED and E\_USER\_DEPRECATED levels never throw. E\_RECOVERABLE\_ERROR and E\_USER\_ERROR levels always throw. Non catchable errors that can be detected at shutdown time are logged when the scream bit field allows so. As errors have a performance cost, repeated errors are all logged, so that the developer can see them and weight them as more important to fix than others of the same level. Methods ------- | | | | | --- | --- | --- | | static [ErrorHandler](errorhandler "Symfony\Component\Debug\ErrorHandler") | [register](#method_register)([ErrorHandler](errorhandler "Symfony\Component\Debug\ErrorHandler") $handler = null, bool $replace = true) Registers the error handler. | | | | [\_\_construct](#method___construct)([BufferingLogger](bufferinglogger "Symfony\Component\Debug\BufferingLogger") $bootstrappingLogger = null) | | | | [setDefaultLogger](#method_setDefaultLogger)(LoggerInterface $logger, array|int $levels = E\_ALL, bool $replace = false) Sets a logger to non assigned errors levels. | | | array | [setLoggers](#method_setLoggers)(array $loggers) Sets a logger for each error level. | | | callable|null | [setExceptionHandler](#method_setExceptionHandler)(callable $handler = null) Sets a user exception handler. | | | int | [throwAt](#method_throwAt)(int $levels, bool $replace = false) Sets the PHP error levels that throw an exception when a PHP error occurs. | | | int | [scopeAt](#method_scopeAt)(int $levels, bool $replace = false) Sets the PHP error levels for which local variables are preserved. | | | int | [traceAt](#method_traceAt)(int $levels, bool $replace = false) Sets the PHP error levels for which the stack trace is preserved. | | | int | [screamAt](#method_screamAt)(int $levels, bool $replace = false) Sets the error levels where the @-operator is ignored. | | | bool | [handleError](#method_handleError)(int $type, string $message, string $file, int $line) Handles errors by filtering then logging them according to the configured bit fields. | | | | [handleException](#method_handleException)([Exception](http://php.net/Exception)|[Throwable](http://php.net/Throwable) $exception, array $error = null) Handles an exception by logging then forwarding it to another handler. | | | static | [handleFatalError](#method_handleFatalError)(array $error = null) Shutdown registered function for handling PHP fatal errors. | | | [FatalErrorHandlerInterface](fatalerrorhandler/fatalerrorhandlerinterface "Symfony\Component\Debug\FatalErrorHandler\FatalErrorHandlerInterface")[] | [getFatalErrorHandlers](#method_getFatalErrorHandlers)() Gets the fatal error handlers. | | Details ------- ### static [ErrorHandler](errorhandler "Symfony\Component\Debug\ErrorHandler") register([ErrorHandler](errorhandler "Symfony\Component\Debug\ErrorHandler") $handler = null, bool $replace = true) Registers the error handler. #### Parameters | | | | | --- | --- | --- | | [ErrorHandler](errorhandler "Symfony\Component\Debug\ErrorHandler") | $handler | The handler to register | | bool | $replace | Whether to replace or not any existing handler | #### Return Value | | | | --- | --- | | [ErrorHandler](errorhandler "Symfony\Component\Debug\ErrorHandler") | The registered error handler | ### \_\_construct([BufferingLogger](bufferinglogger "Symfony\Component\Debug\BufferingLogger") $bootstrappingLogger = null) #### Parameters | | | | | --- | --- | --- | | [BufferingLogger](bufferinglogger "Symfony\Component\Debug\BufferingLogger") | $bootstrappingLogger | | ### setDefaultLogger(LoggerInterface $logger, array|int $levels = E\_ALL, bool $replace = false) Sets a logger to non assigned errors levels. #### Parameters | | | | | --- | --- | --- | | LoggerInterface | $logger | A PSR-3 logger to put as default for the given levels | | array|int | $levels | An array map of E\_\* to LogLevel::\* or an integer bit field of E\_\* constants | | bool | $replace | Whether to replace or not any existing logger | ### array setLoggers(array $loggers) Sets a logger for each error level. #### Parameters | | | | | --- | --- | --- | | array | $loggers | Error levels to [LoggerInterface|null, LogLevel::\*] map | #### Return Value | | | | --- | --- | | array | The previous map | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | | ### callable|null setExceptionHandler(callable $handler = null) Sets a user exception handler. #### Parameters | | | | | --- | --- | --- | | callable | $handler | A handler that will be called on Exception | #### Return Value | | | | --- | --- | | callable|null | The previous exception handler | ### int throwAt(int $levels, bool $replace = false) Sets the PHP error levels that throw an exception when a PHP error occurs. #### Parameters | | | | | --- | --- | --- | | int | $levels | A bit field of E\_\* constants for thrown errors | | bool | $replace | Replace or amend the previous value | #### Return Value | | | | --- | --- | | int | The previous value | ### int scopeAt(int $levels, bool $replace = false) Sets the PHP error levels for which local variables are preserved. #### Parameters | | | | | --- | --- | --- | | int | $levels | A bit field of E\_\* constants for scoped errors | | bool | $replace | Replace or amend the previous value | #### Return Value | | | | --- | --- | | int | The previous value | ### int traceAt(int $levels, bool $replace = false) Sets the PHP error levels for which the stack trace is preserved. #### Parameters | | | | | --- | --- | --- | | int | $levels | A bit field of E\_\* constants for traced errors | | bool | $replace | Replace or amend the previous value | #### Return Value | | | | --- | --- | | int | The previous value | ### int screamAt(int $levels, bool $replace = false) Sets the error levels where the @-operator is ignored. #### Parameters | | | | | --- | --- | --- | | int | $levels | A bit field of E\_\* constants for screamed errors | | bool | $replace | Replace or amend the previous value | #### Return Value | | | | --- | --- | | int | The previous value | ### bool handleError(int $type, string $message, string $file, int $line) Handles errors by filtering then logging them according to the configured bit fields. #### Parameters | | | | | --- | --- | --- | | int | $type | One of the E\_\* constants | | string | $message | | | string | $file | | | int | $line | | #### Return Value | | | | --- | --- | | bool | Returns false when no handling happens so that the PHP engine can handle the error itself | #### Exceptions | | | | --- | --- | | [ErrorException](http://php.net/ErrorException) | When $this->thrownErrors requests so | ### handleException([Exception](http://php.net/Exception)|[Throwable](http://php.net/Throwable) $exception, array $error = null) Handles an exception by logging then forwarding it to another handler. #### Parameters | | | | | --- | --- | --- | | [Exception](http://php.net/Exception)|[Throwable](http://php.net/Throwable) | $exception | An exception to handle | | array | $error | An array as returned by error\_get\_last() | ### static handleFatalError(array $error = null) Shutdown registered function for handling PHP fatal errors. #### Parameters | | | | | --- | --- | --- | | array | $error | An array as returned by error\_get\_last() | ### protected [FatalErrorHandlerInterface](fatalerrorhandler/fatalerrorhandlerinterface "Symfony\Component\Debug\FatalErrorHandler\FatalErrorHandlerInterface")[] getFatalErrorHandlers() Gets the fatal error handlers. Override this method if you want to define more fatal error handlers. #### Return Value | | | | --- | --- | | [FatalErrorHandlerInterface](fatalerrorhandler/fatalerrorhandlerinterface "Symfony\Component\Debug\FatalErrorHandler\FatalErrorHandlerInterface")[] | An array of FatalErrorHandlerInterface | symfony Debug Debug ====== class **Debug** Registers all the debug tools. Methods ------- | | | | | --- | --- | --- | | static | [enable](#method_enable)(int $errorReportingLevel = E\_ALL, bool $displayErrors = true) Enables the debug tools. | | Details ------- ### static enable(int $errorReportingLevel = E\_ALL, bool $displayErrors = true) Enables the debug tools. This method registers an error handler and an exception handler. #### Parameters | | | | | --- | --- | --- | | int | $errorReportingLevel | The level of error reporting you want | | bool | $displayErrors | Whether to display errors (for development) or just log them (for production) | symfony DebugClassLoader DebugClassLoader ================= class **DebugClassLoader** Autoloader checking if the class is really defined in the file found. The ClassLoader will wrap all registered autoloaders and will throw an exception if a file is found but does not declare the class. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(callable $classLoader) | | | callable | [getClassLoader](#method_getClassLoader)() Gets the wrapped class loader. | | | static | [enable](#method_enable)() Wraps all autoloaders. | | | static | [disable](#method_disable)() Disables the wrapping. | | | | [loadClass](#method_loadClass)(string $class) Loads the given class or interface. | | | | [checkAnnotations](#method_checkAnnotations)([ReflectionClass](http://php.net/ReflectionClass) $refl, $class) | | | | [checkCase](#method_checkCase)([ReflectionClass](http://php.net/ReflectionClass) $refl, $file, $class) | | Details ------- ### \_\_construct(callable $classLoader) #### Parameters | | | | | --- | --- | --- | | callable | $classLoader | | ### callable getClassLoader() Gets the wrapped class loader. #### Return Value | | | | --- | --- | | callable | The wrapped class loader | ### static enable() Wraps all autoloaders. ### static disable() Disables the wrapping. ### loadClass(string $class) Loads the given class or interface. #### Parameters | | | | | --- | --- | --- | | string | $class | The name of the class | #### Exceptions | | | | --- | --- | | [RuntimeException](http://php.net/RuntimeException) | | ### checkAnnotations([ReflectionClass](http://php.net/ReflectionClass) $refl, $class) #### Parameters | | | | | --- | --- | --- | | [ReflectionClass](http://php.net/ReflectionClass) | $refl | | | | $class | | ### checkCase([ReflectionClass](http://php.net/ReflectionClass) $refl, $file, $class) #### Parameters | | | | | --- | --- | --- | | [ReflectionClass](http://php.net/ReflectionClass) | $refl | | | | $file | | | | $class | | symfony ClassNotFoundFatalErrorHandler ClassNotFoundFatalErrorHandler =============================== class **ClassNotFoundFatalErrorHandler** implements [FatalErrorHandlerInterface](fatalerrorhandlerinterface "Symfony\Component\Debug\FatalErrorHandler\FatalErrorHandlerInterface") ErrorHandler for classes that do not exist. Methods ------- | | | | | --- | --- | --- | | [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException")|null | [handleError](#method_handleError)(array $error, [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") $exception) Attempts to convert an error into an exception. | | Details ------- ### [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException")|null handleError(array $error, [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") $exception) Attempts to convert an error into an exception. #### Parameters | | | | | --- | --- | --- | | array | $error | An array as returned by error\_get\_last() | | [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") | $exception | A FatalErrorException instance | #### Return Value | | | | --- | --- | | [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException")|null | A FatalErrorException instance if the class is able to convert the error, null otherwise | symfony UndefinedFunctionFatalErrorHandler UndefinedFunctionFatalErrorHandler =================================== class **UndefinedFunctionFatalErrorHandler** implements [FatalErrorHandlerInterface](fatalerrorhandlerinterface "Symfony\Component\Debug\FatalErrorHandler\FatalErrorHandlerInterface") ErrorHandler for undefined functions. Methods ------- | | | | | --- | --- | --- | | [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException")|null | [handleError](#method_handleError)(array $error, [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") $exception) Attempts to convert an error into an exception. | | Details ------- ### [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException")|null handleError(array $error, [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") $exception) Attempts to convert an error into an exception. #### Parameters | | | | | --- | --- | --- | | array | $error | An array as returned by error\_get\_last() | | [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") | $exception | A FatalErrorException instance | #### Return Value | | | | --- | --- | | [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException")|null | A FatalErrorException instance if the class is able to convert the error, null otherwise | symfony UndefinedMethodFatalErrorHandler UndefinedMethodFatalErrorHandler ================================= class **UndefinedMethodFatalErrorHandler** implements [FatalErrorHandlerInterface](fatalerrorhandlerinterface "Symfony\Component\Debug\FatalErrorHandler\FatalErrorHandlerInterface") ErrorHandler for undefined methods. Methods ------- | | | | | --- | --- | --- | | [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException")|null | [handleError](#method_handleError)(array $error, [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") $exception) Attempts to convert an error into an exception. | | Details ------- ### [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException")|null handleError(array $error, [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") $exception) Attempts to convert an error into an exception. #### Parameters | | | | | --- | --- | --- | | array | $error | An array as returned by error\_get\_last() | | [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") | $exception | A FatalErrorException instance | #### Return Value | | | | --- | --- | | [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException")|null | A FatalErrorException instance if the class is able to convert the error, null otherwise | symfony FatalErrorHandlerInterface FatalErrorHandlerInterface =========================== interface **FatalErrorHandlerInterface** Attempts to convert fatal errors to exceptions. Methods ------- | | | | | --- | --- | --- | | [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException")|null | [handleError](#method_handleError)(array $error, [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") $exception) Attempts to convert an error into an exception. | | Details ------- ### [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException")|null handleError(array $error, [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") $exception) Attempts to convert an error into an exception. #### Parameters | | | | | --- | --- | --- | | array | $error | An array as returned by error\_get\_last() | | [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") | $exception | A FatalErrorException instance | #### Return Value | | | | --- | --- | | [FatalErrorException](../exception/fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException")|null | A FatalErrorException instance if the class is able to convert the error, null otherwise |
programming_docs
symfony UndefinedFunctionException UndefinedFunctionException =========================== class **UndefinedFunctionException** extends [FatalErrorException](fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") Undefined Function Exception. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $message, [Throwable](http://php.net/Throwable) $previous) | | | | [setTrace](#method_setTrace)($trace) | from [FatalErrorException](fatalerrorexception#method_setTrace "Symfony\Component\Debug\Exception\FatalErrorException") | Details ------- ### \_\_construct(string $message, [Throwable](http://php.net/Throwable) $previous) #### Parameters | | | | | --- | --- | --- | | string | $message | | | [Throwable](http://php.net/Throwable) | $previous | | ### protected setTrace($trace) #### Parameters | | | | | --- | --- | --- | | | $trace | | symfony SilencedErrorContext SilencedErrorContext ===================== class **SilencedErrorContext** implements [JsonSerializable](http://php.net/JsonSerializable) Data Object that represents a Silenced Error. Properties ---------- | | | | | | --- | --- | --- | --- | | | $count | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(int $severity, string $file, int $line, array $trace = array(), int $count = 1) | | | | [getSeverity](#method_getSeverity)() | | | | [getFile](#method_getFile)() | | | | [getLine](#method_getLine)() | | | | [getTrace](#method_getTrace)() | | | | [JsonSerialize](#method_JsonSerialize)() | | Details ------- ### \_\_construct(int $severity, string $file, int $line, array $trace = array(), int $count = 1) #### Parameters | | | | | --- | --- | --- | | int | $severity | | | string | $file | | | int | $line | | | array | $trace | | | int | $count | | ### getSeverity() ### getFile() ### getLine() ### getTrace() ### JsonSerialize() symfony FlattenException FlattenException ================= class **FlattenException** FlattenException wraps a PHP Error or Exception to be able to serialize it. Basically, this class removes all objects from the trace. Methods ------- | | | | | --- | --- | --- | | static | [create](#method_create)([Exception](http://php.net/Exception) $exception, $statusCode = null, array $headers = array()) | | | static [FlattenException](flattenexception "Symfony\Component\Debug\Exception\FlattenException") | [createFromThrowable](#method_createFromThrowable)([Throwable](http://php.net/Throwable) $exception, int|null $statusCode = null, array $headers = array()) | | | | [toArray](#method_toArray)() | | | | [getStatusCode](#method_getStatusCode)() | | | | [setStatusCode](#method_setStatusCode)($code) | | | | [getHeaders](#method_getHeaders)() | | | | [setHeaders](#method_setHeaders)(array $headers) | | | | [getClass](#method_getClass)() | | | | [setClass](#method_setClass)($class) | | | | [getFile](#method_getFile)() | | | | [setFile](#method_setFile)($file) | | | | [getLine](#method_getLine)() | | | | [setLine](#method_setLine)($line) | | | | [getMessage](#method_getMessage)() | | | | [setMessage](#method_setMessage)($message) | | | | [getCode](#method_getCode)() | | | | [setCode](#method_setCode)($code) | | | | [getPrevious](#method_getPrevious)() | | | | [setPrevious](#method_setPrevious)([FlattenException](flattenexception "Symfony\Component\Debug\Exception\FlattenException") $previous) | | | | [getAllPrevious](#method_getAllPrevious)() | | | | [getTrace](#method_getTrace)() | | | | [setTraceFromException](#method_setTraceFromException)([Exception](http://php.net/Exception) $exception) deprecated | | | void | [setTraceFromThrowable](#method_setTraceFromThrowable)([Throwable](http://php.net/Throwable) $throwable) | | | | [setTrace](#method_setTrace)($trace, $file, $line) | | Details ------- ### static create([Exception](http://php.net/Exception) $exception, $statusCode = null, array $headers = array()) #### Parameters | | | | | --- | --- | --- | | [Exception](http://php.net/Exception) | $exception | | | | $statusCode | | | array | $headers | | ### static [FlattenException](flattenexception "Symfony\Component\Debug\Exception\FlattenException") createFromThrowable([Throwable](http://php.net/Throwable) $exception, int|null $statusCode = null, array $headers = array()) #### Parameters | | | | | --- | --- | --- | | [Throwable](http://php.net/Throwable) | $exception | | | int|null | $statusCode | | | array | $headers | | #### Return Value | | | | --- | --- | | [FlattenException](flattenexception "Symfony\Component\Debug\Exception\FlattenException") | | ### toArray() ### getStatusCode() ### setStatusCode($code) #### Parameters | | | | | --- | --- | --- | | | $code | | ### getHeaders() ### setHeaders(array $headers) #### Parameters | | | | | --- | --- | --- | | array | $headers | | ### getClass() ### setClass($class) #### Parameters | | | | | --- | --- | --- | | | $class | | ### getFile() ### setFile($file) #### Parameters | | | | | --- | --- | --- | | | $file | | ### getLine() ### setLine($line) #### Parameters | | | | | --- | --- | --- | | | $line | | ### getMessage() ### setMessage($message) #### Parameters | | | | | --- | --- | --- | | | $message | | ### getCode() ### setCode($code) #### Parameters | | | | | --- | --- | --- | | | $code | | ### getPrevious() ### setPrevious([FlattenException](flattenexception "Symfony\Component\Debug\Exception\FlattenException") $previous) #### Parameters | | | | | --- | --- | --- | | [FlattenException](flattenexception "Symfony\Component\Debug\Exception\FlattenException") | $previous | | ### getAllPrevious() ### getTrace() ### setTraceFromException([Exception](http://php.net/Exception) $exception) deprecated deprecated | since | 4.1, use {@see setTraceFromThrowable()} instead. | #### Parameters | | | | | --- | --- | --- | | [Exception](http://php.net/Exception) | $exception | | ### void setTraceFromThrowable([Throwable](http://php.net/Throwable) $throwable) #### Parameters | | | | | --- | --- | --- | | [Throwable](http://php.net/Throwable) | $throwable | | #### Return Value | | | | --- | --- | | void | | ### setTrace($trace, $file, $line) #### Parameters | | | | | --- | --- | --- | | | $trace | | | | $file | | | | $line | | symfony OutOfMemoryException OutOfMemoryException ===================== class **OutOfMemoryException** extends [FatalErrorException](fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") Out of memory exception. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $message, int $code, int $severity, string $filename, int $lineno, int $traceOffset = null, bool $traceArgs = true, array $trace = null, [Throwable](http://php.net/Throwable) $previous = null) | from [FatalErrorException](fatalerrorexception#method___construct "Symfony\Component\Debug\Exception\FatalErrorException") | | | [setTrace](#method_setTrace)($trace) | from [FatalErrorException](fatalerrorexception#method_setTrace "Symfony\Component\Debug\Exception\FatalErrorException") | Details ------- ### \_\_construct(string $message, int $code, int $severity, string $filename, int $lineno, int $traceOffset = null, bool $traceArgs = true, array $trace = null, [Throwable](http://php.net/Throwable) $previous = null) #### Parameters | | | | | --- | --- | --- | | string | $message | | | int | $code | | | int | $severity | | | string | $filename | | | int | $lineno | | | int | $traceOffset | | | bool | $traceArgs | | | array | $trace | | | [Throwable](http://php.net/Throwable) | $previous | | ### protected setTrace($trace) #### Parameters | | | | | --- | --- | --- | | | $trace | | symfony ClassNotFoundException ClassNotFoundException ======================= class **ClassNotFoundException** extends [FatalErrorException](fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") Class (or Trait or Interface) Not Found Exception. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $message, [Throwable](http://php.net/Throwable) $previous) | | | | [setTrace](#method_setTrace)($trace) | from [FatalErrorException](fatalerrorexception#method_setTrace "Symfony\Component\Debug\Exception\FatalErrorException") | Details ------- ### \_\_construct(string $message, [Throwable](http://php.net/Throwable) $previous) #### Parameters | | | | | --- | --- | --- | | string | $message | | | [Throwable](http://php.net/Throwable) | $previous | | ### protected setTrace($trace) #### Parameters | | | | | --- | --- | --- | | | $trace | | symfony FatalThrowableError FatalThrowableError ==================== class **FatalThrowableError** extends [FatalErrorException](fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") Fatal Throwable Error. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Throwable](http://php.net/Throwable) $e) | | | | [setTrace](#method_setTrace)($trace) | from [FatalErrorException](fatalerrorexception#method_setTrace "Symfony\Component\Debug\Exception\FatalErrorException") | | string | [getOriginalClassName](#method_getOriginalClassName)() | | Details ------- ### \_\_construct([Throwable](http://php.net/Throwable) $e) #### Parameters | | | | | --- | --- | --- | | [Throwable](http://php.net/Throwable) | $e | | ### protected setTrace($trace) #### Parameters | | | | | --- | --- | --- | | | $trace | | ### string getOriginalClassName() #### Return Value | | | | --- | --- | | string | | symfony UndefinedMethodException UndefinedMethodException ========================= class **UndefinedMethodException** extends [FatalErrorException](fatalerrorexception "Symfony\Component\Debug\Exception\FatalErrorException") Undefined Method Exception. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $message, [Throwable](http://php.net/Throwable) $previous) | | | | [setTrace](#method_setTrace)($trace) | from [FatalErrorException](fatalerrorexception#method_setTrace "Symfony\Component\Debug\Exception\FatalErrorException") | Details ------- ### \_\_construct(string $message, [Throwable](http://php.net/Throwable) $previous) #### Parameters | | | | | --- | --- | --- | | string | $message | | | [Throwable](http://php.net/Throwable) | $previous | | ### protected setTrace($trace) #### Parameters | | | | | --- | --- | --- | | | $trace | | symfony FatalErrorException FatalErrorException ==================== class **FatalErrorException** extends [ErrorException](http://php.net/ErrorException) Fatal Error Exception. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $message, int $code, int $severity, string $filename, int $lineno, int $traceOffset = null, bool $traceArgs = true, array $trace = null, [Throwable](http://php.net/Throwable) $previous = null) | | | | [setTrace](#method_setTrace)($trace) | | Details ------- ### \_\_construct(string $message, int $code, int $severity, string $filename, int $lineno, int $traceOffset = null, bool $traceArgs = true, array $trace = null, [Throwable](http://php.net/Throwable) $previous = null) #### Parameters | | | | | --- | --- | --- | | string | $message | | | int | $code | | | int | $severity | | | string | $filename | | | int | $lineno | | | int | $traceOffset | | | bool | $traceArgs | | | array | $trace | | | [Throwable](http://php.net/Throwable) | $previous | | ### protected setTrace($trace) #### Parameters | | | | | --- | --- | --- | | | $trace | | symfony Application Application ============ class **Application** An Application is the container for a collection of commands. It is the main entry point of a Console application. This class is optimized for a standard CLI environment. Usage: ``` $app = new Application('myapp', '1.0 (stable)'); $app->add(new SimpleCommand()); $app->run(); ``` Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $name = 'UNKNOWN', string $version = 'UNKNOWN') | | | | [setDispatcher](#method_setDispatcher)([EventDispatcherInterface](../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher) | | | | [setCommandLoader](#method_setCommandLoader)([CommandLoaderInterface](commandloader/commandloaderinterface "Symfony\Component\Console\CommandLoader\CommandLoaderInterface") $commandLoader) | | | int | [run](#method_run)([InputInterface](input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input = null, [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output = null) Runs the current application. | | | int | [doRun](#method_doRun)([InputInterface](input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the current application. | | | | [setHelperSet](#method_setHelperSet)([HelperSet](helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) | | | [HelperSet](helper/helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Get the helper set associated with the command. | | | | [setDefinition](#method_setDefinition)([InputDefinition](input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) | | | [InputDefinition](input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getDefinition](#method_getDefinition)() Gets the InputDefinition related to this Application. | | | string | [getHelp](#method_getHelp)() Gets the help message. | | | bool | [areExceptionsCaught](#method_areExceptionsCaught)() Gets whether to catch exceptions or not during commands execution. | | | | [setCatchExceptions](#method_setCatchExceptions)(bool $boolean) Sets whether to catch exceptions or not during commands execution. | | | bool | [isAutoExitEnabled](#method_isAutoExitEnabled)() Gets whether to automatically exit after a command execution or not. | | | | [setAutoExit](#method_setAutoExit)(bool $boolean) Sets whether to automatically exit after a command execution or not. | | | string | [getName](#method_getName)() Gets the name of the application. | | | | [setName](#method_setName)(string $name) Sets the application name. | | | string | [getVersion](#method_getVersion)() Gets the application version. | | | | [setVersion](#method_setVersion)(string $version) Sets the application version. | | | string | [getLongVersion](#method_getLongVersion)() Returns the long version of the application. | | | [Command](command/command "Symfony\Component\Console\Command\Command") | [register](#method_register)(string $name) Registers a new command. | | | | [addCommands](#method_addCommands)(array $commands) Adds an array of command objects. | | | [Command](command/command "Symfony\Component\Console\Command\Command")|null | [add](#method_add)([Command](command/command "Symfony\Component\Console\Command\Command") $command) Adds a command object. | | | [Command](command/command "Symfony\Component\Console\Command\Command") | [get](#method_get)(string $name) Returns a registered command by name or alias. | | | bool | [has](#method_has)(string $name) Returns true if the command exists, false otherwise. | | | string[] | [getNamespaces](#method_getNamespaces)() Returns an array of all unique namespaces used by currently registered commands. | | | string | [findNamespace](#method_findNamespace)(string $namespace) Finds a registered namespace by a name or an abbreviation. | | | [Command](command/command "Symfony\Component\Console\Command\Command") | [find](#method_find)(string $name) Finds a command by name or alias. | | | [Command](command/command "Symfony\Component\Console\Command\Command")[] | [all](#method_all)(string $namespace = null) Gets the commands (registered in the given namespace if provided). | | | static array | [getAbbreviations](#method_getAbbreviations)(array $names) Returns an array of possible abbreviations given a set of names. | | | | [renderException](#method_renderException)([Exception](http://php.net/Exception) $e, [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Renders a caught exception. | | | | [doRenderException](#method_doRenderException)([Exception](http://php.net/Exception) $e, [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) | | | | [configureIO](#method_configureIO)([InputInterface](input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Configures the input and output instances based on the user arguments and options. | | | int | [doRunCommand](#method_doRunCommand)([Command](command/command "Symfony\Component\Console\Command\Command") $command, [InputInterface](input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the current command. | | | string | [getCommandName](#method_getCommandName)([InputInterface](input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input) Gets the name of the command based on input. | | | [InputDefinition](input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getDefaultInputDefinition](#method_getDefaultInputDefinition)() Gets the default input definition. | | | [Command](command/command "Symfony\Component\Console\Command\Command")[] | [getDefaultCommands](#method_getDefaultCommands)() Gets the default commands that should always be available. | | | [HelperSet](helper/helperset "Symfony\Component\Console\Helper\HelperSet") | [getDefaultHelperSet](#method_getDefaultHelperSet)() Gets the default helper set with the helpers that should always be available. | | | string | [extractNamespace](#method_extractNamespace)(string $name, string $limit = null) Returns the namespace part of the command name. | | | [Application](application "Symfony\Component\Console\Application") | [setDefaultCommand](#method_setDefaultCommand)(string $commandName, bool $isSingleCommand = false) Sets the default Command name. | | Details ------- ### \_\_construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN') #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the application | | string | $version | The version of the application | ### setDispatcher([EventDispatcherInterface](../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") $dispatcher) #### Parameters | | | | | --- | --- | --- | | [EventDispatcherInterface](../eventdispatcher/eventdispatcherinterface "Symfony\Component\EventDispatcher\EventDispatcherInterface") | $dispatcher | | ### setCommandLoader([CommandLoaderInterface](commandloader/commandloaderinterface "Symfony\Component\Console\CommandLoader\CommandLoaderInterface") $commandLoader) #### Parameters | | | | | --- | --- | --- | | [CommandLoaderInterface](commandloader/commandloaderinterface "Symfony\Component\Console\CommandLoader\CommandLoaderInterface") | $commandLoader | | ### int run([InputInterface](input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input = null, [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output = null) Runs the current application. #### Parameters | | | | | --- | --- | --- | | [InputInterface](input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int | 0 if everything went fine, or an error code | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | When running fails. Bypass this when {@link setCatchExceptions()}. | ### int doRun([InputInterface](input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the current application. #### Parameters | | | | | --- | --- | --- | | [InputInterface](input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int | 0 if everything went fine, or an error code | ### setHelperSet([HelperSet](helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) #### Parameters | | | | | --- | --- | --- | | [HelperSet](helper/helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](helper/helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Get the helper set associated with the command. #### Return Value | | | | --- | --- | | [HelperSet](helper/helperset "Symfony\Component\Console\Helper\HelperSet") | The HelperSet instance associated with this command | ### setDefinition([InputDefinition](input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) #### Parameters | | | | | --- | --- | --- | | [InputDefinition](input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | | ### [InputDefinition](input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getDefinition() Gets the InputDefinition related to this Application. #### Return Value | | | | --- | --- | | [InputDefinition](input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | The InputDefinition instance | ### string getHelp() Gets the help message. #### Return Value | | | | --- | --- | | string | A help message | ### bool areExceptionsCaught() Gets whether to catch exceptions or not during commands execution. #### Return Value | | | | --- | --- | | bool | Whether to catch exceptions or not during commands execution | ### setCatchExceptions(bool $boolean) Sets whether to catch exceptions or not during commands execution. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | Whether to catch exceptions or not during commands execution | ### bool isAutoExitEnabled() Gets whether to automatically exit after a command execution or not. #### Return Value | | | | --- | --- | | bool | Whether to automatically exit after a command execution or not | ### setAutoExit(bool $boolean) Sets whether to automatically exit after a command execution or not. #### Parameters | | | | | --- | --- | --- | | bool | $boolean | Whether to automatically exit after a command execution or not | ### string getName() Gets the name of the application. #### Return Value | | | | --- | --- | | string | The application name | ### setName(string $name) Sets the application name. #### Parameters | | | | | --- | --- | --- | | string | $name | The application name | ### string getVersion() Gets the application version. #### Return Value | | | | --- | --- | | string | The application version | ### setVersion(string $version) Sets the application version. #### Parameters | | | | | --- | --- | --- | | string | $version | The application version | ### string getLongVersion() Returns the long version of the application. #### Return Value | | | | --- | --- | | string | The long application version | ### [Command](command/command "Symfony\Component\Console\Command\Command") register(string $name) Registers a new command. #### Parameters | | | | | --- | --- | --- | | string | $name | The command name | #### Return Value | | | | --- | --- | | [Command](command/command "Symfony\Component\Console\Command\Command") | The newly created command | ### addCommands(array $commands) Adds an array of command objects. If a Command is not enabled it will not be added. #### Parameters | | | | | --- | --- | --- | | array | $commands | An array of commands | ### [Command](command/command "Symfony\Component\Console\Command\Command")|null add([Command](command/command "Symfony\Component\Console\Command\Command") $command) Adds a command object. If a command with the same name already exists, it will be overridden. If the command is not enabled it will not be added. #### Parameters | | | | | --- | --- | --- | | [Command](command/command "Symfony\Component\Console\Command\Command") | $command | | #### Return Value | | | | --- | --- | | [Command](command/command "Symfony\Component\Console\Command\Command")|null | The registered command if enabled or null | ### [Command](command/command "Symfony\Component\Console\Command\Command") get(string $name) Returns a registered command by name or alias. #### Parameters | | | | | --- | --- | --- | | string | $name | The command name or alias | #### Return Value | | | | --- | --- | | [Command](command/command "Symfony\Component\Console\Command\Command") | A Command object | #### Exceptions | | | | --- | --- | | [CommandNotFoundException](exception/commandnotfoundexception "Symfony\Component\Console\Exception\CommandNotFoundException") | When given command name does not exist | ### bool has(string $name) Returns true if the command exists, false otherwise. #### Parameters | | | | | --- | --- | --- | | string | $name | The command name or alias | #### Return Value | | | | --- | --- | | bool | true if the command exists, false otherwise | ### string[] getNamespaces() Returns an array of all unique namespaces used by currently registered commands. It does not return the global namespace which always exists. #### Return Value | | | | --- | --- | | string[] | An array of namespaces | ### string findNamespace(string $namespace) Finds a registered namespace by a name or an abbreviation. #### Parameters | | | | | --- | --- | --- | | string | $namespace | A namespace or abbreviation to search for | #### Return Value | | | | --- | --- | | string | A registered namespace | #### Exceptions | | | | --- | --- | | [NamespaceNotFoundException](exception/namespacenotfoundexception "Symfony\Component\Console\Exception\NamespaceNotFoundException") | When namespace is incorrect or ambiguous | ### [Command](command/command "Symfony\Component\Console\Command\Command") find(string $name) Finds a command by name or alias. Contrary to get, this command tries to find the best match if you give it an abbreviation of a name or alias. #### Parameters | | | | | --- | --- | --- | | string | $name | A command name or a command alias | #### Return Value | | | | --- | --- | | [Command](command/command "Symfony\Component\Console\Command\Command") | A Command instance | #### Exceptions | | | | --- | --- | | [CommandNotFoundException](exception/commandnotfoundexception "Symfony\Component\Console\Exception\CommandNotFoundException") | When command name is incorrect or ambiguous | ### [Command](command/command "Symfony\Component\Console\Command\Command")[] all(string $namespace = null) Gets the commands (registered in the given namespace if provided). The array keys are the full names and the values the command instances. #### Parameters | | | | | --- | --- | --- | | string | $namespace | A namespace name | #### Return Value | | | | --- | --- | | [Command](command/command "Symfony\Component\Console\Command\Command")[] | An array of Command instances | ### static array getAbbreviations(array $names) Returns an array of possible abbreviations given a set of names. #### Parameters | | | | | --- | --- | --- | | array | $names | An array of names | #### Return Value | | | | --- | --- | | array | An array of abbreviations | ### renderException([Exception](http://php.net/Exception) $e, [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Renders a caught exception. #### Parameters | | | | | --- | --- | --- | | [Exception](http://php.net/Exception) | $e | | | [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### protected doRenderException([Exception](http://php.net/Exception) $e, [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) #### Parameters | | | | | --- | --- | --- | | [Exception](http://php.net/Exception) | $e | | | [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### protected configureIO([InputInterface](input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Configures the input and output instances based on the user arguments and options. #### Parameters | | | | | --- | --- | --- | | [InputInterface](input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### protected int doRunCommand([Command](command/command "Symfony\Component\Console\Command\Command") $command, [InputInterface](input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the current command. If an event dispatcher has been attached to the application, events are also dispatched during the life-cycle of the command. #### Parameters | | | | | --- | --- | --- | | [Command](command/command "Symfony\Component\Console\Command\Command") | $command | | | [InputInterface](input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int | 0 if everything went fine, or an error code | ### protected string getCommandName([InputInterface](input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input) Gets the name of the command based on input. #### Parameters | | | | | --- | --- | --- | | [InputInterface](input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | #### Return Value | | | | --- | --- | | string | The command name | ### protected [InputDefinition](input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getDefaultInputDefinition() Gets the default input definition. #### Return Value | | | | --- | --- | | [InputDefinition](input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### protected [Command](command/command "Symfony\Component\Console\Command\Command")[] getDefaultCommands() Gets the default commands that should always be available. #### Return Value | | | | --- | --- | | [Command](command/command "Symfony\Component\Console\Command\Command")[] | An array of default Command instances | ### protected [HelperSet](helper/helperset "Symfony\Component\Console\Helper\HelperSet") getDefaultHelperSet() Gets the default helper set with the helpers that should always be available. #### Return Value | | | | --- | --- | | [HelperSet](helper/helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### string extractNamespace(string $name, string $limit = null) Returns the namespace part of the command name. This method is not part of public API and should not be used directly. #### Parameters | | | | | --- | --- | --- | | string | $name | The full name of the command | | string | $limit | The maximum number of parts of the namespace | #### Return Value | | | | --- | --- | | string | The namespace of the command | ### [Application](application "Symfony\Component\Console\Application") setDefaultCommand(string $commandName, bool $isSingleCommand = false) Sets the default Command name. #### Parameters | | | | | --- | --- | --- | | string | $commandName | The Command name | | bool | $isSingleCommand | Set to true if there is only one command in this application | #### Return Value | | | | --- | --- | | [Application](application "Symfony\Component\Console\Application") | |
programming_docs
symfony Symfony\Component\Console\Descriptor Symfony\Component\Console\Descriptor ==================================== Classes ------- | | | | --- | --- | | [ApplicationDescription](descriptor/applicationdescription "Symfony\Component\Console\Descriptor\ApplicationDescription") | | | [Descriptor](descriptor/descriptor "Symfony\Component\Console\Descriptor\Descriptor") | | | [JsonDescriptor](descriptor/jsondescriptor "Symfony\Component\Console\Descriptor\JsonDescriptor") | JSON descriptor. | | [MarkdownDescriptor](descriptor/markdowndescriptor "Symfony\Component\Console\Descriptor\MarkdownDescriptor") | Markdown descriptor. | | [TextDescriptor](descriptor/textdescriptor "Symfony\Component\Console\Descriptor\TextDescriptor") | Text descriptor. | | [XmlDescriptor](descriptor/xmldescriptor "Symfony\Component\Console\Descriptor\XmlDescriptor") | XML descriptor. | Interfaces ---------- | | | | --- | --- | | *[DescriptorInterface](descriptor/descriptorinterface "Symfony\Component\Console\Descriptor\DescriptorInterface")* | Descriptor interface. | symfony Symfony\Component\Console\Exception Symfony\Component\Console\Exception =================================== Classes ------- | | | | --- | --- | | [CommandNotFoundException](exception/commandnotfoundexception "Symfony\Component\Console\Exception\CommandNotFoundException") | Represents an incorrect command name typed in the console. | | [InvalidArgumentException](exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | | | [InvalidOptionException](exception/invalidoptionexception "Symfony\Component\Console\Exception\InvalidOptionException") | Represents an incorrect option name typed in the console. | | [LogicException](exception/logicexception "Symfony\Component\Console\Exception\LogicException") | | | [NamespaceNotFoundException](exception/namespacenotfoundexception "Symfony\Component\Console\Exception\NamespaceNotFoundException") | Represents an incorrect namespace typed in the console. | | [RuntimeException](exception/runtimeexception "Symfony\Component\Console\Exception\RuntimeException") | | Interfaces ---------- | | | | --- | --- | | *[ExceptionInterface](exception/exceptioninterface "Symfony\Component\Console\Exception\ExceptionInterface")* | ExceptionInterface. | symfony Symfony\Component\Console\Helper Symfony\Component\Console\Helper ================================ Classes ------- | | | | --- | --- | | [DebugFormatterHelper](helper/debugformatterhelper "Symfony\Component\Console\Helper\DebugFormatterHelper") | Helps outputting debug information when running an external program from a command. | | [DescriptorHelper](helper/descriptorhelper "Symfony\Component\Console\Helper\DescriptorHelper") | This class adds helper method to describe objects in various formats. | | [FormatterHelper](helper/formatterhelper "Symfony\Component\Console\Helper\FormatterHelper") | The Formatter class provides helpers to format messages. | | [Helper](helper/helper "Symfony\Component\Console\Helper\Helper") | Helper is the base class for all helper classes. | | [HelperSet](helper/helperset "Symfony\Component\Console\Helper\HelperSet") | HelperSet represents a set of helpers to be used with a command. | | [InputAwareHelper](helper/inputawarehelper "Symfony\Component\Console\Helper\InputAwareHelper") | An implementation of InputAwareInterface for Helpers. | | [ProcessHelper](helper/processhelper "Symfony\Component\Console\Helper\ProcessHelper") | The ProcessHelper class provides helpers to run external processes. | | [ProgressBar](helper/progressbar "Symfony\Component\Console\Helper\ProgressBar") | The ProgressBar provides helpers to display progress output. | | [ProgressIndicator](helper/progressindicator "Symfony\Component\Console\Helper\ProgressIndicator") | | | [QuestionHelper](helper/questionhelper "Symfony\Component\Console\Helper\QuestionHelper") | The QuestionHelper class provides helpers to interact with the user. | | [SymfonyQuestionHelper](helper/symfonyquestionhelper "Symfony\Component\Console\Helper\SymfonyQuestionHelper") | Symfony Style Guide compliant question helper. | | [Table](helper/table "Symfony\Component\Console\Helper\Table") | Provides helpers to display a table. | | [TableCell](helper/tablecell "Symfony\Component\Console\Helper\TableCell") | | | [TableRows](helper/tablerows "Symfony\Component\Console\Helper\TableRows") | | | [TableSeparator](helper/tableseparator "Symfony\Component\Console\Helper\TableSeparator") | Marks a row as being a separator. | | [TableStyle](helper/tablestyle "Symfony\Component\Console\Helper\TableStyle") | Defines the styles for a Table. | Interfaces ---------- | | | | --- | --- | | *[HelperInterface](helper/helperinterface "Symfony\Component\Console\Helper\HelperInterface")* | HelperInterface is the interface all helpers must implement. | symfony Terminal Terminal ========= class **Terminal** Methods ------- | | | | | --- | --- | --- | | int | [getWidth](#method_getWidth)() Gets the terminal width. | | | int | [getHeight](#method_getHeight)() Gets the terminal height. | | Details ------- ### int getWidth() Gets the terminal width. #### Return Value | | | | --- | --- | | int | | ### int getHeight() Gets the terminal height. #### Return Value | | | | --- | --- | | int | | symfony Symfony\Component\Console\Logger Symfony\Component\Console\Logger ================================ Classes ------- | | | | --- | --- | | [ConsoleLogger](logger/consolelogger "Symfony\Component\Console\Logger\ConsoleLogger") | PSR-3 compliant console logger. | symfony Symfony\Component\Console\CommandLoader Symfony\Component\Console\CommandLoader ======================================= Classes ------- | | | | --- | --- | | [ContainerCommandLoader](commandloader/containercommandloader "Symfony\Component\Console\CommandLoader\ContainerCommandLoader") | Loads commands from a PSR-11 container. | | [FactoryCommandLoader](commandloader/factorycommandloader "Symfony\Component\Console\CommandLoader\FactoryCommandLoader") | A simple command loader using factories to instantiate commands lazily. | Interfaces ---------- | | | | --- | --- | | *[CommandLoaderInterface](commandloader/commandloaderinterface "Symfony\Component\Console\CommandLoader\CommandLoaderInterface")* | | symfony Symfony\Component\Console\Command Symfony\Component\Console\Command ================================= Classes ------- | | | | --- | --- | | [Command](command/command "Symfony\Component\Console\Command\Command") | Base class for all commands. | | [HelpCommand](command/helpcommand "Symfony\Component\Console\Command\HelpCommand") | HelpCommand displays the help for a given command. | | [ListCommand](command/listcommand "Symfony\Component\Console\Command\ListCommand") | ListCommand displays the list of all available commands for the application. | | [LockableTrait](command/lockabletrait "Symfony\Component\Console\Command\LockableTrait") | Basic lock feature for commands. | symfony Symfony\Component\Console\Question Symfony\Component\Console\Question ================================== Classes ------- | | | | --- | --- | | [ChoiceQuestion](question/choicequestion "Symfony\Component\Console\Question\ChoiceQuestion") | Represents a choice question. | | [ConfirmationQuestion](question/confirmationquestion "Symfony\Component\Console\Question\ConfirmationQuestion") | Represents a yes/no question. | | [Question](question/question "Symfony\Component\Console\Question\Question") | Represents a Question. | symfony Symfony\Component\Console\Event Symfony\Component\Console\Event =============================== Classes ------- | | | | --- | --- | | [ConsoleCommandEvent](event/consolecommandevent "Symfony\Component\Console\Event\ConsoleCommandEvent") | Allows to do things before the command is executed, like skipping the command or changing the input. | | [ConsoleErrorEvent](event/consoleerrorevent "Symfony\Component\Console\Event\ConsoleErrorEvent") | Allows to handle throwables thrown while running a command. | | [ConsoleEvent](event/consoleevent "Symfony\Component\Console\Event\ConsoleEvent") | Allows to inspect input and output of a command. | | [ConsoleTerminateEvent](event/consoleterminateevent "Symfony\Component\Console\Event\ConsoleTerminateEvent") | Allows to manipulate the exit code of a command after its execution. | symfony Symfony\Component\Console\Style Symfony\Component\Console\Style =============================== Classes ------- | | | | --- | --- | | [OutputStyle](style/outputstyle "Symfony\Component\Console\Style\OutputStyle") | Decorates output to add console style guide helpers. | | [SymfonyStyle](style/symfonystyle "Symfony\Component\Console\Style\SymfonyStyle") | Output decorator helpers for the Symfony Style Guide. | Interfaces ---------- | | | | --- | --- | | *[StyleInterface](style/styleinterface "Symfony\Component\Console\Style\StyleInterface")* | Output style helpers. | symfony Symfony\Component\Console\Formatter Symfony\Component\Console\Formatter =================================== Classes ------- | | | | --- | --- | | [OutputFormatter](formatter/outputformatter "Symfony\Component\Console\Formatter\OutputFormatter") | Formatter class for console output. | | [OutputFormatterStyle](formatter/outputformatterstyle "Symfony\Component\Console\Formatter\OutputFormatterStyle") | Formatter style class for defining styles. | | [OutputFormatterStyleStack](formatter/outputformatterstylestack "Symfony\Component\Console\Formatter\OutputFormatterStyleStack") | | Interfaces ---------- | | | | --- | --- | | *[OutputFormatterInterface](formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface")* | Formatter interface for console output. | | *[OutputFormatterStyleInterface](formatter/outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface")* | Formatter style interface for defining styles. | symfony Symfony\Component\Console\Output Symfony\Component\Console\Output ================================ Classes ------- | | | | --- | --- | | [BufferedOutput](output/bufferedoutput "Symfony\Component\Console\Output\BufferedOutput") | | | [ConsoleOutput](output/consoleoutput "Symfony\Component\Console\Output\ConsoleOutput") | ConsoleOutput is the default class for all CLI output. It uses STDOUT and STDERR. | | [ConsoleSectionOutput](output/consolesectionoutput "Symfony\Component\Console\Output\ConsoleSectionOutput") | | | [NullOutput](output/nulloutput "Symfony\Component\Console\Output\NullOutput") | NullOutput suppresses all output. | | [Output](output/output "Symfony\Component\Console\Output\Output") | Base class for output classes. | | [StreamOutput](output/streamoutput "Symfony\Component\Console\Output\StreamOutput") | StreamOutput writes the output to a given stream. | Interfaces ---------- | | | | --- | --- | | *[ConsoleOutputInterface](output/consoleoutputinterface "Symfony\Component\Console\Output\ConsoleOutputInterface")* | ConsoleOutputInterface is the interface implemented by ConsoleOutput class. | | *[OutputInterface](output/outputinterface "Symfony\Component\Console\Output\OutputInterface")* | OutputInterface is the interface implemented by all Output classes. | symfony Symfony\Component\Console\Tester Symfony\Component\Console\Tester ================================ Classes ------- | | | | --- | --- | | [ApplicationTester](tester/applicationtester "Symfony\Component\Console\Tester\ApplicationTester") | Eases the testing of console applications. | | [CommandTester](tester/commandtester "Symfony\Component\Console\Tester\CommandTester") | Eases the testing of console commands. | | [TesterTrait](tester/testertrait "Symfony\Component\Console\Tester\TesterTrait") | | symfony Symfony\Component\Console\DependencyInjection Symfony\Component\Console\DependencyInjection ============================================= Classes ------- | | | | --- | --- | | [AddConsoleCommandPass](dependencyinjection/addconsolecommandpass "Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass") | Registers console commands. | symfony Symfony\Component\Console\Input Symfony\Component\Console\Input =============================== Classes ------- | | | | --- | --- | | [ArgvInput](input/argvinput "Symfony\Component\Console\Input\ArgvInput") | ArgvInput represents an input coming from the CLI arguments. | | [ArrayInput](input/arrayinput "Symfony\Component\Console\Input\ArrayInput") | ArrayInput represents an input provided as an array. | | [Input](input/input "Symfony\Component\Console\Input\Input") | Input is the base class for all concrete Input classes. | | [InputArgument](input/inputargument "Symfony\Component\Console\Input\InputArgument") | Represents a command line argument. | | [InputDefinition](input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | A InputDefinition represents a set of valid command line arguments and options. | | [InputOption](input/inputoption "Symfony\Component\Console\Input\InputOption") | Represents a command line option. | | [StringInput](input/stringinput "Symfony\Component\Console\Input\StringInput") | StringInput represents an input provided as a string. | Interfaces ---------- | | | | --- | --- | | *[InputAwareInterface](input/inputawareinterface "Symfony\Component\Console\Input\InputAwareInterface")* | InputAwareInterface should be implemented by classes that depends on the Console Input. | | *[InputInterface](input/inputinterface "Symfony\Component\Console\Input\InputInterface")* | InputInterface is the interface implemented by all input classes. | | *[StreamableInputInterface](input/streamableinputinterface "Symfony\Component\Console\Input\StreamableInputInterface")* | StreamableInputInterface is the interface implemented by all input classes that have an input stream. | symfony Symfony\Component\Console\EventListener Symfony\Component\Console\EventListener ======================================= Classes ------- | | | | --- | --- | | [ErrorListener](eventlistener/errorlistener "Symfony\Component\Console\EventListener\ErrorListener") | | symfony ConsoleEvents ConsoleEvents ============== class **ConsoleEvents** Contains all events dispatched by an Application. Constants --------- | | | | --- | --- | | COMMAND | *The COMMAND event allows you to attach listeners before any command is executed by the console. It also allows you to modify the command, input and output before they are handled to the command.* | | TERMINATE | *The TERMINATE event allows you to attach listeners after a command is executed by the console.* | | ERROR | *The ERROR event occurs when an uncaught exception or error appears.* This event allows you to deal with the exception/error or to modify the thrown exception. | symfony ConsoleLogger ConsoleLogger ============== class **ConsoleLogger** extends AbstractLogger PSR-3 compliant console logger. Constants --------- | | | | --- | --- | | INFO | | | ERROR | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, array $verbosityLevelMap = array(), array $formatLevelMap = array()) | | | | [log](#method_log)($level, $message, array $context = array()) {@inheritdoc} | | | bool | [hasErrored](#method_hasErrored)() Returns true when any messages have been logged at error levels. | | Details ------- ### \_\_construct([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, array $verbosityLevelMap = array(), array $formatLevelMap = array()) #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | array | $verbosityLevelMap | | | array | $formatLevelMap | | ### log($level, $message, array $context = array()) {@inheritdoc} #### Parameters | | | | | --- | --- | --- | | | $level | | | | $message | | | array | $context | | ### bool hasErrored() Returns true when any messages have been logged at error levels. #### Return Value | | | | --- | --- | | bool | | symfony StreamableInputInterface StreamableInputInterface ========================= interface **StreamableInputInterface** implements [InputInterface](inputinterface "Symfony\Component\Console\Input\InputInterface") StreamableInputInterface is the interface implemented by all input classes that have an input stream. Methods ------- | | | | | --- | --- | --- | | string|null | [getFirstArgument](#method_getFirstArgument)() Returns the first argument from the raw parameters (not parsed). | from [InputInterface](inputinterface#method_getFirstArgument "Symfony\Component\Console\Input\InputInterface") | | bool | [hasParameterOption](#method_hasParameterOption)(string|array $values, bool $onlyParams = false) Returns true if the raw parameters (not parsed) contain a value. | from [InputInterface](inputinterface#method_hasParameterOption "Symfony\Component\Console\Input\InputInterface") | | mixed | [getParameterOption](#method_getParameterOption)(string|array $values, mixed $default = false, bool $onlyParams = false) Returns the value of a raw option (not parsed). | from [InputInterface](inputinterface#method_getParameterOption "Symfony\Component\Console\Input\InputInterface") | | | [bind](#method_bind)([InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Binds the current Input instance with the given arguments and options. | from [InputInterface](inputinterface#method_bind "Symfony\Component\Console\Input\InputInterface") | | | [validate](#method_validate)() Validates the input. | from [InputInterface](inputinterface#method_validate "Symfony\Component\Console\Input\InputInterface") | | array | [getArguments](#method_getArguments)() Returns all the given arguments merged with the default values. | from [InputInterface](inputinterface#method_getArguments "Symfony\Component\Console\Input\InputInterface") | | string|string[]|null | [getArgument](#method_getArgument)(string $name) Returns the argument value for a given argument name. | from [InputInterface](inputinterface#method_getArgument "Symfony\Component\Console\Input\InputInterface") | | | [setArgument](#method_setArgument)(string $name, string|string[]|null $value) Sets an argument value by name. | from [InputInterface](inputinterface#method_setArgument "Symfony\Component\Console\Input\InputInterface") | | bool | [hasArgument](#method_hasArgument)(string|int $name) Returns true if an InputArgument object exists by name or position. | from [InputInterface](inputinterface#method_hasArgument "Symfony\Component\Console\Input\InputInterface") | | array | [getOptions](#method_getOptions)() Returns all the given options merged with the default values. | from [InputInterface](inputinterface#method_getOptions "Symfony\Component\Console\Input\InputInterface") | | string|string[]|bool|null | [getOption](#method_getOption)(string $name) Returns the option value for a given option name. | from [InputInterface](inputinterface#method_getOption "Symfony\Component\Console\Input\InputInterface") | | | [setOption](#method_setOption)(string $name, string|string[]|bool|null $value) Sets an option value by name. | from [InputInterface](inputinterface#method_setOption "Symfony\Component\Console\Input\InputInterface") | | bool | [hasOption](#method_hasOption)(string $name) Returns true if an InputOption object exists by name. | from [InputInterface](inputinterface#method_hasOption "Symfony\Component\Console\Input\InputInterface") | | bool | [isInteractive](#method_isInteractive)() Is this input means interactive? | from [InputInterface](inputinterface#method_isInteractive "Symfony\Component\Console\Input\InputInterface") | | | [setInteractive](#method_setInteractive)(bool $interactive) Sets the input interactivity. | from [InputInterface](inputinterface#method_setInteractive "Symfony\Component\Console\Input\InputInterface") | | | [setStream](#method_setStream)(resource $stream) Sets the input stream to read from when interacting with the user. | | | resource|null | [getStream](#method_getStream)() Returns the input stream. | | Details ------- ### string|null getFirstArgument() Returns the first argument from the raw parameters (not parsed). #### Return Value | | | | --- | --- | | string|null | The value of the first argument or null otherwise | ### bool hasParameterOption(string|array $values, bool $onlyParams = false) Returns true if the raw parameters (not parsed) contain a value. This method is to be used to introspect the input parameters before they have been validated. It must be used carefully. Does not necessarily return the correct result for short options when multiple flags are combined in the same option. #### Parameters | | | | | --- | --- | --- | | string|array | $values | The values to look for in the raw parameters (can be an array) | | bool | $onlyParams | Only check real parameters, skip those following an end of options (--) signal | #### Return Value | | | | --- | --- | | bool | true if the value is contained in the raw parameters | ### mixed getParameterOption(string|array $values, mixed $default = false, bool $onlyParams = false) Returns the value of a raw option (not parsed). This method is to be used to introspect the input parameters before they have been validated. It must be used carefully. Does not necessarily return the correct result for short options when multiple flags are combined in the same option. #### Parameters | | | | | --- | --- | --- | | string|array | $values | The value(s) to look for in the raw parameters (can be an array) | | mixed | $default | The default value to return if no result is found | | bool | $onlyParams | Only check real parameters, skip those following an end of options (--) signal | #### Return Value | | | | --- | --- | | mixed | The option value | ### bind([InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Binds the current Input instance with the given arguments and options. #### Parameters | | | | | --- | --- | --- | | [InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\Console\Exception\RuntimeException") | | ### validate() Validates the input. #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\Console\Exception\RuntimeException") | When not enough arguments are given | ### array getArguments() Returns all the given arguments merged with the default values. #### Return Value | | | | --- | --- | | array | | ### string|string[]|null getArgument(string $name) Returns the argument value for a given argument name. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | #### Return Value | | | | --- | --- | | string|string[]|null | The argument value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument given doesn't exist | ### setArgument(string $name, string|string[]|null $value) Sets an argument value by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | | string|string[]|null | $value | The argument value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument given doesn't exist | ### bool hasArgument(string|int $name) Returns true if an InputArgument object exists by name or position. #### Parameters | | | | | --- | --- | --- | | string|int | $name | The InputArgument name or position | #### Return Value | | | | --- | --- | | bool | true if the InputArgument object exists, false otherwise | ### array getOptions() Returns all the given options merged with the default values. #### Return Value | | | | --- | --- | | array | | ### string|string[]|bool|null getOption(string $name) Returns the option value for a given option name. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | #### Return Value | | | | --- | --- | | string|string[]|bool|null | The option value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When option given doesn't exist | ### setOption(string $name, string|string[]|bool|null $value) Sets an option value by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | | string|string[]|bool|null | $value | The option value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When option given doesn't exist | ### bool hasOption(string $name) Returns true if an InputOption object exists by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The InputOption name | #### Return Value | | | | --- | --- | | bool | true if the InputOption object exists, false otherwise | ### bool isInteractive() Is this input means interactive? #### Return Value | | | | --- | --- | | bool | | ### setInteractive(bool $interactive) Sets the input interactivity. #### Parameters | | | | | --- | --- | --- | | bool | $interactive | If the input should be interactive | ### setStream(resource $stream) Sets the input stream to read from when interacting with the user. This is mainly useful for testing purpose. #### Parameters | | | | | --- | --- | --- | | resource | $stream | The input stream | ### resource|null getStream() Returns the input stream. #### Return Value | | | | --- | --- | | resource|null | |
programming_docs
symfony InputDefinition InputDefinition ================ class **InputDefinition** A InputDefinition represents a set of valid command line arguments and options. Usage: ``` $definition = new InputDefinition(array( new InputArgument('name', InputArgument::REQUIRED), new InputOption('foo', 'f', InputOption::VALUE_REQUIRED), )); ``` Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $definition = array()) | | | | [setDefinition](#method_setDefinition)(array $definition) Sets the definition of the input. | | | | [setArguments](#method_setArguments)([InputArgument](inputargument "Symfony\Component\Console\Input\InputArgument")[] $arguments = array()) Sets the InputArgument objects. | | | | [addArguments](#method_addArguments)([InputArgument](inputargument "Symfony\Component\Console\Input\InputArgument")[] $arguments = array()) Adds an array of InputArgument objects. | | | | [addArgument](#method_addArgument)([InputArgument](inputargument "Symfony\Component\Console\Input\InputArgument") $argument) | | | [InputArgument](inputargument "Symfony\Component\Console\Input\InputArgument") | [getArgument](#method_getArgument)(string|int $name) Returns an InputArgument by name or by position. | | | bool | [hasArgument](#method_hasArgument)(string|int $name) Returns true if an InputArgument object exists by name or position. | | | [InputArgument](inputargument "Symfony\Component\Console\Input\InputArgument")[] | [getArguments](#method_getArguments)() Gets the array of InputArgument objects. | | | int | [getArgumentCount](#method_getArgumentCount)() Returns the number of InputArguments. | | | int | [getArgumentRequiredCount](#method_getArgumentRequiredCount)() Returns the number of required InputArguments. | | | array | [getArgumentDefaults](#method_getArgumentDefaults)() Gets the default values. | | | | [setOptions](#method_setOptions)([InputOption](inputoption "Symfony\Component\Console\Input\InputOption")[] $options = array()) Sets the InputOption objects. | | | | [addOptions](#method_addOptions)([InputOption](inputoption "Symfony\Component\Console\Input\InputOption")[] $options = array()) Adds an array of InputOption objects. | | | | [addOption](#method_addOption)([InputOption](inputoption "Symfony\Component\Console\Input\InputOption") $option) | | | [InputOption](inputoption "Symfony\Component\Console\Input\InputOption") | [getOption](#method_getOption)(string $name) Returns an InputOption by name. | | | bool | [hasOption](#method_hasOption)(string $name) Returns true if an InputOption object exists by name. | | | [InputOption](inputoption "Symfony\Component\Console\Input\InputOption")[] | [getOptions](#method_getOptions)() Gets the array of InputOption objects. | | | bool | [hasShortcut](#method_hasShortcut)(string $name) Returns true if an InputOption object exists by shortcut. | | | [InputOption](inputoption "Symfony\Component\Console\Input\InputOption") | [getOptionForShortcut](#method_getOptionForShortcut)(string $shortcut) Gets an InputOption by shortcut. | | | array | [getOptionDefaults](#method_getOptionDefaults)() Gets an array of default values. | | | string | [getSynopsis](#method_getSynopsis)(bool $short = false) Gets the synopsis. | | Details ------- ### \_\_construct(array $definition = array()) #### Parameters | | | | | --- | --- | --- | | array | $definition | An array of InputArgument and InputOption instance | ### setDefinition(array $definition) Sets the definition of the input. #### Parameters | | | | | --- | --- | --- | | array | $definition | | ### setArguments([InputArgument](inputargument "Symfony\Component\Console\Input\InputArgument")[] $arguments = array()) Sets the InputArgument objects. #### Parameters | | | | | --- | --- | --- | | [InputArgument](inputargument "Symfony\Component\Console\Input\InputArgument")[] | $arguments | An array of InputArgument objects | ### addArguments([InputArgument](inputargument "Symfony\Component\Console\Input\InputArgument")[] $arguments = array()) Adds an array of InputArgument objects. #### Parameters | | | | | --- | --- | --- | | [InputArgument](inputargument "Symfony\Component\Console\Input\InputArgument")[] | $arguments | An array of InputArgument objects | ### addArgument([InputArgument](inputargument "Symfony\Component\Console\Input\InputArgument") $argument) #### Parameters | | | | | --- | --- | --- | | [InputArgument](inputargument "Symfony\Component\Console\Input\InputArgument") | $argument | | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When incorrect argument is given | ### [InputArgument](inputargument "Symfony\Component\Console\Input\InputArgument") getArgument(string|int $name) Returns an InputArgument by name or by position. #### Parameters | | | | | --- | --- | --- | | string|int | $name | The InputArgument name or position | #### Return Value | | | | --- | --- | | [InputArgument](inputargument "Symfony\Component\Console\Input\InputArgument") | An InputArgument object | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument given doesn't exist | ### bool hasArgument(string|int $name) Returns true if an InputArgument object exists by name or position. #### Parameters | | | | | --- | --- | --- | | string|int | $name | The InputArgument name or position | #### Return Value | | | | --- | --- | | bool | true if the InputArgument object exists, false otherwise | ### [InputArgument](inputargument "Symfony\Component\Console\Input\InputArgument")[] getArguments() Gets the array of InputArgument objects. #### Return Value | | | | --- | --- | | [InputArgument](inputargument "Symfony\Component\Console\Input\InputArgument")[] | An array of InputArgument objects | ### int getArgumentCount() Returns the number of InputArguments. #### Return Value | | | | --- | --- | | int | The number of InputArguments | ### int getArgumentRequiredCount() Returns the number of required InputArguments. #### Return Value | | | | --- | --- | | int | The number of required InputArguments | ### array getArgumentDefaults() Gets the default values. #### Return Value | | | | --- | --- | | array | An array of default values | ### setOptions([InputOption](inputoption "Symfony\Component\Console\Input\InputOption")[] $options = array()) Sets the InputOption objects. #### Parameters | | | | | --- | --- | --- | | [InputOption](inputoption "Symfony\Component\Console\Input\InputOption")[] | $options | An array of InputOption objects | ### addOptions([InputOption](inputoption "Symfony\Component\Console\Input\InputOption")[] $options = array()) Adds an array of InputOption objects. #### Parameters | | | | | --- | --- | --- | | [InputOption](inputoption "Symfony\Component\Console\Input\InputOption")[] | $options | An array of InputOption objects | ### addOption([InputOption](inputoption "Symfony\Component\Console\Input\InputOption") $option) #### Parameters | | | | | --- | --- | --- | | [InputOption](inputoption "Symfony\Component\Console\Input\InputOption") | $option | | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When option given already exist | ### [InputOption](inputoption "Symfony\Component\Console\Input\InputOption") getOption(string $name) Returns an InputOption by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The InputOption name | #### Return Value | | | | --- | --- | | [InputOption](inputoption "Symfony\Component\Console\Input\InputOption") | A InputOption object | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When option given doesn't exist | ### bool hasOption(string $name) Returns true if an InputOption object exists by name. This method can't be used to check if the user included the option when executing the command (use getOption() instead). #### Parameters | | | | | --- | --- | --- | | string | $name | The InputOption name | #### Return Value | | | | --- | --- | | bool | true if the InputOption object exists, false otherwise | ### [InputOption](inputoption "Symfony\Component\Console\Input\InputOption")[] getOptions() Gets the array of InputOption objects. #### Return Value | | | | --- | --- | | [InputOption](inputoption "Symfony\Component\Console\Input\InputOption")[] | An array of InputOption objects | ### bool hasShortcut(string $name) Returns true if an InputOption object exists by shortcut. #### Parameters | | | | | --- | --- | --- | | string | $name | The InputOption shortcut | #### Return Value | | | | --- | --- | | bool | true if the InputOption object exists, false otherwise | ### [InputOption](inputoption "Symfony\Component\Console\Input\InputOption") getOptionForShortcut(string $shortcut) Gets an InputOption by shortcut. #### Parameters | | | | | --- | --- | --- | | string | $shortcut | The Shortcut name | #### Return Value | | | | --- | --- | | [InputOption](inputoption "Symfony\Component\Console\Input\InputOption") | An InputOption object | ### array getOptionDefaults() Gets an array of default values. #### Return Value | | | | --- | --- | | array | An array of all default values | ### string getSynopsis(bool $short = false) Gets the synopsis. #### Parameters | | | | | --- | --- | --- | | bool | $short | Whether to return the short version (with options folded) or not | #### Return Value | | | | --- | --- | | string | The synopsis | symfony ArrayInput ArrayInput =========== class **ArrayInput** extends [Input](input "Symfony\Component\Console\Input\Input") ArrayInput represents an input provided as an array. Usage: ``` $input = new ArrayInput(array('name' => 'foo', '--bar' => 'foobar')); ``` Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $definition | | from [Input](input#property_definition "Symfony\Component\Console\Input\Input") | | protected | $stream | | from [Input](input#property_stream "Symfony\Component\Console\Input\Input") | | protected | $options | | from [Input](input#property_options "Symfony\Component\Console\Input\Input") | | protected | $arguments | | from [Input](input#property_arguments "Symfony\Component\Console\Input\Input") | | protected | $interactive | | from [Input](input#property_interactive "Symfony\Component\Console\Input\Input") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $parameters, [InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition = null) | | | | [bind](#method_bind)([InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Binds the current Input instance with the given arguments and options. | from [Input](input#method_bind "Symfony\Component\Console\Input\Input") | | | [parse](#method_parse)() Processes command line arguments. | | | | [validate](#method_validate)() Validates the input. | from [Input](input#method_validate "Symfony\Component\Console\Input\Input") | | bool | [isInteractive](#method_isInteractive)() Is this input means interactive? | from [Input](input#method_isInteractive "Symfony\Component\Console\Input\Input") | | | [setInteractive](#method_setInteractive)(bool $interactive) Sets the input interactivity. | from [Input](input#method_setInteractive "Symfony\Component\Console\Input\Input") | | array | [getArguments](#method_getArguments)() Returns all the given arguments merged with the default values. | from [Input](input#method_getArguments "Symfony\Component\Console\Input\Input") | | string|string[]|null | [getArgument](#method_getArgument)(string $name) Returns the argument value for a given argument name. | from [Input](input#method_getArgument "Symfony\Component\Console\Input\Input") | | | [setArgument](#method_setArgument)(string $name, string|string[]|null $value) Sets an argument value by name. | from [Input](input#method_setArgument "Symfony\Component\Console\Input\Input") | | bool | [hasArgument](#method_hasArgument)(string|int $name) Returns true if an InputArgument object exists by name or position. | from [Input](input#method_hasArgument "Symfony\Component\Console\Input\Input") | | array | [getOptions](#method_getOptions)() Returns all the given options merged with the default values. | from [Input](input#method_getOptions "Symfony\Component\Console\Input\Input") | | string|string[]|bool|null | [getOption](#method_getOption)(string $name) Returns the option value for a given option name. | from [Input](input#method_getOption "Symfony\Component\Console\Input\Input") | | | [setOption](#method_setOption)(string $name, string|string[]|bool|null $value) Sets an option value by name. | from [Input](input#method_setOption "Symfony\Component\Console\Input\Input") | | bool | [hasOption](#method_hasOption)(string $name) Returns true if an InputOption object exists by name. | from [Input](input#method_hasOption "Symfony\Component\Console\Input\Input") | | string | [escapeToken](#method_escapeToken)(string $token) Escapes a token through escapeshellarg if it contains unsafe chars. | from [Input](input#method_escapeToken "Symfony\Component\Console\Input\Input") | | | [setStream](#method_setStream)(resource $stream) Sets the input stream to read from when interacting with the user. | from [Input](input#method_setStream "Symfony\Component\Console\Input\Input") | | resource|null | [getStream](#method_getStream)() Returns the input stream. | from [Input](input#method_getStream "Symfony\Component\Console\Input\Input") | | string|null | [getFirstArgument](#method_getFirstArgument)() Returns the first argument from the raw parameters (not parsed). | | | bool | [hasParameterOption](#method_hasParameterOption)(string|array $values, bool $onlyParams = false) Returns true if the raw parameters (not parsed) contain a value. | | | mixed | [getParameterOption](#method_getParameterOption)(string|array $values, mixed $default = false, bool $onlyParams = false) Returns the value of a raw option (not parsed). | | | string | [\_\_toString](#method___toString)() Returns a stringified representation of the args passed to the command. | | Details ------- ### \_\_construct(array $parameters, [InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition = null) #### Parameters | | | | | --- | --- | --- | | array | $parameters | | | [InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | | ### bind([InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Binds the current Input instance with the given arguments and options. #### Parameters | | | | | --- | --- | --- | | [InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\Console\Exception\RuntimeException") | | ### protected parse() Processes command line arguments. ### validate() Validates the input. #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\Console\Exception\RuntimeException") | When not enough arguments are given | ### bool isInteractive() Is this input means interactive? #### Return Value | | | | --- | --- | | bool | | ### setInteractive(bool $interactive) Sets the input interactivity. #### Parameters | | | | | --- | --- | --- | | bool | $interactive | If the input should be interactive | ### array getArguments() Returns all the given arguments merged with the default values. #### Return Value | | | | --- | --- | | array | | ### string|string[]|null getArgument(string $name) Returns the argument value for a given argument name. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | #### Return Value | | | | --- | --- | | string|string[]|null | The argument value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument given doesn't exist | ### setArgument(string $name, string|string[]|null $value) Sets an argument value by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | | string|string[]|null | $value | The argument value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument given doesn't exist | ### bool hasArgument(string|int $name) Returns true if an InputArgument object exists by name or position. #### Parameters | | | | | --- | --- | --- | | string|int | $name | The InputArgument name or position | #### Return Value | | | | --- | --- | | bool | true if the InputArgument object exists, false otherwise | ### array getOptions() Returns all the given options merged with the default values. #### Return Value | | | | --- | --- | | array | | ### string|string[]|bool|null getOption(string $name) Returns the option value for a given option name. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | #### Return Value | | | | --- | --- | | string|string[]|bool|null | The option value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When option given doesn't exist | ### setOption(string $name, string|string[]|bool|null $value) Sets an option value by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | | string|string[]|bool|null | $value | The option value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When option given doesn't exist | ### bool hasOption(string $name) Returns true if an InputOption object exists by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The InputOption name | #### Return Value | | | | --- | --- | | bool | true if the InputOption object exists, false otherwise | ### string escapeToken(string $token) Escapes a token through escapeshellarg if it contains unsafe chars. #### Parameters | | | | | --- | --- | --- | | string | $token | | #### Return Value | | | | --- | --- | | string | | ### setStream(resource $stream) Sets the input stream to read from when interacting with the user. This is mainly useful for testing purpose. #### Parameters | | | | | --- | --- | --- | | resource | $stream | The input stream | ### resource|null getStream() Returns the input stream. #### Return Value | | | | --- | --- | | resource|null | | ### string|null getFirstArgument() Returns the first argument from the raw parameters (not parsed). #### Return Value | | | | --- | --- | | string|null | The value of the first argument or null otherwise | ### bool hasParameterOption(string|array $values, bool $onlyParams = false) Returns true if the raw parameters (not parsed) contain a value. This method is to be used to introspect the input parameters before they have been validated. It must be used carefully. Does not necessarily return the correct result for short options when multiple flags are combined in the same option. #### Parameters | | | | | --- | --- | --- | | string|array | $values | The values to look for in the raw parameters (can be an array) | | bool | $onlyParams | Only check real parameters, skip those following an end of options (--) signal | #### Return Value | | | | --- | --- | | bool | true if the value is contained in the raw parameters | ### mixed getParameterOption(string|array $values, mixed $default = false, bool $onlyParams = false) Returns the value of a raw option (not parsed). This method is to be used to introspect the input parameters before they have been validated. It must be used carefully. Does not necessarily return the correct result for short options when multiple flags are combined in the same option. #### Parameters | | | | | --- | --- | --- | | string|array | $values | The value(s) to look for in the raw parameters (can be an array) | | mixed | $default | The default value to return if no result is found | | bool | $onlyParams | Only check real parameters, skip those following an end of options (--) signal | #### Return Value | | | | --- | --- | | mixed | The option value | ### string \_\_toString() Returns a stringified representation of the args passed to the command. #### Return Value | | | | --- | --- | | string | |
programming_docs
symfony InputArgument InputArgument ============== class **InputArgument** Represents a command line argument. Constants --------- | | | | --- | --- | | REQUIRED | | | OPTIONAL | | | IS\_ARRAY | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $name, int $mode = null, string $description = '', string|string[]|null $default = null) | | | string | [getName](#method_getName)() Returns the argument name. | | | bool | [isRequired](#method_isRequired)() Returns true if the argument is required. | | | bool | [isArray](#method_isArray)() Returns true if the argument can take multiple values. | | | | [setDefault](#method_setDefault)(string|string[]|null $default = null) Sets the default value. | | | string|string[]|null | [getDefault](#method_getDefault)() Returns the default value. | | | string | [getDescription](#method_getDescription)() Returns the description text. | | Details ------- ### \_\_construct(string $name, int $mode = null, string $description = '', string|string[]|null $default = null) #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | | int | $mode | The argument mode: self::REQUIRED or self::OPTIONAL | | string | $description | A description text | | string|string[]|null | $default | The default value (for self::OPTIONAL mode only) | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument mode is not valid | ### string getName() Returns the argument name. #### Return Value | | | | --- | --- | | string | The argument name | ### bool isRequired() Returns true if the argument is required. #### Return Value | | | | --- | --- | | bool | true if parameter mode is self::REQUIRED, false otherwise | ### bool isArray() Returns true if the argument can take multiple values. #### Return Value | | | | --- | --- | | bool | true if mode is self::IS\_ARRAY, false otherwise | ### setDefault(string|string[]|null $default = null) Sets the default value. #### Parameters | | | | | --- | --- | --- | | string|string[]|null | $default | The default value | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When incorrect default value is given | ### string|string[]|null getDefault() Returns the default value. #### Return Value | | | | --- | --- | | string|string[]|null | The default value | ### string getDescription() Returns the description text. #### Return Value | | | | --- | --- | | string | The description text | symfony InputOption InputOption ============ class **InputOption** Represents a command line option. Constants --------- | | | | --- | --- | | VALUE\_NONE | | | VALUE\_REQUIRED | | | VALUE\_OPTIONAL | | | VALUE\_IS\_ARRAY | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $name, string|array $shortcut = null, int $mode = null, string $description = '', string|string[]|int|bool|null $default = null) | | | string | [getShortcut](#method_getShortcut)() Returns the option shortcut. | | | string | [getName](#method_getName)() Returns the option name. | | | bool | [acceptValue](#method_acceptValue)() Returns true if the option accepts a value. | | | bool | [isValueRequired](#method_isValueRequired)() Returns true if the option requires a value. | | | bool | [isValueOptional](#method_isValueOptional)() Returns true if the option takes an optional value. | | | bool | [isArray](#method_isArray)() Returns true if the option can take multiple values. | | | | [setDefault](#method_setDefault)(string|string[]|int|bool|null $default = null) Sets the default value. | | | string|string[]|int|bool|null | [getDefault](#method_getDefault)() Returns the default value. | | | string | [getDescription](#method_getDescription)() Returns the description text. | | | bool | [equals](#method_equals)([InputOption](inputoption "Symfony\Component\Console\Input\InputOption") $option) Checks whether the given option equals this one. | | Details ------- ### \_\_construct(string $name, string|array $shortcut = null, int $mode = null, string $description = '', string|string[]|int|bool|null $default = null) #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | | string|array | $shortcut | The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts | | int | $mode | The option mode: One of the VALUE\_\* constants | | string | $description | A description text | | string|string[]|int|bool|null | $default | The default value (must be null for self::VALUE\_NONE) | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | If option mode is invalid or incompatible | ### string getShortcut() Returns the option shortcut. #### Return Value | | | | --- | --- | | string | The shortcut | ### string getName() Returns the option name. #### Return Value | | | | --- | --- | | string | The name | ### bool acceptValue() Returns true if the option accepts a value. #### Return Value | | | | --- | --- | | bool | true if value mode is not self::VALUE\_NONE, false otherwise | ### bool isValueRequired() Returns true if the option requires a value. #### Return Value | | | | --- | --- | | bool | true if value mode is self::VALUE\_REQUIRED, false otherwise | ### bool isValueOptional() Returns true if the option takes an optional value. #### Return Value | | | | --- | --- | | bool | true if value mode is self::VALUE\_OPTIONAL, false otherwise | ### bool isArray() Returns true if the option can take multiple values. #### Return Value | | | | --- | --- | | bool | true if mode is self::VALUE\_IS\_ARRAY, false otherwise | ### setDefault(string|string[]|int|bool|null $default = null) Sets the default value. #### Parameters | | | | | --- | --- | --- | | string|string[]|int|bool|null | $default | The default value | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When incorrect default value is given | ### string|string[]|int|bool|null getDefault() Returns the default value. #### Return Value | | | | --- | --- | | string|string[]|int|bool|null | The default value | ### string getDescription() Returns the description text. #### Return Value | | | | --- | --- | | string | The description text | ### bool equals([InputOption](inputoption "Symfony\Component\Console\Input\InputOption") $option) Checks whether the given option equals this one. #### Parameters | | | | | --- | --- | --- | | [InputOption](inputoption "Symfony\Component\Console\Input\InputOption") | $option | | #### Return Value | | | | --- | --- | | bool | | symfony Input Input ====== abstract class **Input** implements [InputInterface](inputinterface "Symfony\Component\Console\Input\InputInterface"), [StreamableInputInterface](streamableinputinterface "Symfony\Component\Console\Input\StreamableInputInterface") Input is the base class for all concrete Input classes. Three concrete classes are provided by default: * `ArgvInput`: The input comes from the CLI arguments (argv) * `StringInput`: The input is provided as a string * `ArrayInput`: The input is provided as an array Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $definition | | | | protected | $stream | | | | protected | $options | | | | protected | $arguments | | | | protected | $interactive | | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition = null) | | | | [bind](#method_bind)([InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Binds the current Input instance with the given arguments and options. | | | | [parse](#method_parse)() Processes command line arguments. | | | | [validate](#method_validate)() Validates the input. | | | bool | [isInteractive](#method_isInteractive)() Is this input means interactive? | | | | [setInteractive](#method_setInteractive)(bool $interactive) Sets the input interactivity. | | | array | [getArguments](#method_getArguments)() Returns all the given arguments merged with the default values. | | | string|string[]|null | [getArgument](#method_getArgument)(string $name) Returns the argument value for a given argument name. | | | | [setArgument](#method_setArgument)(string $name, string|string[]|null $value) Sets an argument value by name. | | | bool | [hasArgument](#method_hasArgument)(string|int $name) Returns true if an InputArgument object exists by name or position. | | | array | [getOptions](#method_getOptions)() Returns all the given options merged with the default values. | | | string|string[]|bool|null | [getOption](#method_getOption)(string $name) Returns the option value for a given option name. | | | | [setOption](#method_setOption)(string $name, string|string[]|bool|null $value) Sets an option value by name. | | | bool | [hasOption](#method_hasOption)(string $name) Returns true if an InputOption object exists by name. | | | string | [escapeToken](#method_escapeToken)(string $token) Escapes a token through escapeshellarg if it contains unsafe chars. | | | | [setStream](#method_setStream)(resource $stream) Sets the input stream to read from when interacting with the user. | | | resource|null | [getStream](#method_getStream)() Returns the input stream. | | Details ------- ### \_\_construct([InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition = null) #### Parameters | | | | | --- | --- | --- | | [InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | | ### bind([InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Binds the current Input instance with the given arguments and options. #### Parameters | | | | | --- | --- | --- | | [InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\Console\Exception\RuntimeException") | | ### abstract protected parse() Processes command line arguments. ### validate() Validates the input. #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\Console\Exception\RuntimeException") | When not enough arguments are given | ### bool isInteractive() Is this input means interactive? #### Return Value | | | | --- | --- | | bool | | ### setInteractive(bool $interactive) Sets the input interactivity. #### Parameters | | | | | --- | --- | --- | | bool | $interactive | If the input should be interactive | ### array getArguments() Returns all the given arguments merged with the default values. #### Return Value | | | | --- | --- | | array | | ### string|string[]|null getArgument(string $name) Returns the argument value for a given argument name. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | #### Return Value | | | | --- | --- | | string|string[]|null | The argument value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument given doesn't exist | ### setArgument(string $name, string|string[]|null $value) Sets an argument value by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | | string|string[]|null | $value | The argument value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument given doesn't exist | ### bool hasArgument(string|int $name) Returns true if an InputArgument object exists by name or position. #### Parameters | | | | | --- | --- | --- | | string|int | $name | The InputArgument name or position | #### Return Value | | | | --- | --- | | bool | true if the InputArgument object exists, false otherwise | ### array getOptions() Returns all the given options merged with the default values. #### Return Value | | | | --- | --- | | array | | ### string|string[]|bool|null getOption(string $name) Returns the option value for a given option name. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | #### Return Value | | | | --- | --- | | string|string[]|bool|null | The option value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When option given doesn't exist | ### setOption(string $name, string|string[]|bool|null $value) Sets an option value by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | | string|string[]|bool|null | $value | The option value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When option given doesn't exist | ### bool hasOption(string $name) Returns true if an InputOption object exists by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The InputOption name | #### Return Value | | | | --- | --- | | bool | true if the InputOption object exists, false otherwise | ### string escapeToken(string $token) Escapes a token through escapeshellarg if it contains unsafe chars. #### Parameters | | | | | --- | --- | --- | | string | $token | | #### Return Value | | | | --- | --- | | string | | ### setStream(resource $stream) Sets the input stream to read from when interacting with the user. This is mainly useful for testing purpose. #### Parameters | | | | | --- | --- | --- | | resource | $stream | The input stream | ### resource|null getStream() Returns the input stream. #### Return Value | | | | --- | --- | | resource|null | | symfony StringInput StringInput ============ class **StringInput** extends [ArgvInput](argvinput "Symfony\Component\Console\Input\ArgvInput") StringInput represents an input provided as a string. Usage: ``` $input = new StringInput('foo --bar="foobar"'); ``` Constants --------- | | | | --- | --- | | REGEX\_STRING | | | REGEX\_QUOTED\_STRING | | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $definition | | from [Input](input#property_definition "Symfony\Component\Console\Input\Input") | | protected | $stream | | from [Input](input#property_stream "Symfony\Component\Console\Input\Input") | | protected | $options | | from [Input](input#property_options "Symfony\Component\Console\Input\Input") | | protected | $arguments | | from [Input](input#property_arguments "Symfony\Component\Console\Input\Input") | | protected | $interactive | | from [Input](input#property_interactive "Symfony\Component\Console\Input\Input") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $input) | | | | [bind](#method_bind)([InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Binds the current Input instance with the given arguments and options. | from [Input](input#method_bind "Symfony\Component\Console\Input\Input") | | | [parse](#method_parse)() Processes command line arguments. | from [ArgvInput](argvinput#method_parse "Symfony\Component\Console\Input\ArgvInput") | | | [validate](#method_validate)() Validates the input. | from [Input](input#method_validate "Symfony\Component\Console\Input\Input") | | bool | [isInteractive](#method_isInteractive)() Is this input means interactive? | from [Input](input#method_isInteractive "Symfony\Component\Console\Input\Input") | | | [setInteractive](#method_setInteractive)(bool $interactive) Sets the input interactivity. | from [Input](input#method_setInteractive "Symfony\Component\Console\Input\Input") | | array | [getArguments](#method_getArguments)() Returns all the given arguments merged with the default values. | from [Input](input#method_getArguments "Symfony\Component\Console\Input\Input") | | string|string[]|null | [getArgument](#method_getArgument)(string $name) Returns the argument value for a given argument name. | from [Input](input#method_getArgument "Symfony\Component\Console\Input\Input") | | | [setArgument](#method_setArgument)(string $name, string|string[]|null $value) Sets an argument value by name. | from [Input](input#method_setArgument "Symfony\Component\Console\Input\Input") | | bool | [hasArgument](#method_hasArgument)(string|int $name) Returns true if an InputArgument object exists by name or position. | from [Input](input#method_hasArgument "Symfony\Component\Console\Input\Input") | | array | [getOptions](#method_getOptions)() Returns all the given options merged with the default values. | from [Input](input#method_getOptions "Symfony\Component\Console\Input\Input") | | string|string[]|bool|null | [getOption](#method_getOption)(string $name) Returns the option value for a given option name. | from [Input](input#method_getOption "Symfony\Component\Console\Input\Input") | | | [setOption](#method_setOption)(string $name, string|string[]|bool|null $value) Sets an option value by name. | from [Input](input#method_setOption "Symfony\Component\Console\Input\Input") | | bool | [hasOption](#method_hasOption)(string $name) Returns true if an InputOption object exists by name. | from [Input](input#method_hasOption "Symfony\Component\Console\Input\Input") | | string | [escapeToken](#method_escapeToken)(string $token) Escapes a token through escapeshellarg if it contains unsafe chars. | from [Input](input#method_escapeToken "Symfony\Component\Console\Input\Input") | | | [setStream](#method_setStream)(resource $stream) Sets the input stream to read from when interacting with the user. | from [Input](input#method_setStream "Symfony\Component\Console\Input\Input") | | resource|null | [getStream](#method_getStream)() Returns the input stream. | from [Input](input#method_getStream "Symfony\Component\Console\Input\Input") | | | [setTokens](#method_setTokens)(array $tokens) | from [ArgvInput](argvinput#method_setTokens "Symfony\Component\Console\Input\ArgvInput") | | string|null | [getFirstArgument](#method_getFirstArgument)() Returns the first argument from the raw parameters (not parsed). | from [ArgvInput](argvinput#method_getFirstArgument "Symfony\Component\Console\Input\ArgvInput") | | bool | [hasParameterOption](#method_hasParameterOption)(string|array $values, bool $onlyParams = false) Returns true if the raw parameters (not parsed) contain a value. | from [ArgvInput](argvinput#method_hasParameterOption "Symfony\Component\Console\Input\ArgvInput") | | mixed | [getParameterOption](#method_getParameterOption)(string|array $values, mixed $default = false, bool $onlyParams = false) Returns the value of a raw option (not parsed). | from [ArgvInput](argvinput#method_getParameterOption "Symfony\Component\Console\Input\ArgvInput") | | string | [\_\_toString](#method___toString)() Returns a stringified representation of the args passed to the command. | from [ArgvInput](argvinput#method___toString "Symfony\Component\Console\Input\ArgvInput") | Details ------- ### \_\_construct(string $input) #### Parameters | | | | | --- | --- | --- | | string | $input | A string representing the parameters from the CLI | ### bind([InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Binds the current Input instance with the given arguments and options. #### Parameters | | | | | --- | --- | --- | | [InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\Console\Exception\RuntimeException") | | ### protected parse() Processes command line arguments. ### validate() Validates the input. #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\Console\Exception\RuntimeException") | When not enough arguments are given | ### bool isInteractive() Is this input means interactive? #### Return Value | | | | --- | --- | | bool | | ### setInteractive(bool $interactive) Sets the input interactivity. #### Parameters | | | | | --- | --- | --- | | bool | $interactive | If the input should be interactive | ### array getArguments() Returns all the given arguments merged with the default values. #### Return Value | | | | --- | --- | | array | | ### string|string[]|null getArgument(string $name) Returns the argument value for a given argument name. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | #### Return Value | | | | --- | --- | | string|string[]|null | The argument value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument given doesn't exist | ### setArgument(string $name, string|string[]|null $value) Sets an argument value by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | | string|string[]|null | $value | The argument value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument given doesn't exist | ### bool hasArgument(string|int $name) Returns true if an InputArgument object exists by name or position. #### Parameters | | | | | --- | --- | --- | | string|int | $name | The InputArgument name or position | #### Return Value | | | | --- | --- | | bool | true if the InputArgument object exists, false otherwise | ### array getOptions() Returns all the given options merged with the default values. #### Return Value | | | | --- | --- | | array | | ### string|string[]|bool|null getOption(string $name) Returns the option value for a given option name. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | #### Return Value | | | | --- | --- | | string|string[]|bool|null | The option value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When option given doesn't exist | ### setOption(string $name, string|string[]|bool|null $value) Sets an option value by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | | string|string[]|bool|null | $value | The option value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When option given doesn't exist | ### bool hasOption(string $name) Returns true if an InputOption object exists by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The InputOption name | #### Return Value | | | | --- | --- | | bool | true if the InputOption object exists, false otherwise | ### string escapeToken(string $token) Escapes a token through escapeshellarg if it contains unsafe chars. #### Parameters | | | | | --- | --- | --- | | string | $token | | #### Return Value | | | | --- | --- | | string | | ### setStream(resource $stream) Sets the input stream to read from when interacting with the user. This is mainly useful for testing purpose. #### Parameters | | | | | --- | --- | --- | | resource | $stream | The input stream | ### resource|null getStream() Returns the input stream. #### Return Value | | | | --- | --- | | resource|null | | ### protected setTokens(array $tokens) #### Parameters | | | | | --- | --- | --- | | array | $tokens | | ### string|null getFirstArgument() Returns the first argument from the raw parameters (not parsed). #### Return Value | | | | --- | --- | | string|null | The value of the first argument or null otherwise | ### bool hasParameterOption(string|array $values, bool $onlyParams = false) Returns true if the raw parameters (not parsed) contain a value. This method is to be used to introspect the input parameters before they have been validated. It must be used carefully. Does not necessarily return the correct result for short options when multiple flags are combined in the same option. #### Parameters | | | | | --- | --- | --- | | string|array | $values | The values to look for in the raw parameters (can be an array) | | bool | $onlyParams | Only check real parameters, skip those following an end of options (--) signal | #### Return Value | | | | --- | --- | | bool | true if the value is contained in the raw parameters | ### mixed getParameterOption(string|array $values, mixed $default = false, bool $onlyParams = false) Returns the value of a raw option (not parsed). This method is to be used to introspect the input parameters before they have been validated. It must be used carefully. Does not necessarily return the correct result for short options when multiple flags are combined in the same option. #### Parameters | | | | | --- | --- | --- | | string|array | $values | The value(s) to look for in the raw parameters (can be an array) | | mixed | $default | The default value to return if no result is found | | bool | $onlyParams | Only check real parameters, skip those following an end of options (--) signal | #### Return Value | | | | --- | --- | | mixed | The option value | ### string \_\_toString() Returns a stringified representation of the args passed to the command. #### Return Value | | | | --- | --- | | string | |
programming_docs
symfony InputAwareInterface InputAwareInterface ==================== interface **InputAwareInterface** InputAwareInterface should be implemented by classes that depends on the Console Input. Methods ------- | | | | | --- | --- | --- | | | [setInput](#method_setInput)([InputInterface](inputinterface "Symfony\Component\Console\Input\InputInterface") $input) Sets the Console Input. | | Details ------- ### setInput([InputInterface](inputinterface "Symfony\Component\Console\Input\InputInterface") $input) Sets the Console Input. #### Parameters | | | | | --- | --- | --- | | [InputInterface](inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | symfony ArgvInput ArgvInput ========== class **ArgvInput** extends [Input](input "Symfony\Component\Console\Input\Input") ArgvInput represents an input coming from the CLI arguments. Usage: ``` $input = new ArgvInput(); ``` By default, the `$_SERVER['argv']` array is used for the input values. This can be overridden by explicitly passing the input values in the constructor: ``` $input = new ArgvInput($_SERVER['argv']); ``` If you pass it yourself, don't forget that the first element of the array is the name of the running application. When passing an argument to the constructor, be sure that it respects the same rules as the argv one. It's almost always better to use the `StringInput` when you want to provide your own input. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $definition | | from [Input](input#property_definition "Symfony\Component\Console\Input\Input") | | protected | $stream | | from [Input](input#property_stream "Symfony\Component\Console\Input\Input") | | protected | $options | | from [Input](input#property_options "Symfony\Component\Console\Input\Input") | | protected | $arguments | | from [Input](input#property_arguments "Symfony\Component\Console\Input\Input") | | protected | $interactive | | from [Input](input#property_interactive "Symfony\Component\Console\Input\Input") | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $argv = null, [InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition = null) | | | | [bind](#method_bind)([InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Binds the current Input instance with the given arguments and options. | from [Input](input#method_bind "Symfony\Component\Console\Input\Input") | | | [parse](#method_parse)() Processes command line arguments. | | | | [validate](#method_validate)() Validates the input. | from [Input](input#method_validate "Symfony\Component\Console\Input\Input") | | bool | [isInteractive](#method_isInteractive)() Is this input means interactive? | from [Input](input#method_isInteractive "Symfony\Component\Console\Input\Input") | | | [setInteractive](#method_setInteractive)(bool $interactive) Sets the input interactivity. | from [Input](input#method_setInteractive "Symfony\Component\Console\Input\Input") | | array | [getArguments](#method_getArguments)() Returns all the given arguments merged with the default values. | from [Input](input#method_getArguments "Symfony\Component\Console\Input\Input") | | string|string[]|null | [getArgument](#method_getArgument)(string $name) Returns the argument value for a given argument name. | from [Input](input#method_getArgument "Symfony\Component\Console\Input\Input") | | | [setArgument](#method_setArgument)(string $name, string|string[]|null $value) Sets an argument value by name. | from [Input](input#method_setArgument "Symfony\Component\Console\Input\Input") | | bool | [hasArgument](#method_hasArgument)(string|int $name) Returns true if an InputArgument object exists by name or position. | from [Input](input#method_hasArgument "Symfony\Component\Console\Input\Input") | | array | [getOptions](#method_getOptions)() Returns all the given options merged with the default values. | from [Input](input#method_getOptions "Symfony\Component\Console\Input\Input") | | string|string[]|bool|null | [getOption](#method_getOption)(string $name) Returns the option value for a given option name. | from [Input](input#method_getOption "Symfony\Component\Console\Input\Input") | | | [setOption](#method_setOption)(string $name, string|string[]|bool|null $value) Sets an option value by name. | from [Input](input#method_setOption "Symfony\Component\Console\Input\Input") | | bool | [hasOption](#method_hasOption)(string $name) Returns true if an InputOption object exists by name. | from [Input](input#method_hasOption "Symfony\Component\Console\Input\Input") | | string | [escapeToken](#method_escapeToken)(string $token) Escapes a token through escapeshellarg if it contains unsafe chars. | from [Input](input#method_escapeToken "Symfony\Component\Console\Input\Input") | | | [setStream](#method_setStream)(resource $stream) Sets the input stream to read from when interacting with the user. | from [Input](input#method_setStream "Symfony\Component\Console\Input\Input") | | resource|null | [getStream](#method_getStream)() Returns the input stream. | from [Input](input#method_getStream "Symfony\Component\Console\Input\Input") | | | [setTokens](#method_setTokens)(array $tokens) | | | string|null | [getFirstArgument](#method_getFirstArgument)() Returns the first argument from the raw parameters (not parsed). | | | bool | [hasParameterOption](#method_hasParameterOption)(string|array $values, bool $onlyParams = false) Returns true if the raw parameters (not parsed) contain a value. | | | mixed | [getParameterOption](#method_getParameterOption)(string|array $values, mixed $default = false, bool $onlyParams = false) Returns the value of a raw option (not parsed). | | | string | [\_\_toString](#method___toString)() Returns a stringified representation of the args passed to the command. | | Details ------- ### \_\_construct(array $argv = null, [InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition = null) #### Parameters | | | | | --- | --- | --- | | array | $argv | An array of parameters from the CLI (in the argv format) | | [InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | | ### bind([InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Binds the current Input instance with the given arguments and options. #### Parameters | | | | | --- | --- | --- | | [InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\Console\Exception\RuntimeException") | | ### protected parse() Processes command line arguments. ### validate() Validates the input. #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\Console\Exception\RuntimeException") | When not enough arguments are given | ### bool isInteractive() Is this input means interactive? #### Return Value | | | | --- | --- | | bool | | ### setInteractive(bool $interactive) Sets the input interactivity. #### Parameters | | | | | --- | --- | --- | | bool | $interactive | If the input should be interactive | ### array getArguments() Returns all the given arguments merged with the default values. #### Return Value | | | | --- | --- | | array | | ### string|string[]|null getArgument(string $name) Returns the argument value for a given argument name. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | #### Return Value | | | | --- | --- | | string|string[]|null | The argument value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument given doesn't exist | ### setArgument(string $name, string|string[]|null $value) Sets an argument value by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | | string|string[]|null | $value | The argument value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument given doesn't exist | ### bool hasArgument(string|int $name) Returns true if an InputArgument object exists by name or position. #### Parameters | | | | | --- | --- | --- | | string|int | $name | The InputArgument name or position | #### Return Value | | | | --- | --- | | bool | true if the InputArgument object exists, false otherwise | ### array getOptions() Returns all the given options merged with the default values. #### Return Value | | | | --- | --- | | array | | ### string|string[]|bool|null getOption(string $name) Returns the option value for a given option name. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | #### Return Value | | | | --- | --- | | string|string[]|bool|null | The option value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When option given doesn't exist | ### setOption(string $name, string|string[]|bool|null $value) Sets an option value by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | | string|string[]|bool|null | $value | The option value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When option given doesn't exist | ### bool hasOption(string $name) Returns true if an InputOption object exists by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The InputOption name | #### Return Value | | | | --- | --- | | bool | true if the InputOption object exists, false otherwise | ### string escapeToken(string $token) Escapes a token through escapeshellarg if it contains unsafe chars. #### Parameters | | | | | --- | --- | --- | | string | $token | | #### Return Value | | | | --- | --- | | string | | ### setStream(resource $stream) Sets the input stream to read from when interacting with the user. This is mainly useful for testing purpose. #### Parameters | | | | | --- | --- | --- | | resource | $stream | The input stream | ### resource|null getStream() Returns the input stream. #### Return Value | | | | --- | --- | | resource|null | | ### protected setTokens(array $tokens) #### Parameters | | | | | --- | --- | --- | | array | $tokens | | ### string|null getFirstArgument() Returns the first argument from the raw parameters (not parsed). #### Return Value | | | | --- | --- | | string|null | The value of the first argument or null otherwise | ### bool hasParameterOption(string|array $values, bool $onlyParams = false) Returns true if the raw parameters (not parsed) contain a value. This method is to be used to introspect the input parameters before they have been validated. It must be used carefully. Does not necessarily return the correct result for short options when multiple flags are combined in the same option. #### Parameters | | | | | --- | --- | --- | | string|array | $values | The values to look for in the raw parameters (can be an array) | | bool | $onlyParams | Only check real parameters, skip those following an end of options (--) signal | #### Return Value | | | | --- | --- | | bool | true if the value is contained in the raw parameters | ### mixed getParameterOption(string|array $values, mixed $default = false, bool $onlyParams = false) Returns the value of a raw option (not parsed). This method is to be used to introspect the input parameters before they have been validated. It must be used carefully. Does not necessarily return the correct result for short options when multiple flags are combined in the same option. #### Parameters | | | | | --- | --- | --- | | string|array | $values | The value(s) to look for in the raw parameters (can be an array) | | mixed | $default | The default value to return if no result is found | | bool | $onlyParams | Only check real parameters, skip those following an end of options (--) signal | #### Return Value | | | | --- | --- | | mixed | The option value | ### string \_\_toString() Returns a stringified representation of the args passed to the command. #### Return Value | | | | --- | --- | | string | | symfony InputInterface InputInterface =============== interface **InputInterface** InputInterface is the interface implemented by all input classes. Methods ------- | | | | | --- | --- | --- | | string|null | [getFirstArgument](#method_getFirstArgument)() Returns the first argument from the raw parameters (not parsed). | | | bool | [hasParameterOption](#method_hasParameterOption)(string|array $values, bool $onlyParams = false) Returns true if the raw parameters (not parsed) contain a value. | | | mixed | [getParameterOption](#method_getParameterOption)(string|array $values, mixed $default = false, bool $onlyParams = false) Returns the value of a raw option (not parsed). | | | | [bind](#method_bind)([InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Binds the current Input instance with the given arguments and options. | | | | [validate](#method_validate)() Validates the input. | | | array | [getArguments](#method_getArguments)() Returns all the given arguments merged with the default values. | | | string|string[]|null | [getArgument](#method_getArgument)(string $name) Returns the argument value for a given argument name. | | | | [setArgument](#method_setArgument)(string $name, string|string[]|null $value) Sets an argument value by name. | | | bool | [hasArgument](#method_hasArgument)(string|int $name) Returns true if an InputArgument object exists by name or position. | | | array | [getOptions](#method_getOptions)() Returns all the given options merged with the default values. | | | string|string[]|bool|null | [getOption](#method_getOption)(string $name) Returns the option value for a given option name. | | | | [setOption](#method_setOption)(string $name, string|string[]|bool|null $value) Sets an option value by name. | | | bool | [hasOption](#method_hasOption)(string $name) Returns true if an InputOption object exists by name. | | | bool | [isInteractive](#method_isInteractive)() Is this input means interactive? | | | | [setInteractive](#method_setInteractive)(bool $interactive) Sets the input interactivity. | | Details ------- ### string|null getFirstArgument() Returns the first argument from the raw parameters (not parsed). #### Return Value | | | | --- | --- | | string|null | The value of the first argument or null otherwise | ### bool hasParameterOption(string|array $values, bool $onlyParams = false) Returns true if the raw parameters (not parsed) contain a value. This method is to be used to introspect the input parameters before they have been validated. It must be used carefully. Does not necessarily return the correct result for short options when multiple flags are combined in the same option. #### Parameters | | | | | --- | --- | --- | | string|array | $values | The values to look for in the raw parameters (can be an array) | | bool | $onlyParams | Only check real parameters, skip those following an end of options (--) signal | #### Return Value | | | | --- | --- | | bool | true if the value is contained in the raw parameters | ### mixed getParameterOption(string|array $values, mixed $default = false, bool $onlyParams = false) Returns the value of a raw option (not parsed). This method is to be used to introspect the input parameters before they have been validated. It must be used carefully. Does not necessarily return the correct result for short options when multiple flags are combined in the same option. #### Parameters | | | | | --- | --- | --- | | string|array | $values | The value(s) to look for in the raw parameters (can be an array) | | mixed | $default | The default value to return if no result is found | | bool | $onlyParams | Only check real parameters, skip those following an end of options (--) signal | #### Return Value | | | | --- | --- | | mixed | The option value | ### bind([InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Binds the current Input instance with the given arguments and options. #### Parameters | | | | | --- | --- | --- | | [InputDefinition](inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\Console\Exception\RuntimeException") | | ### validate() Validates the input. #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\Console\Exception\RuntimeException") | When not enough arguments are given | ### array getArguments() Returns all the given arguments merged with the default values. #### Return Value | | | | --- | --- | | array | | ### string|string[]|null getArgument(string $name) Returns the argument value for a given argument name. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | #### Return Value | | | | --- | --- | | string|string[]|null | The argument value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument given doesn't exist | ### setArgument(string $name, string|string[]|null $value) Sets an argument value by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | | string|string[]|null | $value | The argument value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument given doesn't exist | ### bool hasArgument(string|int $name) Returns true if an InputArgument object exists by name or position. #### Parameters | | | | | --- | --- | --- | | string|int | $name | The InputArgument name or position | #### Return Value | | | | --- | --- | | bool | true if the InputArgument object exists, false otherwise | ### array getOptions() Returns all the given options merged with the default values. #### Return Value | | | | --- | --- | | array | | ### string|string[]|bool|null getOption(string $name) Returns the option value for a given option name. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | #### Return Value | | | | --- | --- | | string|string[]|bool|null | The option value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When option given doesn't exist | ### setOption(string $name, string|string[]|bool|null $value) Sets an option value by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | | string|string[]|bool|null | $value | The option value | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When option given doesn't exist | ### bool hasOption(string $name) Returns true if an InputOption object exists by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The InputOption name | #### Return Value | | | | --- | --- | | bool | true if the InputOption object exists, false otherwise | ### bool isInteractive() Is this input means interactive? #### Return Value | | | | --- | --- | | bool | | ### setInteractive(bool $interactive) Sets the input interactivity. #### Parameters | | | | | --- | --- | --- | | bool | $interactive | If the input should be interactive |
programming_docs
symfony ConsoleOutputInterface ConsoleOutputInterface ======================= interface **ConsoleOutputInterface** implements [OutputInterface](outputinterface "Symfony\Component\Console\Output\OutputInterface") ConsoleOutputInterface is the interface implemented by ConsoleOutput class. This adds information about stderr and section output stream. Methods ------- | | | | | --- | --- | --- | | | [write](#method_write)(string|iterable $messages, bool $newline = false, int $options = 0) Writes a message to the output. | from [OutputInterface](outputinterface#method_write "Symfony\Component\Console\Output\OutputInterface") | | | [writeln](#method_writeln)(string|iterable $messages, int $options = 0) Writes a message to the output and adds a newline at the end. | from [OutputInterface](outputinterface#method_writeln "Symfony\Component\Console\Output\OutputInterface") | | | [setVerbosity](#method_setVerbosity)(int $level) Sets the verbosity of the output. | from [OutputInterface](outputinterface#method_setVerbosity "Symfony\Component\Console\Output\OutputInterface") | | int | [getVerbosity](#method_getVerbosity)() Gets the current verbosity of the output. | from [OutputInterface](outputinterface#method_getVerbosity "Symfony\Component\Console\Output\OutputInterface") | | bool | [isQuiet](#method_isQuiet)() Returns whether verbosity is quiet (-q). | from [OutputInterface](outputinterface#method_isQuiet "Symfony\Component\Console\Output\OutputInterface") | | bool | [isVerbose](#method_isVerbose)() Returns whether verbosity is verbose (-v). | from [OutputInterface](outputinterface#method_isVerbose "Symfony\Component\Console\Output\OutputInterface") | | bool | [isVeryVerbose](#method_isVeryVerbose)() Returns whether verbosity is very verbose (-vv). | from [OutputInterface](outputinterface#method_isVeryVerbose "Symfony\Component\Console\Output\OutputInterface") | | bool | [isDebug](#method_isDebug)() Returns whether verbosity is debug (-vvv). | from [OutputInterface](outputinterface#method_isDebug "Symfony\Component\Console\Output\OutputInterface") | | | [setDecorated](#method_setDecorated)(bool $decorated) Sets the decorated flag. | from [OutputInterface](outputinterface#method_setDecorated "Symfony\Component\Console\Output\OutputInterface") | | bool | [isDecorated](#method_isDecorated)() Gets the decorated flag. | from [OutputInterface](outputinterface#method_isDecorated "Symfony\Component\Console\Output\OutputInterface") | | | [setFormatter](#method_setFormatter)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) | from [OutputInterface](outputinterface#method_setFormatter "Symfony\Component\Console\Output\OutputInterface") | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | [getFormatter](#method_getFormatter)() Returns current output formatter instance. | from [OutputInterface](outputinterface#method_getFormatter "Symfony\Component\Console\Output\OutputInterface") | | [OutputInterface](outputinterface "Symfony\Component\Console\Output\OutputInterface") | [getErrorOutput](#method_getErrorOutput)() Gets the OutputInterface for errors. | | | | [setErrorOutput](#method_setErrorOutput)([OutputInterface](outputinterface "Symfony\Component\Console\Output\OutputInterface") $error) | | | ConsoleSectionOutput | [section](#method_section)() Creates a new output section | | Details ------- ### write(string|iterable $messages, bool $newline = false, int $options = 0) Writes a message to the output. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | bool | $newline | Whether to add a newline | | int | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT\_NORMAL | self::VERBOSITY\_NORMAL | ### writeln(string|iterable $messages, int $options = 0) Writes a message to the output and adds a newline at the end. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | int | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT\_NORMAL | self::VERBOSITY\_NORMAL | ### setVerbosity(int $level) Sets the verbosity of the output. #### Parameters | | | | | --- | --- | --- | | int | $level | The level of verbosity (one of the VERBOSITY constants) | ### int getVerbosity() Gets the current verbosity of the output. #### Return Value | | | | --- | --- | | int | The current level of verbosity (one of the VERBOSITY constants) | ### bool isQuiet() Returns whether verbosity is quiet (-q). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_QUIET, false otherwise | ### bool isVerbose() Returns whether verbosity is verbose (-v). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERBOSE, false otherwise | ### bool isVeryVerbose() Returns whether verbosity is very verbose (-vv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERY\_VERBOSE, false otherwise | ### bool isDebug() Returns whether verbosity is debug (-vvv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_DEBUG, false otherwise | ### setDecorated(bool $decorated) Sets the decorated flag. #### Parameters | | | | | --- | --- | --- | | bool | $decorated | Whether to decorate the messages | ### bool isDecorated() Gets the decorated flag. #### Return Value | | | | --- | --- | | bool | true if the output will decorate messages, false otherwise | ### setFormatter([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | ### [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") getFormatter() Returns current output formatter instance. #### Return Value | | | | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | | ### [OutputInterface](outputinterface "Symfony\Component\Console\Output\OutputInterface") getErrorOutput() Gets the OutputInterface for errors. #### Return Value | | | | --- | --- | | [OutputInterface](outputinterface "Symfony\Component\Console\Output\OutputInterface") | | ### setErrorOutput([OutputInterface](outputinterface "Symfony\Component\Console\Output\OutputInterface") $error) #### Parameters | | | | | --- | --- | --- | | [OutputInterface](outputinterface "Symfony\Component\Console\Output\OutputInterface") | $error | | ### ConsoleSectionOutput section() Creates a new output section #### Return Value | | | | --- | --- | | ConsoleSectionOutput | | symfony ConsoleSectionOutput ConsoleSectionOutput ===================== class **ConsoleSectionOutput** extends [StreamOutput](streamoutput "Symfony\Component\Console\Output\StreamOutput") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(resource $stream, array $sections, int|null $verbosity, bool $decorated, [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) | | | | [setFormatter](#method_setFormatter)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) | from [Output](output#method_setFormatter "Symfony\Component\Console\Output\Output") | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | [getFormatter](#method_getFormatter)() Returns current output formatter instance. | from [Output](output#method_getFormatter "Symfony\Component\Console\Output\Output") | | | [setDecorated](#method_setDecorated)(bool $decorated) Sets the decorated flag. | from [Output](output#method_setDecorated "Symfony\Component\Console\Output\Output") | | bool | [isDecorated](#method_isDecorated)() Gets the decorated flag. | from [Output](output#method_isDecorated "Symfony\Component\Console\Output\Output") | | | [setVerbosity](#method_setVerbosity)(int $level) Sets the verbosity of the output. | from [Output](output#method_setVerbosity "Symfony\Component\Console\Output\Output") | | int | [getVerbosity](#method_getVerbosity)() Gets the current verbosity of the output. | from [Output](output#method_getVerbosity "Symfony\Component\Console\Output\Output") | | bool | [isQuiet](#method_isQuiet)() Returns whether verbosity is quiet (-q). | from [Output](output#method_isQuiet "Symfony\Component\Console\Output\Output") | | bool | [isVerbose](#method_isVerbose)() Returns whether verbosity is verbose (-v). | from [Output](output#method_isVerbose "Symfony\Component\Console\Output\Output") | | bool | [isVeryVerbose](#method_isVeryVerbose)() Returns whether verbosity is very verbose (-vv). | from [Output](output#method_isVeryVerbose "Symfony\Component\Console\Output\Output") | | bool | [isDebug](#method_isDebug)() Returns whether verbosity is debug (-vvv). | from [Output](output#method_isDebug "Symfony\Component\Console\Output\Output") | | | [writeln](#method_writeln)(string|iterable $messages, int $options = self::OUTPUT\_NORMAL) Writes a message to the output and adds a newline at the end. | from [Output](output#method_writeln "Symfony\Component\Console\Output\Output") | | | [write](#method_write)(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT\_NORMAL) Writes a message to the output. | from [Output](output#method_write "Symfony\Component\Console\Output\Output") | | | [doWrite](#method_doWrite)(string $message, bool $newline) Writes a message to the output. | | | resource | [getStream](#method_getStream)() Gets the stream attached to this StreamOutput instance. | from [StreamOutput](streamoutput#method_getStream "Symfony\Component\Console\Output\StreamOutput") | | bool | [hasColorSupport](#method_hasColorSupport)() Returns true if the stream supports colorization. | from [StreamOutput](streamoutput#method_hasColorSupport "Symfony\Component\Console\Output\StreamOutput") | | | [clear](#method_clear)(int $lines = null) Clears previous output for this section. | | | | [overwrite](#method_overwrite)(array|string $message) Overwrites the previous output with a new message. | | | string | [getContent](#method_getContent)() | | | | [addContent](#method_addContent)(string $input) | | Details ------- ### \_\_construct(resource $stream, array $sections, int|null $verbosity, bool $decorated, [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) #### Parameters | | | | | --- | --- | --- | | resource | $stream | A stream resource | | array | $sections | | | int|null | $verbosity | The verbosity level (one of the VERBOSITY constants in OutputInterface) | | bool | $decorated | Whether to decorate messages | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | Output formatter instance (null to use default OutputFormatter) | ### setFormatter([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | ### [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") getFormatter() Returns current output formatter instance. #### Return Value | | | | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | | ### setDecorated(bool $decorated) Sets the decorated flag. #### Parameters | | | | | --- | --- | --- | | bool | $decorated | Whether to decorate the messages | ### bool isDecorated() Gets the decorated flag. #### Return Value | | | | --- | --- | | bool | true if the output will decorate messages, false otherwise | ### setVerbosity(int $level) Sets the verbosity of the output. #### Parameters | | | | | --- | --- | --- | | int | $level | The level of verbosity (one of the VERBOSITY constants) | ### int getVerbosity() Gets the current verbosity of the output. #### Return Value | | | | --- | --- | | int | The current level of verbosity (one of the VERBOSITY constants) | ### bool isQuiet() Returns whether verbosity is quiet (-q). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_QUIET, false otherwise | ### bool isVerbose() Returns whether verbosity is verbose (-v). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERBOSE, false otherwise | ### bool isVeryVerbose() Returns whether verbosity is very verbose (-vv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERY\_VERBOSE, false otherwise | ### bool isDebug() Returns whether verbosity is debug (-vvv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_DEBUG, false otherwise | ### writeln(string|iterable $messages, int $options = self::OUTPUT\_NORMAL) Writes a message to the output and adds a newline at the end. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | int | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT\_NORMAL | self::VERBOSITY\_NORMAL | ### write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT\_NORMAL) Writes a message to the output. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | bool | $newline | Whether to add a newline | | int | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT\_NORMAL | self::VERBOSITY\_NORMAL | ### protected doWrite(string $message, bool $newline) Writes a message to the output. #### Parameters | | | | | --- | --- | --- | | string | $message | A message to write to the output | | bool | $newline | Whether to add a newline or not | ### resource getStream() Gets the stream attached to this StreamOutput instance. #### Return Value | | | | --- | --- | | resource | A stream resource | ### protected bool hasColorSupport() Returns true if the stream supports colorization. Colorization is disabled if not supported by the stream: This is tricky on Windows, because Cygwin, Msys2 etc emulate pseudo terminals via named pipes, so we can only check the environment. Reference: Composer\XdebugHandler\Process::supportsColor https://github.com/composer/xdebug-handler #### Return Value | | | | --- | --- | | bool | true if the stream supports colorization, false otherwise | ### clear(int $lines = null) Clears previous output for this section. #### Parameters | | | | | --- | --- | --- | | int | $lines | Number of lines to clear. If null, then the entire output of this section is cleared | ### overwrite(array|string $message) Overwrites the previous output with a new message. #### Parameters | | | | | --- | --- | --- | | array|string | $message | | ### string getContent() #### Return Value | | | | --- | --- | | string | | ### addContent(string $input) #### Parameters | | | | | --- | --- | --- | | string | $input | | symfony StreamOutput StreamOutput ============= class **StreamOutput** extends [Output](output "Symfony\Component\Console\Output\Output") StreamOutput writes the output to a given stream. Usage: ``` $output = new StreamOutput(fopen('php://stdout', 'w')); ``` As `StreamOutput` can use any stream, you can also use a file: ``` $output = new StreamOutput(fopen('/path/to/output.log', 'a', false)); ``` Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(resource $stream, int|null $verbosity = self::VERBOSITY\_NORMAL, bool $decorated = null, [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter = null) | | | | [setFormatter](#method_setFormatter)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) | from [Output](output#method_setFormatter "Symfony\Component\Console\Output\Output") | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | [getFormatter](#method_getFormatter)() Returns current output formatter instance. | from [Output](output#method_getFormatter "Symfony\Component\Console\Output\Output") | | | [setDecorated](#method_setDecorated)(bool $decorated) Sets the decorated flag. | from [Output](output#method_setDecorated "Symfony\Component\Console\Output\Output") | | bool | [isDecorated](#method_isDecorated)() Gets the decorated flag. | from [Output](output#method_isDecorated "Symfony\Component\Console\Output\Output") | | | [setVerbosity](#method_setVerbosity)(int $level) Sets the verbosity of the output. | from [Output](output#method_setVerbosity "Symfony\Component\Console\Output\Output") | | int | [getVerbosity](#method_getVerbosity)() Gets the current verbosity of the output. | from [Output](output#method_getVerbosity "Symfony\Component\Console\Output\Output") | | bool | [isQuiet](#method_isQuiet)() Returns whether verbosity is quiet (-q). | from [Output](output#method_isQuiet "Symfony\Component\Console\Output\Output") | | bool | [isVerbose](#method_isVerbose)() Returns whether verbosity is verbose (-v). | from [Output](output#method_isVerbose "Symfony\Component\Console\Output\Output") | | bool | [isVeryVerbose](#method_isVeryVerbose)() Returns whether verbosity is very verbose (-vv). | from [Output](output#method_isVeryVerbose "Symfony\Component\Console\Output\Output") | | bool | [isDebug](#method_isDebug)() Returns whether verbosity is debug (-vvv). | from [Output](output#method_isDebug "Symfony\Component\Console\Output\Output") | | | [writeln](#method_writeln)(string|iterable $messages, int $options = self::OUTPUT\_NORMAL) Writes a message to the output and adds a newline at the end. | from [Output](output#method_writeln "Symfony\Component\Console\Output\Output") | | | [write](#method_write)(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT\_NORMAL) Writes a message to the output. | from [Output](output#method_write "Symfony\Component\Console\Output\Output") | | | [doWrite](#method_doWrite)(string $message, bool $newline) Writes a message to the output. | | | resource | [getStream](#method_getStream)() Gets the stream attached to this StreamOutput instance. | | | bool | [hasColorSupport](#method_hasColorSupport)() Returns true if the stream supports colorization. | | Details ------- ### \_\_construct(resource $stream, int|null $verbosity = self::VERBOSITY\_NORMAL, bool $decorated = null, [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter = null) #### Parameters | | | | | --- | --- | --- | | resource | $stream | A stream resource | | int|null | $verbosity | The verbosity level (one of the VERBOSITY constants in OutputInterface) | | bool | $decorated | Whether to decorate messages | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | Output formatter instance (null to use default OutputFormatter) | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When first argument is not a real stream | ### setFormatter([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | ### [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") getFormatter() Returns current output formatter instance. #### Return Value | | | | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | | ### setDecorated(bool $decorated) Sets the decorated flag. #### Parameters | | | | | --- | --- | --- | | bool | $decorated | Whether to decorate the messages | ### bool isDecorated() Gets the decorated flag. #### Return Value | | | | --- | --- | | bool | true if the output will decorate messages, false otherwise | ### setVerbosity(int $level) Sets the verbosity of the output. #### Parameters | | | | | --- | --- | --- | | int | $level | The level of verbosity (one of the VERBOSITY constants) | ### int getVerbosity() Gets the current verbosity of the output. #### Return Value | | | | --- | --- | | int | The current level of verbosity (one of the VERBOSITY constants) | ### bool isQuiet() Returns whether verbosity is quiet (-q). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_QUIET, false otherwise | ### bool isVerbose() Returns whether verbosity is verbose (-v). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERBOSE, false otherwise | ### bool isVeryVerbose() Returns whether verbosity is very verbose (-vv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERY\_VERBOSE, false otherwise | ### bool isDebug() Returns whether verbosity is debug (-vvv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_DEBUG, false otherwise | ### writeln(string|iterable $messages, int $options = self::OUTPUT\_NORMAL) Writes a message to the output and adds a newline at the end. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | int | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT\_NORMAL | self::VERBOSITY\_NORMAL | ### write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT\_NORMAL) Writes a message to the output. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | bool | $newline | Whether to add a newline | | int | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT\_NORMAL | self::VERBOSITY\_NORMAL | ### protected doWrite(string $message, bool $newline) Writes a message to the output. #### Parameters | | | | | --- | --- | --- | | string | $message | A message to write to the output | | bool | $newline | Whether to add a newline or not | ### resource getStream() Gets the stream attached to this StreamOutput instance. #### Return Value | | | | --- | --- | | resource | A stream resource | ### protected bool hasColorSupport() Returns true if the stream supports colorization. Colorization is disabled if not supported by the stream: This is tricky on Windows, because Cygwin, Msys2 etc emulate pseudo terminals via named pipes, so we can only check the environment. Reference: Composer\XdebugHandler\Process::supportsColor https://github.com/composer/xdebug-handler #### Return Value | | | | --- | --- | | bool | true if the stream supports colorization, false otherwise |
programming_docs
symfony NullOutput NullOutput =========== class **NullOutput** implements [OutputInterface](outputinterface "Symfony\Component\Console\Output\OutputInterface") NullOutput suppresses all output. $output = new NullOutput(); Methods ------- | | | | | --- | --- | --- | | | [setFormatter](#method_setFormatter)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) | | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | [getFormatter](#method_getFormatter)() Returns current output formatter instance. | | | | [setDecorated](#method_setDecorated)(bool $decorated) Sets the decorated flag. | | | bool | [isDecorated](#method_isDecorated)() Gets the decorated flag. | | | | [setVerbosity](#method_setVerbosity)(int $level) Sets the verbosity of the output. | | | int | [getVerbosity](#method_getVerbosity)() Gets the current verbosity of the output. | | | bool | [isQuiet](#method_isQuiet)() Returns whether verbosity is quiet (-q). | | | bool | [isVerbose](#method_isVerbose)() Returns whether verbosity is verbose (-v). | | | bool | [isVeryVerbose](#method_isVeryVerbose)() Returns whether verbosity is very verbose (-vv). | | | bool | [isDebug](#method_isDebug)() Returns whether verbosity is debug (-vvv). | | | | [writeln](#method_writeln)(string|iterable $messages, int $options = self::OUTPUT\_NORMAL) Writes a message to the output and adds a newline at the end. | | | | [write](#method_write)(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT\_NORMAL) Writes a message to the output. | | Details ------- ### setFormatter([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | ### [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") getFormatter() Returns current output formatter instance. #### Return Value | | | | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | | ### setDecorated(bool $decorated) Sets the decorated flag. #### Parameters | | | | | --- | --- | --- | | bool | $decorated | Whether to decorate the messages | ### bool isDecorated() Gets the decorated flag. #### Return Value | | | | --- | --- | | bool | true if the output will decorate messages, false otherwise | ### setVerbosity(int $level) Sets the verbosity of the output. #### Parameters | | | | | --- | --- | --- | | int | $level | The level of verbosity (one of the VERBOSITY constants) | ### int getVerbosity() Gets the current verbosity of the output. #### Return Value | | | | --- | --- | | int | The current level of verbosity (one of the VERBOSITY constants) | ### bool isQuiet() Returns whether verbosity is quiet (-q). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_QUIET, false otherwise | ### bool isVerbose() Returns whether verbosity is verbose (-v). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERBOSE, false otherwise | ### bool isVeryVerbose() Returns whether verbosity is very verbose (-vv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERY\_VERBOSE, false otherwise | ### bool isDebug() Returns whether verbosity is debug (-vvv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_DEBUG, false otherwise | ### writeln(string|iterable $messages, int $options = self::OUTPUT\_NORMAL) Writes a message to the output and adds a newline at the end. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | int | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT\_NORMAL | self::VERBOSITY\_NORMAL | ### write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT\_NORMAL) Writes a message to the output. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | bool | $newline | Whether to add a newline | | int | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT\_NORMAL | self::VERBOSITY\_NORMAL | symfony BufferedOutput BufferedOutput =============== class **BufferedOutput** extends [Output](output "Symfony\Component\Console\Output\Output") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(int|null $verbosity = self::VERBOSITY\_NORMAL, bool $decorated = false, [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter = null) | from [Output](output#method___construct "Symfony\Component\Console\Output\Output") | | | [setFormatter](#method_setFormatter)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) | from [Output](output#method_setFormatter "Symfony\Component\Console\Output\Output") | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | [getFormatter](#method_getFormatter)() Returns current output formatter instance. | from [Output](output#method_getFormatter "Symfony\Component\Console\Output\Output") | | | [setDecorated](#method_setDecorated)(bool $decorated) Sets the decorated flag. | from [Output](output#method_setDecorated "Symfony\Component\Console\Output\Output") | | bool | [isDecorated](#method_isDecorated)() Gets the decorated flag. | from [Output](output#method_isDecorated "Symfony\Component\Console\Output\Output") | | | [setVerbosity](#method_setVerbosity)(int $level) Sets the verbosity of the output. | from [Output](output#method_setVerbosity "Symfony\Component\Console\Output\Output") | | int | [getVerbosity](#method_getVerbosity)() Gets the current verbosity of the output. | from [Output](output#method_getVerbosity "Symfony\Component\Console\Output\Output") | | bool | [isQuiet](#method_isQuiet)() Returns whether verbosity is quiet (-q). | from [Output](output#method_isQuiet "Symfony\Component\Console\Output\Output") | | bool | [isVerbose](#method_isVerbose)() Returns whether verbosity is verbose (-v). | from [Output](output#method_isVerbose "Symfony\Component\Console\Output\Output") | | bool | [isVeryVerbose](#method_isVeryVerbose)() Returns whether verbosity is very verbose (-vv). | from [Output](output#method_isVeryVerbose "Symfony\Component\Console\Output\Output") | | bool | [isDebug](#method_isDebug)() Returns whether verbosity is debug (-vvv). | from [Output](output#method_isDebug "Symfony\Component\Console\Output\Output") | | | [writeln](#method_writeln)(string|iterable $messages, int $options = self::OUTPUT\_NORMAL) Writes a message to the output and adds a newline at the end. | from [Output](output#method_writeln "Symfony\Component\Console\Output\Output") | | | [write](#method_write)(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT\_NORMAL) Writes a message to the output. | from [Output](output#method_write "Symfony\Component\Console\Output\Output") | | | [doWrite](#method_doWrite)(string $message, bool $newline) Writes a message to the output. | | | string | [fetch](#method_fetch)() Empties buffer and returns its content. | | Details ------- ### \_\_construct(int|null $verbosity = self::VERBOSITY\_NORMAL, bool $decorated = false, [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter = null) #### Parameters | | | | | --- | --- | --- | | int|null | $verbosity | The verbosity level (one of the VERBOSITY constants in OutputInterface) | | bool | $decorated | Whether to decorate messages | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | Output formatter instance (null to use default OutputFormatter) | ### setFormatter([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | ### [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") getFormatter() Returns current output formatter instance. #### Return Value | | | | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | | ### setDecorated(bool $decorated) Sets the decorated flag. #### Parameters | | | | | --- | --- | --- | | bool | $decorated | Whether to decorate the messages | ### bool isDecorated() Gets the decorated flag. #### Return Value | | | | --- | --- | | bool | true if the output will decorate messages, false otherwise | ### setVerbosity(int $level) Sets the verbosity of the output. #### Parameters | | | | | --- | --- | --- | | int | $level | The level of verbosity (one of the VERBOSITY constants) | ### int getVerbosity() Gets the current verbosity of the output. #### Return Value | | | | --- | --- | | int | The current level of verbosity (one of the VERBOSITY constants) | ### bool isQuiet() Returns whether verbosity is quiet (-q). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_QUIET, false otherwise | ### bool isVerbose() Returns whether verbosity is verbose (-v). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERBOSE, false otherwise | ### bool isVeryVerbose() Returns whether verbosity is very verbose (-vv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERY\_VERBOSE, false otherwise | ### bool isDebug() Returns whether verbosity is debug (-vvv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_DEBUG, false otherwise | ### writeln(string|iterable $messages, int $options = self::OUTPUT\_NORMAL) Writes a message to the output and adds a newline at the end. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | int | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT\_NORMAL | self::VERBOSITY\_NORMAL | ### write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT\_NORMAL) Writes a message to the output. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | bool | $newline | Whether to add a newline | | int | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT\_NORMAL | self::VERBOSITY\_NORMAL | ### protected doWrite(string $message, bool $newline) Writes a message to the output. #### Parameters | | | | | --- | --- | --- | | string | $message | A message to write to the output | | bool | $newline | Whether to add a newline or not | ### string fetch() Empties buffer and returns its content. #### Return Value | | | | --- | --- | | string | | symfony OutputInterface OutputInterface ================ interface **OutputInterface** OutputInterface is the interface implemented by all Output classes. Constants --------- | | | | --- | --- | | VERBOSITY\_QUIET | | | VERBOSITY\_NORMAL | | | VERBOSITY\_VERBOSE | | | VERBOSITY\_VERY\_VERBOSE | | | VERBOSITY\_DEBUG | | | OUTPUT\_NORMAL | | | OUTPUT\_RAW | | | OUTPUT\_PLAIN | | Methods ------- | | | | | --- | --- | --- | | | [write](#method_write)(string|iterable $messages, bool $newline = false, int $options = 0) Writes a message to the output. | | | | [writeln](#method_writeln)(string|iterable $messages, int $options = 0) Writes a message to the output and adds a newline at the end. | | | | [setVerbosity](#method_setVerbosity)(int $level) Sets the verbosity of the output. | | | int | [getVerbosity](#method_getVerbosity)() Gets the current verbosity of the output. | | | bool | [isQuiet](#method_isQuiet)() Returns whether verbosity is quiet (-q). | | | bool | [isVerbose](#method_isVerbose)() Returns whether verbosity is verbose (-v). | | | bool | [isVeryVerbose](#method_isVeryVerbose)() Returns whether verbosity is very verbose (-vv). | | | bool | [isDebug](#method_isDebug)() Returns whether verbosity is debug (-vvv). | | | | [setDecorated](#method_setDecorated)(bool $decorated) Sets the decorated flag. | | | bool | [isDecorated](#method_isDecorated)() Gets the decorated flag. | | | | [setFormatter](#method_setFormatter)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) | | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | [getFormatter](#method_getFormatter)() Returns current output formatter instance. | | Details ------- ### write(string|iterable $messages, bool $newline = false, int $options = 0) Writes a message to the output. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | bool | $newline | Whether to add a newline | | int | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT\_NORMAL | self::VERBOSITY\_NORMAL | ### writeln(string|iterable $messages, int $options = 0) Writes a message to the output and adds a newline at the end. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | int | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT\_NORMAL | self::VERBOSITY\_NORMAL | ### setVerbosity(int $level) Sets the verbosity of the output. #### Parameters | | | | | --- | --- | --- | | int | $level | The level of verbosity (one of the VERBOSITY constants) | ### int getVerbosity() Gets the current verbosity of the output. #### Return Value | | | | --- | --- | | int | The current level of verbosity (one of the VERBOSITY constants) | ### bool isQuiet() Returns whether verbosity is quiet (-q). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_QUIET, false otherwise | ### bool isVerbose() Returns whether verbosity is verbose (-v). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERBOSE, false otherwise | ### bool isVeryVerbose() Returns whether verbosity is very verbose (-vv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERY\_VERBOSE, false otherwise | ### bool isDebug() Returns whether verbosity is debug (-vvv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_DEBUG, false otherwise | ### setDecorated(bool $decorated) Sets the decorated flag. #### Parameters | | | | | --- | --- | --- | | bool | $decorated | Whether to decorate the messages | ### bool isDecorated() Gets the decorated flag. #### Return Value | | | | --- | --- | | bool | true if the output will decorate messages, false otherwise | ### setFormatter([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | ### [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") getFormatter() Returns current output formatter instance. #### Return Value | | | | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | | symfony Output Output ======= abstract class **Output** implements [OutputInterface](outputinterface "Symfony\Component\Console\Output\OutputInterface") Base class for output classes. There are five levels of verbosity: * normal: no option passed (normal output) * verbose: -v (more output) * very verbose: -vv (highly extended output) * debug: -vvv (all debug output) * quiet: -q (no output) Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(int|null $verbosity = self::VERBOSITY\_NORMAL, bool $decorated = false, [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter = null) | | | | [setFormatter](#method_setFormatter)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) | | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | [getFormatter](#method_getFormatter)() Returns current output formatter instance. | | | | [setDecorated](#method_setDecorated)(bool $decorated) Sets the decorated flag. | | | bool | [isDecorated](#method_isDecorated)() Gets the decorated flag. | | | | [setVerbosity](#method_setVerbosity)(int $level) Sets the verbosity of the output. | | | int | [getVerbosity](#method_getVerbosity)() Gets the current verbosity of the output. | | | bool | [isQuiet](#method_isQuiet)() Returns whether verbosity is quiet (-q). | | | bool | [isVerbose](#method_isVerbose)() Returns whether verbosity is verbose (-v). | | | bool | [isVeryVerbose](#method_isVeryVerbose)() Returns whether verbosity is very verbose (-vv). | | | bool | [isDebug](#method_isDebug)() Returns whether verbosity is debug (-vvv). | | | | [writeln](#method_writeln)(string|iterable $messages, int $options = self::OUTPUT\_NORMAL) Writes a message to the output and adds a newline at the end. | | | | [write](#method_write)(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT\_NORMAL) Writes a message to the output. | | | | [doWrite](#method_doWrite)(string $message, bool $newline) Writes a message to the output. | | Details ------- ### \_\_construct(int|null $verbosity = self::VERBOSITY\_NORMAL, bool $decorated = false, [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter = null) #### Parameters | | | | | --- | --- | --- | | int|null | $verbosity | The verbosity level (one of the VERBOSITY constants in OutputInterface) | | bool | $decorated | Whether to decorate messages | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | Output formatter instance (null to use default OutputFormatter) | ### setFormatter([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | ### [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") getFormatter() Returns current output formatter instance. #### Return Value | | | | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | | ### setDecorated(bool $decorated) Sets the decorated flag. #### Parameters | | | | | --- | --- | --- | | bool | $decorated | Whether to decorate the messages | ### bool isDecorated() Gets the decorated flag. #### Return Value | | | | --- | --- | | bool | true if the output will decorate messages, false otherwise | ### setVerbosity(int $level) Sets the verbosity of the output. #### Parameters | | | | | --- | --- | --- | | int | $level | The level of verbosity (one of the VERBOSITY constants) | ### int getVerbosity() Gets the current verbosity of the output. #### Return Value | | | | --- | --- | | int | The current level of verbosity (one of the VERBOSITY constants) | ### bool isQuiet() Returns whether verbosity is quiet (-q). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_QUIET, false otherwise | ### bool isVerbose() Returns whether verbosity is verbose (-v). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERBOSE, false otherwise | ### bool isVeryVerbose() Returns whether verbosity is very verbose (-vv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERY\_VERBOSE, false otherwise | ### bool isDebug() Returns whether verbosity is debug (-vvv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_DEBUG, false otherwise | ### writeln(string|iterable $messages, int $options = self::OUTPUT\_NORMAL) Writes a message to the output and adds a newline at the end. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | int | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT\_NORMAL | self::VERBOSITY\_NORMAL | ### write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT\_NORMAL) Writes a message to the output. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | bool | $newline | Whether to add a newline | | int | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT\_NORMAL | self::VERBOSITY\_NORMAL | ### abstract protected doWrite(string $message, bool $newline) Writes a message to the output. #### Parameters | | | | | --- | --- | --- | | string | $message | A message to write to the output | | bool | $newline | Whether to add a newline or not |
programming_docs
symfony ConsoleOutput ConsoleOutput ============== class **ConsoleOutput** extends [StreamOutput](streamoutput "Symfony\Component\Console\Output\StreamOutput") implements [ConsoleOutputInterface](consoleoutputinterface "Symfony\Component\Console\Output\ConsoleOutputInterface") ConsoleOutput is the default class for all CLI output. It uses STDOUT and STDERR. This class is a convenient wrapper around `StreamOutput` for both STDOUT and STDERR. ``` $output = new ConsoleOutput(); ``` This is equivalent to: ``` $output = new StreamOutput(fopen('php://stdout', 'w')); $stdErr = new StreamOutput(fopen('php://stderr', 'w')); ``` Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(int|null $verbosity = self::VERBOSITY\_NORMAL, bool $decorated = null, [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter = null) | | | | [setFormatter](#method_setFormatter)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) | | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | [getFormatter](#method_getFormatter)() Returns current output formatter instance. | from [Output](output#method_getFormatter "Symfony\Component\Console\Output\Output") | | | [setDecorated](#method_setDecorated)(bool $decorated) Sets the decorated flag. | | | bool | [isDecorated](#method_isDecorated)() Gets the decorated flag. | from [Output](output#method_isDecorated "Symfony\Component\Console\Output\Output") | | | [setVerbosity](#method_setVerbosity)(int $level) Sets the verbosity of the output. | | | int | [getVerbosity](#method_getVerbosity)() Gets the current verbosity of the output. | from [Output](output#method_getVerbosity "Symfony\Component\Console\Output\Output") | | bool | [isQuiet](#method_isQuiet)() Returns whether verbosity is quiet (-q). | from [Output](output#method_isQuiet "Symfony\Component\Console\Output\Output") | | bool | [isVerbose](#method_isVerbose)() Returns whether verbosity is verbose (-v). | from [Output](output#method_isVerbose "Symfony\Component\Console\Output\Output") | | bool | [isVeryVerbose](#method_isVeryVerbose)() Returns whether verbosity is very verbose (-vv). | from [Output](output#method_isVeryVerbose "Symfony\Component\Console\Output\Output") | | bool | [isDebug](#method_isDebug)() Returns whether verbosity is debug (-vvv). | from [Output](output#method_isDebug "Symfony\Component\Console\Output\Output") | | | [writeln](#method_writeln)(string|iterable $messages, int $options = self::OUTPUT\_NORMAL) Writes a message to the output and adds a newline at the end. | from [Output](output#method_writeln "Symfony\Component\Console\Output\Output") | | | [write](#method_write)(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT\_NORMAL) Writes a message to the output. | from [Output](output#method_write "Symfony\Component\Console\Output\Output") | | | [doWrite](#method_doWrite)(string $message, bool $newline) Writes a message to the output. | from [StreamOutput](streamoutput#method_doWrite "Symfony\Component\Console\Output\StreamOutput") | | resource | [getStream](#method_getStream)() Gets the stream attached to this StreamOutput instance. | from [StreamOutput](streamoutput#method_getStream "Symfony\Component\Console\Output\StreamOutput") | | bool | [hasColorSupport](#method_hasColorSupport)() Returns true if the stream supports colorization. | from [StreamOutput](streamoutput#method_hasColorSupport "Symfony\Component\Console\Output\StreamOutput") | | ConsoleSectionOutput | [section](#method_section)() Creates a new output section. | | | [OutputInterface](outputinterface "Symfony\Component\Console\Output\OutputInterface") | [getErrorOutput](#method_getErrorOutput)() Gets the OutputInterface for errors. | | | | [setErrorOutput](#method_setErrorOutput)([OutputInterface](outputinterface "Symfony\Component\Console\Output\OutputInterface") $error) | | | bool | [hasStdoutSupport](#method_hasStdoutSupport)() Returns true if current environment supports writing console output to STDOUT. | | | bool | [hasStderrSupport](#method_hasStderrSupport)() Returns true if current environment supports writing console output to STDERR. | | Details ------- ### \_\_construct(int|null $verbosity = self::VERBOSITY\_NORMAL, bool $decorated = null, [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter = null) #### Parameters | | | | | --- | --- | --- | | int|null | $verbosity | The verbosity level (one of the VERBOSITY constants in OutputInterface) | | bool | $decorated | Whether to decorate messages | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | Output formatter instance (null to use default OutputFormatter) | ### setFormatter([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | ### [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") getFormatter() Returns current output formatter instance. #### Return Value | | | | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | | ### setDecorated(bool $decorated) Sets the decorated flag. #### Parameters | | | | | --- | --- | --- | | bool | $decorated | Whether to decorate the messages | ### bool isDecorated() Gets the decorated flag. #### Return Value | | | | --- | --- | | bool | true if the output will decorate messages, false otherwise | ### setVerbosity(int $level) Sets the verbosity of the output. #### Parameters | | | | | --- | --- | --- | | int | $level | The level of verbosity (one of the VERBOSITY constants) | ### int getVerbosity() Gets the current verbosity of the output. #### Return Value | | | | --- | --- | | int | The current level of verbosity (one of the VERBOSITY constants) | ### bool isQuiet() Returns whether verbosity is quiet (-q). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_QUIET, false otherwise | ### bool isVerbose() Returns whether verbosity is verbose (-v). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERBOSE, false otherwise | ### bool isVeryVerbose() Returns whether verbosity is very verbose (-vv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERY\_VERBOSE, false otherwise | ### bool isDebug() Returns whether verbosity is debug (-vvv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_DEBUG, false otherwise | ### writeln(string|iterable $messages, int $options = self::OUTPUT\_NORMAL) Writes a message to the output and adds a newline at the end. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | int | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT\_NORMAL | self::VERBOSITY\_NORMAL | ### write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT\_NORMAL) Writes a message to the output. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | bool | $newline | Whether to add a newline | | int | $options | A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT\_NORMAL | self::VERBOSITY\_NORMAL | ### protected doWrite(string $message, bool $newline) Writes a message to the output. #### Parameters | | | | | --- | --- | --- | | string | $message | A message to write to the output | | bool | $newline | Whether to add a newline or not | ### resource getStream() Gets the stream attached to this StreamOutput instance. #### Return Value | | | | --- | --- | | resource | A stream resource | ### protected bool hasColorSupport() Returns true if the stream supports colorization. Colorization is disabled if not supported by the stream: This is tricky on Windows, because Cygwin, Msys2 etc emulate pseudo terminals via named pipes, so we can only check the environment. Reference: Composer\XdebugHandler\Process::supportsColor https://github.com/composer/xdebug-handler #### Return Value | | | | --- | --- | | bool | true if the stream supports colorization, false otherwise | ### ConsoleSectionOutput section() Creates a new output section. #### Return Value | | | | --- | --- | | ConsoleSectionOutput | | ### [OutputInterface](outputinterface "Symfony\Component\Console\Output\OutputInterface") getErrorOutput() Gets the OutputInterface for errors. #### Return Value | | | | --- | --- | | [OutputInterface](outputinterface "Symfony\Component\Console\Output\OutputInterface") | | ### setErrorOutput([OutputInterface](outputinterface "Symfony\Component\Console\Output\OutputInterface") $error) #### Parameters | | | | | --- | --- | --- | | [OutputInterface](outputinterface "Symfony\Component\Console\Output\OutputInterface") | $error | | ### protected bool hasStdoutSupport() Returns true if current environment supports writing console output to STDOUT. #### Return Value | | | | --- | --- | | bool | | ### protected bool hasStderrSupport() Returns true if current environment supports writing console output to STDERR. #### Return Value | | | | --- | --- | | bool | | symfony SymfonyStyle SymfonyStyle ============= class **SymfonyStyle** extends [OutputStyle](outputstyle "Symfony\Component\Console\Style\OutputStyle") Output decorator helpers for the Symfony Style Guide. Constants --------- | | | | --- | --- | | MAX\_LINE\_LENGTH | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) | | | | [newLine](#method_newLine)(int $count = 1) Add newline(s). | | | [ProgressBar](../helper/progressbar "Symfony\Component\Console\Helper\ProgressBar") | [createProgressBar](#method_createProgressBar)(int $max = 0) | | | | [write](#method_write)(string|iterable $messages, bool $newline = false, $type = self::OUTPUT\_NORMAL) Writes a message to the output. | | | | [writeln](#method_writeln)(string|iterable $messages, $type = self::OUTPUT\_NORMAL) Writes a message to the output and adds a newline at the end. | | | | [setVerbosity](#method_setVerbosity)(int $level) Sets the verbosity of the output. | from [OutputStyle](outputstyle#method_setVerbosity "Symfony\Component\Console\Style\OutputStyle") | | int | [getVerbosity](#method_getVerbosity)() Gets the current verbosity of the output. | from [OutputStyle](outputstyle#method_getVerbosity "Symfony\Component\Console\Style\OutputStyle") | | | [setDecorated](#method_setDecorated)(bool $decorated) Sets the decorated flag. | from [OutputStyle](outputstyle#method_setDecorated "Symfony\Component\Console\Style\OutputStyle") | | bool | [isDecorated](#method_isDecorated)() Gets the decorated flag. | from [OutputStyle](outputstyle#method_isDecorated "Symfony\Component\Console\Style\OutputStyle") | | | [setFormatter](#method_setFormatter)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) | from [OutputStyle](outputstyle#method_setFormatter "Symfony\Component\Console\Style\OutputStyle") | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | [getFormatter](#method_getFormatter)() Returns current output formatter instance. | from [OutputStyle](outputstyle#method_getFormatter "Symfony\Component\Console\Style\OutputStyle") | | bool | [isQuiet](#method_isQuiet)() Returns whether verbosity is quiet (-q). | from [OutputStyle](outputstyle#method_isQuiet "Symfony\Component\Console\Style\OutputStyle") | | bool | [isVerbose](#method_isVerbose)() Returns whether verbosity is verbose (-v). | from [OutputStyle](outputstyle#method_isVerbose "Symfony\Component\Console\Style\OutputStyle") | | bool | [isVeryVerbose](#method_isVeryVerbose)() Returns whether verbosity is very verbose (-vv). | from [OutputStyle](outputstyle#method_isVeryVerbose "Symfony\Component\Console\Style\OutputStyle") | | bool | [isDebug](#method_isDebug)() Returns whether verbosity is debug (-vvv). | from [OutputStyle](outputstyle#method_isDebug "Symfony\Component\Console\Style\OutputStyle") | | | [getErrorOutput](#method_getErrorOutput)() | from [OutputStyle](outputstyle#method_getErrorOutput "Symfony\Component\Console\Style\OutputStyle") | | | [block](#method_block)(string|array $messages, string|null $type = null, string|null $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) Formats a message as a block of text. | | | | [title](#method_title)(string $message) Formats a command title. | | | | [section](#method_section)(string $message) Formats a section title. | | | | [listing](#method_listing)(array $elements) Formats a list. | | | | [text](#method_text)(string|array $message) Formats informational text. | | | | [comment](#method_comment)(string|array $message) Formats a command comment. | | | | [success](#method_success)(string|array $message) Formats a success result bar. | | | | [error](#method_error)(string|array $message) Formats an error result bar. | | | | [warning](#method_warning)(string|array $message) Formats an warning result bar. | | | | [note](#method_note)(string|array $message) Formats a note admonition. | | | | [caution](#method_caution)(string|array $message) Formats a caution admonition. | | | | [table](#method_table)(array $headers, array $rows) Formats a table. | | | mixed | [ask](#method_ask)(string $question, string|null $default = null, callable|null $validator = null) Asks a question. | | | mixed | [askHidden](#method_askHidden)(string $question, callable|null $validator = null) Asks a question with the user input hidden. | | | bool | [confirm](#method_confirm)(string $question, bool $default = true) Asks for confirmation. | | | mixed | [choice](#method_choice)(string $question, array $choices, string|int|null $default = null) Asks a choice question. | | | | [progressStart](#method_progressStart)(int $max = 0) Starts the progress output. | | | | [progressAdvance](#method_progressAdvance)(int $step = 1) Advances the progress output X steps. | | | | [progressFinish](#method_progressFinish)() Finishes the progress output. | | | mixed | [askQuestion](#method_askQuestion)([Question](../question/question "Symfony\Component\Console\Question\Question") $question) | | | [SymfonyStyle](symfonystyle "Symfony\Component\Console\Style\SymfonyStyle") | [getErrorStyle](#method_getErrorStyle)() Returns a new instance which makes use of stderr if available. | | Details ------- ### \_\_construct([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### newLine(int $count = 1) Add newline(s). #### Parameters | | | | | --- | --- | --- | | int | $count | The number of newlines | ### [ProgressBar](../helper/progressbar "Symfony\Component\Console\Helper\ProgressBar") createProgressBar(int $max = 0) #### Parameters | | | | | --- | --- | --- | | int | $max | | #### Return Value | | | | --- | --- | | [ProgressBar](../helper/progressbar "Symfony\Component\Console\Helper\ProgressBar") | | ### write(string|iterable $messages, bool $newline = false, $type = self::OUTPUT\_NORMAL) Writes a message to the output. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | bool | $newline | Whether to add a newline | | | $type | | ### writeln(string|iterable $messages, $type = self::OUTPUT\_NORMAL) Writes a message to the output and adds a newline at the end. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | | $type | | ### setVerbosity(int $level) Sets the verbosity of the output. #### Parameters | | | | | --- | --- | --- | | int | $level | The level of verbosity (one of the VERBOSITY constants) | ### int getVerbosity() Gets the current verbosity of the output. #### Return Value | | | | --- | --- | | int | The current level of verbosity (one of the VERBOSITY constants) | ### setDecorated(bool $decorated) Sets the decorated flag. #### Parameters | | | | | --- | --- | --- | | bool | $decorated | Whether to decorate the messages | ### bool isDecorated() Gets the decorated flag. #### Return Value | | | | --- | --- | | bool | true if the output will decorate messages, false otherwise | ### setFormatter([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | ### [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") getFormatter() Returns current output formatter instance. #### Return Value | | | | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | | ### bool isQuiet() Returns whether verbosity is quiet (-q). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_QUIET, false otherwise | ### bool isVerbose() Returns whether verbosity is verbose (-v). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERBOSE, false otherwise | ### bool isVeryVerbose() Returns whether verbosity is very verbose (-vv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERY\_VERBOSE, false otherwise | ### bool isDebug() Returns whether verbosity is debug (-vvv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_DEBUG, false otherwise | ### protected getErrorOutput() ### block(string|array $messages, string|null $type = null, string|null $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) Formats a message as a block of text. #### Parameters | | | | | --- | --- | --- | | string|array | $messages | The message to write in the block | | string|null | $type | The block type (added in [] on first line) | | string|null | $style | The style to apply to the whole block | | string | $prefix | The prefix for the block | | bool | $padding | Whether to add vertical padding | | bool | $escape | Whether to escape the message | ### title(string $message) Formats a command title. #### Parameters | | | | | --- | --- | --- | | string | $message | | ### section(string $message) Formats a section title. #### Parameters | | | | | --- | --- | --- | | string | $message | | ### listing(array $elements) Formats a list. #### Parameters | | | | | --- | --- | --- | | array | $elements | | ### text(string|array $message) Formats informational text. #### Parameters | | | | | --- | --- | --- | | string|array | $message | | ### comment(string|array $message) Formats a command comment. #### Parameters | | | | | --- | --- | --- | | string|array | $message | | ### success(string|array $message) Formats a success result bar. #### Parameters | | | | | --- | --- | --- | | string|array | $message | | ### error(string|array $message) Formats an error result bar. #### Parameters | | | | | --- | --- | --- | | string|array | $message | | ### warning(string|array $message) Formats an warning result bar. #### Parameters | | | | | --- | --- | --- | | string|array | $message | | ### note(string|array $message) Formats a note admonition. #### Parameters | | | | | --- | --- | --- | | string|array | $message | | ### caution(string|array $message) Formats a caution admonition. #### Parameters | | | | | --- | --- | --- | | string|array | $message | | ### table(array $headers, array $rows) Formats a table. #### Parameters | | | | | --- | --- | --- | | array | $headers | | | array | $rows | | ### mixed ask(string $question, string|null $default = null, callable|null $validator = null) Asks a question. #### Parameters | | | | | --- | --- | --- | | string | $question | | | string|null | $default | | | callable|null | $validator | | #### Return Value | | | | --- | --- | | mixed | | ### mixed askHidden(string $question, callable|null $validator = null) Asks a question with the user input hidden. #### Parameters | | | | | --- | --- | --- | | string | $question | | | callable|null | $validator | | #### Return Value | | | | --- | --- | | mixed | | ### bool confirm(string $question, bool $default = true) Asks for confirmation. #### Parameters | | | | | --- | --- | --- | | string | $question | | | bool | $default | | #### Return Value | | | | --- | --- | | bool | | ### mixed choice(string $question, array $choices, string|int|null $default = null) Asks a choice question. #### Parameters | | | | | --- | --- | --- | | string | $question | | | array | $choices | | | string|int|null | $default | | #### Return Value | | | | --- | --- | | mixed | | ### progressStart(int $max = 0) Starts the progress output. #### Parameters | | | | | --- | --- | --- | | int | $max | Maximum steps (0 if unknown) | ### progressAdvance(int $step = 1) Advances the progress output X steps. #### Parameters | | | | | --- | --- | --- | | int | $step | Number of steps to advance | ### progressFinish() Finishes the progress output. ### mixed askQuestion([Question](../question/question "Symfony\Component\Console\Question\Question") $question) #### Parameters | | | | | --- | --- | --- | | [Question](../question/question "Symfony\Component\Console\Question\Question") | $question | | #### Return Value | | | | --- | --- | | mixed | | ### [SymfonyStyle](symfonystyle "Symfony\Component\Console\Style\SymfonyStyle") getErrorStyle() Returns a new instance which makes use of stderr if available. #### Return Value | | | | --- | --- | | [SymfonyStyle](symfonystyle "Symfony\Component\Console\Style\SymfonyStyle") | |
programming_docs
symfony StyleInterface StyleInterface =============== interface **StyleInterface** Output style helpers. Methods ------- | | | | | --- | --- | --- | | | [title](#method_title)(string $message) Formats a command title. | | | | [section](#method_section)(string $message) Formats a section title. | | | | [listing](#method_listing)(array $elements) Formats a list. | | | | [text](#method_text)(string|array $message) Formats informational text. | | | | [success](#method_success)(string|array $message) Formats a success result bar. | | | | [error](#method_error)(string|array $message) Formats an error result bar. | | | | [warning](#method_warning)(string|array $message) Formats an warning result bar. | | | | [note](#method_note)(string|array $message) Formats a note admonition. | | | | [caution](#method_caution)(string|array $message) Formats a caution admonition. | | | | [table](#method_table)(array $headers, array $rows) Formats a table. | | | mixed | [ask](#method_ask)(string $question, string|null $default = null, callable|null $validator = null) Asks a question. | | | mixed | [askHidden](#method_askHidden)(string $question, callable|null $validator = null) Asks a question with the user input hidden. | | | bool | [confirm](#method_confirm)(string $question, bool $default = true) Asks for confirmation. | | | mixed | [choice](#method_choice)(string $question, array $choices, string|int|null $default = null) Asks a choice question. | | | | [newLine](#method_newLine)(int $count = 1) Add newline(s). | | | | [progressStart](#method_progressStart)(int $max = 0) Starts the progress output. | | | | [progressAdvance](#method_progressAdvance)(int $step = 1) Advances the progress output X steps. | | | | [progressFinish](#method_progressFinish)() Finishes the progress output. | | Details ------- ### title(string $message) Formats a command title. #### Parameters | | | | | --- | --- | --- | | string | $message | | ### section(string $message) Formats a section title. #### Parameters | | | | | --- | --- | --- | | string | $message | | ### listing(array $elements) Formats a list. #### Parameters | | | | | --- | --- | --- | | array | $elements | | ### text(string|array $message) Formats informational text. #### Parameters | | | | | --- | --- | --- | | string|array | $message | | ### success(string|array $message) Formats a success result bar. #### Parameters | | | | | --- | --- | --- | | string|array | $message | | ### error(string|array $message) Formats an error result bar. #### Parameters | | | | | --- | --- | --- | | string|array | $message | | ### warning(string|array $message) Formats an warning result bar. #### Parameters | | | | | --- | --- | --- | | string|array | $message | | ### note(string|array $message) Formats a note admonition. #### Parameters | | | | | --- | --- | --- | | string|array | $message | | ### caution(string|array $message) Formats a caution admonition. #### Parameters | | | | | --- | --- | --- | | string|array | $message | | ### table(array $headers, array $rows) Formats a table. #### Parameters | | | | | --- | --- | --- | | array | $headers | | | array | $rows | | ### mixed ask(string $question, string|null $default = null, callable|null $validator = null) Asks a question. #### Parameters | | | | | --- | --- | --- | | string | $question | | | string|null | $default | | | callable|null | $validator | | #### Return Value | | | | --- | --- | | mixed | | ### mixed askHidden(string $question, callable|null $validator = null) Asks a question with the user input hidden. #### Parameters | | | | | --- | --- | --- | | string | $question | | | callable|null | $validator | | #### Return Value | | | | --- | --- | | mixed | | ### bool confirm(string $question, bool $default = true) Asks for confirmation. #### Parameters | | | | | --- | --- | --- | | string | $question | | | bool | $default | | #### Return Value | | | | --- | --- | | bool | | ### mixed choice(string $question, array $choices, string|int|null $default = null) Asks a choice question. #### Parameters | | | | | --- | --- | --- | | string | $question | | | array | $choices | | | string|int|null | $default | | #### Return Value | | | | --- | --- | | mixed | | ### newLine(int $count = 1) Add newline(s). #### Parameters | | | | | --- | --- | --- | | int | $count | The number of newlines | ### progressStart(int $max = 0) Starts the progress output. #### Parameters | | | | | --- | --- | --- | | int | $max | Maximum steps (0 if unknown) | ### progressAdvance(int $step = 1) Advances the progress output X steps. #### Parameters | | | | | --- | --- | --- | | int | $step | Number of steps to advance | ### progressFinish() Finishes the progress output. symfony OutputStyle OutputStyle ============ abstract class **OutputStyle** implements [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface"), [StyleInterface](styleinterface "Symfony\Component\Console\Style\StyleInterface") Decorates output to add console style guide helpers. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) | | | | [newLine](#method_newLine)(int $count = 1) Add newline(s). | | | [ProgressBar](../helper/progressbar "Symfony\Component\Console\Helper\ProgressBar") | [createProgressBar](#method_createProgressBar)(int $max = 0) | | | | [write](#method_write)(string|iterable $messages, bool $newline = false, $type = self::OUTPUT\_NORMAL) Writes a message to the output. | | | | [writeln](#method_writeln)(string|iterable $messages, $type = self::OUTPUT\_NORMAL) Writes a message to the output and adds a newline at the end. | | | | [setVerbosity](#method_setVerbosity)(int $level) Sets the verbosity of the output. | | | int | [getVerbosity](#method_getVerbosity)() Gets the current verbosity of the output. | | | | [setDecorated](#method_setDecorated)(bool $decorated) Sets the decorated flag. | | | bool | [isDecorated](#method_isDecorated)() Gets the decorated flag. | | | | [setFormatter](#method_setFormatter)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) | | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | [getFormatter](#method_getFormatter)() Returns current output formatter instance. | | | bool | [isQuiet](#method_isQuiet)() Returns whether verbosity is quiet (-q). | | | bool | [isVerbose](#method_isVerbose)() Returns whether verbosity is verbose (-v). | | | bool | [isVeryVerbose](#method_isVeryVerbose)() Returns whether verbosity is very verbose (-vv). | | | bool | [isDebug](#method_isDebug)() Returns whether verbosity is debug (-vvv). | | | | [getErrorOutput](#method_getErrorOutput)() | | Details ------- ### \_\_construct([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### newLine(int $count = 1) Add newline(s). #### Parameters | | | | | --- | --- | --- | | int | $count | The number of newlines | ### [ProgressBar](../helper/progressbar "Symfony\Component\Console\Helper\ProgressBar") createProgressBar(int $max = 0) #### Parameters | | | | | --- | --- | --- | | int | $max | | #### Return Value | | | | --- | --- | | [ProgressBar](../helper/progressbar "Symfony\Component\Console\Helper\ProgressBar") | | ### write(string|iterable $messages, bool $newline = false, $type = self::OUTPUT\_NORMAL) Writes a message to the output. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | bool | $newline | Whether to add a newline | | | $type | | ### writeln(string|iterable $messages, $type = self::OUTPUT\_NORMAL) Writes a message to the output and adds a newline at the end. #### Parameters | | | | | --- | --- | --- | | string|iterable | $messages | The message as an iterable of strings or a single string | | | $type | | ### setVerbosity(int $level) Sets the verbosity of the output. #### Parameters | | | | | --- | --- | --- | | int | $level | The level of verbosity (one of the VERBOSITY constants) | ### int getVerbosity() Gets the current verbosity of the output. #### Return Value | | | | --- | --- | | int | The current level of verbosity (one of the VERBOSITY constants) | ### setDecorated(bool $decorated) Sets the decorated flag. #### Parameters | | | | | --- | --- | --- | | bool | $decorated | Whether to decorate the messages | ### bool isDecorated() Gets the decorated flag. #### Return Value | | | | --- | --- | | bool | true if the output will decorate messages, false otherwise | ### setFormatter([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | ### [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") getFormatter() Returns current output formatter instance. #### Return Value | | | | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | | ### bool isQuiet() Returns whether verbosity is quiet (-q). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_QUIET, false otherwise | ### bool isVerbose() Returns whether verbosity is verbose (-v). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERBOSE, false otherwise | ### bool isVeryVerbose() Returns whether verbosity is very verbose (-vv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_VERY\_VERBOSE, false otherwise | ### bool isDebug() Returns whether verbosity is debug (-vvv). #### Return Value | | | | --- | --- | | bool | true if verbosity is set to VERBOSITY\_DEBUG, false otherwise | ### protected getErrorOutput() symfony Question Question ========= class **Question** Represents a Question. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $question, mixed $default = null) | | | string | [getQuestion](#method_getQuestion)() Returns the question. | | | mixed | [getDefault](#method_getDefault)() Returns the default answer. | | | bool | [isHidden](#method_isHidden)() Returns whether the user response must be hidden. | | | $this | [setHidden](#method_setHidden)(bool $hidden) Sets whether the user response must be hidden or not. | | | bool | [isHiddenFallback](#method_isHiddenFallback)() In case the response can not be hidden, whether to fallback on non-hidden question or not. | | | $this | [setHiddenFallback](#method_setHiddenFallback)(bool $fallback) Sets whether to fallback on non-hidden question if the response can not be hidden. | | | iterable|null | [getAutocompleterValues](#method_getAutocompleterValues)() Gets values for the autocompleter. | | | $this | [setAutocompleterValues](#method_setAutocompleterValues)(iterable|null $values) Sets values for the autocompleter. | | | $this | [setValidator](#method_setValidator)(callable $validator = null) Sets a validator for the question. | | | callable|null | [getValidator](#method_getValidator)() Gets the validator for the question. | | | $this | [setMaxAttempts](#method_setMaxAttempts)(int|null $attempts) Sets the maximum number of attempts. | | | int|null | [getMaxAttempts](#method_getMaxAttempts)() Gets the maximum number of attempts. | | | $this | [setNormalizer](#method_setNormalizer)(callable $normalizer) Sets a normalizer for the response. | | | callable | [getNormalizer](#method_getNormalizer)() Gets the normalizer for the response. | | | | [isAssoc](#method_isAssoc)($array) | | Details ------- ### \_\_construct(string $question, mixed $default = null) #### Parameters | | | | | --- | --- | --- | | string | $question | The question to ask to the user | | mixed | $default | The default answer to return if the user enters nothing | ### string getQuestion() Returns the question. #### Return Value | | | | --- | --- | | string | | ### mixed getDefault() Returns the default answer. #### Return Value | | | | --- | --- | | mixed | | ### bool isHidden() Returns whether the user response must be hidden. #### Return Value | | | | --- | --- | | bool | | ### $this setHidden(bool $hidden) Sets whether the user response must be hidden or not. #### Parameters | | | | | --- | --- | --- | | bool | $hidden | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | In case the autocompleter is also used | ### bool isHiddenFallback() In case the response can not be hidden, whether to fallback on non-hidden question or not. #### Return Value | | | | --- | --- | | bool | | ### $this setHiddenFallback(bool $fallback) Sets whether to fallback on non-hidden question if the response can not be hidden. #### Parameters | | | | | --- | --- | --- | | bool | $fallback | | #### Return Value | | | | --- | --- | | $this | | ### iterable|null getAutocompleterValues() Gets values for the autocompleter. #### Return Value | | | | --- | --- | | iterable|null | | ### $this setAutocompleterValues(iterable|null $values) Sets values for the autocompleter. #### Parameters | | | | | --- | --- | --- | | iterable|null | $values | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | | ### $this setValidator(callable $validator = null) Sets a validator for the question. #### Parameters | | | | | --- | --- | --- | | callable | $validator | | #### Return Value | | | | --- | --- | | $this | | ### callable|null getValidator() Gets the validator for the question. #### Return Value | | | | --- | --- | | callable|null | | ### $this setMaxAttempts(int|null $attempts) Sets the maximum number of attempts. Null means an unlimited number of attempts. #### Parameters | | | | | --- | --- | --- | | int|null | $attempts | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | in case the number of attempts is invalid | ### int|null getMaxAttempts() Gets the maximum number of attempts. Null means an unlimited number of attempts. #### Return Value | | | | --- | --- | | int|null | | ### $this setNormalizer(callable $normalizer) Sets a normalizer for the response. The normalizer can be a callable (a string), a closure or a class implementing \_\_invoke. #### Parameters | | | | | --- | --- | --- | | callable | $normalizer | | #### Return Value | | | | --- | --- | | $this | | ### callable getNormalizer() Gets the normalizer for the response. The normalizer can ba a callable (a string), a closure or a class implementing \_\_invoke. #### Return Value | | | | --- | --- | | callable | | ### protected isAssoc($array) #### Parameters | | | | | --- | --- | --- | | | $array | | symfony ConfirmationQuestion ConfirmationQuestion ===================== class **ConfirmationQuestion** extends [Question](question "Symfony\Component\Console\Question\Question") Represents a yes/no question. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $question, mixed $default = true, string $trueAnswerRegex = '/^y/i') | | | string | [getQuestion](#method_getQuestion)() Returns the question. | from [Question](question#method_getQuestion "Symfony\Component\Console\Question\Question") | | mixed | [getDefault](#method_getDefault)() Returns the default answer. | from [Question](question#method_getDefault "Symfony\Component\Console\Question\Question") | | bool | [isHidden](#method_isHidden)() Returns whether the user response must be hidden. | from [Question](question#method_isHidden "Symfony\Component\Console\Question\Question") | | $this | [setHidden](#method_setHidden)(bool $hidden) Sets whether the user response must be hidden or not. | from [Question](question#method_setHidden "Symfony\Component\Console\Question\Question") | | bool | [isHiddenFallback](#method_isHiddenFallback)() In case the response can not be hidden, whether to fallback on non-hidden question or not. | from [Question](question#method_isHiddenFallback "Symfony\Component\Console\Question\Question") | | $this | [setHiddenFallback](#method_setHiddenFallback)(bool $fallback) Sets whether to fallback on non-hidden question if the response can not be hidden. | from [Question](question#method_setHiddenFallback "Symfony\Component\Console\Question\Question") | | iterable|null | [getAutocompleterValues](#method_getAutocompleterValues)() Gets values for the autocompleter. | from [Question](question#method_getAutocompleterValues "Symfony\Component\Console\Question\Question") | | $this | [setAutocompleterValues](#method_setAutocompleterValues)(iterable|null $values) Sets values for the autocompleter. | from [Question](question#method_setAutocompleterValues "Symfony\Component\Console\Question\Question") | | $this | [setValidator](#method_setValidator)(callable $validator = null) Sets a validator for the question. | from [Question](question#method_setValidator "Symfony\Component\Console\Question\Question") | | callable|null | [getValidator](#method_getValidator)() Gets the validator for the question. | from [Question](question#method_getValidator "Symfony\Component\Console\Question\Question") | | $this | [setMaxAttempts](#method_setMaxAttempts)(int|null $attempts) Sets the maximum number of attempts. | from [Question](question#method_setMaxAttempts "Symfony\Component\Console\Question\Question") | | int|null | [getMaxAttempts](#method_getMaxAttempts)() Gets the maximum number of attempts. | from [Question](question#method_getMaxAttempts "Symfony\Component\Console\Question\Question") | | $this | [setNormalizer](#method_setNormalizer)(callable $normalizer) Sets a normalizer for the response. | from [Question](question#method_setNormalizer "Symfony\Component\Console\Question\Question") | | callable | [getNormalizer](#method_getNormalizer)() Gets the normalizer for the response. | from [Question](question#method_getNormalizer "Symfony\Component\Console\Question\Question") | | | [isAssoc](#method_isAssoc)($array) | from [Question](question#method_isAssoc "Symfony\Component\Console\Question\Question") | Details ------- ### \_\_construct(string $question, mixed $default = true, string $trueAnswerRegex = '/^y/i') #### Parameters | | | | | --- | --- | --- | | string | $question | The question to ask to the user | | mixed | $default | The default answer to return if the user enters nothing | | string | $trueAnswerRegex | A regex to match the "yes" answer | ### string getQuestion() Returns the question. #### Return Value | | | | --- | --- | | string | | ### mixed getDefault() Returns the default answer. #### Return Value | | | | --- | --- | | mixed | | ### bool isHidden() Returns whether the user response must be hidden. #### Return Value | | | | --- | --- | | bool | | ### $this setHidden(bool $hidden) Sets whether the user response must be hidden or not. #### Parameters | | | | | --- | --- | --- | | bool | $hidden | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | In case the autocompleter is also used | ### bool isHiddenFallback() In case the response can not be hidden, whether to fallback on non-hidden question or not. #### Return Value | | | | --- | --- | | bool | | ### $this setHiddenFallback(bool $fallback) Sets whether to fallback on non-hidden question if the response can not be hidden. #### Parameters | | | | | --- | --- | --- | | bool | $fallback | | #### Return Value | | | | --- | --- | | $this | | ### iterable|null getAutocompleterValues() Gets values for the autocompleter. #### Return Value | | | | --- | --- | | iterable|null | | ### $this setAutocompleterValues(iterable|null $values) Sets values for the autocompleter. #### Parameters | | | | | --- | --- | --- | | iterable|null | $values | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | | ### $this setValidator(callable $validator = null) Sets a validator for the question. #### Parameters | | | | | --- | --- | --- | | callable | $validator | | #### Return Value | | | | --- | --- | | $this | | ### callable|null getValidator() Gets the validator for the question. #### Return Value | | | | --- | --- | | callable|null | | ### $this setMaxAttempts(int|null $attempts) Sets the maximum number of attempts. Null means an unlimited number of attempts. #### Parameters | | | | | --- | --- | --- | | int|null | $attempts | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | in case the number of attempts is invalid | ### int|null getMaxAttempts() Gets the maximum number of attempts. Null means an unlimited number of attempts. #### Return Value | | | | --- | --- | | int|null | | ### $this setNormalizer(callable $normalizer) Sets a normalizer for the response. The normalizer can be a callable (a string), a closure or a class implementing \_\_invoke. #### Parameters | | | | | --- | --- | --- | | callable | $normalizer | | #### Return Value | | | | --- | --- | | $this | | ### callable getNormalizer() Gets the normalizer for the response. The normalizer can ba a callable (a string), a closure or a class implementing \_\_invoke. #### Return Value | | | | --- | --- | | callable | | ### protected isAssoc($array) #### Parameters | | | | | --- | --- | --- | | | $array | |
programming_docs
symfony ChoiceQuestion ChoiceQuestion =============== class **ChoiceQuestion** extends [Question](question "Symfony\Component\Console\Question\Question") Represents a choice question. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $question, array $choices, mixed $default = null) | | | string | [getQuestion](#method_getQuestion)() Returns the question. | from [Question](question#method_getQuestion "Symfony\Component\Console\Question\Question") | | mixed | [getDefault](#method_getDefault)() Returns the default answer. | from [Question](question#method_getDefault "Symfony\Component\Console\Question\Question") | | bool | [isHidden](#method_isHidden)() Returns whether the user response must be hidden. | from [Question](question#method_isHidden "Symfony\Component\Console\Question\Question") | | $this | [setHidden](#method_setHidden)(bool $hidden) Sets whether the user response must be hidden or not. | from [Question](question#method_setHidden "Symfony\Component\Console\Question\Question") | | bool | [isHiddenFallback](#method_isHiddenFallback)() In case the response can not be hidden, whether to fallback on non-hidden question or not. | from [Question](question#method_isHiddenFallback "Symfony\Component\Console\Question\Question") | | $this | [setHiddenFallback](#method_setHiddenFallback)(bool $fallback) Sets whether to fallback on non-hidden question if the response can not be hidden. | from [Question](question#method_setHiddenFallback "Symfony\Component\Console\Question\Question") | | iterable|null | [getAutocompleterValues](#method_getAutocompleterValues)() Gets values for the autocompleter. | from [Question](question#method_getAutocompleterValues "Symfony\Component\Console\Question\Question") | | $this | [setAutocompleterValues](#method_setAutocompleterValues)(iterable|null $values) Sets values for the autocompleter. | from [Question](question#method_setAutocompleterValues "Symfony\Component\Console\Question\Question") | | $this | [setValidator](#method_setValidator)(callable $validator = null) Sets a validator for the question. | from [Question](question#method_setValidator "Symfony\Component\Console\Question\Question") | | callable|null | [getValidator](#method_getValidator)() Gets the validator for the question. | from [Question](question#method_getValidator "Symfony\Component\Console\Question\Question") | | $this | [setMaxAttempts](#method_setMaxAttempts)(int|null $attempts) Sets the maximum number of attempts. | from [Question](question#method_setMaxAttempts "Symfony\Component\Console\Question\Question") | | int|null | [getMaxAttempts](#method_getMaxAttempts)() Gets the maximum number of attempts. | from [Question](question#method_getMaxAttempts "Symfony\Component\Console\Question\Question") | | $this | [setNormalizer](#method_setNormalizer)(callable $normalizer) Sets a normalizer for the response. | from [Question](question#method_setNormalizer "Symfony\Component\Console\Question\Question") | | callable | [getNormalizer](#method_getNormalizer)() Gets the normalizer for the response. | from [Question](question#method_getNormalizer "Symfony\Component\Console\Question\Question") | | | [isAssoc](#method_isAssoc)($array) | from [Question](question#method_isAssoc "Symfony\Component\Console\Question\Question") | | array | [getChoices](#method_getChoices)() Returns available choices. | | | $this | [setMultiselect](#method_setMultiselect)(bool $multiselect) Sets multiselect option. | | | bool | [isMultiselect](#method_isMultiselect)() Returns whether the choices are multiselect. | | | string | [getPrompt](#method_getPrompt)() Gets the prompt for choices. | | | $this | [setPrompt](#method_setPrompt)(string $prompt) Sets the prompt for choices. | | | $this | [setErrorMessage](#method_setErrorMessage)(string $errorMessage) Sets the error message for invalid values. | | Details ------- ### \_\_construct(string $question, array $choices, mixed $default = null) #### Parameters | | | | | --- | --- | --- | | string | $question | The question to ask to the user | | array | $choices | The list of available choices | | mixed | $default | The default answer to return if the user enters nothing | ### string getQuestion() Returns the question. #### Return Value | | | | --- | --- | | string | | ### mixed getDefault() Returns the default answer. #### Return Value | | | | --- | --- | | mixed | | ### bool isHidden() Returns whether the user response must be hidden. #### Return Value | | | | --- | --- | | bool | | ### $this setHidden(bool $hidden) Sets whether the user response must be hidden or not. #### Parameters | | | | | --- | --- | --- | | bool | $hidden | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | In case the autocompleter is also used | ### bool isHiddenFallback() In case the response can not be hidden, whether to fallback on non-hidden question or not. #### Return Value | | | | --- | --- | | bool | | ### $this setHiddenFallback(bool $fallback) Sets whether to fallback on non-hidden question if the response can not be hidden. #### Parameters | | | | | --- | --- | --- | | bool | $fallback | | #### Return Value | | | | --- | --- | | $this | | ### iterable|null getAutocompleterValues() Gets values for the autocompleter. #### Return Value | | | | --- | --- | | iterable|null | | ### $this setAutocompleterValues(iterable|null $values) Sets values for the autocompleter. #### Parameters | | | | | --- | --- | --- | | iterable|null | $values | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | | ### $this setValidator(callable $validator = null) Sets a validator for the question. #### Parameters | | | | | --- | --- | --- | | callable | $validator | | #### Return Value | | | | --- | --- | | $this | | ### callable|null getValidator() Gets the validator for the question. #### Return Value | | | | --- | --- | | callable|null | | ### $this setMaxAttempts(int|null $attempts) Sets the maximum number of attempts. Null means an unlimited number of attempts. #### Parameters | | | | | --- | --- | --- | | int|null | $attempts | | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | in case the number of attempts is invalid | ### int|null getMaxAttempts() Gets the maximum number of attempts. Null means an unlimited number of attempts. #### Return Value | | | | --- | --- | | int|null | | ### $this setNormalizer(callable $normalizer) Sets a normalizer for the response. The normalizer can be a callable (a string), a closure or a class implementing \_\_invoke. #### Parameters | | | | | --- | --- | --- | | callable | $normalizer | | #### Return Value | | | | --- | --- | | $this | | ### callable getNormalizer() Gets the normalizer for the response. The normalizer can ba a callable (a string), a closure or a class implementing \_\_invoke. #### Return Value | | | | --- | --- | | callable | | ### protected isAssoc($array) #### Parameters | | | | | --- | --- | --- | | | $array | | ### array getChoices() Returns available choices. #### Return Value | | | | --- | --- | | array | | ### $this setMultiselect(bool $multiselect) Sets multiselect option. When multiselect is set to true, multiple choices can be answered. #### Parameters | | | | | --- | --- | --- | | bool | $multiselect | | #### Return Value | | | | --- | --- | | $this | | ### bool isMultiselect() Returns whether the choices are multiselect. #### Return Value | | | | --- | --- | | bool | | ### string getPrompt() Gets the prompt for choices. #### Return Value | | | | --- | --- | | string | | ### $this setPrompt(string $prompt) Sets the prompt for choices. #### Parameters | | | | | --- | --- | --- | | string | $prompt | | #### Return Value | | | | --- | --- | | $this | | ### $this setErrorMessage(string $errorMessage) Sets the error message for invalid values. The error message has a string placeholder (%s) for the invalid value. #### Parameters | | | | | --- | --- | --- | | string | $errorMessage | | #### Return Value | | | | --- | --- | | $this | | symfony OutputFormatterStyle OutputFormatterStyle ===================== class **OutputFormatterStyle** implements [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") Formatter style class for defining styles. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $foreground = null, string $background = null, array $options = array()) Initializes output formatter style. | | | | [setForeground](#method_setForeground)(string $color = null) Sets style foreground color. | | | | [setBackground](#method_setBackground)(string $color = null) Sets style background color. | | | | [setOption](#method_setOption)(string $option) Sets some specific style option. | | | | [unsetOption](#method_unsetOption)(string $option) Unsets some specific style option. | | | | [setOptions](#method_setOptions)(array $options) Sets multiple style options at once. | | | string | [apply](#method_apply)(string $text) Applies the style to a given text. | | Details ------- ### \_\_construct(string $foreground = null, string $background = null, array $options = array()) Initializes output formatter style. #### Parameters | | | | | --- | --- | --- | | string | $foreground | The style foreground color name | | string | $background | The style background color name | | array | $options | The style options | ### setForeground(string $color = null) Sets style foreground color. #### Parameters | | | | | --- | --- | --- | | string | $color | The color name | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When the color name isn't defined | ### setBackground(string $color = null) Sets style background color. #### Parameters | | | | | --- | --- | --- | | string | $color | The color name | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When the color name isn't defined | ### setOption(string $option) Sets some specific style option. #### Parameters | | | | | --- | --- | --- | | string | $option | The option name | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When the option name isn't defined | ### unsetOption(string $option) Unsets some specific style option. #### Parameters | | | | | --- | --- | --- | | string | $option | The option name | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When the option name isn't defined | ### setOptions(array $options) Sets multiple style options at once. #### Parameters | | | | | --- | --- | --- | | array | $options | | ### string apply(string $text) Applies the style to a given text. #### Parameters | | | | | --- | --- | --- | | string | $text | The text to style | #### Return Value | | | | --- | --- | | string | | symfony OutputFormatter OutputFormatter ================ class **OutputFormatter** implements [OutputFormatterInterface](outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") Formatter class for console output. Methods ------- | | | | | --- | --- | --- | | static string | [escape](#method_escape)(string $text) Escapes "<" special char in given text. | | | static string | [escapeTrailingBackslash](#method_escapeTrailingBackslash)(string $text) Escapes trailing "\" in given text. | | | | [\_\_construct](#method___construct)(bool $decorated = false, array $styles = array()) Initializes console output formatter. | | | | [setDecorated](#method_setDecorated)(bool $decorated) Sets the decorated flag. | | | bool | [isDecorated](#method_isDecorated)() Gets the decorated flag. | | | | [setStyle](#method_setStyle)(string $name, [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") $style) Sets a new style. | | | bool | [hasStyle](#method_hasStyle)(string $name) Checks if output formatter has style with specified name. | | | [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") | [getStyle](#method_getStyle)(string $name) Gets style options from style with specified name. | | | string | [format](#method_format)(string $message) Formats a message according to the given styles. | | | [OutputFormatterStyleStack](outputformatterstylestack "Symfony\Component\Console\Formatter\OutputFormatterStyleStack") | [getStyleStack](#method_getStyleStack)() | | Details ------- ### static string escape(string $text) Escapes "<" special char in given text. #### Parameters | | | | | --- | --- | --- | | string | $text | Text to escape | #### Return Value | | | | --- | --- | | string | Escaped text | ### static string escapeTrailingBackslash(string $text) Escapes trailing "\" in given text. #### Parameters | | | | | --- | --- | --- | | string | $text | Text to escape | #### Return Value | | | | --- | --- | | string | Escaped text | ### \_\_construct(bool $decorated = false, array $styles = array()) Initializes console output formatter. #### Parameters | | | | | --- | --- | --- | | bool | $decorated | Whether this formatter should actually decorate strings | | array | $styles | Array of "name => FormatterStyle" instances | ### setDecorated(bool $decorated) Sets the decorated flag. #### Parameters | | | | | --- | --- | --- | | bool | $decorated | Whether to decorate the messages or not | ### bool isDecorated() Gets the decorated flag. #### Return Value | | | | --- | --- | | bool | true if the output will decorate messages, false otherwise | ### setStyle(string $name, [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") $style) Sets a new style. #### Parameters | | | | | --- | --- | --- | | string | $name | The style name | | [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") | $style | The style instance | ### bool hasStyle(string $name) Checks if output formatter has style with specified name. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | bool | | ### [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") getStyle(string $name) Gets style options from style with specified name. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When style isn't defined | ### string format(string $message) Formats a message according to the given styles. #### Parameters | | | | | --- | --- | --- | | string | $message | The message to style | #### Return Value | | | | --- | --- | | string | The styled message | ### [OutputFormatterStyleStack](outputformatterstylestack "Symfony\Component\Console\Formatter\OutputFormatterStyleStack") getStyleStack() #### Return Value | | | | --- | --- | | [OutputFormatterStyleStack](outputformatterstylestack "Symfony\Component\Console\Formatter\OutputFormatterStyleStack") | | symfony OutputFormatterInterface OutputFormatterInterface ========================= interface **OutputFormatterInterface** Formatter interface for console output. Methods ------- | | | | | --- | --- | --- | | | [setDecorated](#method_setDecorated)(bool $decorated) Sets the decorated flag. | | | bool | [isDecorated](#method_isDecorated)() Gets the decorated flag. | | | | [setStyle](#method_setStyle)(string $name, [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") $style) Sets a new style. | | | bool | [hasStyle](#method_hasStyle)(string $name) Checks if output formatter has style with specified name. | | | [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") | [getStyle](#method_getStyle)(string $name) Gets style options from style with specified name. | | | string | [format](#method_format)(string $message) Formats a message according to the given styles. | | Details ------- ### setDecorated(bool $decorated) Sets the decorated flag. #### Parameters | | | | | --- | --- | --- | | bool | $decorated | Whether to decorate the messages or not | ### bool isDecorated() Gets the decorated flag. #### Return Value | | | | --- | --- | | bool | true if the output will decorate messages, false otherwise | ### setStyle(string $name, [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") $style) Sets a new style. #### Parameters | | | | | --- | --- | --- | | string | $name | The style name | | [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") | $style | The style instance | ### bool hasStyle(string $name) Checks if output formatter has style with specified name. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | bool | | ### [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") getStyle(string $name) Gets style options from style with specified name. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When style isn't defined | ### string format(string $message) Formats a message according to the given styles. #### Parameters | | | | | --- | --- | --- | | string | $message | The message to style | #### Return Value | | | | --- | --- | | string | The styled message |
programming_docs
symfony OutputFormatterStyleInterface OutputFormatterStyleInterface ============================== interface **OutputFormatterStyleInterface** Formatter style interface for defining styles. Methods ------- | | | | | --- | --- | --- | | | [setForeground](#method_setForeground)(string $color = null) Sets style foreground color. | | | | [setBackground](#method_setBackground)(string $color = null) Sets style background color. | | | | [setOption](#method_setOption)(string $option) Sets some specific style option. | | | | [unsetOption](#method_unsetOption)(string $option) Unsets some specific style option. | | | | [setOptions](#method_setOptions)(array $options) Sets multiple style options at once. | | | string | [apply](#method_apply)(string $text) Applies the style to a given text. | | Details ------- ### setForeground(string $color = null) Sets style foreground color. #### Parameters | | | | | --- | --- | --- | | string | $color | The color name | ### setBackground(string $color = null) Sets style background color. #### Parameters | | | | | --- | --- | --- | | string | $color | The color name | ### setOption(string $option) Sets some specific style option. #### Parameters | | | | | --- | --- | --- | | string | $option | The option name | ### unsetOption(string $option) Unsets some specific style option. #### Parameters | | | | | --- | --- | --- | | string | $option | The option name | ### setOptions(array $options) Sets multiple style options at once. #### Parameters | | | | | --- | --- | --- | | array | $options | | ### string apply(string $text) Applies the style to a given text. #### Parameters | | | | | --- | --- | --- | | string | $text | The text to style | #### Return Value | | | | --- | --- | | string | | symfony OutputFormatterStyleStack OutputFormatterStyleStack ========================== class **OutputFormatterStyleStack** Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") $emptyStyle = null) | | | | [reset](#method_reset)() Resets stack (ie. empty internal arrays). | | | | [push](#method_push)([OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") $style) Pushes a style in the stack. | | | [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") | [pop](#method_pop)([OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") $style = null) Pops a style from the stack. | | | [OutputFormatterStyle](outputformatterstyle "Symfony\Component\Console\Formatter\OutputFormatterStyle") | [getCurrent](#method_getCurrent)() Computes current style with stacks top codes. | | | $this | [setEmptyStyle](#method_setEmptyStyle)([OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") $emptyStyle) | | | [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") | [getEmptyStyle](#method_getEmptyStyle)() | | Details ------- ### \_\_construct([OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") $emptyStyle = null) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") | $emptyStyle | | ### reset() Resets stack (ie. empty internal arrays). ### push([OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") $style) Pushes a style in the stack. #### Parameters | | | | | --- | --- | --- | | [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") | $style | | ### [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") pop([OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") $style = null) Pops a style from the stack. #### Parameters | | | | | --- | --- | --- | | [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") | $style | | #### Return Value | | | | --- | --- | | [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When style tags incorrectly nested | ### [OutputFormatterStyle](outputformatterstyle "Symfony\Component\Console\Formatter\OutputFormatterStyle") getCurrent() Computes current style with stacks top codes. #### Return Value | | | | --- | --- | | [OutputFormatterStyle](outputformatterstyle "Symfony\Component\Console\Formatter\OutputFormatterStyle") | | ### $this setEmptyStyle([OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") $emptyStyle) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") | $emptyStyle | | #### Return Value | | | | --- | --- | | $this | | ### [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") getEmptyStyle() #### Return Value | | | | --- | --- | | [OutputFormatterStyleInterface](outputformatterstyleinterface "Symfony\Component\Console\Formatter\OutputFormatterStyleInterface") | | symfony ContainerCommandLoader ContainerCommandLoader ======================= class **ContainerCommandLoader** implements [CommandLoaderInterface](commandloaderinterface "Symfony\Component\Console\CommandLoader\CommandLoaderInterface") Loads commands from a PSR-11 container. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(ContainerInterface $container, array $commandMap) | | | [Command](../command/command "Symfony\Component\Console\Command\Command") | [get](#method_get)(string $name) Loads a command. | | | bool | [has](#method_has)(string $name) Checks if a command exists. | | | string[] | [getNames](#method_getNames)() | | Details ------- ### \_\_construct(ContainerInterface $container, array $commandMap) #### Parameters | | | | | --- | --- | --- | | ContainerInterface | $container | A container from which to load command services | | array | $commandMap | An array with command names as keys and service ids as values | ### [Command](../command/command "Symfony\Component\Console\Command\Command") get(string $name) Loads a command. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | | #### Exceptions | | | | --- | --- | | [CommandNotFoundException](../exception/commandnotfoundexception "Symfony\Component\Console\Exception\CommandNotFoundException") | | ### bool has(string $name) Checks if a command exists. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | bool | | ### string[] getNames() #### Return Value | | | | --- | --- | | string[] | All registered command names | symfony CommandLoaderInterface CommandLoaderInterface ======================= interface **CommandLoaderInterface** Methods ------- | | | | | --- | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | [get](#method_get)(string $name) Loads a command. | | | bool | [has](#method_has)(string $name) Checks if a command exists. | | | string[] | [getNames](#method_getNames)() | | Details ------- ### [Command](../command/command "Symfony\Component\Console\Command\Command") get(string $name) Loads a command. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | | #### Exceptions | | | | --- | --- | | [CommandNotFoundException](../exception/commandnotfoundexception "Symfony\Component\Console\Exception\CommandNotFoundException") | | ### bool has(string $name) Checks if a command exists. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | bool | | ### string[] getNames() #### Return Value | | | | --- | --- | | string[] | All registered command names | symfony FactoryCommandLoader FactoryCommandLoader ===================== class **FactoryCommandLoader** implements [CommandLoaderInterface](commandloaderinterface "Symfony\Component\Console\CommandLoader\CommandLoaderInterface") A simple command loader using factories to instantiate commands lazily. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $factories) | | | bool | [has](#method_has)(string $name) Checks if a command exists. | | | [Command](../command/command "Symfony\Component\Console\Command\Command") | [get](#method_get)(string $name) Loads a command. | | | string[] | [getNames](#method_getNames)() | | Details ------- ### \_\_construct(array $factories) #### Parameters | | | | | --- | --- | --- | | array | $factories | Indexed by command names | ### bool has(string $name) Checks if a command exists. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | bool | | ### [Command](../command/command "Symfony\Component\Console\Command\Command") get(string $name) Loads a command. #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | | #### Exceptions | | | | --- | --- | | [CommandNotFoundException](../exception/commandnotfoundexception "Symfony\Component\Console\Exception\CommandNotFoundException") | | ### string[] getNames() #### Return Value | | | | --- | --- | | string[] | All registered command names | symfony Descriptor Descriptor =========== abstract class **Descriptor** implements [DescriptorInterface](descriptorinterface "Symfony\Component\Console\Descriptor\DescriptorInterface") Properties ---------- | | | | | | --- | --- | --- | --- | | protected [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | Methods ------- | | | | | --- | --- | --- | | | [describe](#method_describe)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, object $object, array $options = array()) Describes an object if supported. | | | | [write](#method_write)(string $content, bool $decorated = false) Writes content to output. | | | string|mixed | [describeInputArgument](#method_describeInputArgument)([InputArgument](../input/inputargument "Symfony\Component\Console\Input\InputArgument") $argument, array $options = array()) Describes an InputArgument instance. | | | string|mixed | [describeInputOption](#method_describeInputOption)([InputOption](../input/inputoption "Symfony\Component\Console\Input\InputOption") $option, array $options = array()) Describes an InputOption instance. | | | string|mixed | [describeInputDefinition](#method_describeInputDefinition)([InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition, array $options = array()) Describes an InputDefinition instance. | | | string|mixed | [describeCommand](#method_describeCommand)([Command](../command/command "Symfony\Component\Console\Command\Command") $command, array $options = array()) Describes a Command instance. | | | string|mixed | [describeApplication](#method_describeApplication)([Application](../application "Symfony\Component\Console\Application") $application, array $options = array()) Describes an Application instance. | | Details ------- ### describe([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, object $object, array $options = array()) Describes an object if supported. #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | object | $object | | | array | $options | | ### protected write(string $content, bool $decorated = false) Writes content to output. #### Parameters | | | | | --- | --- | --- | | string | $content | | | bool | $decorated | | ### abstract protected string|mixed describeInputArgument([InputArgument](../input/inputargument "Symfony\Component\Console\Input\InputArgument") $argument, array $options = array()) Describes an InputArgument instance. #### Parameters | | | | | --- | --- | --- | | [InputArgument](../input/inputargument "Symfony\Component\Console\Input\InputArgument") | $argument | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### abstract protected string|mixed describeInputOption([InputOption](../input/inputoption "Symfony\Component\Console\Input\InputOption") $option, array $options = array()) Describes an InputOption instance. #### Parameters | | | | | --- | --- | --- | | [InputOption](../input/inputoption "Symfony\Component\Console\Input\InputOption") | $option | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### abstract protected string|mixed describeInputDefinition([InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition, array $options = array()) Describes an InputDefinition instance. #### Parameters | | | | | --- | --- | --- | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### abstract protected string|mixed describeCommand([Command](../command/command "Symfony\Component\Console\Command\Command") $command, array $options = array()) Describes a Command instance. #### Parameters | | | | | --- | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | $command | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### abstract protected string|mixed describeApplication([Application](../application "Symfony\Component\Console\Application") $application, array $options = array()) Describes an Application instance. #### Parameters | | | | | --- | --- | --- | | [Application](../application "Symfony\Component\Console\Application") | $application | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | symfony JsonDescriptor JsonDescriptor =============== class **JsonDescriptor** extends [Descriptor](descriptor "Symfony\Component\Console\Descriptor\Descriptor") JSON descriptor. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | from [Descriptor](descriptor#property_output "Symfony\Component\Console\Descriptor\Descriptor") | Methods ------- | | | | | --- | --- | --- | | | [describe](#method_describe)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, object $object, array $options = array()) Describes an object if supported. | from [Descriptor](descriptor#method_describe "Symfony\Component\Console\Descriptor\Descriptor") | | | [write](#method_write)(string $content, bool $decorated = false) Writes content to output. | from [Descriptor](descriptor#method_write "Symfony\Component\Console\Descriptor\Descriptor") | | string|mixed | [describeInputArgument](#method_describeInputArgument)([InputArgument](../input/inputargument "Symfony\Component\Console\Input\InputArgument") $argument, array $options = array()) Describes an InputArgument instance. | | | string|mixed | [describeInputOption](#method_describeInputOption)([InputOption](../input/inputoption "Symfony\Component\Console\Input\InputOption") $option, array $options = array()) Describes an InputOption instance. | | | string|mixed | [describeInputDefinition](#method_describeInputDefinition)([InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition, array $options = array()) Describes an InputDefinition instance. | | | string|mixed | [describeCommand](#method_describeCommand)([Command](../command/command "Symfony\Component\Console\Command\Command") $command, array $options = array()) Describes a Command instance. | | | string|mixed | [describeApplication](#method_describeApplication)([Application](../application "Symfony\Component\Console\Application") $application, array $options = array()) Describes an Application instance. | | Details ------- ### describe([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, object $object, array $options = array()) Describes an object if supported. #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | object | $object | | | array | $options | | ### protected write(string $content, bool $decorated = false) Writes content to output. #### Parameters | | | | | --- | --- | --- | | string | $content | | | bool | $decorated | | ### protected string|mixed describeInputArgument([InputArgument](../input/inputargument "Symfony\Component\Console\Input\InputArgument") $argument, array $options = array()) Describes an InputArgument instance. #### Parameters | | | | | --- | --- | --- | | [InputArgument](../input/inputargument "Symfony\Component\Console\Input\InputArgument") | $argument | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### protected string|mixed describeInputOption([InputOption](../input/inputoption "Symfony\Component\Console\Input\InputOption") $option, array $options = array()) Describes an InputOption instance. #### Parameters | | | | | --- | --- | --- | | [InputOption](../input/inputoption "Symfony\Component\Console\Input\InputOption") | $option | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### protected string|mixed describeInputDefinition([InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition, array $options = array()) Describes an InputDefinition instance. #### Parameters | | | | | --- | --- | --- | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### protected string|mixed describeCommand([Command](../command/command "Symfony\Component\Console\Command\Command") $command, array $options = array()) Describes a Command instance. #### Parameters | | | | | --- | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | $command | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### protected string|mixed describeApplication([Application](../application "Symfony\Component\Console\Application") $application, array $options = array()) Describes an Application instance. #### Parameters | | | | | --- | --- | --- | | [Application](../application "Symfony\Component\Console\Application") | $application | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | |
programming_docs
symfony MarkdownDescriptor MarkdownDescriptor =================== class **MarkdownDescriptor** extends [Descriptor](descriptor "Symfony\Component\Console\Descriptor\Descriptor") Markdown descriptor. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | from [Descriptor](descriptor#property_output "Symfony\Component\Console\Descriptor\Descriptor") | Methods ------- | | | | | --- | --- | --- | | | [describe](#method_describe)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, object $object, array $options = array()) Describes an object if supported. | | | | [write](#method_write)(string $content, bool $decorated = true) Writes content to output. | | | string|mixed | [describeInputArgument](#method_describeInputArgument)([InputArgument](../input/inputargument "Symfony\Component\Console\Input\InputArgument") $argument, array $options = array()) Describes an InputArgument instance. | | | string|mixed | [describeInputOption](#method_describeInputOption)([InputOption](../input/inputoption "Symfony\Component\Console\Input\InputOption") $option, array $options = array()) Describes an InputOption instance. | | | string|mixed | [describeInputDefinition](#method_describeInputDefinition)([InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition, array $options = array()) Describes an InputDefinition instance. | | | string|mixed | [describeCommand](#method_describeCommand)([Command](../command/command "Symfony\Component\Console\Command\Command") $command, array $options = array()) Describes a Command instance. | | | string|mixed | [describeApplication](#method_describeApplication)([Application](../application "Symfony\Component\Console\Application") $application, array $options = array()) Describes an Application instance. | | Details ------- ### describe([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, object $object, array $options = array()) Describes an object if supported. #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | object | $object | | | array | $options | | ### protected write(string $content, bool $decorated = true) Writes content to output. #### Parameters | | | | | --- | --- | --- | | string | $content | | | bool | $decorated | | ### protected string|mixed describeInputArgument([InputArgument](../input/inputargument "Symfony\Component\Console\Input\InputArgument") $argument, array $options = array()) Describes an InputArgument instance. #### Parameters | | | | | --- | --- | --- | | [InputArgument](../input/inputargument "Symfony\Component\Console\Input\InputArgument") | $argument | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### protected string|mixed describeInputOption([InputOption](../input/inputoption "Symfony\Component\Console\Input\InputOption") $option, array $options = array()) Describes an InputOption instance. #### Parameters | | | | | --- | --- | --- | | [InputOption](../input/inputoption "Symfony\Component\Console\Input\InputOption") | $option | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### protected string|mixed describeInputDefinition([InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition, array $options = array()) Describes an InputDefinition instance. #### Parameters | | | | | --- | --- | --- | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### protected string|mixed describeCommand([Command](../command/command "Symfony\Component\Console\Command\Command") $command, array $options = array()) Describes a Command instance. #### Parameters | | | | | --- | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | $command | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### protected string|mixed describeApplication([Application](../application "Symfony\Component\Console\Application") $application, array $options = array()) Describes an Application instance. #### Parameters | | | | | --- | --- | --- | | [Application](../application "Symfony\Component\Console\Application") | $application | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | symfony XmlDescriptor XmlDescriptor ============== class **XmlDescriptor** extends [Descriptor](descriptor "Symfony\Component\Console\Descriptor\Descriptor") XML descriptor. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | from [Descriptor](descriptor#property_output "Symfony\Component\Console\Descriptor\Descriptor") | Methods ------- | | | | | --- | --- | --- | | | [describe](#method_describe)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, object $object, array $options = array()) Describes an object if supported. | from [Descriptor](descriptor#method_describe "Symfony\Component\Console\Descriptor\Descriptor") | | | [write](#method_write)(string $content, bool $decorated = false) Writes content to output. | from [Descriptor](descriptor#method_write "Symfony\Component\Console\Descriptor\Descriptor") | | string|mixed | [describeInputArgument](#method_describeInputArgument)([InputArgument](../input/inputargument "Symfony\Component\Console\Input\InputArgument") $argument, array $options = array()) Describes an InputArgument instance. | | | string|mixed | [describeInputOption](#method_describeInputOption)([InputOption](../input/inputoption "Symfony\Component\Console\Input\InputOption") $option, array $options = array()) Describes an InputOption instance. | | | string|mixed | [describeInputDefinition](#method_describeInputDefinition)([InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition, array $options = array()) Describes an InputDefinition instance. | | | string|mixed | [describeCommand](#method_describeCommand)([Command](../command/command "Symfony\Component\Console\Command\Command") $command, array $options = array()) Describes a Command instance. | | | string|mixed | [describeApplication](#method_describeApplication)([Application](../application "Symfony\Component\Console\Application") $application, array $options = array()) Describes an Application instance. | | | [DOMDocument](http://php.net/DOMDocument) | [getInputDefinitionDocument](#method_getInputDefinitionDocument)([InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) | | | [DOMDocument](http://php.net/DOMDocument) | [getCommandDocument](#method_getCommandDocument)([Command](../command/command "Symfony\Component\Console\Command\Command") $command) | | | [DOMDocument](http://php.net/DOMDocument) | [getApplicationDocument](#method_getApplicationDocument)([Application](../application "Symfony\Component\Console\Application") $application, string|null $namespace = null) | | Details ------- ### describe([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, object $object, array $options = array()) Describes an object if supported. #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | object | $object | | | array | $options | | ### protected write(string $content, bool $decorated = false) Writes content to output. #### Parameters | | | | | --- | --- | --- | | string | $content | | | bool | $decorated | | ### protected string|mixed describeInputArgument([InputArgument](../input/inputargument "Symfony\Component\Console\Input\InputArgument") $argument, array $options = array()) Describes an InputArgument instance. #### Parameters | | | | | --- | --- | --- | | [InputArgument](../input/inputargument "Symfony\Component\Console\Input\InputArgument") | $argument | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### protected string|mixed describeInputOption([InputOption](../input/inputoption "Symfony\Component\Console\Input\InputOption") $option, array $options = array()) Describes an InputOption instance. #### Parameters | | | | | --- | --- | --- | | [InputOption](../input/inputoption "Symfony\Component\Console\Input\InputOption") | $option | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### protected string|mixed describeInputDefinition([InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition, array $options = array()) Describes an InputDefinition instance. #### Parameters | | | | | --- | --- | --- | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### protected string|mixed describeCommand([Command](../command/command "Symfony\Component\Console\Command\Command") $command, array $options = array()) Describes a Command instance. #### Parameters | | | | | --- | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | $command | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### protected string|mixed describeApplication([Application](../application "Symfony\Component\Console\Application") $application, array $options = array()) Describes an Application instance. #### Parameters | | | | | --- | --- | --- | | [Application](../application "Symfony\Component\Console\Application") | $application | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### [DOMDocument](http://php.net/DOMDocument) getInputDefinitionDocument([InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) #### Parameters | | | | | --- | --- | --- | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | | #### Return Value | | | | --- | --- | | [DOMDocument](http://php.net/DOMDocument) | | ### [DOMDocument](http://php.net/DOMDocument) getCommandDocument([Command](../command/command "Symfony\Component\Console\Command\Command") $command) #### Parameters | | | | | --- | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | $command | | #### Return Value | | | | --- | --- | | [DOMDocument](http://php.net/DOMDocument) | | ### [DOMDocument](http://php.net/DOMDocument) getApplicationDocument([Application](../application "Symfony\Component\Console\Application") $application, string|null $namespace = null) #### Parameters | | | | | --- | --- | --- | | [Application](../application "Symfony\Component\Console\Application") | $application | | | string|null | $namespace | | #### Return Value | | | | --- | --- | | [DOMDocument](http://php.net/DOMDocument) | | symfony DescriptorInterface DescriptorInterface ==================== interface **DescriptorInterface** Descriptor interface. Methods ------- | | | | | --- | --- | --- | | | [describe](#method_describe)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, object $object, array $options = array()) Describes an object if supported. | | Details ------- ### describe([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, object $object, array $options = array()) Describes an object if supported. #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | object | $object | | | array | $options | | symfony TextDescriptor TextDescriptor =============== class **TextDescriptor** extends [Descriptor](descriptor "Symfony\Component\Console\Descriptor\Descriptor") Text descriptor. Properties ---------- | | | | | | --- | --- | --- | --- | | protected [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | from [Descriptor](descriptor#property_output "Symfony\Component\Console\Descriptor\Descriptor") | Methods ------- | | | | | --- | --- | --- | | | [describe](#method_describe)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, object $object, array $options = array()) Describes an object if supported. | from [Descriptor](descriptor#method_describe "Symfony\Component\Console\Descriptor\Descriptor") | | | [write](#method_write)(string $content, bool $decorated = false) Writes content to output. | from [Descriptor](descriptor#method_write "Symfony\Component\Console\Descriptor\Descriptor") | | string|mixed | [describeInputArgument](#method_describeInputArgument)([InputArgument](../input/inputargument "Symfony\Component\Console\Input\InputArgument") $argument, array $options = array()) Describes an InputArgument instance. | | | string|mixed | [describeInputOption](#method_describeInputOption)([InputOption](../input/inputoption "Symfony\Component\Console\Input\InputOption") $option, array $options = array()) Describes an InputOption instance. | | | string|mixed | [describeInputDefinition](#method_describeInputDefinition)([InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition, array $options = array()) Describes an InputDefinition instance. | | | string|mixed | [describeCommand](#method_describeCommand)([Command](../command/command "Symfony\Component\Console\Command\Command") $command, array $options = array()) Describes a Command instance. | | | string|mixed | [describeApplication](#method_describeApplication)([Application](../application "Symfony\Component\Console\Application") $application, array $options = array()) Describes an Application instance. | | Details ------- ### describe([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, object $object, array $options = array()) Describes an object if supported. #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | object | $object | | | array | $options | | ### protected write(string $content, bool $decorated = false) Writes content to output. #### Parameters | | | | | --- | --- | --- | | string | $content | | | bool | $decorated | | ### protected string|mixed describeInputArgument([InputArgument](../input/inputargument "Symfony\Component\Console\Input\InputArgument") $argument, array $options = array()) Describes an InputArgument instance. #### Parameters | | | | | --- | --- | --- | | [InputArgument](../input/inputargument "Symfony\Component\Console\Input\InputArgument") | $argument | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### protected string|mixed describeInputOption([InputOption](../input/inputoption "Symfony\Component\Console\Input\InputOption") $option, array $options = array()) Describes an InputOption instance. #### Parameters | | | | | --- | --- | --- | | [InputOption](../input/inputoption "Symfony\Component\Console\Input\InputOption") | $option | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### protected string|mixed describeInputDefinition([InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition, array $options = array()) Describes an InputDefinition instance. #### Parameters | | | | | --- | --- | --- | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### protected string|mixed describeCommand([Command](../command/command "Symfony\Component\Console\Command\Command") $command, array $options = array()) Describes a Command instance. #### Parameters | | | | | --- | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | $command | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | ### protected string|mixed describeApplication([Application](../application "Symfony\Component\Console\Application") $application, array $options = array()) Describes an Application instance. #### Parameters | | | | | --- | --- | --- | | [Application](../application "Symfony\Component\Console\Application") | $application | | | array | $options | | #### Return Value | | | | --- | --- | | string|mixed | | symfony ApplicationDescription ApplicationDescription ======================= class **ApplicationDescription** Constants --------- | | | | --- | --- | | GLOBAL\_NAMESPACE | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([Application](../application "Symfony\Component\Console\Application") $application, string $namespace = null, bool $showHidden = false) | | | array | [getNamespaces](#method_getNamespaces)() | | | [Command](../command/command "Symfony\Component\Console\Command\Command")[] | [getCommands](#method_getCommands)() | | | [Command](../command/command "Symfony\Component\Console\Command\Command") | [getCommand](#method_getCommand)(string $name) | | Details ------- ### \_\_construct([Application](../application "Symfony\Component\Console\Application") $application, string $namespace = null, bool $showHidden = false) #### Parameters | | | | | --- | --- | --- | | [Application](../application "Symfony\Component\Console\Application") | $application | | | string | $namespace | | | bool | $showHidden | | ### array getNamespaces() #### Return Value | | | | --- | --- | | array | | ### [Command](../command/command "Symfony\Component\Console\Command\Command")[] getCommands() #### Return Value | | | | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command")[] | | ### [Command](../command/command "Symfony\Component\Console\Command\Command") getCommand(string $name) #### Parameters | | | | | --- | --- | --- | | string | $name | | #### Return Value | | | | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | | #### Exceptions | | | | --- | --- | | [CommandNotFoundException](../exception/commandnotfoundexception "Symfony\Component\Console\Exception\CommandNotFoundException") | | symfony ApplicationTester ApplicationTester ================== class **ApplicationTester** Eases the testing of console applications. When testing an application, don't forget to disable the auto exit flag: ``` $application = new Application(); $application->setAutoExit(false); ``` Traits ------ | | | | --- | --- | | [TesterTrait](testertrait "Symfony\Component\Console\Tester\TesterTrait") | | Methods ------- | | | | | --- | --- | --- | | string | [getDisplay](#method_getDisplay)(bool $normalize = false) Gets the display returned by the last execution of the command or application. | from [TesterTrait](testertrait#method_getDisplay "Symfony\Component\Console\Tester\TesterTrait") | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | [getInput](#method_getInput)() Gets the input instance used by the last execution of the command or application. | from [TesterTrait](testertrait#method_getInput "Symfony\Component\Console\Tester\TesterTrait") | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | [getOutput](#method_getOutput)() Gets the output instance used by the last execution of the command or application. | from [TesterTrait](testertrait#method_getOutput "Symfony\Component\Console\Tester\TesterTrait") | | int | [getStatusCode](#method_getStatusCode)() Gets the status code returned by the last execution of the command or application. | from [TesterTrait](testertrait#method_getStatusCode "Symfony\Component\Console\Tester\TesterTrait") | | [TesterTrait](testertrait "Symfony\Component\Console\Tester\TesterTrait") | [setInputs](#method_setInputs)(array $inputs) Sets the user inputs. | from [TesterTrait](testertrait#method_setInputs "Symfony\Component\Console\Tester\TesterTrait") | | | [\_\_construct](#method___construct)([Application](../application "Symfony\Component\Console\Application") $application) | | | int | [run](#method_run)(array $input, array $options = array()) Executes the application. | | | string | [getErrorOutput](#method_getErrorOutput)(bool $normalize = false) Gets the output written to STDERR by the application. | | Details ------- ### string getDisplay(bool $normalize = false) Gets the display returned by the last execution of the command or application. #### Parameters | | | | | --- | --- | --- | | bool | $normalize | Whether to normalize end of lines to \n or not | #### Return Value | | | | --- | --- | | string | The display | ### [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") getInput() Gets the input instance used by the last execution of the command or application. #### Return Value | | | | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | The current input instance | ### [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") getOutput() Gets the output instance used by the last execution of the command or application. #### Return Value | | | | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | The current output instance | ### int getStatusCode() Gets the status code returned by the last execution of the command or application. #### Return Value | | | | --- | --- | | int | The status code | ### [TesterTrait](testertrait "Symfony\Component\Console\Tester\TesterTrait") setInputs(array $inputs) Sets the user inputs. #### Parameters | | | | | --- | --- | --- | | array | $inputs | array An array of strings representing each input passed to the command input stream | #### Return Value | | | | --- | --- | | [TesterTrait](testertrait "Symfony\Component\Console\Tester\TesterTrait") | | ### \_\_construct([Application](../application "Symfony\Component\Console\Application") $application) #### Parameters | | | | | --- | --- | --- | | [Application](../application "Symfony\Component\Console\Application") | $application | | ### int run(array $input, array $options = array()) Executes the application. Available options: * interactive: Sets the input interactive flag * decorated: Sets the output decorated flag * verbosity: Sets the output verbosity flag * capture\_stderr\_separately: Make output of stdOut and stdErr separately available #### Parameters | | | | | --- | --- | --- | | array | $input | An array of arguments and options | | array | $options | An array of options | #### Return Value | | | | --- | --- | | int | The command exit code | ### string getErrorOutput(bool $normalize = false) Gets the output written to STDERR by the application. #### Parameters | | | | | --- | --- | --- | | bool | $normalize | Whether to normalize end of lines to \n or not | #### Return Value | | | | --- | --- | | string | |
programming_docs
symfony CommandTester CommandTester ============== class **CommandTester** Eases the testing of console commands. Traits ------ | | | | --- | --- | | [TesterTrait](testertrait "Symfony\Component\Console\Tester\TesterTrait") | | Methods ------- | | | | | --- | --- | --- | | string | [getDisplay](#method_getDisplay)(bool $normalize = false) Gets the display returned by the last execution of the command or application. | from [TesterTrait](testertrait#method_getDisplay "Symfony\Component\Console\Tester\TesterTrait") | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | [getInput](#method_getInput)() Gets the input instance used by the last execution of the command or application. | from [TesterTrait](testertrait#method_getInput "Symfony\Component\Console\Tester\TesterTrait") | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | [getOutput](#method_getOutput)() Gets the output instance used by the last execution of the command or application. | from [TesterTrait](testertrait#method_getOutput "Symfony\Component\Console\Tester\TesterTrait") | | int | [getStatusCode](#method_getStatusCode)() Gets the status code returned by the last execution of the command or application. | from [TesterTrait](testertrait#method_getStatusCode "Symfony\Component\Console\Tester\TesterTrait") | | [TesterTrait](testertrait "Symfony\Component\Console\Tester\TesterTrait") | [setInputs](#method_setInputs)(array $inputs) Sets the user inputs. | from [TesterTrait](testertrait#method_setInputs "Symfony\Component\Console\Tester\TesterTrait") | | | [\_\_construct](#method___construct)([Command](../command/command "Symfony\Component\Console\Command\Command") $command) | | | int | [execute](#method_execute)(array $input, array $options = array()) Executes the command. | | Details ------- ### string getDisplay(bool $normalize = false) Gets the display returned by the last execution of the command or application. #### Parameters | | | | | --- | --- | --- | | bool | $normalize | Whether to normalize end of lines to \n or not | #### Return Value | | | | --- | --- | | string | The display | ### [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") getInput() Gets the input instance used by the last execution of the command or application. #### Return Value | | | | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | The current input instance | ### [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") getOutput() Gets the output instance used by the last execution of the command or application. #### Return Value | | | | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | The current output instance | ### int getStatusCode() Gets the status code returned by the last execution of the command or application. #### Return Value | | | | --- | --- | | int | The status code | ### [TesterTrait](testertrait "Symfony\Component\Console\Tester\TesterTrait") setInputs(array $inputs) Sets the user inputs. #### Parameters | | | | | --- | --- | --- | | array | $inputs | array An array of strings representing each input passed to the command input stream | #### Return Value | | | | --- | --- | | [TesterTrait](testertrait "Symfony\Component\Console\Tester\TesterTrait") | | ### \_\_construct([Command](../command/command "Symfony\Component\Console\Command\Command") $command) #### Parameters | | | | | --- | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | $command | | ### int execute(array $input, array $options = array()) Executes the command. Available execution options: * interactive: Sets the input interactive flag * decorated: Sets the output decorated flag * verbosity: Sets the output verbosity flag #### Parameters | | | | | --- | --- | --- | | array | $input | An array of command arguments and options | | array | $options | An array of execution options | #### Return Value | | | | --- | --- | | int | The command exit code | symfony TesterTrait TesterTrait ============ trait **TesterTrait** Methods ------- | | | | | --- | --- | --- | | string | [getDisplay](#method_getDisplay)(bool $normalize = false) Gets the display returned by the last execution of the command or application. | | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | [getInput](#method_getInput)() Gets the input instance used by the last execution of the command or application. | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | [getOutput](#method_getOutput)() Gets the output instance used by the last execution of the command or application. | | | int | [getStatusCode](#method_getStatusCode)() Gets the status code returned by the last execution of the command or application. | | | [TesterTrait](testertrait "Symfony\Component\Console\Tester\TesterTrait") | [setInputs](#method_setInputs)(array $inputs) Sets the user inputs. | | Details ------- ### string getDisplay(bool $normalize = false) Gets the display returned by the last execution of the command or application. #### Parameters | | | | | --- | --- | --- | | bool | $normalize | Whether to normalize end of lines to \n or not | #### Return Value | | | | --- | --- | | string | The display | ### [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") getInput() Gets the input instance used by the last execution of the command or application. #### Return Value | | | | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | The current input instance | ### [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") getOutput() Gets the output instance used by the last execution of the command or application. #### Return Value | | | | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | The current output instance | ### int getStatusCode() Gets the status code returned by the last execution of the command or application. #### Return Value | | | | --- | --- | | int | The status code | ### [TesterTrait](testertrait "Symfony\Component\Console\Tester\TesterTrait") setInputs(array $inputs) Sets the user inputs. #### Parameters | | | | | --- | --- | --- | | array | $inputs | array An array of strings representing each input passed to the command input stream | #### Return Value | | | | --- | --- | | [TesterTrait](testertrait "Symfony\Component\Console\Tester\TesterTrait") | | symfony ListCommand ListCommand ============ class **ListCommand** extends [Command](command "Symfony\Component\Console\Command\Command") ListCommand displays the list of all available commands for the application. Properties ---------- | | | | | | --- | --- | --- | --- | | static protected string|null | $defaultName | | from [Command](command#property_defaultName "Symfony\Component\Console\Command\Command") | Methods ------- | | | | | --- | --- | --- | | static string|null | [getDefaultName](#method_getDefaultName)() | from [Command](command#method_getDefaultName "Symfony\Component\Console\Command\Command") | | | [\_\_construct](#method___construct)(string $name = null) | from [Command](command#method___construct "Symfony\Component\Console\Command\Command") | | | [ignoreValidationErrors](#method_ignoreValidationErrors)() Ignores validation errors. | from [Command](command#method_ignoreValidationErrors "Symfony\Component\Console\Command\Command") | | | [setApplication](#method_setApplication)([Application](../application "Symfony\Component\Console\Application") $application = null) | from [Command](command#method_setApplication "Symfony\Component\Console\Command\Command") | | | [setHelperSet](#method_setHelperSet)([HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) | from [Command](command#method_setHelperSet "Symfony\Component\Console\Command\Command") | | [HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set. | from [Command](command#method_getHelperSet "Symfony\Component\Console\Command\Command") | | [Application](../application "Symfony\Component\Console\Application") | [getApplication](#method_getApplication)() Gets the application instance for this command. | from [Command](command#method_getApplication "Symfony\Component\Console\Command\Command") | | bool | [isEnabled](#method_isEnabled)() Checks whether the command is enabled or not in the current environment. | from [Command](command#method_isEnabled "Symfony\Component\Console\Command\Command") | | | [configure](#method_configure)() Configures the current command. | | | int|null | [execute](#method_execute)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. | | | | [interact](#method_interact)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. | from [Command](command#method_interact "Symfony\Component\Console\Command\Command") | | | [initialize](#method_initialize)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. | from [Command](command#method_initialize "Symfony\Component\Console\Command\Command") | | int | [run](#method_run)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. | from [Command](command#method_run "Symfony\Component\Console\Command\Command") | | $this | [setCode](#method_setCode)(callable $code) Sets the code to execute when running this command. | from [Command](command#method_setCode "Symfony\Component\Console\Command\Command") | | | [mergeApplicationDefinition](#method_mergeApplicationDefinition)(bool $mergeArgs = true) Merges the application definition with the command definition. | from [Command](command#method_mergeApplicationDefinition "Symfony\Component\Console\Command\Command") | | $this | [setDefinition](#method_setDefinition)(array|[InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. | from [Command](command#method_setDefinition "Symfony\Component\Console\Command\Command") | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getDefinition](#method_getDefinition)() Gets the InputDefinition attached to this Command. | from [Command](command#method_getDefinition "Symfony\Component\Console\Command\Command") | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getNativeDefinition](#method_getNativeDefinition)() Gets the InputDefinition to be used to create representations of this Command. | | | $this | [addArgument](#method_addArgument)(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. | from [Command](command#method_addArgument "Symfony\Component\Console\Command\Command") | | $this | [addOption](#method_addOption)(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. | from [Command](command#method_addOption "Symfony\Component\Console\Command\Command") | | $this | [setName](#method_setName)(string $name) Sets the name of the command. | from [Command](command#method_setName "Symfony\Component\Console\Command\Command") | | $this | [setProcessTitle](#method_setProcessTitle)(string $title) Sets the process title of the command. | from [Command](command#method_setProcessTitle "Symfony\Component\Console\Command\Command") | | string | [getName](#method_getName)() Returns the command name. | from [Command](command#method_getName "Symfony\Component\Console\Command\Command") | | [Command](command "Symfony\Component\Console\Command\Command") | [setHidden](#method_setHidden)(bool $hidden) | from [Command](command#method_setHidden "Symfony\Component\Console\Command\Command") | | bool | [isHidden](#method_isHidden)() | from [Command](command#method_isHidden "Symfony\Component\Console\Command\Command") | | $this | [setDescription](#method_setDescription)(string $description) Sets the description for the command. | from [Command](command#method_setDescription "Symfony\Component\Console\Command\Command") | | string | [getDescription](#method_getDescription)() Returns the description for the command. | from [Command](command#method_getDescription "Symfony\Component\Console\Command\Command") | | $this | [setHelp](#method_setHelp)(string $help) Sets the help for the command. | from [Command](command#method_setHelp "Symfony\Component\Console\Command\Command") | | string | [getHelp](#method_getHelp)() Returns the help for the command. | from [Command](command#method_getHelp "Symfony\Component\Console\Command\Command") | | string | [getProcessedHelp](#method_getProcessedHelp)() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. | from [Command](command#method_getProcessedHelp "Symfony\Component\Console\Command\Command") | | $this | [setAliases](#method_setAliases)(string[] $aliases) Sets the aliases for the command. | from [Command](command#method_setAliases "Symfony\Component\Console\Command\Command") | | array | [getAliases](#method_getAliases)() Returns the aliases for the command. | from [Command](command#method_getAliases "Symfony\Component\Console\Command\Command") | | string | [getSynopsis](#method_getSynopsis)(bool $short = false) Returns the synopsis for the command. | from [Command](command#method_getSynopsis "Symfony\Component\Console\Command\Command") | | $this | [addUsage](#method_addUsage)(string $usage) Add a command usage example. | from [Command](command#method_addUsage "Symfony\Component\Console\Command\Command") | | array | [getUsages](#method_getUsages)() Returns alternative usages of the command. | from [Command](command#method_getUsages "Symfony\Component\Console\Command\Command") | | mixed | [getHelper](#method_getHelper)(string $name) Gets a helper instance by name. | from [Command](command#method_getHelper "Symfony\Component\Console\Command\Command") | Details ------- ### static string|null getDefaultName() #### Return Value | | | | --- | --- | | string|null | The default command name or null when no default name is set | ### \_\_construct(string $name = null) #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the command; passing null means it must be set in configure() | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When the command name is empty | ### ignoreValidationErrors() Ignores validation errors. This is mainly useful for the help command. ### setApplication([Application](../application "Symfony\Component\Console\Application") $application = null) #### Parameters | | | | | --- | --- | --- | | [Application](../application "Symfony\Component\Console\Application") | $application | | ### setHelperSet([HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) #### Parameters | | | | | --- | --- | --- | | [HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set. #### Return Value | | | | --- | --- | | [HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### [Application](../application "Symfony\Component\Console\Application") getApplication() Gets the application instance for this command. #### Return Value | | | | --- | --- | | [Application](../application "Symfony\Component\Console\Application") | An Application instance | ### bool isEnabled() Checks whether the command is enabled or not in the current environment. Override this to check for x or y and return false if the command can not run properly under the current conditions. #### Return Value | | | | --- | --- | | bool | | ### protected configure() Configures the current command. ### protected int|null execute([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. This method is not abstract because you can use this class as a concrete class. In this case, instead of defining the execute() method, you set the code to execute by passing a Closure to the setCode() method. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int|null | null or 0 if everything went fine, or an error code | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When this abstract method is not implemented | ### protected interact([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. This method is executed before the InputDefinition is validated. This means that this is the only place where the command can interactively ask for values of missing required arguments. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### protected initialize([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. This is mainly useful when a lot of commands extends one main command where some things need to be initialized based on the input arguments and options. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### See also | | | | --- | --- | | [InputInterface::bind](../input/inputinterface#method_bind "Symfony\Component\Console\Input\InputInterface") | | | [InputInterface::validate](../input/inputinterface#method_validate "Symfony\Component\Console\Input\InputInterface") | | ### int run([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. The code to execute is either defined directly with the setCode() method or by overriding the execute() method in a sub-class. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int | The command exit code | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | When binding input fails. Bypass this by calling {@link ignoreValidationErrors()}. | #### See also | | | | --- | --- | | setCode() | | | execute() | | ### $this setCode(callable $code) Sets the code to execute when running this command. If this method is used, it overrides the code defined in the execute() method. #### Parameters | | | | | --- | --- | --- | | callable | $code | A callable(InputInterface $input, OutputInterface $output) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | | #### See also | | | | --- | --- | | execute() | | ### mergeApplicationDefinition(bool $mergeArgs = true) Merges the application definition with the command definition. This method is not part of public API and should not be used directly. #### Parameters | | | | | --- | --- | --- | | bool | $mergeArgs | Whether to merge or not the Application definition arguments to Command definition arguments | ### $this setDefinition(array|[InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. #### Parameters | | | | | --- | --- | --- | | array|[InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | An array of argument and option instances or a definition instance | #### Return Value | | | | --- | --- | | $this | | ### [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getDefinition() Gets the InputDefinition attached to this Command. #### Return Value | | | | --- | --- | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getNativeDefinition() Gets the InputDefinition to be used to create representations of this Command. Can be overridden to provide the original command representation when it would otherwise be changed by merging with the application InputDefinition. This method is not part of public API and should not be used directly. #### Return Value | | | | --- | --- | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### $this addArgument(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | | int|null | $mode | The argument mode: self::REQUIRED or self::OPTIONAL | | string | $description | A description text | | string|string[]|null | $default | The default value (for self::OPTIONAL mode only) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument mode is not valid | ### $this addOption(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | | string|array | $shortcut | The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts | | int|null | $mode | The option mode: One of the VALUE\_\* constants | | string | $description | A description text | | string|string[]|bool|null | $default | The default value (must be null for self::VALUE\_NONE) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | If option mode is invalid or incompatible | ### $this setName(string $name) Sets the name of the command. This method can set both the namespace and the name if you separate them by a colon (:) ``` $command->setName('foo:bar'); ``` #### Parameters | | | | | --- | --- | --- | | string | $name | The command name | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When the name is invalid | ### $this setProcessTitle(string $title) Sets the process title of the command. This feature should be used only when creating a long process command, like a daemon. PHP 5.5+ or the proctitle PECL library is required #### Parameters | | | | | --- | --- | --- | | string | $title | The process title | #### Return Value | | | | --- | --- | | $this | | ### string getName() Returns the command name. #### Return Value | | | | --- | --- | | string | The command name | ### [Command](command "Symfony\Component\Console\Command\Command") setHidden(bool $hidden) #### Parameters | | | | | --- | --- | --- | | bool | $hidden | Whether or not the command should be hidden from the list of commands | #### Return Value | | | | --- | --- | | [Command](command "Symfony\Component\Console\Command\Command") | The current instance | ### bool isHidden() #### Return Value | | | | --- | --- | | bool | whether the command should be publicly shown or not | ### $this setDescription(string $description) Sets the description for the command. #### Parameters | | | | | --- | --- | --- | | string | $description | The description for the command | #### Return Value | | | | --- | --- | | $this | | ### string getDescription() Returns the description for the command. #### Return Value | | | | --- | --- | | string | The description for the command | ### $this setHelp(string $help) Sets the help for the command. #### Parameters | | | | | --- | --- | --- | | string | $help | The help for the command | #### Return Value | | | | --- | --- | | $this | | ### string getHelp() Returns the help for the command. #### Return Value | | | | --- | --- | | string | The help for the command | ### string getProcessedHelp() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. #### Return Value | | | | --- | --- | | string | The processed help for the command | ### $this setAliases(string[] $aliases) Sets the aliases for the command. #### Parameters | | | | | --- | --- | --- | | string[] | $aliases | An array of aliases for the command | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When an alias is invalid | ### array getAliases() Returns the aliases for the command. #### Return Value | | | | --- | --- | | array | An array of aliases for the command | ### string getSynopsis(bool $short = false) Returns the synopsis for the command. #### Parameters | | | | | --- | --- | --- | | bool | $short | Whether to show the short version of the synopsis (with options folded) or not | #### Return Value | | | | --- | --- | | string | The synopsis | ### $this addUsage(string $usage) Add a command usage example. #### Parameters | | | | | --- | --- | --- | | string | $usage | The usage, it'll be prefixed with the command name | #### Return Value | | | | --- | --- | | $this | | ### array getUsages() Returns alternative usages of the command. #### Return Value | | | | --- | --- | | array | | ### mixed getHelper(string $name) Gets a helper instance by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The helper name | #### Return Value | | | | --- | --- | | mixed | The helper value | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | if no HelperSet is defined | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | if the helper is not defined |
programming_docs
symfony Command Command ======== class **Command** Base class for all commands. Properties ---------- | | | | | | --- | --- | --- | --- | | static protected string|null | $defaultName | | | Methods ------- | | | | | --- | --- | --- | | static string|null | [getDefaultName](#method_getDefaultName)() | | | | [\_\_construct](#method___construct)(string $name = null) | | | | [ignoreValidationErrors](#method_ignoreValidationErrors)() Ignores validation errors. | | | | [setApplication](#method_setApplication)([Application](../application "Symfony\Component\Console\Application") $application = null) | | | | [setHelperSet](#method_setHelperSet)([HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) | | | [HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set. | | | [Application](../application "Symfony\Component\Console\Application") | [getApplication](#method_getApplication)() Gets the application instance for this command. | | | bool | [isEnabled](#method_isEnabled)() Checks whether the command is enabled or not in the current environment. | | | | [configure](#method_configure)() Configures the current command. | | | int|null | [execute](#method_execute)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. | | | | [interact](#method_interact)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. | | | | [initialize](#method_initialize)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. | | | int | [run](#method_run)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. | | | $this | [setCode](#method_setCode)(callable $code) Sets the code to execute when running this command. | | | | [mergeApplicationDefinition](#method_mergeApplicationDefinition)(bool $mergeArgs = true) Merges the application definition with the command definition. | | | $this | [setDefinition](#method_setDefinition)(array|[InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. | | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getDefinition](#method_getDefinition)() Gets the InputDefinition attached to this Command. | | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getNativeDefinition](#method_getNativeDefinition)() Gets the InputDefinition to be used to create representations of this Command. | | | $this | [addArgument](#method_addArgument)(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. | | | $this | [addOption](#method_addOption)(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. | | | $this | [setName](#method_setName)(string $name) Sets the name of the command. | | | $this | [setProcessTitle](#method_setProcessTitle)(string $title) Sets the process title of the command. | | | string | [getName](#method_getName)() Returns the command name. | | | [Command](command "Symfony\Component\Console\Command\Command") | [setHidden](#method_setHidden)(bool $hidden) | | | bool | [isHidden](#method_isHidden)() | | | $this | [setDescription](#method_setDescription)(string $description) Sets the description for the command. | | | string | [getDescription](#method_getDescription)() Returns the description for the command. | | | $this | [setHelp](#method_setHelp)(string $help) Sets the help for the command. | | | string | [getHelp](#method_getHelp)() Returns the help for the command. | | | string | [getProcessedHelp](#method_getProcessedHelp)() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. | | | $this | [setAliases](#method_setAliases)(string[] $aliases) Sets the aliases for the command. | | | array | [getAliases](#method_getAliases)() Returns the aliases for the command. | | | string | [getSynopsis](#method_getSynopsis)(bool $short = false) Returns the synopsis for the command. | | | $this | [addUsage](#method_addUsage)(string $usage) Add a command usage example. | | | array | [getUsages](#method_getUsages)() Returns alternative usages of the command. | | | mixed | [getHelper](#method_getHelper)(string $name) Gets a helper instance by name. | | Details ------- ### static string|null getDefaultName() #### Return Value | | | | --- | --- | | string|null | The default command name or null when no default name is set | ### \_\_construct(string $name = null) #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the command; passing null means it must be set in configure() | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When the command name is empty | ### ignoreValidationErrors() Ignores validation errors. This is mainly useful for the help command. ### setApplication([Application](../application "Symfony\Component\Console\Application") $application = null) #### Parameters | | | | | --- | --- | --- | | [Application](../application "Symfony\Component\Console\Application") | $application | | ### setHelperSet([HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) #### Parameters | | | | | --- | --- | --- | | [HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set. #### Return Value | | | | --- | --- | | [HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### [Application](../application "Symfony\Component\Console\Application") getApplication() Gets the application instance for this command. #### Return Value | | | | --- | --- | | [Application](../application "Symfony\Component\Console\Application") | An Application instance | ### bool isEnabled() Checks whether the command is enabled or not in the current environment. Override this to check for x or y and return false if the command can not run properly under the current conditions. #### Return Value | | | | --- | --- | | bool | | ### protected configure() Configures the current command. ### protected int|null execute([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. This method is not abstract because you can use this class as a concrete class. In this case, instead of defining the execute() method, you set the code to execute by passing a Closure to the setCode() method. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int|null | null or 0 if everything went fine, or an error code | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When this abstract method is not implemented | #### See also | | | | --- | --- | | setCode() | | ### protected interact([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. This method is executed before the InputDefinition is validated. This means that this is the only place where the command can interactively ask for values of missing required arguments. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### protected initialize([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. This is mainly useful when a lot of commands extends one main command where some things need to be initialized based on the input arguments and options. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### See also | | | | --- | --- | | [InputInterface::bind](../input/inputinterface#method_bind "Symfony\Component\Console\Input\InputInterface") | | | [InputInterface::validate](../input/inputinterface#method_validate "Symfony\Component\Console\Input\InputInterface") | | ### int run([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. The code to execute is either defined directly with the setCode() method or by overriding the execute() method in a sub-class. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int | The command exit code | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | When binding input fails. Bypass this by calling {@link ignoreValidationErrors()}. | #### See also | | | | --- | --- | | setCode() | | | execute() | | ### $this setCode(callable $code) Sets the code to execute when running this command. If this method is used, it overrides the code defined in the execute() method. #### Parameters | | | | | --- | --- | --- | | callable | $code | A callable(InputInterface $input, OutputInterface $output) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | | #### See also | | | | --- | --- | | execute() | | ### mergeApplicationDefinition(bool $mergeArgs = true) Merges the application definition with the command definition. This method is not part of public API and should not be used directly. #### Parameters | | | | | --- | --- | --- | | bool | $mergeArgs | Whether to merge or not the Application definition arguments to Command definition arguments | ### $this setDefinition(array|[InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. #### Parameters | | | | | --- | --- | --- | | array|[InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | An array of argument and option instances or a definition instance | #### Return Value | | | | --- | --- | | $this | | ### [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getDefinition() Gets the InputDefinition attached to this Command. #### Return Value | | | | --- | --- | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getNativeDefinition() Gets the InputDefinition to be used to create representations of this Command. Can be overridden to provide the original command representation when it would otherwise be changed by merging with the application InputDefinition. This method is not part of public API and should not be used directly. #### Return Value | | | | --- | --- | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### $this addArgument(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | | int|null | $mode | The argument mode: self::REQUIRED or self::OPTIONAL | | string | $description | A description text | | string|string[]|null | $default | The default value (for self::OPTIONAL mode only) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument mode is not valid | ### $this addOption(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | | string|array | $shortcut | The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts | | int|null | $mode | The option mode: One of the VALUE\_\* constants | | string | $description | A description text | | string|string[]|bool|null | $default | The default value (must be null for self::VALUE\_NONE) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | If option mode is invalid or incompatible | ### $this setName(string $name) Sets the name of the command. This method can set both the namespace and the name if you separate them by a colon (:) ``` $command->setName('foo:bar'); ``` #### Parameters | | | | | --- | --- | --- | | string | $name | The command name | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When the name is invalid | ### $this setProcessTitle(string $title) Sets the process title of the command. This feature should be used only when creating a long process command, like a daemon. PHP 5.5+ or the proctitle PECL library is required #### Parameters | | | | | --- | --- | --- | | string | $title | The process title | #### Return Value | | | | --- | --- | | $this | | ### string getName() Returns the command name. #### Return Value | | | | --- | --- | | string | The command name | ### [Command](command "Symfony\Component\Console\Command\Command") setHidden(bool $hidden) #### Parameters | | | | | --- | --- | --- | | bool | $hidden | Whether or not the command should be hidden from the list of commands | #### Return Value | | | | --- | --- | | [Command](command "Symfony\Component\Console\Command\Command") | The current instance | ### bool isHidden() #### Return Value | | | | --- | --- | | bool | whether the command should be publicly shown or not | ### $this setDescription(string $description) Sets the description for the command. #### Parameters | | | | | --- | --- | --- | | string | $description | The description for the command | #### Return Value | | | | --- | --- | | $this | | ### string getDescription() Returns the description for the command. #### Return Value | | | | --- | --- | | string | The description for the command | ### $this setHelp(string $help) Sets the help for the command. #### Parameters | | | | | --- | --- | --- | | string | $help | The help for the command | #### Return Value | | | | --- | --- | | $this | | ### string getHelp() Returns the help for the command. #### Return Value | | | | --- | --- | | string | The help for the command | ### string getProcessedHelp() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. #### Return Value | | | | --- | --- | | string | The processed help for the command | ### $this setAliases(string[] $aliases) Sets the aliases for the command. #### Parameters | | | | | --- | --- | --- | | string[] | $aliases | An array of aliases for the command | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When an alias is invalid | ### array getAliases() Returns the aliases for the command. #### Return Value | | | | --- | --- | | array | An array of aliases for the command | ### string getSynopsis(bool $short = false) Returns the synopsis for the command. #### Parameters | | | | | --- | --- | --- | | bool | $short | Whether to show the short version of the synopsis (with options folded) or not | #### Return Value | | | | --- | --- | | string | The synopsis | ### $this addUsage(string $usage) Add a command usage example. #### Parameters | | | | | --- | --- | --- | | string | $usage | The usage, it'll be prefixed with the command name | #### Return Value | | | | --- | --- | | $this | | ### array getUsages() Returns alternative usages of the command. #### Return Value | | | | --- | --- | | array | | ### mixed getHelper(string $name) Gets a helper instance by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The helper name | #### Return Value | | | | --- | --- | | mixed | The helper value | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | if no HelperSet is defined | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | if the helper is not defined | symfony HelpCommand HelpCommand ============ class **HelpCommand** extends [Command](command "Symfony\Component\Console\Command\Command") HelpCommand displays the help for a given command. Properties ---------- | | | | | | --- | --- | --- | --- | | static protected string|null | $defaultName | | from [Command](command#property_defaultName "Symfony\Component\Console\Command\Command") | Methods ------- | | | | | --- | --- | --- | | static string|null | [getDefaultName](#method_getDefaultName)() | from [Command](command#method_getDefaultName "Symfony\Component\Console\Command\Command") | | | [\_\_construct](#method___construct)(string $name = null) | from [Command](command#method___construct "Symfony\Component\Console\Command\Command") | | | [ignoreValidationErrors](#method_ignoreValidationErrors)() Ignores validation errors. | from [Command](command#method_ignoreValidationErrors "Symfony\Component\Console\Command\Command") | | | [setApplication](#method_setApplication)([Application](../application "Symfony\Component\Console\Application") $application = null) | from [Command](command#method_setApplication "Symfony\Component\Console\Command\Command") | | | [setHelperSet](#method_setHelperSet)([HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) | from [Command](command#method_setHelperSet "Symfony\Component\Console\Command\Command") | | [HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set. | from [Command](command#method_getHelperSet "Symfony\Component\Console\Command\Command") | | [Application](../application "Symfony\Component\Console\Application") | [getApplication](#method_getApplication)() Gets the application instance for this command. | from [Command](command#method_getApplication "Symfony\Component\Console\Command\Command") | | bool | [isEnabled](#method_isEnabled)() Checks whether the command is enabled or not in the current environment. | from [Command](command#method_isEnabled "Symfony\Component\Console\Command\Command") | | | [configure](#method_configure)() Configures the current command. | | | int|null | [execute](#method_execute)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. | | | | [interact](#method_interact)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. | from [Command](command#method_interact "Symfony\Component\Console\Command\Command") | | | [initialize](#method_initialize)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. | from [Command](command#method_initialize "Symfony\Component\Console\Command\Command") | | int | [run](#method_run)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. | from [Command](command#method_run "Symfony\Component\Console\Command\Command") | | $this | [setCode](#method_setCode)(callable $code) Sets the code to execute when running this command. | from [Command](command#method_setCode "Symfony\Component\Console\Command\Command") | | | [mergeApplicationDefinition](#method_mergeApplicationDefinition)(bool $mergeArgs = true) Merges the application definition with the command definition. | from [Command](command#method_mergeApplicationDefinition "Symfony\Component\Console\Command\Command") | | $this | [setDefinition](#method_setDefinition)(array|[InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. | from [Command](command#method_setDefinition "Symfony\Component\Console\Command\Command") | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getDefinition](#method_getDefinition)() Gets the InputDefinition attached to this Command. | from [Command](command#method_getDefinition "Symfony\Component\Console\Command\Command") | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getNativeDefinition](#method_getNativeDefinition)() Gets the InputDefinition to be used to create representations of this Command. | from [Command](command#method_getNativeDefinition "Symfony\Component\Console\Command\Command") | | $this | [addArgument](#method_addArgument)(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. | from [Command](command#method_addArgument "Symfony\Component\Console\Command\Command") | | $this | [addOption](#method_addOption)(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. | from [Command](command#method_addOption "Symfony\Component\Console\Command\Command") | | $this | [setName](#method_setName)(string $name) Sets the name of the command. | from [Command](command#method_setName "Symfony\Component\Console\Command\Command") | | $this | [setProcessTitle](#method_setProcessTitle)(string $title) Sets the process title of the command. | from [Command](command#method_setProcessTitle "Symfony\Component\Console\Command\Command") | | string | [getName](#method_getName)() Returns the command name. | from [Command](command#method_getName "Symfony\Component\Console\Command\Command") | | [Command](command "Symfony\Component\Console\Command\Command") | [setHidden](#method_setHidden)(bool $hidden) | from [Command](command#method_setHidden "Symfony\Component\Console\Command\Command") | | bool | [isHidden](#method_isHidden)() | from [Command](command#method_isHidden "Symfony\Component\Console\Command\Command") | | $this | [setDescription](#method_setDescription)(string $description) Sets the description for the command. | from [Command](command#method_setDescription "Symfony\Component\Console\Command\Command") | | string | [getDescription](#method_getDescription)() Returns the description for the command. | from [Command](command#method_getDescription "Symfony\Component\Console\Command\Command") | | $this | [setHelp](#method_setHelp)(string $help) Sets the help for the command. | from [Command](command#method_setHelp "Symfony\Component\Console\Command\Command") | | string | [getHelp](#method_getHelp)() Returns the help for the command. | from [Command](command#method_getHelp "Symfony\Component\Console\Command\Command") | | string | [getProcessedHelp](#method_getProcessedHelp)() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. | from [Command](command#method_getProcessedHelp "Symfony\Component\Console\Command\Command") | | $this | [setAliases](#method_setAliases)(string[] $aliases) Sets the aliases for the command. | from [Command](command#method_setAliases "Symfony\Component\Console\Command\Command") | | array | [getAliases](#method_getAliases)() Returns the aliases for the command. | from [Command](command#method_getAliases "Symfony\Component\Console\Command\Command") | | string | [getSynopsis](#method_getSynopsis)(bool $short = false) Returns the synopsis for the command. | from [Command](command#method_getSynopsis "Symfony\Component\Console\Command\Command") | | $this | [addUsage](#method_addUsage)(string $usage) Add a command usage example. | from [Command](command#method_addUsage "Symfony\Component\Console\Command\Command") | | array | [getUsages](#method_getUsages)() Returns alternative usages of the command. | from [Command](command#method_getUsages "Symfony\Component\Console\Command\Command") | | mixed | [getHelper](#method_getHelper)(string $name) Gets a helper instance by name. | from [Command](command#method_getHelper "Symfony\Component\Console\Command\Command") | | | [setCommand](#method_setCommand)([Command](command "Symfony\Component\Console\Command\Command") $command) | | Details ------- ### static string|null getDefaultName() #### Return Value | | | | --- | --- | | string|null | The default command name or null when no default name is set | ### \_\_construct(string $name = null) #### Parameters | | | | | --- | --- | --- | | string | $name | The name of the command; passing null means it must be set in configure() | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When the command name is empty | ### ignoreValidationErrors() Ignores validation errors. This is mainly useful for the help command. ### setApplication([Application](../application "Symfony\Component\Console\Application") $application = null) #### Parameters | | | | | --- | --- | --- | | [Application](../application "Symfony\Component\Console\Application") | $application | | ### setHelperSet([HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) #### Parameters | | | | | --- | --- | --- | | [HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set. #### Return Value | | | | --- | --- | | [HelperSet](../helper/helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### [Application](../application "Symfony\Component\Console\Application") getApplication() Gets the application instance for this command. #### Return Value | | | | --- | --- | | [Application](../application "Symfony\Component\Console\Application") | An Application instance | ### bool isEnabled() Checks whether the command is enabled or not in the current environment. Override this to check for x or y and return false if the command can not run properly under the current conditions. #### Return Value | | | | --- | --- | | bool | | ### protected configure() Configures the current command. ### protected int|null execute([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. This method is not abstract because you can use this class as a concrete class. In this case, instead of defining the execute() method, you set the code to execute by passing a Closure to the setCode() method. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int|null | null or 0 if everything went fine, or an error code | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When this abstract method is not implemented | ### protected interact([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. This method is executed before the InputDefinition is validated. This means that this is the only place where the command can interactively ask for values of missing required arguments. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### protected initialize([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. This is mainly useful when a lot of commands extends one main command where some things need to be initialized based on the input arguments and options. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### See also | | | | --- | --- | | [InputInterface::bind](../input/inputinterface#method_bind "Symfony\Component\Console\Input\InputInterface") | | | [InputInterface::validate](../input/inputinterface#method_validate "Symfony\Component\Console\Input\InputInterface") | | ### int run([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. The code to execute is either defined directly with the setCode() method or by overriding the execute() method in a sub-class. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int | The command exit code | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | When binding input fails. Bypass this by calling {@link ignoreValidationErrors()}. | #### See also | | | | --- | --- | | setCode() | | | execute() | | ### $this setCode(callable $code) Sets the code to execute when running this command. If this method is used, it overrides the code defined in the execute() method. #### Parameters | | | | | --- | --- | --- | | callable | $code | A callable(InputInterface $input, OutputInterface $output) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | | #### See also | | | | --- | --- | | execute() | | ### mergeApplicationDefinition(bool $mergeArgs = true) Merges the application definition with the command definition. This method is not part of public API and should not be used directly. #### Parameters | | | | | --- | --- | --- | | bool | $mergeArgs | Whether to merge or not the Application definition arguments to Command definition arguments | ### $this setDefinition(array|[InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. #### Parameters | | | | | --- | --- | --- | | array|[InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | An array of argument and option instances or a definition instance | #### Return Value | | | | --- | --- | | $this | | ### [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getDefinition() Gets the InputDefinition attached to this Command. #### Return Value | | | | --- | --- | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getNativeDefinition() Gets the InputDefinition to be used to create representations of this Command. Can be overridden to provide the original command representation when it would otherwise be changed by merging with the application InputDefinition. This method is not part of public API and should not be used directly. #### Return Value | | | | --- | --- | | [InputDefinition](../input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### $this addArgument(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | | int|null | $mode | The argument mode: self::REQUIRED or self::OPTIONAL | | string | $description | A description text | | string|string[]|null | $default | The default value (for self::OPTIONAL mode only) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument mode is not valid | ### $this addOption(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | | string|array | $shortcut | The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts | | int|null | $mode | The option mode: One of the VALUE\_\* constants | | string | $description | A description text | | string|string[]|bool|null | $default | The default value (must be null for self::VALUE\_NONE) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | If option mode is invalid or incompatible | ### $this setName(string $name) Sets the name of the command. This method can set both the namespace and the name if you separate them by a colon (:) ``` $command->setName('foo:bar'); ``` #### Parameters | | | | | --- | --- | --- | | string | $name | The command name | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When the name is invalid | ### $this setProcessTitle(string $title) Sets the process title of the command. This feature should be used only when creating a long process command, like a daemon. PHP 5.5+ or the proctitle PECL library is required #### Parameters | | | | | --- | --- | --- | | string | $title | The process title | #### Return Value | | | | --- | --- | | $this | | ### string getName() Returns the command name. #### Return Value | | | | --- | --- | | string | The command name | ### [Command](command "Symfony\Component\Console\Command\Command") setHidden(bool $hidden) #### Parameters | | | | | --- | --- | --- | | bool | $hidden | Whether or not the command should be hidden from the list of commands | #### Return Value | | | | --- | --- | | [Command](command "Symfony\Component\Console\Command\Command") | The current instance | ### bool isHidden() #### Return Value | | | | --- | --- | | bool | whether the command should be publicly shown or not | ### $this setDescription(string $description) Sets the description for the command. #### Parameters | | | | | --- | --- | --- | | string | $description | The description for the command | #### Return Value | | | | --- | --- | | $this | | ### string getDescription() Returns the description for the command. #### Return Value | | | | --- | --- | | string | The description for the command | ### $this setHelp(string $help) Sets the help for the command. #### Parameters | | | | | --- | --- | --- | | string | $help | The help for the command | #### Return Value | | | | --- | --- | | $this | | ### string getHelp() Returns the help for the command. #### Return Value | | | | --- | --- | | string | The help for the command | ### string getProcessedHelp() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. #### Return Value | | | | --- | --- | | string | The processed help for the command | ### $this setAliases(string[] $aliases) Sets the aliases for the command. #### Parameters | | | | | --- | --- | --- | | string[] | $aliases | An array of aliases for the command | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When an alias is invalid | ### array getAliases() Returns the aliases for the command. #### Return Value | | | | --- | --- | | array | An array of aliases for the command | ### string getSynopsis(bool $short = false) Returns the synopsis for the command. #### Parameters | | | | | --- | --- | --- | | bool | $short | Whether to show the short version of the synopsis (with options folded) or not | #### Return Value | | | | --- | --- | | string | The synopsis | ### $this addUsage(string $usage) Add a command usage example. #### Parameters | | | | | --- | --- | --- | | string | $usage | The usage, it'll be prefixed with the command name | #### Return Value | | | | --- | --- | | $this | | ### array getUsages() Returns alternative usages of the command. #### Return Value | | | | --- | --- | | array | | ### mixed getHelper(string $name) Gets a helper instance by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The helper name | #### Return Value | | | | --- | --- | | mixed | The helper value | #### Exceptions | | | | --- | --- | | [LogicException](../exception/logicexception "Symfony\Component\Console\Exception\LogicException") | if no HelperSet is defined | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | if the helper is not defined | ### setCommand([Command](command "Symfony\Component\Console\Command\Command") $command) #### Parameters | | | | | --- | --- | --- | | [Command](command "Symfony\Component\Console\Command\Command") | $command | |
programming_docs
symfony TableStyle TableStyle =========== class **TableStyle** Defines the styles for a Table. Methods ------- | | | | | --- | --- | --- | | $this | [setPaddingChar](#method_setPaddingChar)(string $paddingChar) Sets padding character, used for cell padding. | | | string | [getPaddingChar](#method_getPaddingChar)() Gets padding character, used for cell padding. | | | [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") | [setHorizontalBorderChars](#method_setHorizontalBorderChars)(string $outside, string $inside = null) Sets horizontal border characters. | | | $this | [setHorizontalBorderChar](#method_setHorizontalBorderChar)(string $horizontalBorderChar) deprecated Sets horizontal border character. | | | string | [getHorizontalBorderChar](#method_getHorizontalBorderChar)() deprecated Gets horizontal border character. | | | [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") | [setVerticalBorderChars](#method_setVerticalBorderChars)(string $outside, string $inside = null) Sets vertical border characters. | | | $this | [setVerticalBorderChar](#method_setVerticalBorderChar)(string $verticalBorderChar) deprecated Sets vertical border character. | | | string | [getVerticalBorderChar](#method_getVerticalBorderChar)() deprecated Gets vertical border character. | | | | [getBorderChars](#method_getBorderChars)() Gets border characters. | | | [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") | [setCrossingChars](#method_setCrossingChars)(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, string $topLeftBottom = null, string $topMidBottom = null, string $topRightBottom = null) Sets crossing characters. | | | [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") | [setDefaultCrossingChar](#method_setDefaultCrossingChar)(string $char) Sets default crossing character used for each cross. | | | $this | [setCrossingChar](#method_setCrossingChar)(string $crossingChar) deprecated Sets crossing character. | | | string | [getCrossingChar](#method_getCrossingChar)() Gets crossing character. | | | array | [getCrossingChars](#method_getCrossingChars)() Gets crossing characters. | | | $this | [setCellHeaderFormat](#method_setCellHeaderFormat)(string $cellHeaderFormat) Sets header cell format. | | | string | [getCellHeaderFormat](#method_getCellHeaderFormat)() Gets header cell format. | | | $this | [setCellRowFormat](#method_setCellRowFormat)(string $cellRowFormat) Sets row cell format. | | | string | [getCellRowFormat](#method_getCellRowFormat)() Gets row cell format. | | | $this | [setCellRowContentFormat](#method_setCellRowContentFormat)(string $cellRowContentFormat) Sets row cell content format. | | | string | [getCellRowContentFormat](#method_getCellRowContentFormat)() Gets row cell content format. | | | $this | [setBorderFormat](#method_setBorderFormat)(string $borderFormat) Sets table border format. | | | string | [getBorderFormat](#method_getBorderFormat)() Gets table border format. | | | $this | [setPadType](#method_setPadType)(int $padType) Sets cell padding type. | | | int | [getPadType](#method_getPadType)() Gets cell padding type. | | Details ------- ### $this setPaddingChar(string $paddingChar) Sets padding character, used for cell padding. #### Parameters | | | | | --- | --- | --- | | string | $paddingChar | | #### Return Value | | | | --- | --- | | $this | | ### string getPaddingChar() Gets padding character, used for cell padding. #### Return Value | | | | --- | --- | | string | | ### [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") setHorizontalBorderChars(string $outside, string $inside = null) Sets horizontal border characters. `╔═══════════════╤══════════════════════════╤══════════════════╗ 1 ISBN 2 Title │ Author ║ ╠═══════════════╪══════════════════════════╪══════════════════╣ ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ ╚═══════════════╧══════════════════════════╧══════════════════╝` #### Parameters | | | | | --- | --- | --- | | string | $outside | Outside border char (see #1 of example) | | string | $inside | Inside border char (see #2 of example), equals $outside if null | #### Return Value | | | | --- | --- | | [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") | | ### $this setHorizontalBorderChar(string $horizontalBorderChar) deprecated deprecated | since | Symfony 4.1, use {@link setHorizontalBorderChars()} instead. | Sets horizontal border character. #### Parameters | | | | | --- | --- | --- | | string | $horizontalBorderChar | | #### Return Value | | | | --- | --- | | $this | | ### string getHorizontalBorderChar() deprecated deprecated | since | Symfony 4.1, use {@link getBorderChars()} instead. | Gets horizontal border character. #### Return Value | | | | --- | --- | | string | | ### [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") setVerticalBorderChars(string $outside, string $inside = null) Sets vertical border characters. `╔═══════════════╤══════════════════════════╤══════════════════╗ ║ ISBN │ Title │ Author ║ ╠═══════1═══════╪══════════════════════════╪══════════════════╣ ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ ╟───────2───────┼──────────────────────────┼──────────────────╢ ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ ╚═══════════════╧══════════════════════════╧══════════════════╝` #### Parameters | | | | | --- | --- | --- | | string | $outside | Outside border char (see #1 of example) | | string | $inside | Inside border char (see #2 of example), equals $outside if null | #### Return Value | | | | --- | --- | | [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") | | ### $this setVerticalBorderChar(string $verticalBorderChar) deprecated deprecated | since | Symfony 4.1, use {@link setVerticalBorderChars()} instead. | Sets vertical border character. #### Parameters | | | | | --- | --- | --- | | string | $verticalBorderChar | | #### Return Value | | | | --- | --- | | $this | | ### string getVerticalBorderChar() deprecated deprecated | since | Symfony 4.1, use {@link getBorderChars()} instead. | Gets vertical border character. #### Return Value | | | | --- | --- | | string | | ### getBorderChars() Gets border characters. ### [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, string $topLeftBottom = null, string $topMidBottom = null, string $topRightBottom = null) Sets crossing characters. Example: `1═══════════════2══════════════════════════2══════════════════3 ║ ISBN │ Title │ Author ║ 8'══════════════0'═════════════════════════0'═════════════════4' ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ 8───────────────0──────────────────────────0──────────────────4 ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ 7═══════════════6══════════════════════════6══════════════════5` #### Parameters | | | | | --- | --- | --- | | string | $cross | Crossing char (see #0 of example) | | string | $topLeft | Top left char (see #1 of example) | | string | $topMid | Top mid char (see #2 of example) | | string | $topRight | Top right char (see #3 of example) | | string | $midRight | Mid right char (see #4 of example) | | string | $bottomRight | Bottom right char (see #5 of example) | | string | $bottomMid | Bottom mid char (see #6 of example) | | string | $bottomLeft | Bottom left char (see #7 of example) | | string | $midLeft | Mid left char (see #8 of example) | | string | $topLeftBottom | Top left bottom char (see #8' of example), equals to $midLeft if null | | string | $topMidBottom | Top mid bottom char (see #0' of example), equals to $cross if null | | string | $topRightBottom | Top right bottom char (see #4' of example), equals to $midRight if null | #### Return Value | | | | --- | --- | | [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") | | ### [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") setDefaultCrossingChar(string $char) Sets default crossing character used for each cross. #### Parameters | | | | | --- | --- | --- | | string | $char | | #### Return Value | | | | --- | --- | | [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") | | #### See also | | | | --- | --- | | {@link | setCrossingChars()} for setting each crossing individually. | ### $this setCrossingChar(string $crossingChar) deprecated deprecated | since | Symfony 4.1. Use {@link setDefaultCrossingChar()} instead. | Sets crossing character. #### Parameters | | | | | --- | --- | --- | | string | $crossingChar | | #### Return Value | | | | --- | --- | | $this | | ### string getCrossingChar() Gets crossing character. #### Return Value | | | | --- | --- | | string | $crossingChar | ### array getCrossingChars() Gets crossing characters. #### Return Value | | | | --- | --- | | array | | ### $this setCellHeaderFormat(string $cellHeaderFormat) Sets header cell format. #### Parameters | | | | | --- | --- | --- | | string | $cellHeaderFormat | | #### Return Value | | | | --- | --- | | $this | | ### string getCellHeaderFormat() Gets header cell format. #### Return Value | | | | --- | --- | | string | | ### $this setCellRowFormat(string $cellRowFormat) Sets row cell format. #### Parameters | | | | | --- | --- | --- | | string | $cellRowFormat | | #### Return Value | | | | --- | --- | | $this | | ### string getCellRowFormat() Gets row cell format. #### Return Value | | | | --- | --- | | string | | ### $this setCellRowContentFormat(string $cellRowContentFormat) Sets row cell content format. #### Parameters | | | | | --- | --- | --- | | string | $cellRowContentFormat | | #### Return Value | | | | --- | --- | | $this | | ### string getCellRowContentFormat() Gets row cell content format. #### Return Value | | | | --- | --- | | string | | ### $this setBorderFormat(string $borderFormat) Sets table border format. #### Parameters | | | | | --- | --- | --- | | string | $borderFormat | | #### Return Value | | | | --- | --- | | $this | | ### string getBorderFormat() Gets table border format. #### Return Value | | | | --- | --- | | string | | ### $this setPadType(int $padType) Sets cell padding type. #### Parameters | | | | | --- | --- | --- | | int | $padType | STR\_PAD\_\* | #### Return Value | | | | --- | --- | | $this | | ### int getPadType() Gets cell padding type. #### Return Value | | | | --- | --- | | int | | symfony TableCell TableCell ========== class **TableCell** Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $value = '', array $options = array()) | | | string | [\_\_toString](#method___toString)() Returns the cell value. | | | int | [getColspan](#method_getColspan)() Gets number of colspan. | | | int | [getRowspan](#method_getRowspan)() Gets number of rowspan. | | Details ------- ### \_\_construct(string $value = '', array $options = array()) #### Parameters | | | | | --- | --- | --- | | string | $value | | | array | $options | | ### string \_\_toString() Returns the cell value. #### Return Value | | | | --- | --- | | string | | ### int getColspan() Gets number of colspan. #### Return Value | | | | --- | --- | | int | | ### int getRowspan() Gets number of rowspan. #### Return Value | | | | --- | --- | | int | | symfony DescriptorHelper DescriptorHelper ================= class **DescriptorHelper** extends [Helper](helper "Symfony\Component\Console\Helper\Helper") This class adds helper method to describe objects in various formats. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $helperSet | | from [Helper](helper#property_helperSet "Symfony\Component\Console\Helper\Helper") | Methods ------- | | | | | --- | --- | --- | | | [setHelperSet](#method_setHelperSet)([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. | from [Helper](helper#method_setHelperSet "Symfony\Component\Console\Helper\Helper") | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set associated with this helper. | from [Helper](helper#method_getHelperSet "Symfony\Component\Console\Helper\Helper") | | static int | [strlen](#method_strlen)(string $string) Returns the length of a string, using mb\_strwidth if it is available. | from [Helper](helper#method_strlen "Symfony\Component\Console\Helper\Helper") | | static string | [substr](#method_substr)(string $string, int $from, int|null $length = null) Returns the subset of a string, using mb\_substr if it is available. | from [Helper](helper#method_substr "Symfony\Component\Console\Helper\Helper") | | static | [formatTime](#method_formatTime)($secs) | from [Helper](helper#method_formatTime "Symfony\Component\Console\Helper\Helper") | | static | [formatMemory](#method_formatMemory)($memory) | from [Helper](helper#method_formatMemory "Symfony\Component\Console\Helper\Helper") | | static | [strlenWithoutDecoration](#method_strlenWithoutDecoration)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) | from [Helper](helper#method_strlenWithoutDecoration "Symfony\Component\Console\Helper\Helper") | | static | [removeDecoration](#method_removeDecoration)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) | from [Helper](helper#method_removeDecoration "Symfony\Component\Console\Helper\Helper") | | | [\_\_construct](#method___construct)() | | | | [describe](#method_describe)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, object $object, array $options = array()) Describes an object if supported. | | | $this | [register](#method_register)(string $format, [DescriptorInterface](../descriptor/descriptorinterface "Symfony\Component\Console\Descriptor\DescriptorInterface") $descriptor) Registers a descriptor. | | | string | [getName](#method_getName)() Returns the canonical name of this helper. | | Details ------- ### setHelperSet([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. #### Parameters | | | | | --- | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set associated with this helper. #### Return Value | | | | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### static int strlen(string $string) Returns the length of a string, using mb\_strwidth if it is available. #### Parameters | | | | | --- | --- | --- | | string | $string | The string to check its length | #### Return Value | | | | --- | --- | | int | The length of the string | ### static string substr(string $string, int $from, int|null $length = null) Returns the subset of a string, using mb\_substr if it is available. #### Parameters | | | | | --- | --- | --- | | string | $string | String to subset | | int | $from | Start offset | | int|null | $length | Length to read | #### Return Value | | | | --- | --- | | string | The string subset | ### static formatTime($secs) #### Parameters | | | | | --- | --- | --- | | | $secs | | ### static formatMemory($memory) #### Parameters | | | | | --- | --- | --- | | | $memory | | ### static strlenWithoutDecoration([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | | | $string | | ### static removeDecoration([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | | | $string | | ### \_\_construct() ### describe([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, object $object, array $options = array()) Describes an object if supported. Available options are: \* format: string, the output format name \* raw\_text: boolean, sets output type as raw #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | object | $object | | | array | $options | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | when the given format is not supported | ### $this register(string $format, [DescriptorInterface](../descriptor/descriptorinterface "Symfony\Component\Console\Descriptor\DescriptorInterface") $descriptor) Registers a descriptor. #### Parameters | | | | | --- | --- | --- | | string | $format | | | [DescriptorInterface](../descriptor/descriptorinterface "Symfony\Component\Console\Descriptor\DescriptorInterface") | $descriptor | | #### Return Value | | | | --- | --- | | $this | | ### string getName() Returns the canonical name of this helper. #### Return Value | | | | --- | --- | | string | The canonical name | symfony TableSeparator TableSeparator =============== class **TableSeparator** extends [TableCell](tablecell "Symfony\Component\Console\Helper\TableCell") Marks a row as being a separator. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $options = array()) | | | string | [\_\_toString](#method___toString)() Returns the cell value. | from [TableCell](tablecell#method___toString "Symfony\Component\Console\Helper\TableCell") | | int | [getColspan](#method_getColspan)() Gets number of colspan. | from [TableCell](tablecell#method_getColspan "Symfony\Component\Console\Helper\TableCell") | | int | [getRowspan](#method_getRowspan)() Gets number of rowspan. | from [TableCell](tablecell#method_getRowspan "Symfony\Component\Console\Helper\TableCell") | Details ------- ### \_\_construct(array $options = array()) #### Parameters | | | | | --- | --- | --- | | array | $options | | ### string \_\_toString() Returns the cell value. #### Return Value | | | | --- | --- | | string | | ### int getColspan() Gets number of colspan. #### Return Value | | | | --- | --- | | int | | ### int getRowspan() Gets number of rowspan. #### Return Value | | | | --- | --- | | int | |
programming_docs
symfony Helper Helper ======= abstract class **Helper** implements [HelperInterface](helperinterface "Symfony\Component\Console\Helper\HelperInterface") Helper is the base class for all helper classes. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $helperSet | | | Methods ------- | | | | | --- | --- | --- | | | [setHelperSet](#method_setHelperSet)([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. | | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set associated with this helper. | | | static int | [strlen](#method_strlen)(string $string) Returns the length of a string, using mb\_strwidth if it is available. | | | static string | [substr](#method_substr)(string $string, int $from, int|null $length = null) Returns the subset of a string, using mb\_substr if it is available. | | | static | [formatTime](#method_formatTime)($secs) | | | static | [formatMemory](#method_formatMemory)($memory) | | | static | [strlenWithoutDecoration](#method_strlenWithoutDecoration)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) | | | static | [removeDecoration](#method_removeDecoration)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) | | Details ------- ### setHelperSet([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. #### Parameters | | | | | --- | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set associated with this helper. #### Return Value | | | | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### static int strlen(string $string) Returns the length of a string, using mb\_strwidth if it is available. #### Parameters | | | | | --- | --- | --- | | string | $string | The string to check its length | #### Return Value | | | | --- | --- | | int | The length of the string | ### static string substr(string $string, int $from, int|null $length = null) Returns the subset of a string, using mb\_substr if it is available. #### Parameters | | | | | --- | --- | --- | | string | $string | String to subset | | int | $from | Start offset | | int|null | $length | Length to read | #### Return Value | | | | --- | --- | | string | The string subset | ### static formatTime($secs) #### Parameters | | | | | --- | --- | --- | | | $secs | | ### static formatMemory($memory) #### Parameters | | | | | --- | --- | --- | | | $memory | | ### static strlenWithoutDecoration([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | | | $string | | ### static removeDecoration([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | | | $string | | symfony HelperInterface HelperInterface ================ interface **HelperInterface** HelperInterface is the interface all helpers must implement. Methods ------- | | | | | --- | --- | --- | | | [setHelperSet](#method_setHelperSet)([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. | | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set associated with this helper. | | | string | [getName](#method_getName)() Returns the canonical name of this helper. | | Details ------- ### setHelperSet([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. #### Parameters | | | | | --- | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set associated with this helper. #### Return Value | | | | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### string getName() Returns the canonical name of this helper. #### Return Value | | | | --- | --- | | string | The canonical name | symfony FormatterHelper FormatterHelper ================ class **FormatterHelper** extends [Helper](helper "Symfony\Component\Console\Helper\Helper") The Formatter class provides helpers to format messages. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $helperSet | | from [Helper](helper#property_helperSet "Symfony\Component\Console\Helper\Helper") | Methods ------- | | | | | --- | --- | --- | | | [setHelperSet](#method_setHelperSet)([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. | from [Helper](helper#method_setHelperSet "Symfony\Component\Console\Helper\Helper") | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set associated with this helper. | from [Helper](helper#method_getHelperSet "Symfony\Component\Console\Helper\Helper") | | static int | [strlen](#method_strlen)(string $string) Returns the length of a string, using mb\_strwidth if it is available. | from [Helper](helper#method_strlen "Symfony\Component\Console\Helper\Helper") | | static string | [substr](#method_substr)(string $string, int $from, int|null $length = null) Returns the subset of a string, using mb\_substr if it is available. | from [Helper](helper#method_substr "Symfony\Component\Console\Helper\Helper") | | static | [formatTime](#method_formatTime)($secs) | from [Helper](helper#method_formatTime "Symfony\Component\Console\Helper\Helper") | | static | [formatMemory](#method_formatMemory)($memory) | from [Helper](helper#method_formatMemory "Symfony\Component\Console\Helper\Helper") | | static | [strlenWithoutDecoration](#method_strlenWithoutDecoration)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) | from [Helper](helper#method_strlenWithoutDecoration "Symfony\Component\Console\Helper\Helper") | | static | [removeDecoration](#method_removeDecoration)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) | from [Helper](helper#method_removeDecoration "Symfony\Component\Console\Helper\Helper") | | string | [formatSection](#method_formatSection)(string $section, string $message, string $style = 'info') Formats a message within a section. | | | string | [formatBlock](#method_formatBlock)(string|array $messages, string $style, bool $large = false) Formats a message as a block of text. | | | string | [truncate](#method_truncate)(string $message, int $length, string $suffix = '...') Truncates a message to the given length. | | | string | [getName](#method_getName)() Returns the canonical name of this helper. | | Details ------- ### setHelperSet([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. #### Parameters | | | | | --- | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set associated with this helper. #### Return Value | | | | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### static int strlen(string $string) Returns the length of a string, using mb\_strwidth if it is available. #### Parameters | | | | | --- | --- | --- | | string | $string | The string to check its length | #### Return Value | | | | --- | --- | | int | The length of the string | ### static string substr(string $string, int $from, int|null $length = null) Returns the subset of a string, using mb\_substr if it is available. #### Parameters | | | | | --- | --- | --- | | string | $string | String to subset | | int | $from | Start offset | | int|null | $length | Length to read | #### Return Value | | | | --- | --- | | string | The string subset | ### static formatTime($secs) #### Parameters | | | | | --- | --- | --- | | | $secs | | ### static formatMemory($memory) #### Parameters | | | | | --- | --- | --- | | | $memory | | ### static strlenWithoutDecoration([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | | | $string | | ### static removeDecoration([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | | | $string | | ### string formatSection(string $section, string $message, string $style = 'info') Formats a message within a section. #### Parameters | | | | | --- | --- | --- | | string | $section | The section name | | string | $message | The message | | string | $style | The style to apply to the section | #### Return Value | | | | --- | --- | | string | The format section | ### string formatBlock(string|array $messages, string $style, bool $large = false) Formats a message as a block of text. #### Parameters | | | | | --- | --- | --- | | string|array | $messages | The message to write in the block | | string | $style | The style to apply to the whole block | | bool | $large | Whether to return a large block | #### Return Value | | | | --- | --- | | string | The formatter message | ### string truncate(string $message, int $length, string $suffix = '...') Truncates a message to the given length. #### Parameters | | | | | --- | --- | --- | | string | $message | | | int | $length | | | string | $suffix | | #### Return Value | | | | --- | --- | | string | | ### string getName() Returns the canonical name of this helper. #### Return Value | | | | --- | --- | | string | The canonical name | symfony ProgressIndicator ProgressIndicator ================== class **ProgressIndicator** Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, string $format = null, int $indicatorChangeInterval = 100, array $indicatorValues = null) | | | | [setMessage](#method_setMessage)(string|null $message) Sets the current indicator message. | | | | [start](#method_start)($message) Starts the indicator output. | | | | [advance](#method_advance)() Advances the indicator. | | | | [finish](#method_finish)($message) Finish the indicator with message. | | | static string|null | [getFormatDefinition](#method_getFormatDefinition)(string $name) Gets the format for a given name. | | | static | [setPlaceholderFormatterDefinition](#method_setPlaceholderFormatterDefinition)(string $name, callable $callable) Sets a placeholder formatter for a given name. | | | static callable|null | [getPlaceholderFormatterDefinition](#method_getPlaceholderFormatterDefinition)(string $name) Gets the placeholder formatter for a given name. | | Details ------- ### \_\_construct([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, string $format = null, int $indicatorChangeInterval = 100, array $indicatorValues = null) #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | string | $format | Indicator format | | int | $indicatorChangeInterval | Change interval in milliseconds | | array | $indicatorValues | Animated indicator characters | ### setMessage(string|null $message) Sets the current indicator message. #### Parameters | | | | | --- | --- | --- | | string|null | $message | | ### start($message) Starts the indicator output. #### Parameters | | | | | --- | --- | --- | | | $message | | ### advance() Advances the indicator. ### finish($message) Finish the indicator with message. #### Parameters | | | | | --- | --- | --- | | | $message | | ### static string|null getFormatDefinition(string $name) Gets the format for a given name. #### Parameters | | | | | --- | --- | --- | | string | $name | The format name | #### Return Value | | | | --- | --- | | string|null | A format string | ### static setPlaceholderFormatterDefinition(string $name, callable $callable) Sets a placeholder formatter for a given name. This method also allow you to override an existing placeholder. #### Parameters | | | | | --- | --- | --- | | string | $name | The placeholder name (including the delimiter char like %) | | callable | $callable | A PHP callable | ### static callable|null getPlaceholderFormatterDefinition(string $name) Gets the placeholder formatter for a given name. #### Parameters | | | | | --- | --- | --- | | string | $name | The placeholder name (including the delimiter char like %) | #### Return Value | | | | --- | --- | | callable|null | A PHP callable | symfony HelperSet HelperSet ========== class **HelperSet** implements [IteratorAggregate](http://php.net/IteratorAggregate) HelperSet represents a set of helpers to be used with a command. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $helpers = array()) | | | | [set](#method_set)([HelperInterface](helperinterface "Symfony\Component\Console\Helper\HelperInterface") $helper, string $alias = null) Sets a helper. | | | bool | [has](#method_has)(string $name) Returns true if the helper if defined. | | | [HelperInterface](helperinterface "Symfony\Component\Console\Helper\HelperInterface") | [get](#method_get)(string $name) Gets a helper value. | | | | [setCommand](#method_setCommand)([Command](../command/command "Symfony\Component\Console\Command\Command") $command = null) | | | [Command](../command/command "Symfony\Component\Console\Command\Command") | [getCommand](#method_getCommand)() Gets the command associated with this helper set. | | | [Helper](helper "Symfony\Component\Console\Helper\Helper")[] | [getIterator](#method_getIterator)() | | Details ------- ### \_\_construct(array $helpers = array()) #### Parameters | | | | | --- | --- | --- | | array | $helpers | An array of helper | ### set([HelperInterface](helperinterface "Symfony\Component\Console\Helper\HelperInterface") $helper, string $alias = null) Sets a helper. #### Parameters | | | | | --- | --- | --- | | [HelperInterface](helperinterface "Symfony\Component\Console\Helper\HelperInterface") | $helper | The helper instance | | string | $alias | An alias | ### bool has(string $name) Returns true if the helper if defined. #### Parameters | | | | | --- | --- | --- | | string | $name | The helper name | #### Return Value | | | | --- | --- | | bool | true if the helper is defined, false otherwise | ### [HelperInterface](helperinterface "Symfony\Component\Console\Helper\HelperInterface") get(string $name) Gets a helper value. #### Parameters | | | | | --- | --- | --- | | string | $name | The helper name | #### Return Value | | | | --- | --- | | [HelperInterface](helperinterface "Symfony\Component\Console\Helper\HelperInterface") | The helper instance | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | if the helper is not defined | ### setCommand([Command](../command/command "Symfony\Component\Console\Command\Command") $command = null) #### Parameters | | | | | --- | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | $command | | ### [Command](../command/command "Symfony\Component\Console\Command\Command") getCommand() Gets the command associated with this helper set. #### Return Value | | | | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | A Command instance | ### [Helper](helper "Symfony\Component\Console\Helper\Helper")[] getIterator() #### Return Value | | | | --- | --- | | [Helper](helper "Symfony\Component\Console\Helper\Helper")[] | | symfony Table Table ====== class **Table** Provides helpers to display a table. Constants --------- | | | | --- | --- | | SEPARATOR\_TOP | | | SEPARATOR\_TOP\_BOTTOM | | | SEPARATOR\_MID | | | SEPARATOR\_BOTTOM | | | BORDER\_OUTSIDE | | | BORDER\_INSIDE | | Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) | | | static | [setStyleDefinition](#method_setStyleDefinition)(string $name, [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") $style) Sets a style definition. | | | static [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") | [getStyleDefinition](#method_getStyleDefinition)(string $name) Gets a style definition by name. | | | $this | [setStyle](#method_setStyle)([TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle")|string $name) Sets table style. | | | [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") | [getStyle](#method_getStyle)() Gets the current table style. | | | $this | [setColumnStyle](#method_setColumnStyle)(int $columnIndex, [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle")|string $name) Sets table column style. | | | [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") | [getColumnStyle](#method_getColumnStyle)(int $columnIndex) Gets the current style for a column. | | | $this | [setColumnWidth](#method_setColumnWidth)(int $columnIndex, int $width) Sets the minimum width of a column. | | | $this | [setColumnWidths](#method_setColumnWidths)(array $widths) Sets the minimum width of all columns. | | | | [setHeaders](#method_setHeaders)(array $headers) | | | | [setRows](#method_setRows)(array $rows) | | | | [addRows](#method_addRows)(array $rows) | | | | [addRow](#method_addRow)($row) | | | [Table](table "Symfony\Component\Console\Helper\Table") | [appendRow](#method_appendRow)($row) Adds a row to the table, and re-renders the table. | | | | [setRow](#method_setRow)($column, array $row) | | | | [render](#method_render)() Renders table to output. | | Details ------- ### \_\_construct([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### static setStyleDefinition(string $name, [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") $style) Sets a style definition. #### Parameters | | | | | --- | --- | --- | | string | $name | The style name | | [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") | $style | A TableStyle instance | ### static [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") getStyleDefinition(string $name) Gets a style definition by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The style name | #### Return Value | | | | --- | --- | | [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") | | ### $this setStyle([TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle")|string $name) Sets table style. #### Parameters | | | | | --- | --- | --- | | [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle")|string | $name | The style name or a TableStyle instance | #### Return Value | | | | --- | --- | | $this | | ### [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") getStyle() Gets the current table style. #### Return Value | | | | --- | --- | | [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") | | ### $this setColumnStyle(int $columnIndex, [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle")|string $name) Sets table column style. #### Parameters | | | | | --- | --- | --- | | int | $columnIndex | Column index | | [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle")|string | $name | The style name or a TableStyle instance | #### Return Value | | | | --- | --- | | $this | | ### [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") getColumnStyle(int $columnIndex) Gets the current style for a column. If style was not set, it returns the global table style. #### Parameters | | | | | --- | --- | --- | | int | $columnIndex | Column index | #### Return Value | | | | --- | --- | | [TableStyle](tablestyle "Symfony\Component\Console\Helper\TableStyle") | | ### $this setColumnWidth(int $columnIndex, int $width) Sets the minimum width of a column. #### Parameters | | | | | --- | --- | --- | | int | $columnIndex | Column index | | int | $width | Minimum column width in characters | #### Return Value | | | | --- | --- | | $this | | ### $this setColumnWidths(array $widths) Sets the minimum width of all columns. #### Parameters | | | | | --- | --- | --- | | array | $widths | | #### Return Value | | | | --- | --- | | $this | | ### setHeaders(array $headers) #### Parameters | | | | | --- | --- | --- | | array | $headers | | ### setRows(array $rows) #### Parameters | | | | | --- | --- | --- | | array | $rows | | ### addRows(array $rows) #### Parameters | | | | | --- | --- | --- | | array | $rows | | ### addRow($row) #### Parameters | | | | | --- | --- | --- | | | $row | | ### [Table](table "Symfony\Component\Console\Helper\Table") appendRow($row) Adds a row to the table, and re-renders the table. #### Parameters | | | | | --- | --- | --- | | | $row | | #### Return Value | | | | --- | --- | | [Table](table "Symfony\Component\Console\Helper\Table") | | ### setRow($column, array $row) #### Parameters | | | | | --- | --- | --- | | | $column | | | array | $row | | ### render() Renders table to output. Example: ``` +---------------+-----------------------+------------------+ | ISBN | Title | Author | +---------------+-----------------------+------------------+ | 99921-58-10-7 | Divine Comedy | Dante Alighieri | | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | +---------------+-----------------------+------------------+ ```
programming_docs
symfony QuestionHelper QuestionHelper =============== class **QuestionHelper** extends [Helper](helper "Symfony\Component\Console\Helper\Helper") The QuestionHelper class provides helpers to interact with the user. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $helperSet | | from [Helper](helper#property_helperSet "Symfony\Component\Console\Helper\Helper") | Methods ------- | | | | | --- | --- | --- | | | [setHelperSet](#method_setHelperSet)([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. | from [Helper](helper#method_setHelperSet "Symfony\Component\Console\Helper\Helper") | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set associated with this helper. | from [Helper](helper#method_getHelperSet "Symfony\Component\Console\Helper\Helper") | | static int | [strlen](#method_strlen)(string $string) Returns the length of a string, using mb\_strwidth if it is available. | from [Helper](helper#method_strlen "Symfony\Component\Console\Helper\Helper") | | static string | [substr](#method_substr)(string $string, int $from, int|null $length = null) Returns the subset of a string, using mb\_substr if it is available. | from [Helper](helper#method_substr "Symfony\Component\Console\Helper\Helper") | | static | [formatTime](#method_formatTime)($secs) | from [Helper](helper#method_formatTime "Symfony\Component\Console\Helper\Helper") | | static | [formatMemory](#method_formatMemory)($memory) | from [Helper](helper#method_formatMemory "Symfony\Component\Console\Helper\Helper") | | static | [strlenWithoutDecoration](#method_strlenWithoutDecoration)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) | from [Helper](helper#method_strlenWithoutDecoration "Symfony\Component\Console\Helper\Helper") | | static | [removeDecoration](#method_removeDecoration)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) | from [Helper](helper#method_removeDecoration "Symfony\Component\Console\Helper\Helper") | | mixed | [ask](#method_ask)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Question](../question/question "Symfony\Component\Console\Question\Question") $question) Asks a question to the user. | | | string | [getName](#method_getName)() Returns the canonical name of this helper. | | | static | [disableStty](#method_disableStty)() Prevents usage of stty. | | | | [writePrompt](#method_writePrompt)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Question](../question/question "Symfony\Component\Console\Question\Question") $question) Outputs the question prompt. | | | | [writeError](#method_writeError)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Exception](http://php.net/Exception) $error) Outputs an error message. | | Details ------- ### setHelperSet([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. #### Parameters | | | | | --- | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set associated with this helper. #### Return Value | | | | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### static int strlen(string $string) Returns the length of a string, using mb\_strwidth if it is available. #### Parameters | | | | | --- | --- | --- | | string | $string | The string to check its length | #### Return Value | | | | --- | --- | | int | The length of the string | ### static string substr(string $string, int $from, int|null $length = null) Returns the subset of a string, using mb\_substr if it is available. #### Parameters | | | | | --- | --- | --- | | string | $string | String to subset | | int | $from | Start offset | | int|null | $length | Length to read | #### Return Value | | | | --- | --- | | string | The string subset | ### static formatTime($secs) #### Parameters | | | | | --- | --- | --- | | | $secs | | ### static formatMemory($memory) #### Parameters | | | | | --- | --- | --- | | | $memory | | ### static strlenWithoutDecoration([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | | | $string | | ### static removeDecoration([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | | | $string | | ### mixed ask([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Question](../question/question "Symfony\Component\Console\Question\Question") $question) Asks a question to the user. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | [Question](../question/question "Symfony\Component\Console\Question\Question") | $question | | #### Return Value | | | | --- | --- | | mixed | The user answer | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\Console\Exception\RuntimeException") | If there is no data to read in the input stream | ### string getName() Returns the canonical name of this helper. #### Return Value | | | | --- | --- | | string | The canonical name | ### static disableStty() Prevents usage of stty. ### protected writePrompt([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Question](../question/question "Symfony\Component\Console\Question\Question") $question) Outputs the question prompt. #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | [Question](../question/question "Symfony\Component\Console\Question\Question") | $question | | ### protected writeError([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Exception](http://php.net/Exception) $error) Outputs an error message. #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | [Exception](http://php.net/Exception) | $error | | symfony SymfonyQuestionHelper SymfonyQuestionHelper ====================== class **SymfonyQuestionHelper** extends [QuestionHelper](questionhelper "Symfony\Component\Console\Helper\QuestionHelper") Symfony Style Guide compliant question helper. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $helperSet | | from [Helper](helper#property_helperSet "Symfony\Component\Console\Helper\Helper") | Methods ------- | | | | | --- | --- | --- | | | [setHelperSet](#method_setHelperSet)([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. | from [Helper](helper#method_setHelperSet "Symfony\Component\Console\Helper\Helper") | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set associated with this helper. | from [Helper](helper#method_getHelperSet "Symfony\Component\Console\Helper\Helper") | | static int | [strlen](#method_strlen)(string $string) Returns the length of a string, using mb\_strwidth if it is available. | from [Helper](helper#method_strlen "Symfony\Component\Console\Helper\Helper") | | static string | [substr](#method_substr)(string $string, int $from, int|null $length = null) Returns the subset of a string, using mb\_substr if it is available. | from [Helper](helper#method_substr "Symfony\Component\Console\Helper\Helper") | | static | [formatTime](#method_formatTime)($secs) | from [Helper](helper#method_formatTime "Symfony\Component\Console\Helper\Helper") | | static | [formatMemory](#method_formatMemory)($memory) | from [Helper](helper#method_formatMemory "Symfony\Component\Console\Helper\Helper") | | static | [strlenWithoutDecoration](#method_strlenWithoutDecoration)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) | from [Helper](helper#method_strlenWithoutDecoration "Symfony\Component\Console\Helper\Helper") | | static | [removeDecoration](#method_removeDecoration)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) | from [Helper](helper#method_removeDecoration "Symfony\Component\Console\Helper\Helper") | | mixed | [ask](#method_ask)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Question](../question/question "Symfony\Component\Console\Question\Question") $question) Asks a question to the user. | from [QuestionHelper](questionhelper#method_ask "Symfony\Component\Console\Helper\QuestionHelper") | | string | [getName](#method_getName)() Returns the canonical name of this helper. | from [QuestionHelper](questionhelper#method_getName "Symfony\Component\Console\Helper\QuestionHelper") | | static | [disableStty](#method_disableStty)() Prevents usage of stty. | from [QuestionHelper](questionhelper#method_disableStty "Symfony\Component\Console\Helper\QuestionHelper") | | | [writePrompt](#method_writePrompt)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Question](../question/question "Symfony\Component\Console\Question\Question") $question) Outputs the question prompt. | | | | [writeError](#method_writeError)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Exception](http://php.net/Exception) $error) Outputs an error message. | | Details ------- ### setHelperSet([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. #### Parameters | | | | | --- | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set associated with this helper. #### Return Value | | | | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### static int strlen(string $string) Returns the length of a string, using mb\_strwidth if it is available. #### Parameters | | | | | --- | --- | --- | | string | $string | The string to check its length | #### Return Value | | | | --- | --- | | int | The length of the string | ### static string substr(string $string, int $from, int|null $length = null) Returns the subset of a string, using mb\_substr if it is available. #### Parameters | | | | | --- | --- | --- | | string | $string | String to subset | | int | $from | Start offset | | int|null | $length | Length to read | #### Return Value | | | | --- | --- | | string | The string subset | ### static formatTime($secs) #### Parameters | | | | | --- | --- | --- | | | $secs | | ### static formatMemory($memory) #### Parameters | | | | | --- | --- | --- | | | $memory | | ### static strlenWithoutDecoration([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | | | $string | | ### static removeDecoration([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | | | $string | | ### mixed ask([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Question](../question/question "Symfony\Component\Console\Question\Question") $question) Asks a question to the user. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | [Question](../question/question "Symfony\Component\Console\Question\Question") | $question | | #### Return Value | | | | --- | --- | | mixed | The user answer | #### Exceptions | | | | --- | --- | | [RuntimeException](../exception/runtimeexception "Symfony\Component\Console\Exception\RuntimeException") | If there is no data to read in the input stream | ### string getName() Returns the canonical name of this helper. #### Return Value | | | | --- | --- | | string | The canonical name | ### static disableStty() Prevents usage of stty. ### protected writePrompt([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Question](../question/question "Symfony\Component\Console\Question\Question") $question) Outputs the question prompt. #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | [Question](../question/question "Symfony\Component\Console\Question\Question") | $question | | ### protected writeError([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Exception](http://php.net/Exception) $error) Outputs an error message. #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | [Exception](http://php.net/Exception) | $error | | symfony ProcessHelper ProcessHelper ============== class **ProcessHelper** extends [Helper](helper "Symfony\Component\Console\Helper\Helper") The ProcessHelper class provides helpers to run external processes. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $helperSet | | from [Helper](helper#property_helperSet "Symfony\Component\Console\Helper\Helper") | Methods ------- | | | | | --- | --- | --- | | | [setHelperSet](#method_setHelperSet)([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. | from [Helper](helper#method_setHelperSet "Symfony\Component\Console\Helper\Helper") | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set associated with this helper. | from [Helper](helper#method_getHelperSet "Symfony\Component\Console\Helper\Helper") | | static int | [strlen](#method_strlen)(string $string) Returns the length of a string, using mb\_strwidth if it is available. | from [Helper](helper#method_strlen "Symfony\Component\Console\Helper\Helper") | | static string | [substr](#method_substr)(string $string, int $from, int|null $length = null) Returns the subset of a string, using mb\_substr if it is available. | from [Helper](helper#method_substr "Symfony\Component\Console\Helper\Helper") | | static | [formatTime](#method_formatTime)($secs) | from [Helper](helper#method_formatTime "Symfony\Component\Console\Helper\Helper") | | static | [formatMemory](#method_formatMemory)($memory) | from [Helper](helper#method_formatMemory "Symfony\Component\Console\Helper\Helper") | | static | [strlenWithoutDecoration](#method_strlenWithoutDecoration)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) | from [Helper](helper#method_strlenWithoutDecoration "Symfony\Component\Console\Helper\Helper") | | static | [removeDecoration](#method_removeDecoration)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) | from [Helper](helper#method_removeDecoration "Symfony\Component\Console\Helper\Helper") | | [Process](../../process/process "Symfony\Component\Process\Process") | [run](#method_run)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, string|array|[Process](../../process/process "Symfony\Component\Process\Process") $cmd, string|null $error = null, callable $callback = null, int $verbosity = OutputInterface::VERBOSITY\_VERY\_VERBOSE) Runs an external process. | | | [Process](../../process/process "Symfony\Component\Process\Process") | [mustRun](#method_mustRun)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, string|[Process](../../process/process "Symfony\Component\Process\Process") $cmd, string|null $error = null, callable $callback = null) Runs the process. | | | callable | [wrapCallback](#method_wrapCallback)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Process](../../process/process "Symfony\Component\Process\Process") $process, callable $callback = null) Wraps a Process callback to add debugging output. | | | string | [getName](#method_getName)() Returns the canonical name of this helper. | | Details ------- ### setHelperSet([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. #### Parameters | | | | | --- | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set associated with this helper. #### Return Value | | | | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### static int strlen(string $string) Returns the length of a string, using mb\_strwidth if it is available. #### Parameters | | | | | --- | --- | --- | | string | $string | The string to check its length | #### Return Value | | | | --- | --- | | int | The length of the string | ### static string substr(string $string, int $from, int|null $length = null) Returns the subset of a string, using mb\_substr if it is available. #### Parameters | | | | | --- | --- | --- | | string | $string | String to subset | | int | $from | Start offset | | int|null | $length | Length to read | #### Return Value | | | | --- | --- | | string | The string subset | ### static formatTime($secs) #### Parameters | | | | | --- | --- | --- | | | $secs | | ### static formatMemory($memory) #### Parameters | | | | | --- | --- | --- | | | $memory | | ### static strlenWithoutDecoration([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | | | $string | | ### static removeDecoration([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | | | $string | | ### [Process](../../process/process "Symfony\Component\Process\Process") run([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, string|array|[Process](../../process/process "Symfony\Component\Process\Process") $cmd, string|null $error = null, callable $callback = null, int $verbosity = OutputInterface::VERBOSITY\_VERY\_VERBOSE) Runs an external process. #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | An OutputInterface instance | | string|array|[Process](../../process/process "Symfony\Component\Process\Process") | $cmd | An instance of Process or an array of arguments to escape and run or a command to run | | string|null | $error | An error message that must be displayed if something went wrong | | callable | $callback | A PHP callback to run whenever there is some output available on STDOUT or STDERR | | int | $verbosity | The threshold for verbosity | #### Return Value | | | | --- | --- | | [Process](../../process/process "Symfony\Component\Process\Process") | The process that ran | ### [Process](../../process/process "Symfony\Component\Process\Process") mustRun([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, string|[Process](../../process/process "Symfony\Component\Process\Process") $cmd, string|null $error = null, callable $callback = null) Runs the process. This is identical to run() except that an exception is thrown if the process exits with a non-zero exit code. #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | An OutputInterface instance | | string|[Process](../../process/process "Symfony\Component\Process\Process") | $cmd | An instance of Process or a command to run | | string|null | $error | An error message that must be displayed if something went wrong | | callable | $callback | A PHP callback to run whenever there is some output available on STDOUT or STDERR | #### Return Value | | | | --- | --- | | [Process](../../process/process "Symfony\Component\Process\Process") | The process that ran | #### Exceptions | | | | --- | --- | | [ProcessFailedException](../../process/exception/processfailedexception "Symfony\Component\Process\Exception\ProcessFailedException") | | #### See also | | | | --- | --- | | run() | | ### callable wrapCallback([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Process](../../process/process "Symfony\Component\Process\Process") $process, callable $callback = null) Wraps a Process callback to add debugging output. #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | An OutputInterface interface | | [Process](../../process/process "Symfony\Component\Process\Process") | $process | The Process | | callable | $callback | A PHP callable | #### Return Value | | | | --- | --- | | callable | | ### string getName() Returns the canonical name of this helper. #### Return Value | | | | --- | --- | | string | The canonical name |
programming_docs
symfony InputAwareHelper InputAwareHelper ================= abstract class **InputAwareHelper** extends [Helper](helper "Symfony\Component\Console\Helper\Helper") implements [InputAwareInterface](../input/inputawareinterface "Symfony\Component\Console\Input\InputAwareInterface") An implementation of InputAwareInterface for Helpers. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $helperSet | | from [Helper](helper#property_helperSet "Symfony\Component\Console\Helper\Helper") | | protected | $input | | | Methods ------- | | | | | --- | --- | --- | | | [setHelperSet](#method_setHelperSet)([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. | from [Helper](helper#method_setHelperSet "Symfony\Component\Console\Helper\Helper") | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set associated with this helper. | from [Helper](helper#method_getHelperSet "Symfony\Component\Console\Helper\Helper") | | static int | [strlen](#method_strlen)(string $string) Returns the length of a string, using mb\_strwidth if it is available. | from [Helper](helper#method_strlen "Symfony\Component\Console\Helper\Helper") | | static string | [substr](#method_substr)(string $string, int $from, int|null $length = null) Returns the subset of a string, using mb\_substr if it is available. | from [Helper](helper#method_substr "Symfony\Component\Console\Helper\Helper") | | static | [formatTime](#method_formatTime)($secs) | from [Helper](helper#method_formatTime "Symfony\Component\Console\Helper\Helper") | | static | [formatMemory](#method_formatMemory)($memory) | from [Helper](helper#method_formatMemory "Symfony\Component\Console\Helper\Helper") | | static | [strlenWithoutDecoration](#method_strlenWithoutDecoration)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) | from [Helper](helper#method_strlenWithoutDecoration "Symfony\Component\Console\Helper\Helper") | | static | [removeDecoration](#method_removeDecoration)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) | from [Helper](helper#method_removeDecoration "Symfony\Component\Console\Helper\Helper") | | | [setInput](#method_setInput)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input) Sets the Console Input. | | Details ------- ### setHelperSet([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. #### Parameters | | | | | --- | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set associated with this helper. #### Return Value | | | | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### static int strlen(string $string) Returns the length of a string, using mb\_strwidth if it is available. #### Parameters | | | | | --- | --- | --- | | string | $string | The string to check its length | #### Return Value | | | | --- | --- | | int | The length of the string | ### static string substr(string $string, int $from, int|null $length = null) Returns the subset of a string, using mb\_substr if it is available. #### Parameters | | | | | --- | --- | --- | | string | $string | String to subset | | int | $from | Start offset | | int|null | $length | Length to read | #### Return Value | | | | --- | --- | | string | The string subset | ### static formatTime($secs) #### Parameters | | | | | --- | --- | --- | | | $secs | | ### static formatMemory($memory) #### Parameters | | | | | --- | --- | --- | | | $memory | | ### static strlenWithoutDecoration([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | | | $string | | ### static removeDecoration([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | | | $string | | ### setInput([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input) Sets the Console Input. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | symfony TableRows TableRows ========== class **TableRows** implements [IteratorAggregate](http://php.net/IteratorAggregate) Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(callable $generator) | | | | [getIterator](#method_getIterator)() | | Details ------- ### \_\_construct(callable $generator) #### Parameters | | | | | --- | --- | --- | | callable | $generator | | ### getIterator() symfony DebugFormatterHelper DebugFormatterHelper ===================== class **DebugFormatterHelper** extends [Helper](helper "Symfony\Component\Console\Helper\Helper") Helps outputting debug information when running an external program from a command. An external program can be a Process, an HTTP request, or anything else. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $helperSet | | from [Helper](helper#property_helperSet "Symfony\Component\Console\Helper\Helper") | Methods ------- | | | | | --- | --- | --- | | | [setHelperSet](#method_setHelperSet)([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. | from [Helper](helper#method_setHelperSet "Symfony\Component\Console\Helper\Helper") | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set associated with this helper. | from [Helper](helper#method_getHelperSet "Symfony\Component\Console\Helper\Helper") | | static int | [strlen](#method_strlen)(string $string) Returns the length of a string, using mb\_strwidth if it is available. | from [Helper](helper#method_strlen "Symfony\Component\Console\Helper\Helper") | | static string | [substr](#method_substr)(string $string, int $from, int|null $length = null) Returns the subset of a string, using mb\_substr if it is available. | from [Helper](helper#method_substr "Symfony\Component\Console\Helper\Helper") | | static | [formatTime](#method_formatTime)($secs) | from [Helper](helper#method_formatTime "Symfony\Component\Console\Helper\Helper") | | static | [formatMemory](#method_formatMemory)($memory) | from [Helper](helper#method_formatMemory "Symfony\Component\Console\Helper\Helper") | | static | [strlenWithoutDecoration](#method_strlenWithoutDecoration)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) | from [Helper](helper#method_strlenWithoutDecoration "Symfony\Component\Console\Helper\Helper") | | static | [removeDecoration](#method_removeDecoration)([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) | from [Helper](helper#method_removeDecoration "Symfony\Component\Console\Helper\Helper") | | string | [start](#method_start)(string $id, string $message, string $prefix = 'RUN') Starts a debug formatting session. | | | string | [progress](#method_progress)(string $id, string $buffer, bool $error = false, string $prefix = 'OUT', string $errorPrefix = 'ERR') Adds progress to a formatting session. | | | string | [stop](#method_stop)(string $id, string $message, bool $successful, string $prefix = 'RES') Stops a formatting session. | | | string | [getName](#method_getName)() Returns the canonical name of this helper. | | Details ------- ### setHelperSet([HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet = null) Sets the helper set associated with this helper. #### Parameters | | | | | --- | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set associated with this helper. #### Return Value | | | | --- | --- | | [HelperSet](helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### static int strlen(string $string) Returns the length of a string, using mb\_strwidth if it is available. #### Parameters | | | | | --- | --- | --- | | string | $string | The string to check its length | #### Return Value | | | | --- | --- | | int | The length of the string | ### static string substr(string $string, int $from, int|null $length = null) Returns the subset of a string, using mb\_substr if it is available. #### Parameters | | | | | --- | --- | --- | | string | $string | String to subset | | int | $from | Start offset | | int|null | $length | Length to read | #### Return Value | | | | --- | --- | | string | The string subset | ### static formatTime($secs) #### Parameters | | | | | --- | --- | --- | | | $secs | | ### static formatMemory($memory) #### Parameters | | | | | --- | --- | --- | | | $memory | | ### static strlenWithoutDecoration([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | | | $string | | ### static removeDecoration([OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") $formatter, $string) #### Parameters | | | | | --- | --- | --- | | [OutputFormatterInterface](../formatter/outputformatterinterface "Symfony\Component\Console\Formatter\OutputFormatterInterface") | $formatter | | | | $string | | ### string start(string $id, string $message, string $prefix = 'RUN') Starts a debug formatting session. #### Parameters | | | | | --- | --- | --- | | string | $id | The id of the formatting session | | string | $message | The message to display | | string | $prefix | The prefix to use | #### Return Value | | | | --- | --- | | string | | ### string progress(string $id, string $buffer, bool $error = false, string $prefix = 'OUT', string $errorPrefix = 'ERR') Adds progress to a formatting session. #### Parameters | | | | | --- | --- | --- | | string | $id | The id of the formatting session | | string | $buffer | The message to display | | bool | $error | Whether to consider the buffer as error | | string | $prefix | The prefix for output | | string | $errorPrefix | The prefix for error output | #### Return Value | | | | --- | --- | | string | | ### string stop(string $id, string $message, bool $successful, string $prefix = 'RES') Stops a formatting session. #### Parameters | | | | | --- | --- | --- | | string | $id | The id of the formatting session | | string | $message | The message to display | | bool | $successful | Whether to consider the result as success | | string | $prefix | The prefix for the end output | #### Return Value | | | | --- | --- | | string | | ### string getName() Returns the canonical name of this helper. #### Return Value | | | | --- | --- | | string | The canonical name | symfony ProgressBar ProgressBar ============ class **ProgressBar** The ProgressBar provides helpers to display progress output. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, int $max = 0) | | | static void | [setPlaceholderFormatterDefinition](#method_setPlaceholderFormatterDefinition)(string $name, callable $callable) Sets a placeholder formatter for a given name. | | | static callable|null | [getPlaceholderFormatterDefinition](#method_getPlaceholderFormatterDefinition)(string $name) Gets the placeholder formatter for a given name. | | | static void | [setFormatDefinition](#method_setFormatDefinition)(string $name, string $format) Sets a format for a given name. | | | static string|null | [getFormatDefinition](#method_getFormatDefinition)(string $name) Gets the format for a given name. | | | | [setMessage](#method_setMessage)(string $message, string $name = 'message') Associates a text with a named placeholder. | | | | [getMessage](#method_getMessage)(string $name = 'message') | | | int | [getStartTime](#method_getStartTime)() | | | int | [getMaxSteps](#method_getMaxSteps)() | | | int | [getProgress](#method_getProgress)() | | | float | [getProgressPercent](#method_getProgressPercent)() | | | | [setBarWidth](#method_setBarWidth)(int $size) | | | int | [getBarWidth](#method_getBarWidth)() | | | | [setBarCharacter](#method_setBarCharacter)(string $char) | | | string | [getBarCharacter](#method_getBarCharacter)() | | | | [setEmptyBarCharacter](#method_setEmptyBarCharacter)(string $char) | | | string | [getEmptyBarCharacter](#method_getEmptyBarCharacter)() | | | | [setProgressCharacter](#method_setProgressCharacter)(string $char) | | | string | [getProgressCharacter](#method_getProgressCharacter)() | | | | [setFormat](#method_setFormat)(string $format) | | | | [setRedrawFrequency](#method_setRedrawFrequency)(int $freq) Sets the redraw frequency. | | | | [start](#method_start)(int $max = null) Starts the progress output. | | | | [advance](#method_advance)(int $step = 1) Advances the progress output X steps. | | | | [setOverwrite](#method_setOverwrite)(bool $overwrite) Sets whether to overwrite the progressbar, false for new line. | | | | [setProgress](#method_setProgress)(int $step) | | | | [setMaxSteps](#method_setMaxSteps)(int $max) | | | void | [finish](#method_finish)() Finishes the progress output. | | | void | [display](#method_display)() Outputs the current progress string. | | | void | [clear](#method_clear)() Removes the progress bar from the current line. | | Details ------- ### \_\_construct([OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, int $max = 0) #### Parameters | | | | | --- | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | An OutputInterface instance | | int | $max | Maximum steps (0 if unknown) | ### static void setPlaceholderFormatterDefinition(string $name, callable $callable) Sets a placeholder formatter for a given name. This method also allow you to override an existing placeholder. #### Parameters | | | | | --- | --- | --- | | string | $name | The placeholder name (including the delimiter char like %) | | callable | $callable | A PHP callable | #### Return Value | | | | --- | --- | | void | | ### static callable|null getPlaceholderFormatterDefinition(string $name) Gets the placeholder formatter for a given name. #### Parameters | | | | | --- | --- | --- | | string | $name | The placeholder name (including the delimiter char like %) | #### Return Value | | | | --- | --- | | callable|null | A PHP callable | ### static void setFormatDefinition(string $name, string $format) Sets a format for a given name. This method also allow you to override an existing format. #### Parameters | | | | | --- | --- | --- | | string | $name | The format name | | string | $format | A format string | #### Return Value | | | | --- | --- | | void | | ### static string|null getFormatDefinition(string $name) Gets the format for a given name. #### Parameters | | | | | --- | --- | --- | | string | $name | The format name | #### Return Value | | | | --- | --- | | string|null | A format string | ### setMessage(string $message, string $name = 'message') Associates a text with a named placeholder. The text is displayed when the progress bar is rendered but only when the corresponding placeholder is part of the custom format line (by wrapping the name with %). #### Parameters | | | | | --- | --- | --- | | string | $message | The text to associate with the placeholder | | string | $name | The name of the placeholder | ### getMessage(string $name = 'message') #### Parameters | | | | | --- | --- | --- | | string | $name | | ### int getStartTime() #### Return Value | | | | --- | --- | | int | | ### int getMaxSteps() #### Return Value | | | | --- | --- | | int | | ### int getProgress() #### Return Value | | | | --- | --- | | int | | ### float getProgressPercent() #### Return Value | | | | --- | --- | | float | | ### setBarWidth(int $size) #### Parameters | | | | | --- | --- | --- | | int | $size | | ### int getBarWidth() #### Return Value | | | | --- | --- | | int | | ### setBarCharacter(string $char) #### Parameters | | | | | --- | --- | --- | | string | $char | | ### string getBarCharacter() #### Return Value | | | | --- | --- | | string | | ### setEmptyBarCharacter(string $char) #### Parameters | | | | | --- | --- | --- | | string | $char | | ### string getEmptyBarCharacter() #### Return Value | | | | --- | --- | | string | | ### setProgressCharacter(string $char) #### Parameters | | | | | --- | --- | --- | | string | $char | | ### string getProgressCharacter() #### Return Value | | | | --- | --- | | string | | ### setFormat(string $format) #### Parameters | | | | | --- | --- | --- | | string | $format | | ### setRedrawFrequency(int $freq) Sets the redraw frequency. #### Parameters | | | | | --- | --- | --- | | int | $freq | The frequency in steps | ### start(int $max = null) Starts the progress output. #### Parameters | | | | | --- | --- | --- | | int | $max | Number of steps to complete the bar (0 if indeterminate), null to leave unchanged | ### advance(int $step = 1) Advances the progress output X steps. #### Parameters | | | | | --- | --- | --- | | int | $step | Number of steps to advance | ### setOverwrite(bool $overwrite) Sets whether to overwrite the progressbar, false for new line. #### Parameters | | | | | --- | --- | --- | | bool | $overwrite | | ### setProgress(int $step) #### Parameters | | | | | --- | --- | --- | | int | $step | | ### setMaxSteps(int $max) #### Parameters | | | | | --- | --- | --- | | int | $max | | ### void finish() Finishes the progress output. #### Return Value | | | | --- | --- | | void | | ### void display() Outputs the current progress string. #### Return Value | | | | --- | --- | | void | | ### void clear() Removes the progress bar from the current line. This is useful if you wish to write some output while a progress bar is running. Call display() to show the progress bar again. #### Return Value | | | | --- | --- | | void | |
programming_docs
symfony AddConsoleCommandPass AddConsoleCommandPass ====================== class **AddConsoleCommandPass** implements [CompilerPassInterface](../../dependencyinjection/compiler/compilerpassinterface "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface") Registers console commands. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $commandLoaderServiceId = 'console.command\_loader', string $commandTag = 'console.command') | | | | [process](#method_process)([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. | | Details ------- ### \_\_construct(string $commandLoaderServiceId = 'console.command\_loader', string $commandTag = 'console.command') #### Parameters | | | | | --- | --- | --- | | string | $commandLoaderServiceId | | | string | $commandTag | | ### process([ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) You can modify the container here before it is dumped to PHP code. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | symfony InvalidArgumentException InvalidArgumentException ========================= class **InvalidArgumentException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Console\Exception\ExceptionInterface") symfony CommandNotFoundException CommandNotFoundException ========================= class **CommandNotFoundException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Console\Exception\ExceptionInterface") Represents an incorrect command name typed in the console. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $message, array $alternatives = array(), int $code = 0, [Exception](http://php.net/Exception) $previous = null) | | | array | [getAlternatives](#method_getAlternatives)() | | Details ------- ### \_\_construct(string $message, array $alternatives = array(), int $code = 0, [Exception](http://php.net/Exception) $previous = null) #### Parameters | | | | | --- | --- | --- | | string | $message | Exception message to throw | | array | $alternatives | List of similar defined names | | int | $code | Exception code | | [Exception](http://php.net/Exception) | $previous | Previous exception used for the exception chaining | ### array getAlternatives() #### Return Value | | | | --- | --- | | array | A list of similar defined names | symfony ExceptionInterface ExceptionInterface =================== interface **ExceptionInterface** ExceptionInterface. symfony InvalidOptionException InvalidOptionException ======================= class **InvalidOptionException** extends [InvalidArgumentException](http://php.net/InvalidArgumentException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Console\Exception\ExceptionInterface") Represents an incorrect option name typed in the console. symfony LogicException LogicException =============== class **LogicException** extends [LogicException](http://php.net/LogicException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Console\Exception\ExceptionInterface") symfony RuntimeException RuntimeException ================= class **RuntimeException** extends [RuntimeException](http://php.net/RuntimeException) implements [ExceptionInterface](exceptioninterface "Symfony\Component\Console\Exception\ExceptionInterface") symfony NamespaceNotFoundException NamespaceNotFoundException =========================== class **NamespaceNotFoundException** extends [CommandNotFoundException](commandnotfoundexception "Symfony\Component\Console\Exception\CommandNotFoundException") Represents an incorrect namespace typed in the console. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $message, array $alternatives = array(), int $code = 0, [Exception](http://php.net/Exception) $previous = null) | from [CommandNotFoundException](commandnotfoundexception#method___construct "Symfony\Component\Console\Exception\CommandNotFoundException") | | array | [getAlternatives](#method_getAlternatives)() | from [CommandNotFoundException](commandnotfoundexception#method_getAlternatives "Symfony\Component\Console\Exception\CommandNotFoundException") | Details ------- ### \_\_construct(string $message, array $alternatives = array(), int $code = 0, [Exception](http://php.net/Exception) $previous = null) #### Parameters | | | | | --- | --- | --- | | string | $message | Exception message to throw | | array | $alternatives | List of similar defined names | | int | $code | Exception code | | [Exception](http://php.net/Exception) | $previous | Previous exception used for the exception chaining | ### array getAlternatives() #### Return Value | | | | --- | --- | | array | A list of similar defined names | symfony ConsoleCommandEvent ConsoleCommandEvent ==================== class **ConsoleCommandEvent** extends [ConsoleEvent](consoleevent "Symfony\Component\Console\Event\ConsoleEvent") Allows to do things before the command is executed, like skipping the command or changing the input. Constants --------- | | | | --- | --- | | RETURN\_CODE\_DISABLED | *The return code for skipped commands, this will also be passed into the terminate event.* | Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $command | | from [ConsoleEvent](consoleevent#property_command "Symfony\Component\Console\Event\ConsoleEvent") | Methods ------- | | | | | --- | --- | --- | | bool | [isPropagationStopped](#method_isPropagationStopped)() Returns whether further event listeners should be triggered. | from [Event](../../eventdispatcher/event#method_isPropagationStopped "Symfony\Component\EventDispatcher\Event") | | | [stopPropagation](#method_stopPropagation)() Stops the propagation of the event to further event listeners. | from [Event](../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | | [\_\_construct](#method___construct)([Command](../command/command "Symfony\Component\Console\Command\Command") $command = null, [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) | from [ConsoleEvent](consoleevent#method___construct "Symfony\Component\Console\Event\ConsoleEvent") | | [Command](../command/command "Symfony\Component\Console\Command\Command")|null | [getCommand](#method_getCommand)() Gets the command that is executed. | from [ConsoleEvent](consoleevent#method_getCommand "Symfony\Component\Console\Event\ConsoleEvent") | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | [getInput](#method_getInput)() Gets the input instance. | from [ConsoleEvent](consoleevent#method_getInput "Symfony\Component\Console\Event\ConsoleEvent") | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | [getOutput](#method_getOutput)() Gets the output instance. | from [ConsoleEvent](consoleevent#method_getOutput "Symfony\Component\Console\Event\ConsoleEvent") | | bool | [disableCommand](#method_disableCommand)() Disables the command, so it won't be run. | | | bool | [enableCommand](#method_enableCommand)() Enables the command. | | | bool | [commandShouldRun](#method_commandShouldRun)() Returns true if the command is runnable, false otherwise. | | Details ------- ### bool isPropagationStopped() Returns whether further event listeners should be triggered. #### Return Value | | | | --- | --- | | bool | Whether propagation was already stopped for this event | #### See also | | | | --- | --- | | [Event::stopPropagation](../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | ### stopPropagation() Stops the propagation of the event to further event listeners. If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation(). ### \_\_construct([Command](../command/command "Symfony\Component\Console\Command\Command") $command = null, [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) #### Parameters | | | | | --- | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | $command | | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### [Command](../command/command "Symfony\Component\Console\Command\Command")|null getCommand() Gets the command that is executed. #### Return Value | | | | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command")|null | A Command instance | ### [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") getInput() Gets the input instance. #### Return Value | | | | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | An InputInterface instance | ### [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") getOutput() Gets the output instance. #### Return Value | | | | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | An OutputInterface instance | ### bool disableCommand() Disables the command, so it won't be run. #### Return Value | | | | --- | --- | | bool | | ### bool enableCommand() Enables the command. #### Return Value | | | | --- | --- | | bool | | ### bool commandShouldRun() Returns true if the command is runnable, false otherwise. #### Return Value | | | | --- | --- | | bool | | symfony ConsoleTerminateEvent ConsoleTerminateEvent ====================== class **ConsoleTerminateEvent** extends [ConsoleEvent](consoleevent "Symfony\Component\Console\Event\ConsoleEvent") Allows to manipulate the exit code of a command after its execution. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $command | | from [ConsoleEvent](consoleevent#property_command "Symfony\Component\Console\Event\ConsoleEvent") | Methods ------- | | | | | --- | --- | --- | | bool | [isPropagationStopped](#method_isPropagationStopped)() Returns whether further event listeners should be triggered. | from [Event](../../eventdispatcher/event#method_isPropagationStopped "Symfony\Component\EventDispatcher\Event") | | | [stopPropagation](#method_stopPropagation)() Stops the propagation of the event to further event listeners. | from [Event](../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | | [\_\_construct](#method___construct)([Command](../command/command "Symfony\Component\Console\Command\Command") $command, [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, int $exitCode) | | | [Command](../command/command "Symfony\Component\Console\Command\Command")|null | [getCommand](#method_getCommand)() Gets the command that is executed. | from [ConsoleEvent](consoleevent#method_getCommand "Symfony\Component\Console\Event\ConsoleEvent") | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | [getInput](#method_getInput)() Gets the input instance. | from [ConsoleEvent](consoleevent#method_getInput "Symfony\Component\Console\Event\ConsoleEvent") | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | [getOutput](#method_getOutput)() Gets the output instance. | from [ConsoleEvent](consoleevent#method_getOutput "Symfony\Component\Console\Event\ConsoleEvent") | | | [setExitCode](#method_setExitCode)(int $exitCode) Sets the exit code. | | | int | [getExitCode](#method_getExitCode)() Gets the exit code. | | Details ------- ### bool isPropagationStopped() Returns whether further event listeners should be triggered. #### Return Value | | | | --- | --- | | bool | Whether propagation was already stopped for this event | #### See also | | | | --- | --- | | [Event::stopPropagation](../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | ### stopPropagation() Stops the propagation of the event to further event listeners. If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation(). ### \_\_construct([Command](../command/command "Symfony\Component\Console\Command\Command") $command, [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, int $exitCode) #### Parameters | | | | | --- | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | $command | | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | int | $exitCode | | ### [Command](../command/command "Symfony\Component\Console\Command\Command")|null getCommand() Gets the command that is executed. #### Return Value | | | | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command")|null | A Command instance | ### [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") getInput() Gets the input instance. #### Return Value | | | | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | An InputInterface instance | ### [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") getOutput() Gets the output instance. #### Return Value | | | | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | An OutputInterface instance | ### setExitCode(int $exitCode) Sets the exit code. #### Parameters | | | | | --- | --- | --- | | int | $exitCode | The command exit code | ### int getExitCode() Gets the exit code. #### Return Value | | | | --- | --- | | int | The command exit code | symfony ConsoleErrorEvent ConsoleErrorEvent ================== class **ConsoleErrorEvent** extends [ConsoleEvent](consoleevent "Symfony\Component\Console\Event\ConsoleEvent") Allows to handle throwables thrown while running a command. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $command | | from [ConsoleEvent](consoleevent#property_command "Symfony\Component\Console\Event\ConsoleEvent") | Methods ------- | | | | | --- | --- | --- | | bool | [isPropagationStopped](#method_isPropagationStopped)() Returns whether further event listeners should be triggered. | from [Event](../../eventdispatcher/event#method_isPropagationStopped "Symfony\Component\EventDispatcher\Event") | | | [stopPropagation](#method_stopPropagation)() Stops the propagation of the event to further event listeners. | from [Event](../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | | [\_\_construct](#method___construct)([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Throwable](http://php.net/Throwable) $error, [Command](../command/command "Symfony\Component\Console\Command\Command") $command = null) | | | [Command](../command/command "Symfony\Component\Console\Command\Command")|null | [getCommand](#method_getCommand)() Gets the command that is executed. | from [ConsoleEvent](consoleevent#method_getCommand "Symfony\Component\Console\Event\ConsoleEvent") | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | [getInput](#method_getInput)() Gets the input instance. | from [ConsoleEvent](consoleevent#method_getInput "Symfony\Component\Console\Event\ConsoleEvent") | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | [getOutput](#method_getOutput)() Gets the output instance. | from [ConsoleEvent](consoleevent#method_getOutput "Symfony\Component\Console\Event\ConsoleEvent") | | [Throwable](http://php.net/Throwable) | [getError](#method_getError)() | | | void | [setError](#method_setError)([Throwable](http://php.net/Throwable) $error) | | | void | [setExitCode](#method_setExitCode)(int $exitCode) | | | int | [getExitCode](#method_getExitCode)() | | Details ------- ### bool isPropagationStopped() Returns whether further event listeners should be triggered. #### Return Value | | | | --- | --- | | bool | Whether propagation was already stopped for this event | #### See also | | | | --- | --- | | [Event::stopPropagation](../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | ### stopPropagation() Stops the propagation of the event to further event listeners. If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation(). ### \_\_construct([InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output, [Throwable](http://php.net/Throwable) $error, [Command](../command/command "Symfony\Component\Console\Command\Command") $command = null) #### Parameters | | | | | --- | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | | [Throwable](http://php.net/Throwable) | $error | | | [Command](../command/command "Symfony\Component\Console\Command\Command") | $command | | ### [Command](../command/command "Symfony\Component\Console\Command\Command")|null getCommand() Gets the command that is executed. #### Return Value | | | | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command")|null | A Command instance | ### [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") getInput() Gets the input instance. #### Return Value | | | | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | An InputInterface instance | ### [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") getOutput() Gets the output instance. #### Return Value | | | | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | An OutputInterface instance | ### [Throwable](http://php.net/Throwable) getError() #### Return Value | | | | --- | --- | | [Throwable](http://php.net/Throwable) | | ### void setError([Throwable](http://php.net/Throwable) $error) #### Parameters | | | | | --- | --- | --- | | [Throwable](http://php.net/Throwable) | $error | | #### Return Value | | | | --- | --- | | void | | ### void setExitCode(int $exitCode) #### Parameters | | | | | --- | --- | --- | | int | $exitCode | | #### Return Value | | | | --- | --- | | void | | ### int getExitCode() #### Return Value | | | | --- | --- | | int | |
programming_docs
symfony ConsoleEvent ConsoleEvent ============= class **ConsoleEvent** extends [Event](../../eventdispatcher/event "Symfony\Component\EventDispatcher\Event") Allows to inspect input and output of a command. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $command | | | Methods ------- | | | | | --- | --- | --- | | bool | [isPropagationStopped](#method_isPropagationStopped)() Returns whether further event listeners should be triggered. | from [Event](../../eventdispatcher/event#method_isPropagationStopped "Symfony\Component\EventDispatcher\Event") | | | [stopPropagation](#method_stopPropagation)() Stops the propagation of the event to further event listeners. | from [Event](../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | | [\_\_construct](#method___construct)([Command](../command/command "Symfony\Component\Console\Command\Command") $command = null, [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) | | | [Command](../command/command "Symfony\Component\Console\Command\Command")|null | [getCommand](#method_getCommand)() Gets the command that is executed. | | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | [getInput](#method_getInput)() Gets the input instance. | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | [getOutput](#method_getOutput)() Gets the output instance. | | Details ------- ### bool isPropagationStopped() Returns whether further event listeners should be triggered. #### Return Value | | | | --- | --- | | bool | Whether propagation was already stopped for this event | #### See also | | | | --- | --- | | [Event::stopPropagation](../../eventdispatcher/event#method_stopPropagation "Symfony\Component\EventDispatcher\Event") | | ### stopPropagation() Stops the propagation of the event to further event listeners. If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation(). ### \_\_construct([Command](../command/command "Symfony\Component\Console\Command\Command") $command = null, [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) #### Parameters | | | | | --- | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command") | $command | | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### [Command](../command/command "Symfony\Component\Console\Command\Command")|null getCommand() Gets the command that is executed. #### Return Value | | | | --- | --- | | [Command](../command/command "Symfony\Component\Console\Command\Command")|null | A Command instance | ### [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") getInput() Gets the input instance. #### Return Value | | | | --- | --- | | [InputInterface](../input/inputinterface "Symfony\Component\Console\Input\InputInterface") | An InputInterface instance | ### [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") getOutput() Gets the output instance. #### Return Value | | | | --- | --- | | [OutputInterface](../output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | An OutputInterface instance | symfony ErrorListener ErrorListener ============== class **ErrorListener** implements [EventSubscriberInterface](../../eventdispatcher/eventsubscriberinterface "Symfony\Component\EventDispatcher\EventSubscriberInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(LoggerInterface $logger = null) | | | | [onConsoleError](#method_onConsoleError)([ConsoleErrorEvent](../event/consoleerrorevent "Symfony\Component\Console\Event\ConsoleErrorEvent") $event) | | | | [onConsoleTerminate](#method_onConsoleTerminate)([ConsoleTerminateEvent](../event/consoleterminateevent "Symfony\Component\Console\Event\ConsoleTerminateEvent") $event) | | | static array | [getSubscribedEvents](#method_getSubscribedEvents)() Returns an array of event names this subscriber wants to listen to. | | Details ------- ### \_\_construct(LoggerInterface $logger = null) #### Parameters | | | | | --- | --- | --- | | LoggerInterface | $logger | | ### onConsoleError([ConsoleErrorEvent](../event/consoleerrorevent "Symfony\Component\Console\Event\ConsoleErrorEvent") $event) #### Parameters | | | | | --- | --- | --- | | [ConsoleErrorEvent](../event/consoleerrorevent "Symfony\Component\Console\Event\ConsoleErrorEvent") | $event | | ### onConsoleTerminate([ConsoleTerminateEvent](../event/consoleterminateevent "Symfony\Component\Console\Event\ConsoleTerminateEvent") $event) #### Parameters | | | | | --- | --- | --- | | [ConsoleTerminateEvent](../event/consoleterminateevent "Symfony\Component\Console\Event\ConsoleTerminateEvent") | $event | | ### static array getSubscribedEvents() Returns an array of event names this subscriber wants to listen to. The array keys are event names and the value can be: * The method name to call (priority defaults to 0) * An array composed of the method name to call and the priority * An array of arrays composed of the method names to call and respective priorities, or 0 if unset For instance: * array('eventName' => 'methodName') * array('eventName' => array('methodName', $priority)) * array('eventName' => array(array('methodName1', $priority), array('methodName2'))) #### Return Value | | | | --- | --- | | array | The event names to listen to | symfony FullStack FullStack ========== class **FullStack** A marker to be able to check if symfony/symfony is installed instead of the individual components/bundles. symfony Symfony\Bundle\FrameworkBundle Symfony\Bundle\FrameworkBundle ============================== Namespaces ---------- [Symfony\Bundle\FrameworkBundle\CacheWarmer](frameworkbundle/cachewarmer)[Symfony\Bundle\FrameworkBundle\Command](frameworkbundle/command)[Symfony\Bundle\FrameworkBundle\Console](frameworkbundle/console)[Symfony\Bundle\FrameworkBundle\Controller](frameworkbundle/controller)[Symfony\Bundle\FrameworkBundle\DataCollector](frameworkbundle/datacollector)[Symfony\Bundle\FrameworkBundle\DependencyInjection](frameworkbundle/dependencyinjection)[Symfony\Bundle\FrameworkBundle\EventListener](frameworkbundle/eventlistener)[Symfony\Bundle\FrameworkBundle\HttpCache](frameworkbundle/httpcache)[Symfony\Bundle\FrameworkBundle\Kernel](frameworkbundle/kernel)[Symfony\Bundle\FrameworkBundle\Routing](frameworkbundle/routing)[Symfony\Bundle\FrameworkBundle\Templating](frameworkbundle/templating)[Symfony\Bundle\FrameworkBundle\Test](frameworkbundle/test)[Symfony\Bundle\FrameworkBundle\Translation](frameworkbundle/translation) Classes ------- | | | | --- | --- | | [Client](frameworkbundle/client "Symfony\Bundle\FrameworkBundle\Client") | Client simulates a browser and makes requests to a Kernel object. | | [FrameworkBundle](frameworkbundle/frameworkbundle "Symfony\Bundle\FrameworkBundle\FrameworkBundle") | Bundle. | symfony Symfony\Bundle\SecurityBundle Symfony\Bundle\SecurityBundle ============================= Namespaces ---------- [Symfony\Bundle\SecurityBundle\CacheWarmer](securitybundle/cachewarmer)[Symfony\Bundle\SecurityBundle\Command](securitybundle/command)[Symfony\Bundle\SecurityBundle\DataCollector](securitybundle/datacollector)[Symfony\Bundle\SecurityBundle\Debug](securitybundle/debug)[Symfony\Bundle\SecurityBundle\DependencyInjection](securitybundle/dependencyinjection)[Symfony\Bundle\SecurityBundle\EventListener](securitybundle/eventlistener)[Symfony\Bundle\SecurityBundle\Security](securitybundle/security)[Symfony\Bundle\SecurityBundle\Templating](securitybundle/templating) Classes ------- | | | | --- | --- | | [SecurityBundle](securitybundle/securitybundle "Symfony\Bundle\SecurityBundle\SecurityBundle") | Bundle. | | [SecurityUserValueResolver](securitybundle/securityuservalueresolver "Symfony\Bundle\SecurityBundle\SecurityUserValueResolver") deprecated | Supports the argument type of {see UserInterface}. | symfony Symfony\Bundle\WebProfilerBundle Symfony\Bundle\WebProfilerBundle ================================ Namespaces ---------- [Symfony\Bundle\WebProfilerBundle\Controller](webprofilerbundle/controller)[Symfony\Bundle\WebProfilerBundle\Csp](webprofilerbundle/csp)[Symfony\Bundle\WebProfilerBundle\DependencyInjection](webprofilerbundle/dependencyinjection)[Symfony\Bundle\WebProfilerBundle\EventListener](webprofilerbundle/eventlistener)[Symfony\Bundle\WebProfilerBundle\Profiler](webprofilerbundle/profiler)[Symfony\Bundle\WebProfilerBundle\Twig](webprofilerbundle/twig) Classes ------- | | | | --- | --- | | [WebProfilerBundle](webprofilerbundle/webprofilerbundle "Symfony\Bundle\WebProfilerBundle\WebProfilerBundle") | Bundle. | symfony Symfony\Bundle\WebServerBundle Symfony\Bundle\WebServerBundle ============================== Namespaces ---------- [Symfony\Bundle\WebServerBundle\Command](webserverbundle/command)[Symfony\Bundle\WebServerBundle\DependencyInjection](webserverbundle/dependencyinjection) Classes ------- | | | | --- | --- | | [WebServer](webserverbundle/webserver "Symfony\Bundle\WebServerBundle\WebServer") | Manages a local HTTP web server. | | [WebServerBundle](webserverbundle/webserverbundle "Symfony\Bundle\WebServerBundle\WebServerBundle") | | | [WebServerConfig](webserverbundle/webserverconfig "Symfony\Bundle\WebServerBundle\WebServerConfig") | | symfony Symfony\Bundle\TwigBundle Symfony\Bundle\TwigBundle ========================= Namespaces ---------- [Symfony\Bundle\TwigBundle\CacheWarmer](twigbundle/cachewarmer)[Symfony\Bundle\TwigBundle\Command](twigbundle/command)[Symfony\Bundle\TwigBundle\Controller](twigbundle/controller)[Symfony\Bundle\TwigBundle\DependencyInjection](twigbundle/dependencyinjection)[Symfony\Bundle\TwigBundle\Loader](twigbundle/loader) Classes ------- | | | | --- | --- | | [TemplateIterator](twigbundle/templateiterator "Symfony\Bundle\TwigBundle\TemplateIterator") | Iterator for all templates in bundles and in the application Resources directory. | | [TwigBundle](twigbundle/twigbundle "Symfony\Bundle\TwigBundle\TwigBundle") | Bundle. | | [TwigEngine](twigbundle/twigengine "Symfony\Bundle\TwigBundle\TwigEngine") | This engine renders Twig templates. | symfony Symfony\Bundle\DebugBundle Symfony\Bundle\DebugBundle ========================== Namespaces ---------- [Symfony\Bundle\DebugBundle\Command](debugbundle/command)[Symfony\Bundle\DebugBundle\DependencyInjection](debugbundle/dependencyinjection) Classes ------- | | | | --- | --- | | [DebugBundle](debugbundle/debugbundle "Symfony\Bundle\DebugBundle\DebugBundle") | | symfony SecurityBundle SecurityBundle =============== class **SecurityBundle** extends [Bundle](../../component/httpkernel/bundle/bundle "Symfony\Component\HttpKernel\Bundle\Bundle") Bundle. Traits ------ | | | | --- | --- | | [ContainerAwareTrait](../../component/dependencyinjection/containerawaretrait "Symfony\Component\DependencyInjection\ContainerAwareTrait") | ContainerAware trait. | Properties ---------- | | | | | | --- | --- | --- | --- | | protected [ContainerInterface](../../component/dependencyinjection/containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") | $container | | from [ContainerAwareTrait](../../component/dependencyinjection/containerawaretrait#property_container "Symfony\Component\DependencyInjection\ContainerAwareTrait") | | protected | $name | | from [Bundle](../../component/httpkernel/bundle/bundle#property_name "Symfony\Component\HttpKernel\Bundle\Bundle") | | protected | $extension | | from [Bundle](../../component/httpkernel/bundle/bundle#property_extension "Symfony\Component\HttpKernel\Bundle\Bundle") | | protected | $path | | from [Bundle](../../component/httpkernel/bundle/bundle#property_path "Symfony\Component\HttpKernel\Bundle\Bundle") | Methods ------- | | | | | --- | --- | --- | | | [setContainer](#method_setContainer)([ContainerInterface](../../component/dependencyinjection/containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") $container = null) | from [ContainerAwareTrait](../../component/dependencyinjection/containerawaretrait#method_setContainer "Symfony\Component\DependencyInjection\ContainerAwareTrait") | | | [boot](#method_boot)() Boots the Bundle. | from [Bundle](../../component/httpkernel/bundle/bundle#method_boot "Symfony\Component\HttpKernel\Bundle\Bundle") | | | [shutdown](#method_shutdown)() Shutdowns the Bundle. | from [Bundle](../../component/httpkernel/bundle/bundle#method_shutdown "Symfony\Component\HttpKernel\Bundle\Bundle") | | | [build](#method_build)([ContainerBuilder](../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Builds the bundle. | | | [ExtensionInterface](../../component/dependencyinjection/extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface")|null | [getContainerExtension](#method_getContainerExtension)() Returns the bundle's container extension. | from [Bundle](../../component/httpkernel/bundle/bundle#method_getContainerExtension "Symfony\Component\HttpKernel\Bundle\Bundle") | | string | [getNamespace](#method_getNamespace)() Gets the Bundle namespace. | from [Bundle](../../component/httpkernel/bundle/bundle#method_getNamespace "Symfony\Component\HttpKernel\Bundle\Bundle") | | string | [getPath](#method_getPath)() Gets the Bundle directory path. | from [Bundle](../../component/httpkernel/bundle/bundle#method_getPath "Symfony\Component\HttpKernel\Bundle\Bundle") | | string | [getName](#method_getName)() Returns the bundle name (the class short name). | from [Bundle](../../component/httpkernel/bundle/bundle#method_getName "Symfony\Component\HttpKernel\Bundle\Bundle") | | | [registerCommands](#method_registerCommands)([Application](../../component/console/application "Symfony\Component\Console\Application") $application) | from [Bundle](../../component/httpkernel/bundle/bundle#method_registerCommands "Symfony\Component\HttpKernel\Bundle\Bundle") | | string | [getContainerExtensionClass](#method_getContainerExtensionClass)() Returns the bundle's container extension class. | from [Bundle](../../component/httpkernel/bundle/bundle#method_getContainerExtensionClass "Symfony\Component\HttpKernel\Bundle\Bundle") | | [ExtensionInterface](../../component/dependencyinjection/extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface")|null | [createContainerExtension](#method_createContainerExtension)() Creates the bundle's container extension. | from [Bundle](../../component/httpkernel/bundle/bundle#method_createContainerExtension "Symfony\Component\HttpKernel\Bundle\Bundle") | Details ------- ### setContainer([ContainerInterface](../../component/dependencyinjection/containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") $container = null) #### Parameters | | | | | --- | --- | --- | | [ContainerInterface](../../component/dependencyinjection/containerinterface "Symfony\Component\DependencyInjection\ContainerInterface") | $container | | ### boot() Boots the Bundle. ### shutdown() Shutdowns the Bundle. ### build([ContainerBuilder](../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Builds the bundle. It is only ever called once when the cache is empty. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | ### [ExtensionInterface](../../component/dependencyinjection/extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface")|null getContainerExtension() Returns the bundle's container extension. #### Return Value | | | | --- | --- | | [ExtensionInterface](../../component/dependencyinjection/extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface")|null | The default extension or null if there is none | #### Exceptions | | | | --- | --- | | [LogicException](http://php.net/LogicException) | | ### string getNamespace() Gets the Bundle namespace. #### Return Value | | | | --- | --- | | string | The Bundle namespace | ### string getPath() Gets the Bundle directory path. The path should always be returned as a Unix path (with /). #### Return Value | | | | --- | --- | | string | The Bundle absolute path | ### final string getName() Returns the bundle name (the class short name). #### Return Value | | | | --- | --- | | string | The Bundle name | ### registerCommands([Application](../../component/console/application "Symfony\Component\Console\Application") $application) #### Parameters | | | | | --- | --- | --- | | [Application](../../component/console/application "Symfony\Component\Console\Application") | $application | | ### protected string getContainerExtensionClass() Returns the bundle's container extension class. #### Return Value | | | | --- | --- | | string | | ### protected [ExtensionInterface](../../component/dependencyinjection/extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface")|null createContainerExtension() Creates the bundle's container extension. #### Return Value | | | | --- | --- | | [ExtensionInterface](../../component/dependencyinjection/extension/extensioninterface "Symfony\Component\DependencyInjection\Extension\ExtensionInterface")|null | | symfony Symfony\Bundle\SecurityBundle\DataCollector Symfony\Bundle\SecurityBundle\DataCollector =========================================== Classes ------- | | | | --- | --- | | [SecurityDataCollector](datacollector/securitydatacollector "Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector") | | symfony Symfony\Bundle\SecurityBundle\Command Symfony\Bundle\SecurityBundle\Command ===================================== Classes ------- | | | | --- | --- | | [UserPasswordEncoderCommand](command/userpasswordencodercommand "Symfony\Bundle\SecurityBundle\Command\UserPasswordEncoderCommand") | Encode a user's password. | symfony SecurityUserValueResolver deprecated SecurityUserValueResolver deprecated ===================================== class **SecurityUserValueResolver** implements [ArgumentValueResolverInterface](../../component/httpkernel/controller/argumentvalueresolverinterface "Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface") deprecated | since | Symfony 4.1, use {@link UserValueResolver} instead | Supports the argument type of {see UserInterface}. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../component/security/core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage) | | | bool | [supports](#method_supports)([Request](../../component/httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [ArgumentMetadata](../../component/httpkernel/controllermetadata/argumentmetadata "Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata") $argument) Whether this resolver can resolve the value for the given ArgumentMetadata. | | | [Generator](http://php.net/Generator) | [resolve](#method_resolve)([Request](../../component/httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [ArgumentMetadata](../../component/httpkernel/controllermetadata/argumentmetadata "Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata") $argument) Returns the possible value(s). | | Details ------- ### \_\_construct([TokenStorageInterface](../../component/security/core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../component/security/core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | ### bool supports([Request](../../component/httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [ArgumentMetadata](../../component/httpkernel/controllermetadata/argumentmetadata "Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata") $argument) Whether this resolver can resolve the value for the given ArgumentMetadata. #### Parameters | | | | | --- | --- | --- | | [Request](../../component/httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [ArgumentMetadata](../../component/httpkernel/controllermetadata/argumentmetadata "Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata") | $argument | | #### Return Value | | | | --- | --- | | bool | | ### [Generator](http://php.net/Generator) resolve([Request](../../component/httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [ArgumentMetadata](../../component/httpkernel/controllermetadata/argumentmetadata "Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata") $argument) Returns the possible value(s). #### Parameters | | | | | --- | --- | --- | | [Request](../../component/httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [ArgumentMetadata](../../component/httpkernel/controllermetadata/argumentmetadata "Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata") | $argument | | #### Return Value | | | | --- | --- | | [Generator](http://php.net/Generator) | |
programming_docs
symfony Symfony\Bundle\SecurityBundle\Security Symfony\Bundle\SecurityBundle\Security ====================================== Classes ------- | | | | --- | --- | | [FirewallConfig](security/firewallconfig "Symfony\Bundle\SecurityBundle\Security\FirewallConfig") | | | [FirewallContext](security/firewallcontext "Symfony\Bundle\SecurityBundle\Security\FirewallContext") | This is a wrapper around the actual firewall configuration which allows us to lazy load the context for one specific firewall only when we need it. | | [FirewallMap](security/firewallmap "Symfony\Bundle\SecurityBundle\Security\FirewallMap") | This is a lazy-loading firewall map implementation. | symfony Symfony\Bundle\SecurityBundle\Templating Symfony\Bundle\SecurityBundle\Templating ======================================== Namespaces ---------- [Symfony\Bundle\SecurityBundle\Templating\Helper](templating/helper) symfony Symfony\Bundle\SecurityBundle\DependencyInjection Symfony\Bundle\SecurityBundle\DependencyInjection ================================================= Namespaces ---------- [Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler](dependencyinjection/compiler)[Symfony\Bundle\SecurityBundle\DependencyInjection\Security](dependencyinjection/security) Classes ------- | | | | --- | --- | | [MainConfiguration](dependencyinjection/mainconfiguration "Symfony\Bundle\SecurityBundle\DependencyInjection\MainConfiguration") | SecurityExtension configuration structure. | | [SecurityExtension](dependencyinjection/securityextension "Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension") | SecurityExtension. | symfony Symfony\Bundle\SecurityBundle\Debug Symfony\Bundle\SecurityBundle\Debug =================================== Classes ------- | | | | --- | --- | | [TraceableFirewallListener](debug/traceablefirewalllistener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener") | Firewall collecting called listeners. | | [WrappedListener](debug/wrappedlistener "Symfony\Bundle\SecurityBundle\Debug\WrappedListener") | Wraps a security listener for calls record. | symfony Symfony\Bundle\SecurityBundle\EventListener Symfony\Bundle\SecurityBundle\EventListener =========================================== Classes ------- | | | | --- | --- | | [FirewallListener](eventlistener/firewalllistener "Symfony\Bundle\SecurityBundle\EventListener\FirewallListener") | | symfony Symfony\Bundle\SecurityBundle\CacheWarmer Symfony\Bundle\SecurityBundle\CacheWarmer ========================================= Classes ------- | | | | --- | --- | | [ExpressionCacheWarmer](cachewarmer/expressioncachewarmer "Symfony\Bundle\SecurityBundle\CacheWarmer\ExpressionCacheWarmer") | | symfony SecurityDataCollector SecurityDataCollector ====================== class **SecurityDataCollector** extends [DataCollector](../../../component/httpkernel/datacollector/datacollector "Symfony\Component\HttpKernel\DataCollector\DataCollector") implements [LateDataCollectorInterface](../../../component/httpkernel/datacollector/latedatacollectorinterface "Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface") Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $data | | from [DataCollector](../../../component/httpkernel/datacollector/datacollector#property_data "Symfony\Component\HttpKernel\DataCollector\DataCollector") | Methods ------- | | | | | --- | --- | --- | | | [serialize](#method_serialize)() | from [DataCollector](../../../component/httpkernel/datacollector/datacollector#method_serialize "Symfony\Component\HttpKernel\DataCollector\DataCollector") | | | [unserialize](#method_unserialize)($data) | from [DataCollector](../../../component/httpkernel/datacollector/datacollector#method_unserialize "Symfony\Component\HttpKernel\DataCollector\DataCollector") | | [Data](../../../component/vardumper/cloner/data "Symfony\Component\VarDumper\Cloner\Data") | [cloneVar](#method_cloneVar)(mixed $var) Converts the variable into a serializable Data instance. | from [DataCollector](../../../component/httpkernel/datacollector/datacollector#method_cloneVar "Symfony\Component\HttpKernel\DataCollector\DataCollector") | | callable[] | [getCasters](#method_getCasters)() | from [DataCollector](../../../component/httpkernel/datacollector/datacollector#method_getCasters "Symfony\Component\HttpKernel\DataCollector\DataCollector") | | | [\_\_construct](#method___construct)([TokenStorageInterface](../../../component/security/core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage = null, [RoleHierarchyInterface](../../../component/security/core/role/rolehierarchyinterface "Symfony\Component\Security\Core\Role\RoleHierarchyInterface") $roleHierarchy = null, [LogoutUrlGenerator](../../../component/security/http/logout/logouturlgenerator "Symfony\Component\Security\Http\Logout\LogoutUrlGenerator") $logoutUrlGenerator = null, [AccessDecisionManagerInterface](../../../component/security/core/authorization/accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") $accessDecisionManager = null, [FirewallMapInterface](../../../component/security/http/firewallmapinterface "Symfony\Component\Security\Http\FirewallMapInterface") $firewallMap = null, [TraceableFirewallListener](../debug/traceablefirewalllistener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener") $firewall = null) | | | | [collect](#method_collect)([Request](../../../component/httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../component/httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [Exception](http://php.net/Exception) $exception = null) Collects data for the given Request and Response. | | | | [reset](#method_reset)() Resets this data collector to its initial state. | | | | [lateCollect](#method_lateCollect)() Collects data as late as possible. | | | bool | [isEnabled](#method_isEnabled)() Checks if security is enabled. | | | string | [getUser](#method_getUser)() Gets the user. | | | array | [getRoles](#method_getRoles)() Gets the roles of the user. | | | array | [getInheritedRoles](#method_getInheritedRoles)() Gets the inherited roles of the user. | | | bool | [supportsRoleHierarchy](#method_supportsRoleHierarchy)() Checks if the data contains information about inherited roles. Still the inherited roles can be an empty array. | | | bool | [isAuthenticated](#method_isAuthenticated)() Checks if the user is authenticated or not. | | | | [isImpersonated](#method_isImpersonated)() | | | | [getImpersonatorUser](#method_getImpersonatorUser)() | | | | [getImpersonationExitPath](#method_getImpersonationExitPath)() | | | string | [getTokenClass](#method_getTokenClass)() Get the class name of the security token. | | | [Data](../../../component/vardumper/cloner/data "Symfony\Component\VarDumper\Cloner\Data") | [getToken](#method_getToken)() Get the full security token class as Data object. | | | string | [getLogoutUrl](#method_getLogoutUrl)() Get the logout URL. | | | string[] | [getVoters](#method_getVoters)() Returns the FQCN of the security voters enabled in the application. | | | string | [getVoterStrategy](#method_getVoterStrategy)() Returns the strategy configured for the security voters. | | | array | [getAccessDecisionLog](#method_getAccessDecisionLog)() Returns the log of the security decisions made by the access decision manager. | | | array | [getFirewall](#method_getFirewall)() Returns the configuration of the current firewall context. | | | | [getListeners](#method_getListeners)() | | | string | [getName](#method_getName)() Returns the name of the collector. | | Details ------- ### serialize() ### unserialize($data) #### Parameters | | | | | --- | --- | --- | | | $data | | ### protected [Data](../../../component/vardumper/cloner/data "Symfony\Component\VarDumper\Cloner\Data") cloneVar(mixed $var) Converts the variable into a serializable Data instance. This array can be displayed in the template using the VarDumper component. #### Parameters | | | | | --- | --- | --- | | mixed | $var | | #### Return Value | | | | --- | --- | | [Data](../../../component/vardumper/cloner/data "Symfony\Component\VarDumper\Cloner\Data") | | ### protected callable[] getCasters() #### Return Value | | | | --- | --- | | callable[] | The casters to add to the cloner | ### \_\_construct([TokenStorageInterface](../../../component/security/core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") $tokenStorage = null, [RoleHierarchyInterface](../../../component/security/core/role/rolehierarchyinterface "Symfony\Component\Security\Core\Role\RoleHierarchyInterface") $roleHierarchy = null, [LogoutUrlGenerator](../../../component/security/http/logout/logouturlgenerator "Symfony\Component\Security\Http\Logout\LogoutUrlGenerator") $logoutUrlGenerator = null, [AccessDecisionManagerInterface](../../../component/security/core/authorization/accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") $accessDecisionManager = null, [FirewallMapInterface](../../../component/security/http/firewallmapinterface "Symfony\Component\Security\Http\FirewallMapInterface") $firewallMap = null, [TraceableFirewallListener](../debug/traceablefirewalllistener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener") $firewall = null) #### Parameters | | | | | --- | --- | --- | | [TokenStorageInterface](../../../component/security/core/authentication/token/storage/tokenstorageinterface "Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface") | $tokenStorage | | | [RoleHierarchyInterface](../../../component/security/core/role/rolehierarchyinterface "Symfony\Component\Security\Core\Role\RoleHierarchyInterface") | $roleHierarchy | | | [LogoutUrlGenerator](../../../component/security/http/logout/logouturlgenerator "Symfony\Component\Security\Http\Logout\LogoutUrlGenerator") | $logoutUrlGenerator | | | [AccessDecisionManagerInterface](../../../component/security/core/authorization/accessdecisionmanagerinterface "Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface") | $accessDecisionManager | | | [FirewallMapInterface](../../../component/security/http/firewallmapinterface "Symfony\Component\Security\Http\FirewallMapInterface") | $firewallMap | | | [TraceableFirewallListener](../debug/traceablefirewalllistener "Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener") | $firewall | | ### collect([Request](../../../component/httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request, [Response](../../../component/httpfoundation/response "Symfony\Component\HttpFoundation\Response") $response, [Exception](http://php.net/Exception) $exception = null) Collects data for the given Request and Response. #### Parameters | | | | | --- | --- | --- | | [Request](../../../component/httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | | [Response](../../../component/httpfoundation/response "Symfony\Component\HttpFoundation\Response") | $response | | | [Exception](http://php.net/Exception) | $exception | | ### reset() Resets this data collector to its initial state. ### lateCollect() Collects data as late as possible. ### bool isEnabled() Checks if security is enabled. #### Return Value | | | | --- | --- | | bool | true if security is enabled, false otherwise | ### string getUser() Gets the user. #### Return Value | | | | --- | --- | | string | The user | ### array getRoles() Gets the roles of the user. #### Return Value | | | | --- | --- | | array | The roles | ### array getInheritedRoles() Gets the inherited roles of the user. #### Return Value | | | | --- | --- | | array | The inherited roles | ### bool supportsRoleHierarchy() Checks if the data contains information about inherited roles. Still the inherited roles can be an empty array. #### Return Value | | | | --- | --- | | bool | true if the profile was contains inherited role information | ### bool isAuthenticated() Checks if the user is authenticated or not. #### Return Value | | | | --- | --- | | bool | true if the user is authenticated, false otherwise | ### isImpersonated() ### getImpersonatorUser() ### getImpersonationExitPath() ### string getTokenClass() Get the class name of the security token. #### Return Value | | | | --- | --- | | string | The token | ### [Data](../../../component/vardumper/cloner/data "Symfony\Component\VarDumper\Cloner\Data") getToken() Get the full security token class as Data object. #### Return Value | | | | --- | --- | | [Data](../../../component/vardumper/cloner/data "Symfony\Component\VarDumper\Cloner\Data") | | ### string getLogoutUrl() Get the logout URL. #### Return Value | | | | --- | --- | | string | The logout URL | ### string[] getVoters() Returns the FQCN of the security voters enabled in the application. #### Return Value | | | | --- | --- | | string[] | | ### string getVoterStrategy() Returns the strategy configured for the security voters. #### Return Value | | | | --- | --- | | string | | ### array getAccessDecisionLog() Returns the log of the security decisions made by the access decision manager. #### Return Value | | | | --- | --- | | array | | ### array getFirewall() Returns the configuration of the current firewall context. #### Return Value | | | | --- | --- | | array | | ### getListeners() ### string getName() Returns the name of the collector. #### Return Value | | | | --- | --- | | string | The collector name | symfony FirewallConfig FirewallConfig =============== class **FirewallConfig** Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(string $name, string $userChecker, string $requestMatcher = null, bool $securityEnabled = true, bool $stateless = false, string $provider = null, string $context = null, string $entryPoint = null, string $accessDeniedHandler = null, string $accessDeniedUrl = null, array $listeners = array(), $switchUser = null) | | | string | [getName](#method_getName)() | | | string|null | [getRequestMatcher](#method_getRequestMatcher)() | | | bool | [isSecurityEnabled](#method_isSecurityEnabled)() | | | bool | [allowsAnonymous](#method_allowsAnonymous)() | | | bool | [isStateless](#method_isStateless)() | | | string|null | [getProvider](#method_getProvider)() | | | string|null | [getContext](#method_getContext)() | | | string|null | [getEntryPoint](#method_getEntryPoint)() | | | string | [getUserChecker](#method_getUserChecker)() | | | string|null | [getAccessDeniedHandler](#method_getAccessDeniedHandler)() | | | string|null | [getAccessDeniedUrl](#method_getAccessDeniedUrl)() | | | array | [getListeners](#method_getListeners)() | | | array|null | [getSwitchUser](#method_getSwitchUser)() | | Details ------- ### \_\_construct(string $name, string $userChecker, string $requestMatcher = null, bool $securityEnabled = true, bool $stateless = false, string $provider = null, string $context = null, string $entryPoint = null, string $accessDeniedHandler = null, string $accessDeniedUrl = null, array $listeners = array(), $switchUser = null) #### Parameters | | | | | --- | --- | --- | | string | $name | | | string | $userChecker | | | string | $requestMatcher | | | bool | $securityEnabled | | | bool | $stateless | | | string | $provider | | | string | $context | | | string | $entryPoint | | | string | $accessDeniedHandler | | | string | $accessDeniedUrl | | | array | $listeners | | | | $switchUser | | ### string getName() #### Return Value | | | | --- | --- | | string | | ### string|null getRequestMatcher() #### Return Value | | | | --- | --- | | string|null | The request matcher service id or null if neither the request matcher, pattern or host options were provided | ### bool isSecurityEnabled() #### Return Value | | | | --- | --- | | bool | | ### bool allowsAnonymous() #### Return Value | | | | --- | --- | | bool | | ### bool isStateless() #### Return Value | | | | --- | --- | | bool | | ### string|null getProvider() #### Return Value | | | | --- | --- | | string|null | | ### string|null getContext() #### Return Value | | | | --- | --- | | string|null | The context key (will be null if the firewall is stateless) | ### string|null getEntryPoint() #### Return Value | | | | --- | --- | | string|null | | ### string getUserChecker() #### Return Value | | | | --- | --- | | string | | ### string|null getAccessDeniedHandler() #### Return Value | | | | --- | --- | | string|null | | ### string|null getAccessDeniedUrl() #### Return Value | | | | --- | --- | | string|null | | ### array getListeners() #### Return Value | | | | --- | --- | | array | | ### array|null getSwitchUser() #### Return Value | | | | --- | --- | | array|null | | symfony FirewallContext FirewallContext ================ class **FirewallContext** This is a wrapper around the actual firewall configuration which allows us to lazy load the context for one specific firewall only when we need it. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(iterable $listeners, [ExceptionListener](../../../component/security/http/firewall/exceptionlistener "Symfony\Component\Security\Http\Firewall\ExceptionListener") $exceptionListener = null, $logoutListener = null, [FirewallConfig](firewallconfig "Symfony\Bundle\SecurityBundle\Security\FirewallConfig") $config = null) | | | | [getConfig](#method_getConfig)() | | | iterable | [getListeners](#method_getListeners)() | | | | [getExceptionListener](#method_getExceptionListener)() | | | | [getLogoutListener](#method_getLogoutListener)() | | Details ------- ### \_\_construct(iterable $listeners, [ExceptionListener](../../../component/security/http/firewall/exceptionlistener "Symfony\Component\Security\Http\Firewall\ExceptionListener") $exceptionListener = null, $logoutListener = null, [FirewallConfig](firewallconfig "Symfony\Bundle\SecurityBundle\Security\FirewallConfig") $config = null) #### Parameters | | | | | --- | --- | --- | | iterable | $listeners | | | [ExceptionListener](../../../component/security/http/firewall/exceptionlistener "Symfony\Component\Security\Http\Firewall\ExceptionListener") | $exceptionListener | | | | $logoutListener | | | [FirewallConfig](firewallconfig "Symfony\Bundle\SecurityBundle\Security\FirewallConfig") | $config | | ### getConfig() ### iterable getListeners() #### Return Value | | | | --- | --- | | iterable | | ### getExceptionListener() ### getLogoutListener() symfony FirewallMap FirewallMap ============ class **FirewallMap** implements [FirewallMapInterface](../../../component/security/http/firewallmapinterface "Symfony\Component\Security\Http\FirewallMapInterface") This is a lazy-loading firewall map implementation. Listeners will only be initialized if we really need them. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(ContainerInterface $container, iterable $map) | | | array | [getListeners](#method_getListeners)([Request](../../../component/httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Returns the authentication listeners, and the exception listener to use for the given request. | | | [FirewallConfig](firewallconfig "Symfony\Bundle\SecurityBundle\Security\FirewallConfig")|null | [getFirewallConfig](#method_getFirewallConfig)([Request](../../../component/httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) | | Details ------- ### \_\_construct(ContainerInterface $container, iterable $map) #### Parameters | | | | | --- | --- | --- | | ContainerInterface | $container | | | iterable | $map | | ### array getListeners([Request](../../../component/httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) Returns the authentication listeners, and the exception listener to use for the given request. If there are no authentication listeners, the first inner array must be empty. If there is no exception listener, the second element of the outer array must be null. #### Parameters | | | | | --- | --- | --- | | [Request](../../../component/httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | array | of the format array(array(AuthenticationListener), ExceptionListener) | ### [FirewallConfig](firewallconfig "Symfony\Bundle\SecurityBundle\Security\FirewallConfig")|null getFirewallConfig([Request](../../../component/httpfoundation/request "Symfony\Component\HttpFoundation\Request") $request) #### Parameters | | | | | --- | --- | --- | | [Request](../../../component/httpfoundation/request "Symfony\Component\HttpFoundation\Request") | $request | | #### Return Value | | | | --- | --- | | [FirewallConfig](firewallconfig "Symfony\Bundle\SecurityBundle\Security\FirewallConfig")|null | |
programming_docs
symfony ExpressionCacheWarmer ExpressionCacheWarmer ====================== class **ExpressionCacheWarmer** implements [CacheWarmerInterface](../../../component/httpkernel/cachewarmer/cachewarmerinterface "Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface") Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(iterable $expressions, [ExpressionLanguage](../../../component/security/core/authorization/expressionlanguage "Symfony\Component\Security\Core\Authorization\ExpressionLanguage") $expressionLanguage) | | | bool | [isOptional](#method_isOptional)() Checks whether this warmer is optional or not. | | | | [warmUp](#method_warmUp)(string $cacheDir) Warms up the cache. | | Details ------- ### \_\_construct(iterable $expressions, [ExpressionLanguage](../../../component/security/core/authorization/expressionlanguage "Symfony\Component\Security\Core\Authorization\ExpressionLanguage") $expressionLanguage) #### Parameters | | | | | --- | --- | --- | | iterable | $expressions | | | [ExpressionLanguage](../../../component/security/core/authorization/expressionlanguage "Symfony\Component\Security\Core\Authorization\ExpressionLanguage") | $expressionLanguage | | ### bool isOptional() Checks whether this warmer is optional or not. Optional warmers can be ignored on certain conditions. A warmer should return true if the cache can be generated incrementally and on-demand. #### Return Value | | | | --- | --- | | bool | true if the warmer is optional, false otherwise | ### warmUp(string $cacheDir) Warms up the cache. #### Parameters | | | | | --- | --- | --- | | string | $cacheDir | The cache directory | symfony Symfony\Bundle\SecurityBundle\Templating\Helper Symfony\Bundle\SecurityBundle\Templating\Helper =============================================== Classes ------- | | | | --- | --- | | [LogoutUrlHelper](helper/logouturlhelper "Symfony\Bundle\SecurityBundle\Templating\Helper\LogoutUrlHelper") | LogoutUrlHelper provides generator functions for the logout URL. | | [SecurityHelper](helper/securityhelper "Symfony\Bundle\SecurityBundle\Templating\Helper\SecurityHelper") | SecurityHelper provides read-only access to the security checker. | symfony LogoutUrlHelper LogoutUrlHelper ================ class **LogoutUrlHelper** extends [Helper](../../../../component/templating/helper/helper "Symfony\Component\Templating\Helper\Helper") LogoutUrlHelper provides generator functions for the logout URL. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $charset | | from [Helper](../../../../component/templating/helper/helper#property_charset "Symfony\Component\Templating\Helper\Helper") | Methods ------- | | | | | --- | --- | --- | | | [setCharset](#method_setCharset)(string $charset) Sets the default charset. | from [Helper](../../../../component/templating/helper/helper#method_setCharset "Symfony\Component\Templating\Helper\Helper") | | string | [getCharset](#method_getCharset)() Gets the default charset. | from [Helper](../../../../component/templating/helper/helper#method_getCharset "Symfony\Component\Templating\Helper\Helper") | | | [\_\_construct](#method___construct)([LogoutUrlGenerator](../../../../component/security/http/logout/logouturlgenerator "Symfony\Component\Security\Http\Logout\LogoutUrlGenerator") $generator) | | | string | [getLogoutPath](#method_getLogoutPath)(string|null $key) Generates the absolute logout path for the firewall. | | | string | [getLogoutUrl](#method_getLogoutUrl)(string|null $key) Generates the absolute logout URL for the firewall. | | | string | [getName](#method_getName)() Returns the canonical name of this helper. | | Details ------- ### setCharset(string $charset) Sets the default charset. #### Parameters | | | | | --- | --- | --- | | string | $charset | The charset | ### string getCharset() Gets the default charset. #### Return Value | | | | --- | --- | | string | The default charset | ### \_\_construct([LogoutUrlGenerator](../../../../component/security/http/logout/logouturlgenerator "Symfony\Component\Security\Http\Logout\LogoutUrlGenerator") $generator) #### Parameters | | | | | --- | --- | --- | | [LogoutUrlGenerator](../../../../component/security/http/logout/logouturlgenerator "Symfony\Component\Security\Http\Logout\LogoutUrlGenerator") | $generator | | ### string getLogoutPath(string|null $key) Generates the absolute logout path for the firewall. #### Parameters | | | | | --- | --- | --- | | string|null | $key | The firewall key or null to use the current firewall key | #### Return Value | | | | --- | --- | | string | The logout path | ### string getLogoutUrl(string|null $key) Generates the absolute logout URL for the firewall. #### Parameters | | | | | --- | --- | --- | | string|null | $key | The firewall key or null to use the current firewall key | #### Return Value | | | | --- | --- | | string | The logout URL | ### string getName() Returns the canonical name of this helper. #### Return Value | | | | --- | --- | | string | The canonical name | symfony SecurityHelper SecurityHelper =============== class **SecurityHelper** extends [Helper](../../../../component/templating/helper/helper "Symfony\Component\Templating\Helper\Helper") SecurityHelper provides read-only access to the security checker. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $charset | | from [Helper](../../../../component/templating/helper/helper#property_charset "Symfony\Component\Templating\Helper\Helper") | Methods ------- | | | | | --- | --- | --- | | | [setCharset](#method_setCharset)(string $charset) Sets the default charset. | from [Helper](../../../../component/templating/helper/helper#method_setCharset "Symfony\Component\Templating\Helper\Helper") | | string | [getCharset](#method_getCharset)() Gets the default charset. | from [Helper](../../../../component/templating/helper/helper#method_getCharset "Symfony\Component\Templating\Helper\Helper") | | | [\_\_construct](#method___construct)([AuthorizationCheckerInterface](../../../../component/security/core/authorization/authorizationcheckerinterface "Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface") $securityChecker = null) | | | | [isGranted](#method_isGranted)($role, $object = null, $field = null) | | | string | [getName](#method_getName)() Returns the canonical name of this helper. | | Details ------- ### setCharset(string $charset) Sets the default charset. #### Parameters | | | | | --- | --- | --- | | string | $charset | The charset | ### string getCharset() Gets the default charset. #### Return Value | | | | --- | --- | | string | The default charset | ### \_\_construct([AuthorizationCheckerInterface](../../../../component/security/core/authorization/authorizationcheckerinterface "Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface") $securityChecker = null) #### Parameters | | | | | --- | --- | --- | | [AuthorizationCheckerInterface](../../../../component/security/core/authorization/authorizationcheckerinterface "Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface") | $securityChecker | | ### isGranted($role, $object = null, $field = null) #### Parameters | | | | | --- | --- | --- | | | $role | | | | $object | | | | $field | | ### string getName() Returns the canonical name of this helper. #### Return Value | | | | --- | --- | | string | The canonical name | symfony UserPasswordEncoderCommand UserPasswordEncoderCommand =========================== class **UserPasswordEncoderCommand** extends [Command](../../../component/console/command/command "Symfony\Component\Console\Command\Command") Encode a user's password. Properties ---------- | | | | | | --- | --- | --- | --- | | static protected | $defaultName | | | Methods ------- | | | | | --- | --- | --- | | static string|null | [getDefaultName](#method_getDefaultName)() | from [Command](../../../component/console/command/command#method_getDefaultName "Symfony\Component\Console\Command\Command") | | | [\_\_construct](#method___construct)([EncoderFactoryInterface](../../../component/security/core/encoder/encoderfactoryinterface "Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface") $encoderFactory, array $userClasses = array()) | | | | [ignoreValidationErrors](#method_ignoreValidationErrors)() Ignores validation errors. | from [Command](../../../component/console/command/command#method_ignoreValidationErrors "Symfony\Component\Console\Command\Command") | | | [setApplication](#method_setApplication)([Application](../../../component/console/application "Symfony\Component\Console\Application") $application = null) | from [Command](../../../component/console/command/command#method_setApplication "Symfony\Component\Console\Command\Command") | | | [setHelperSet](#method_setHelperSet)([HelperSet](../../../component/console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) | from [Command](../../../component/console/command/command#method_setHelperSet "Symfony\Component\Console\Command\Command") | | [HelperSet](../../../component/console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | [getHelperSet](#method_getHelperSet)() Gets the helper set. | from [Command](../../../component/console/command/command#method_getHelperSet "Symfony\Component\Console\Command\Command") | | [Application](../../../component/console/application "Symfony\Component\Console\Application") | [getApplication](#method_getApplication)() Gets the application instance for this command. | from [Command](../../../component/console/command/command#method_getApplication "Symfony\Component\Console\Command\Command") | | bool | [isEnabled](#method_isEnabled)() Checks whether the command is enabled or not in the current environment. | from [Command](../../../component/console/command/command#method_isEnabled "Symfony\Component\Console\Command\Command") | | | [configure](#method_configure)() Configures the current command. | | | int|null | [execute](#method_execute)([InputInterface](../../../component/console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../../component/console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. | | | | [interact](#method_interact)([InputInterface](../../../component/console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../../component/console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. | from [Command](../../../component/console/command/command#method_interact "Symfony\Component\Console\Command\Command") | | | [initialize](#method_initialize)([InputInterface](../../../component/console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../../component/console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. | from [Command](../../../component/console/command/command#method_initialize "Symfony\Component\Console\Command\Command") | | int | [run](#method_run)([InputInterface](../../../component/console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../../component/console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. | from [Command](../../../component/console/command/command#method_run "Symfony\Component\Console\Command\Command") | | $this | [setCode](#method_setCode)(callable $code) Sets the code to execute when running this command. | from [Command](../../../component/console/command/command#method_setCode "Symfony\Component\Console\Command\Command") | | | [mergeApplicationDefinition](#method_mergeApplicationDefinition)(bool $mergeArgs = true) Merges the application definition with the command definition. | from [Command](../../../component/console/command/command#method_mergeApplicationDefinition "Symfony\Component\Console\Command\Command") | | $this | [setDefinition](#method_setDefinition)(array|[InputDefinition](../../../component/console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. | from [Command](../../../component/console/command/command#method_setDefinition "Symfony\Component\Console\Command\Command") | | [InputDefinition](../../../component/console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getDefinition](#method_getDefinition)() Gets the InputDefinition attached to this Command. | from [Command](../../../component/console/command/command#method_getDefinition "Symfony\Component\Console\Command\Command") | | [InputDefinition](../../../component/console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | [getNativeDefinition](#method_getNativeDefinition)() Gets the InputDefinition to be used to create representations of this Command. | from [Command](../../../component/console/command/command#method_getNativeDefinition "Symfony\Component\Console\Command\Command") | | $this | [addArgument](#method_addArgument)(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. | from [Command](../../../component/console/command/command#method_addArgument "Symfony\Component\Console\Command\Command") | | $this | [addOption](#method_addOption)(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. | from [Command](../../../component/console/command/command#method_addOption "Symfony\Component\Console\Command\Command") | | $this | [setName](#method_setName)(string $name) Sets the name of the command. | from [Command](../../../component/console/command/command#method_setName "Symfony\Component\Console\Command\Command") | | $this | [setProcessTitle](#method_setProcessTitle)(string $title) Sets the process title of the command. | from [Command](../../../component/console/command/command#method_setProcessTitle "Symfony\Component\Console\Command\Command") | | string | [getName](#method_getName)() Returns the command name. | from [Command](../../../component/console/command/command#method_getName "Symfony\Component\Console\Command\Command") | | [Command](../../../component/console/command/command "Symfony\Component\Console\Command\Command") | [setHidden](#method_setHidden)(bool $hidden) | from [Command](../../../component/console/command/command#method_setHidden "Symfony\Component\Console\Command\Command") | | bool | [isHidden](#method_isHidden)() | from [Command](../../../component/console/command/command#method_isHidden "Symfony\Component\Console\Command\Command") | | $this | [setDescription](#method_setDescription)(string $description) Sets the description for the command. | from [Command](../../../component/console/command/command#method_setDescription "Symfony\Component\Console\Command\Command") | | string | [getDescription](#method_getDescription)() Returns the description for the command. | from [Command](../../../component/console/command/command#method_getDescription "Symfony\Component\Console\Command\Command") | | $this | [setHelp](#method_setHelp)(string $help) Sets the help for the command. | from [Command](../../../component/console/command/command#method_setHelp "Symfony\Component\Console\Command\Command") | | string | [getHelp](#method_getHelp)() Returns the help for the command. | from [Command](../../../component/console/command/command#method_getHelp "Symfony\Component\Console\Command\Command") | | string | [getProcessedHelp](#method_getProcessedHelp)() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. | from [Command](../../../component/console/command/command#method_getProcessedHelp "Symfony\Component\Console\Command\Command") | | $this | [setAliases](#method_setAliases)(string[] $aliases) Sets the aliases for the command. | from [Command](../../../component/console/command/command#method_setAliases "Symfony\Component\Console\Command\Command") | | array | [getAliases](#method_getAliases)() Returns the aliases for the command. | from [Command](../../../component/console/command/command#method_getAliases "Symfony\Component\Console\Command\Command") | | string | [getSynopsis](#method_getSynopsis)(bool $short = false) Returns the synopsis for the command. | from [Command](../../../component/console/command/command#method_getSynopsis "Symfony\Component\Console\Command\Command") | | $this | [addUsage](#method_addUsage)(string $usage) Add a command usage example. | from [Command](../../../component/console/command/command#method_addUsage "Symfony\Component\Console\Command\Command") | | array | [getUsages](#method_getUsages)() Returns alternative usages of the command. | from [Command](../../../component/console/command/command#method_getUsages "Symfony\Component\Console\Command\Command") | | mixed | [getHelper](#method_getHelper)(string $name) Gets a helper instance by name. | from [Command](../../../component/console/command/command#method_getHelper "Symfony\Component\Console\Command\Command") | Details ------- ### static string|null getDefaultName() #### Return Value | | | | --- | --- | | string|null | The default command name or null when no default name is set | ### \_\_construct([EncoderFactoryInterface](../../../component/security/core/encoder/encoderfactoryinterface "Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface") $encoderFactory, array $userClasses = array()) #### Parameters | | | | | --- | --- | --- | | [EncoderFactoryInterface](../../../component/security/core/encoder/encoderfactoryinterface "Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface") | $encoderFactory | | | array | $userClasses | | #### Exceptions | | | | --- | --- | | [LogicException](../../../component/console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When the command name is empty | ### ignoreValidationErrors() Ignores validation errors. This is mainly useful for the help command. ### setApplication([Application](../../../component/console/application "Symfony\Component\Console\Application") $application = null) #### Parameters | | | | | --- | --- | --- | | [Application](../../../component/console/application "Symfony\Component\Console\Application") | $application | | ### setHelperSet([HelperSet](../../../component/console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") $helperSet) #### Parameters | | | | | --- | --- | --- | | [HelperSet](../../../component/console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | $helperSet | | ### [HelperSet](../../../component/console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") getHelperSet() Gets the helper set. #### Return Value | | | | --- | --- | | [HelperSet](../../../component/console/helper/helperset "Symfony\Component\Console\Helper\HelperSet") | A HelperSet instance | ### [Application](../../../component/console/application "Symfony\Component\Console\Application") getApplication() Gets the application instance for this command. #### Return Value | | | | --- | --- | | [Application](../../../component/console/application "Symfony\Component\Console\Application") | An Application instance | ### bool isEnabled() Checks whether the command is enabled or not in the current environment. Override this to check for x or y and return false if the command can not run properly under the current conditions. #### Return Value | | | | --- | --- | | bool | | ### protected configure() Configures the current command. ### protected int|null execute([InputInterface](../../../component/console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../../component/console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Executes the current command. This method is not abstract because you can use this class as a concrete class. In this case, instead of defining the execute() method, you set the code to execute by passing a Closure to the setCode() method. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../../component/console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../../component/console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int|null | null or 0 if everything went fine, or an error code | #### Exceptions | | | | --- | --- | | [LogicException](../../../component/console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | When this abstract method is not implemented | ### protected interact([InputInterface](../../../component/console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../../component/console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Interacts with the user. This method is executed before the InputDefinition is validated. This means that this is the only place where the command can interactively ask for values of missing required arguments. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../../component/console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../../component/console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | ### protected initialize([InputInterface](../../../component/console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../../component/console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Initializes the command after the input has been bound and before the input is validated. This is mainly useful when a lot of commands extends one main command where some things need to be initialized based on the input arguments and options. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../../component/console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../../component/console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### See also | | | | --- | --- | | [InputInterface::bind](../../../component/console/input/inputinterface#method_bind "Symfony\Component\Console\Input\InputInterface") | | | [InputInterface::validate](../../../component/console/input/inputinterface#method_validate "Symfony\Component\Console\Input\InputInterface") | | ### int run([InputInterface](../../../component/console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") $input, [OutputInterface](../../../component/console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") $output) Runs the command. The code to execute is either defined directly with the setCode() method or by overriding the execute() method in a sub-class. #### Parameters | | | | | --- | --- | --- | | [InputInterface](../../../component/console/input/inputinterface "Symfony\Component\Console\Input\InputInterface") | $input | | | [OutputInterface](../../../component/console/output/outputinterface "Symfony\Component\Console\Output\OutputInterface") | $output | | #### Return Value | | | | --- | --- | | int | The command exit code | #### Exceptions | | | | --- | --- | | [Exception](http://php.net/Exception) | When binding input fails. Bypass this by calling {@link ignoreValidationErrors()}. | #### See also | | | | --- | --- | | setCode() | | | execute() | | ### $this setCode(callable $code) Sets the code to execute when running this command. If this method is used, it overrides the code defined in the execute() method. #### Parameters | | | | | --- | --- | --- | | callable | $code | A callable(InputInterface $input, OutputInterface $output) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../../component/console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | | #### See also | | | | --- | --- | | execute() | | ### mergeApplicationDefinition(bool $mergeArgs = true) Merges the application definition with the command definition. This method is not part of public API and should not be used directly. #### Parameters | | | | | --- | --- | --- | | bool | $mergeArgs | Whether to merge or not the Application definition arguments to Command definition arguments | ### $this setDefinition(array|[InputDefinition](../../../component/console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") $definition) Sets an array of argument and option instances. #### Parameters | | | | | --- | --- | --- | | array|[InputDefinition](../../../component/console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | $definition | An array of argument and option instances or a definition instance | #### Return Value | | | | --- | --- | | $this | | ### [InputDefinition](../../../component/console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getDefinition() Gets the InputDefinition attached to this Command. #### Return Value | | | | --- | --- | | [InputDefinition](../../../component/console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### [InputDefinition](../../../component/console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") getNativeDefinition() Gets the InputDefinition to be used to create representations of this Command. Can be overridden to provide the original command representation when it would otherwise be changed by merging with the application InputDefinition. This method is not part of public API and should not be used directly. #### Return Value | | | | --- | --- | | [InputDefinition](../../../component/console/input/inputdefinition "Symfony\Component\Console\Input\InputDefinition") | An InputDefinition instance | ### $this addArgument(string $name, int|null $mode = null, string $description = '', string|string[]|null $default = null) Adds an argument. #### Parameters | | | | | --- | --- | --- | | string | $name | The argument name | | int|null | $mode | The argument mode: self::REQUIRED or self::OPTIONAL | | string | $description | A description text | | string|string[]|null | $default | The default value (for self::OPTIONAL mode only) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../../component/console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When argument mode is not valid | ### $this addOption(string $name, string|array $shortcut = null, int|null $mode = null, string $description = '', string|string[]|bool|null $default = null) Adds an option. #### Parameters | | | | | --- | --- | --- | | string | $name | The option name | | string|array | $shortcut | The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts | | int|null | $mode | The option mode: One of the VALUE\_\* constants | | string | $description | A description text | | string|string[]|bool|null | $default | The default value (must be null for self::VALUE\_NONE) | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../../component/console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | If option mode is invalid or incompatible | ### $this setName(string $name) Sets the name of the command. This method can set both the namespace and the name if you separate them by a colon (:) ``` $command->setName('foo:bar'); ``` #### Parameters | | | | | --- | --- | --- | | string | $name | The command name | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../../component/console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When the name is invalid | ### $this setProcessTitle(string $title) Sets the process title of the command. This feature should be used only when creating a long process command, like a daemon. PHP 5.5+ or the proctitle PECL library is required #### Parameters | | | | | --- | --- | --- | | string | $title | The process title | #### Return Value | | | | --- | --- | | $this | | ### string getName() Returns the command name. #### Return Value | | | | --- | --- | | string | The command name | ### [Command](../../../component/console/command/command "Symfony\Component\Console\Command\Command") setHidden(bool $hidden) #### Parameters | | | | | --- | --- | --- | | bool | $hidden | Whether or not the command should be hidden from the list of commands | #### Return Value | | | | --- | --- | | [Command](../../../component/console/command/command "Symfony\Component\Console\Command\Command") | The current instance | ### bool isHidden() #### Return Value | | | | --- | --- | | bool | whether the command should be publicly shown or not | ### $this setDescription(string $description) Sets the description for the command. #### Parameters | | | | | --- | --- | --- | | string | $description | The description for the command | #### Return Value | | | | --- | --- | | $this | | ### string getDescription() Returns the description for the command. #### Return Value | | | | --- | --- | | string | The description for the command | ### $this setHelp(string $help) Sets the help for the command. #### Parameters | | | | | --- | --- | --- | | string | $help | The help for the command | #### Return Value | | | | --- | --- | | $this | | ### string getHelp() Returns the help for the command. #### Return Value | | | | --- | --- | | string | The help for the command | ### string getProcessedHelp() Returns the processed help for the command replacing the %command.name% and %command.full\_name% patterns with the real values dynamically. #### Return Value | | | | --- | --- | | string | The processed help for the command | ### $this setAliases(string[] $aliases) Sets the aliases for the command. #### Parameters | | | | | --- | --- | --- | | string[] | $aliases | An array of aliases for the command | #### Return Value | | | | --- | --- | | $this | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../../component/console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | When an alias is invalid | ### array getAliases() Returns the aliases for the command. #### Return Value | | | | --- | --- | | array | An array of aliases for the command | ### string getSynopsis(bool $short = false) Returns the synopsis for the command. #### Parameters | | | | | --- | --- | --- | | bool | $short | Whether to show the short version of the synopsis (with options folded) or not | #### Return Value | | | | --- | --- | | string | The synopsis | ### $this addUsage(string $usage) Add a command usage example. #### Parameters | | | | | --- | --- | --- | | string | $usage | The usage, it'll be prefixed with the command name | #### Return Value | | | | --- | --- | | $this | | ### array getUsages() Returns alternative usages of the command. #### Return Value | | | | --- | --- | | array | | ### mixed getHelper(string $name) Gets a helper instance by name. #### Parameters | | | | | --- | --- | --- | | string | $name | The helper name | #### Return Value | | | | --- | --- | | mixed | The helper value | #### Exceptions | | | | --- | --- | | [LogicException](../../../component/console/exception/logicexception "Symfony\Component\Console\Exception\LogicException") | if no HelperSet is defined | | [InvalidArgumentException](../../../component/console/exception/invalidargumentexception "Symfony\Component\Console\Exception\InvalidArgumentException") | if the helper is not defined |
programming_docs
symfony SecurityExtension SecurityExtension ================== class **SecurityExtension** extends [Extension](../../../component/httpkernel/dependencyinjection/extension "Symfony\Component\HttpKernel\DependencyInjection\Extension") SecurityExtension. Methods ------- | | | | | --- | --- | --- | | string | [getXsdValidationBasePath](#method_getXsdValidationBasePath)() Returns the base path for the XSD files. | | | string | [getNamespace](#method_getNamespace)() Returns the namespace to be used for this extension (XML namespace). | | | string | [getAlias](#method_getAlias)() Returns the recommended alias to use in XML. | from [Extension](../../../component/dependencyinjection/extension/extension#method_getAlias "Symfony\Component\DependencyInjection\Extension\Extension") | | [ConfigurationInterface](../../../component/config/definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface")|null | [getConfiguration](#method_getConfiguration)(array $config, [ContainerBuilder](../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Returns extension configuration. | | | | [processConfiguration](#method_processConfiguration)([ConfigurationInterface](../../../component/config/definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") $configuration, array $configs) | from [Extension](../../../component/dependencyinjection/extension/extension#method_processConfiguration "Symfony\Component\DependencyInjection\Extension\Extension") | | | [getProcessedConfigs](#method_getProcessedConfigs)() | from [Extension](../../../component/dependencyinjection/extension/extension#method_getProcessedConfigs "Symfony\Component\DependencyInjection\Extension\Extension") | | bool | [isConfigEnabled](#method_isConfigEnabled)([ContainerBuilder](../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, array $config) | from [Extension](../../../component/dependencyinjection/extension/extension#method_isConfigEnabled "Symfony\Component\DependencyInjection\Extension\Extension") | | array | [getAnnotatedClassesToCompile](#method_getAnnotatedClassesToCompile)() Gets the annotated classes to cache. | from [Extension](../../../component/httpkernel/dependencyinjection/extension#method_getAnnotatedClassesToCompile "Symfony\Component\HttpKernel\DependencyInjection\Extension") | | | [addAnnotatedClassesToCompile](#method_addAnnotatedClassesToCompile)(array $annotatedClasses) Adds annotated classes to the class cache. | from [Extension](../../../component/httpkernel/dependencyinjection/extension#method_addAnnotatedClassesToCompile "Symfony\Component\HttpKernel\DependencyInjection\Extension") | | | [\_\_construct](#method___construct)() | | | | [load](#method_load)(array $configs, [ContainerBuilder](../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Loads a specific configuration. | | | | [addSecurityListenerFactory](#method_addSecurityListenerFactory)([SecurityFactoryInterface](security/factory/securityfactoryinterface "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface") $factory) | | | | [addUserProviderFactory](#method_addUserProviderFactory)([UserProviderFactoryInterface](security/userprovider/userproviderfactoryinterface "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface") $factory) | | Details ------- ### string getXsdValidationBasePath() Returns the base path for the XSD files. #### Return Value | | | | --- | --- | | string | The XSD base path | ### string getNamespace() Returns the namespace to be used for this extension (XML namespace). #### Return Value | | | | --- | --- | | string | The XML namespace | ### string getAlias() Returns the recommended alias to use in XML. This alias is also the mandatory prefix to use when using YAML. This convention is to remove the "Extension" postfix from the class name and then lowercase and underscore the result. So: ``` AcmeHelloExtension ``` becomes ``` acme_hello ``` This can be overridden in a sub-class to specify the alias manually. #### Return Value | | | | --- | --- | | string | The alias | #### Exceptions | | | | --- | --- | | [BadMethodCallException](../../../component/dependencyinjection/exception/badmethodcallexception "Symfony\Component\DependencyInjection\Exception\BadMethodCallException") | When the extension name does not follow conventions | ### [ConfigurationInterface](../../../component/config/definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface")|null getConfiguration(array $config, [ContainerBuilder](../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Returns extension configuration. #### Parameters | | | | | --- | --- | --- | | array | $config | | | [ContainerBuilder](../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | #### Return Value | | | | --- | --- | | [ConfigurationInterface](../../../component/config/definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface")|null | The configuration or null | ### final protected processConfiguration([ConfigurationInterface](../../../component/config/definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") $configuration, array $configs) #### Parameters | | | | | --- | --- | --- | | [ConfigurationInterface](../../../component/config/definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") | $configuration | | | array | $configs | | ### final getProcessedConfigs() ### protected bool isConfigEnabled([ContainerBuilder](../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, array $config) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | array | $config | | #### Return Value | | | | --- | --- | | bool | Whether the configuration is enabled | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](../../../component/dependencyinjection/exception/invalidargumentexception "Symfony\Component\DependencyInjection\Exception\InvalidArgumentException") | When the config is not enableable | ### array getAnnotatedClassesToCompile() Gets the annotated classes to cache. #### Return Value | | | | --- | --- | | array | An array of classes | ### addAnnotatedClassesToCompile(array $annotatedClasses) Adds annotated classes to the class cache. #### Parameters | | | | | --- | --- | --- | | array | $annotatedClasses | An array of class patterns | ### \_\_construct() ### load(array $configs, [ContainerBuilder](../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container) Loads a specific configuration. #### Parameters | | | | | --- | --- | --- | | array | $configs | | | [ContainerBuilder](../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | #### Exceptions | | | | --- | --- | | [InvalidArgumentException](http://php.net/InvalidArgumentException) | When provided tag is not defined in this extension | ### addSecurityListenerFactory([SecurityFactoryInterface](security/factory/securityfactoryinterface "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface") $factory) #### Parameters | | | | | --- | --- | --- | | [SecurityFactoryInterface](security/factory/securityfactoryinterface "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface") | $factory | | ### addUserProviderFactory([UserProviderFactoryInterface](security/userprovider/userproviderfactoryinterface "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface") $factory) #### Parameters | | | | | --- | --- | --- | | [UserProviderFactoryInterface](security/userprovider/userproviderfactoryinterface "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface") | $factory | | symfony MainConfiguration MainConfiguration ================== class **MainConfiguration** implements [ConfigurationInterface](../../../component/config/definition/configurationinterface "Symfony\Component\Config\Definition\ConfigurationInterface") SecurityExtension configuration structure. Methods ------- | | | | | --- | --- | --- | | | [\_\_construct](#method___construct)(array $factories, array $userProviderFactories) | | | [TreeBuilder](../../../component/config/definition/builder/treebuilder "Symfony\Component\Config\Definition\Builder\TreeBuilder") | [getConfigTreeBuilder](#method_getConfigTreeBuilder)() Generates the configuration tree builder. | | Details ------- ### \_\_construct(array $factories, array $userProviderFactories) #### Parameters | | | | | --- | --- | --- | | array | $factories | | | array | $userProviderFactories | | ### [TreeBuilder](../../../component/config/definition/builder/treebuilder "Symfony\Component\Config\Definition\Builder\TreeBuilder") getConfigTreeBuilder() Generates the configuration tree builder. #### Return Value | | | | --- | --- | | [TreeBuilder](../../../component/config/definition/builder/treebuilder "Symfony\Component\Config\Definition\Builder\TreeBuilder") | The tree builder | symfony Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler ========================================================== Classes ------- | | | | --- | --- | | [AddSecurityVotersPass](compiler/addsecurityvoterspass "Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\AddSecurityVotersPass") | Adds all configured security voters to the access decision manager. | | [AddSessionDomainConstraintPass](compiler/addsessiondomainconstraintpass "Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\AddSessionDomainConstraintPass") | Uses the session domain to restrict allowed redirection targets. | | [RegisterCsrfTokenClearingLogoutHandlerPass](compiler/registercsrftokenclearinglogouthandlerpass "Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\RegisterCsrfTokenClearingLogoutHandlerPass") | | symfony Symfony\Bundle\SecurityBundle\DependencyInjection\Security Symfony\Bundle\SecurityBundle\DependencyInjection\Security ========================================================== Namespaces ---------- [Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory](security/factory)[Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider](security/userprovider) symfony Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider ======================================================================= Classes ------- | | | | --- | --- | | [InMemoryFactory](userprovider/inmemoryfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\InMemoryFactory") | InMemoryFactory creates services for the memory provider. | | [LdapFactory](userprovider/ldapfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\LdapFactory") | LdapFactory creates services for Ldap user provider. | Interfaces ---------- | | | | --- | --- | | *[UserProviderFactoryInterface](userprovider/userproviderfactoryinterface "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface")* | UserProviderFactoryInterface is the interface for all user provider factories. | symfony Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory ================================================================== Classes ------- | | | | --- | --- | | [AbstractFactory](factory/abstractfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | AbstractFactory is the base class for all classes inheriting from AbstractAuthenticationListener. | | [FormLoginFactory](factory/formloginfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FormLoginFactory") | FormLoginFactory creates services for form login authentication. | | [FormLoginLdapFactory](factory/formloginldapfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FormLoginLdapFactory") | FormLoginLdapFactory creates services for form login ldap authentication. | | [GuardAuthenticationFactory](factory/guardauthenticationfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\GuardAuthenticationFactory") | Configures the "guard" authentication provider key under a firewall. | | [HttpBasicFactory](factory/httpbasicfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\HttpBasicFactory") | HttpBasicFactory creates services for HTTP basic authentication. | | [HttpBasicLdapFactory](factory/httpbasicldapfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\HttpBasicLdapFactory") | HttpBasicFactory creates services for HTTP basic authentication. | | [JsonLoginFactory](factory/jsonloginfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\JsonLoginFactory") | JsonLoginFactory creates services for JSON login authentication. | | [RememberMeFactory](factory/remembermefactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\RememberMeFactory") | | | [RemoteUserFactory](factory/remoteuserfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\RemoteUserFactory") | RemoteUserFactory creates services for REMOTE\_USER based authentication. | | [SimpleFormFactory](factory/simpleformfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SimpleFormFactory") | | | [SimplePreAuthenticationFactory](factory/simplepreauthenticationfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SimplePreAuthenticationFactory") | | | [X509Factory](factory/x509factory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\X509Factory") | X509Factory creates services for X509 certificate authentication. | Interfaces ---------- | | | | --- | --- | | *[SecurityFactoryInterface](factory/securityfactoryinterface "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface")* | SecurityFactoryInterface is the interface for all security authentication listener. | symfony UserProviderFactoryInterface UserProviderFactoryInterface ============================= interface **UserProviderFactoryInterface** UserProviderFactoryInterface is the interface for all user provider factories. Methods ------- | | | | | --- | --- | --- | | | [create](#method_create)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, $id, $config) | | | | [getKey](#method_getKey)() | | | | [addConfiguration](#method_addConfiguration)([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $builder) | | Details ------- ### create([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, $id, $config) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | | $id | | | | $config | | ### getKey() ### addConfiguration([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $builder) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $builder | | symfony LdapFactory LdapFactory ============ class **LdapFactory** implements [UserProviderFactoryInterface](userproviderfactoryinterface "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface") LdapFactory creates services for Ldap user provider. Methods ------- | | | | | --- | --- | --- | | | [create](#method_create)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, $id, $config) | | | | [getKey](#method_getKey)() | | | | [addConfiguration](#method_addConfiguration)([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | | Details ------- ### create([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, $id, $config) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | | $id | | | | $config | | ### getKey() ### addConfiguration([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | symfony InMemoryFactory InMemoryFactory ================ class **InMemoryFactory** implements [UserProviderFactoryInterface](userproviderfactoryinterface "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface") InMemoryFactory creates services for the memory provider. Methods ------- | | | | | --- | --- | --- | | | [create](#method_create)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, $id, $config) | | | | [getKey](#method_getKey)() | | | | [addConfiguration](#method_addConfiguration)([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | | Details ------- ### create([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, $id, $config) #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | | $id | | | | $config | | ### getKey() ### addConfiguration([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | |
programming_docs
symfony RemoteUserFactory RemoteUserFactory ================== class **RemoteUserFactory** implements [SecurityFactoryInterface](securityfactoryinterface "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface") RemoteUserFactory creates services for REMOTE\_USER based authentication. Methods ------- | | | | | --- | --- | --- | | array | [create](#method_create)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProvider, string $defaultEntryPoint) Configures the container services required to use the authentication listener. | | | string | [getPosition](#method_getPosition)() Defines the position at which the provider is called. | | | string | [getKey](#method_getKey)() Defines the configuration key used to reference the provider in the firewall configuration. | | | | [addConfiguration](#method_addConfiguration)([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | | Details ------- ### array create([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProvider, string $defaultEntryPoint) Configures the container services required to use the authentication listener. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for the listener | | string | $userProvider | The service id of the user provider | | string | $defaultEntryPoint | | #### Return Value | | | | --- | --- | | array | containing three values: - the provider id - the listener id - the entry point id | ### string getPosition() Defines the position at which the provider is called. Possible values: pre\_auth, form, http, and remember\_me. #### Return Value | | | | --- | --- | | string | | ### string getKey() Defines the configuration key used to reference the provider in the firewall configuration. #### Return Value | | | | --- | --- | | string | | ### addConfiguration([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | symfony FormLoginLdapFactory FormLoginLdapFactory ===================== class **FormLoginLdapFactory** extends [FormLoginFactory](formloginfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FormLoginFactory") FormLoginLdapFactory creates services for form login ldap authentication. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $options | | from [AbstractFactory](abstractfactory#property_options "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | protected | $defaultSuccessHandlerOptions | | from [AbstractFactory](abstractfactory#property_defaultSuccessHandlerOptions "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | protected | $defaultFailureHandlerOptions | | from [AbstractFactory](abstractfactory#property_defaultFailureHandlerOptions "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | Methods ------- | | | | | --- | --- | --- | | array | [create](#method_create)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, $userProviderId, $defaultEntryPointId) Configures the container services required to use the authentication listener. | from [AbstractFactory](abstractfactory#method_create "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [addConfiguration](#method_addConfiguration)([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | | | | [addOption](#method_addOption)($name, $default = null) | from [AbstractFactory](abstractfactory#method_addOption "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | string | [createAuthProvider](#method_createAuthProvider)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProviderId) Subclasses must return the id of a service which implements the AuthenticationProviderInterface. | | | string | [getListenerId](#method_getListenerId)() Subclasses must return the id of the abstract listener template. | from [FormLoginFactory](formloginfactory#method_getListenerId "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FormLoginFactory") | | string | [createEntryPoint](#method_createEntryPoint)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, $defaultEntryPoint) Subclasses may create an entry point of their as they see fit. The default implementation does not change the default entry point. | from [FormLoginFactory](formloginfactory#method_createEntryPoint "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FormLoginFactory") | | bool | [isRememberMeAware](#method_isRememberMeAware)($config) Subclasses may disable remember-me features for the listener, by always returning false from this method. | from [AbstractFactory](abstractfactory#method_isRememberMeAware "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [createListener](#method_createListener)($container, $id, $config, $userProvider) | from [FormLoginFactory](formloginfactory#method_createListener "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FormLoginFactory") | | | [createAuthenticationSuccessHandler](#method_createAuthenticationSuccessHandler)($container, $id, $config) | from [AbstractFactory](abstractfactory#method_createAuthenticationSuccessHandler "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [createAuthenticationFailureHandler](#method_createAuthenticationFailureHandler)($container, $id, $config) | from [AbstractFactory](abstractfactory#method_createAuthenticationFailureHandler "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [getSuccessHandlerId](#method_getSuccessHandlerId)($id) | from [AbstractFactory](abstractfactory#method_getSuccessHandlerId "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [getFailureHandlerId](#method_getFailureHandlerId)($id) | from [AbstractFactory](abstractfactory#method_getFailureHandlerId "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [\_\_construct](#method___construct)() | from [FormLoginFactory](formloginfactory#method___construct "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FormLoginFactory") | | string | [getPosition](#method_getPosition)() Defines the position at which the provider is called. | from [FormLoginFactory](formloginfactory#method_getPosition "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FormLoginFactory") | | string | [getKey](#method_getKey)() Defines the configuration key used to reference the provider in the firewall configuration. | | Details ------- ### array create([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, $userProviderId, $defaultEntryPointId) Configures the container services required to use the authentication listener. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for the listener | | | $userProviderId | | | | $defaultEntryPointId | | #### Return Value | | | | --- | --- | | array | containing three values: - the provider id - the listener id - the entry point id | ### addConfiguration([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | ### final addOption($name, $default = null) #### Parameters | | | | | --- | --- | --- | | | $name | | | | $default | | ### protected string createAuthProvider([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProviderId) Subclasses must return the id of a service which implements the AuthenticationProviderInterface. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for this listener | | string | $userProviderId | The id of the user provider | #### Return Value | | | | --- | --- | | string | never null, the id of the authentication provider | ### protected string getListenerId() Subclasses must return the id of the abstract listener template. Listener definitions should inherit from the AbstractAuthenticationListener like this: In the above case, this method would return "my.listener.id". #### Return Value | | | | --- | --- | | string | | ### protected string createEntryPoint([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, $defaultEntryPoint) Subclasses may create an entry point of their as they see fit. The default implementation does not change the default entry point. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | | | array | $config | | | | $defaultEntryPoint | | #### Return Value | | | | --- | --- | | string | the entry point id | ### protected bool isRememberMeAware($config) Subclasses may disable remember-me features for the listener, by always returning false from this method. #### Parameters | | | | | --- | --- | --- | | | $config | | #### Return Value | | | | --- | --- | | bool | Whether a possibly configured RememberMeServices should be set for this listener | ### protected createListener($container, $id, $config, $userProvider) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | | | $userProvider | | ### protected createAuthenticationSuccessHandler($container, $id, $config) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | ### protected createAuthenticationFailureHandler($container, $id, $config) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | ### protected getSuccessHandlerId($id) #### Parameters | | | | | --- | --- | --- | | | $id | | ### protected getFailureHandlerId($id) #### Parameters | | | | | --- | --- | --- | | | $id | | ### \_\_construct() ### string getPosition() Defines the position at which the provider is called. Possible values: pre\_auth, form, http, and remember\_me. #### Return Value | | | | --- | --- | | string | | ### string getKey() Defines the configuration key used to reference the provider in the firewall configuration. #### Return Value | | | | --- | --- | | string | | symfony SecurityFactoryInterface SecurityFactoryInterface ========================= interface **SecurityFactoryInterface** SecurityFactoryInterface is the interface for all security authentication listener. Methods ------- | | | | | --- | --- | --- | | array | [create](#method_create)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProvider, string $defaultEntryPoint) Configures the container services required to use the authentication listener. | | | string | [getPosition](#method_getPosition)() Defines the position at which the provider is called. | | | string | [getKey](#method_getKey)() Defines the configuration key used to reference the provider in the firewall configuration. | | | | [addConfiguration](#method_addConfiguration)([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $builder) | | Details ------- ### array create([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProvider, string $defaultEntryPoint) Configures the container services required to use the authentication listener. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for the listener | | string | $userProvider | The service id of the user provider | | string | $defaultEntryPoint | | #### Return Value | | | | --- | --- | | array | containing three values: - the provider id - the listener id - the entry point id | ### string getPosition() Defines the position at which the provider is called. Possible values: pre\_auth, form, http, and remember\_me. #### Return Value | | | | --- | --- | | string | | ### string getKey() Defines the configuration key used to reference the provider in the firewall configuration. #### Return Value | | | | --- | --- | | string | | ### addConfiguration([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $builder) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $builder | | symfony AbstractFactory AbstractFactory ================ abstract class **AbstractFactory** implements [SecurityFactoryInterface](securityfactoryinterface "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface") AbstractFactory is the base class for all classes inheriting from AbstractAuthenticationListener. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $options | | | | protected | $defaultSuccessHandlerOptions | | | | protected | $defaultFailureHandlerOptions | | | Methods ------- | | | | | --- | --- | --- | | array | [create](#method_create)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, $userProviderId, $defaultEntryPointId) Configures the container services required to use the authentication listener. | | | | [addConfiguration](#method_addConfiguration)([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | | | | [addOption](#method_addOption)($name, $default = null) | | | string | [createAuthProvider](#method_createAuthProvider)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProviderId) Subclasses must return the id of a service which implements the AuthenticationProviderInterface. | | | string | [getListenerId](#method_getListenerId)() Subclasses must return the id of the abstract listener template. | | | string | [createEntryPoint](#method_createEntryPoint)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $defaultEntryPointId) Subclasses may create an entry point of their as they see fit. The default implementation does not change the default entry point. | | | bool | [isRememberMeAware](#method_isRememberMeAware)($config) Subclasses may disable remember-me features for the listener, by always returning false from this method. | | | | [createListener](#method_createListener)($container, $id, $config, $userProvider) | | | | [createAuthenticationSuccessHandler](#method_createAuthenticationSuccessHandler)($container, $id, $config) | | | | [createAuthenticationFailureHandler](#method_createAuthenticationFailureHandler)($container, $id, $config) | | | | [getSuccessHandlerId](#method_getSuccessHandlerId)($id) | | | | [getFailureHandlerId](#method_getFailureHandlerId)($id) | | Details ------- ### array create([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, $userProviderId, $defaultEntryPointId) Configures the container services required to use the authentication listener. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for the listener | | | $userProviderId | | | | $defaultEntryPointId | | #### Return Value | | | | --- | --- | | array | containing three values: - the provider id - the listener id - the entry point id | ### addConfiguration([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | ### final addOption($name, $default = null) #### Parameters | | | | | --- | --- | --- | | | $name | | | | $default | | ### abstract protected string createAuthProvider([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProviderId) Subclasses must return the id of a service which implements the AuthenticationProviderInterface. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for this listener | | string | $userProviderId | The id of the user provider | #### Return Value | | | | --- | --- | | string | never null, the id of the authentication provider | ### abstract protected string getListenerId() Subclasses must return the id of the abstract listener template. Listener definitions should inherit from the AbstractAuthenticationListener like this: In the above case, this method would return "my.listener.id". #### Return Value | | | | --- | --- | | string | | ### protected string createEntryPoint([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $defaultEntryPointId) Subclasses may create an entry point of their as they see fit. The default implementation does not change the default entry point. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | | | array | $config | | | string | $defaultEntryPointId | | #### Return Value | | | | --- | --- | | string | the entry point id | ### protected bool isRememberMeAware($config) Subclasses may disable remember-me features for the listener, by always returning false from this method. #### Parameters | | | | | --- | --- | --- | | | $config | | #### Return Value | | | | --- | --- | | bool | Whether a possibly configured RememberMeServices should be set for this listener | ### protected createListener($container, $id, $config, $userProvider) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | | | $userProvider | | ### protected createAuthenticationSuccessHandler($container, $id, $config) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | ### protected createAuthenticationFailureHandler($container, $id, $config) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | ### protected getSuccessHandlerId($id) #### Parameters | | | | | --- | --- | --- | | | $id | | ### protected getFailureHandlerId($id) #### Parameters | | | | | --- | --- | --- | | | $id | |
programming_docs
symfony RememberMeFactory RememberMeFactory ================== class **RememberMeFactory** implements [SecurityFactoryInterface](securityfactoryinterface "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface") Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $options | | | Methods ------- | | | | | --- | --- | --- | | array | [create](#method_create)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProvider, string $defaultEntryPoint) Configures the container services required to use the authentication listener. | | | string | [getPosition](#method_getPosition)() Defines the position at which the provider is called. | | | string | [getKey](#method_getKey)() Defines the configuration key used to reference the provider in the firewall configuration. | | | | [addConfiguration](#method_addConfiguration)([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | | Details ------- ### array create([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProvider, string $defaultEntryPoint) Configures the container services required to use the authentication listener. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for the listener | | string | $userProvider | The service id of the user provider | | string | $defaultEntryPoint | | #### Return Value | | | | --- | --- | | array | containing three values: - the provider id - the listener id - the entry point id | ### string getPosition() Defines the position at which the provider is called. Possible values: pre\_auth, form, http, and remember\_me. #### Return Value | | | | --- | --- | | string | | ### string getKey() Defines the configuration key used to reference the provider in the firewall configuration. #### Return Value | | | | --- | --- | | string | | ### addConfiguration([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | symfony JsonLoginFactory JsonLoginFactory ================= class **JsonLoginFactory** extends [AbstractFactory](abstractfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") JsonLoginFactory creates services for JSON login authentication. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $options | | from [AbstractFactory](abstractfactory#property_options "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | protected | $defaultSuccessHandlerOptions | | from [AbstractFactory](abstractfactory#property_defaultSuccessHandlerOptions "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | protected | $defaultFailureHandlerOptions | | from [AbstractFactory](abstractfactory#property_defaultFailureHandlerOptions "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | Methods ------- | | | | | --- | --- | --- | | array | [create](#method_create)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, $userProviderId, $defaultEntryPointId) Configures the container services required to use the authentication listener. | from [AbstractFactory](abstractfactory#method_create "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [addConfiguration](#method_addConfiguration)([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | from [AbstractFactory](abstractfactory#method_addConfiguration "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [addOption](#method_addOption)($name, $default = null) | from [AbstractFactory](abstractfactory#method_addOption "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | string | [createAuthProvider](#method_createAuthProvider)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProviderId) Subclasses must return the id of a service which implements the AuthenticationProviderInterface. | | | string | [getListenerId](#method_getListenerId)() Subclasses must return the id of the abstract listener template. | | | string | [createEntryPoint](#method_createEntryPoint)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $defaultEntryPointId) Subclasses may create an entry point of their as they see fit. The default implementation does not change the default entry point. | from [AbstractFactory](abstractfactory#method_createEntryPoint "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | bool | [isRememberMeAware](#method_isRememberMeAware)($config) Subclasses may disable remember-me features for the listener, by always returning false from this method. | | | | [createListener](#method_createListener)($container, $id, $config, $userProvider) | | | | [createAuthenticationSuccessHandler](#method_createAuthenticationSuccessHandler)($container, $id, $config) | from [AbstractFactory](abstractfactory#method_createAuthenticationSuccessHandler "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [createAuthenticationFailureHandler](#method_createAuthenticationFailureHandler)($container, $id, $config) | from [AbstractFactory](abstractfactory#method_createAuthenticationFailureHandler "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [getSuccessHandlerId](#method_getSuccessHandlerId)($id) | from [AbstractFactory](abstractfactory#method_getSuccessHandlerId "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [getFailureHandlerId](#method_getFailureHandlerId)($id) | from [AbstractFactory](abstractfactory#method_getFailureHandlerId "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [\_\_construct](#method___construct)() | | | string | [getPosition](#method_getPosition)() Defines the position at which the provider is called. | | | string | [getKey](#method_getKey)() Defines the configuration key used to reference the provider in the firewall configuration. | | Details ------- ### array create([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, $userProviderId, $defaultEntryPointId) Configures the container services required to use the authentication listener. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for the listener | | | $userProviderId | | | | $defaultEntryPointId | | #### Return Value | | | | --- | --- | | array | containing three values: - the provider id - the listener id - the entry point id | ### addConfiguration([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | ### final addOption($name, $default = null) #### Parameters | | | | | --- | --- | --- | | | $name | | | | $default | | ### protected string createAuthProvider([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProviderId) Subclasses must return the id of a service which implements the AuthenticationProviderInterface. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for this listener | | string | $userProviderId | The id of the user provider | #### Return Value | | | | --- | --- | | string | never null, the id of the authentication provider | ### protected string getListenerId() Subclasses must return the id of the abstract listener template. Listener definitions should inherit from the AbstractAuthenticationListener like this: In the above case, this method would return "my.listener.id". #### Return Value | | | | --- | --- | | string | | ### protected string createEntryPoint([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $defaultEntryPointId) Subclasses may create an entry point of their as they see fit. The default implementation does not change the default entry point. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | | | array | $config | | | string | $defaultEntryPointId | | #### Return Value | | | | --- | --- | | string | the entry point id | ### protected bool isRememberMeAware($config) Subclasses may disable remember-me features for the listener, by always returning false from this method. #### Parameters | | | | | --- | --- | --- | | | $config | | #### Return Value | | | | --- | --- | | bool | Whether a possibly configured RememberMeServices should be set for this listener | ### protected createListener($container, $id, $config, $userProvider) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | | | $userProvider | | ### protected createAuthenticationSuccessHandler($container, $id, $config) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | ### protected createAuthenticationFailureHandler($container, $id, $config) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | ### protected getSuccessHandlerId($id) #### Parameters | | | | | --- | --- | --- | | | $id | | ### protected getFailureHandlerId($id) #### Parameters | | | | | --- | --- | --- | | | $id | | ### \_\_construct() ### string getPosition() Defines the position at which the provider is called. Possible values: pre\_auth, form, http, and remember\_me. #### Return Value | | | | --- | --- | | string | | ### string getKey() Defines the configuration key used to reference the provider in the firewall configuration. #### Return Value | | | | --- | --- | | string | | symfony HttpBasicFactory HttpBasicFactory ================= class **HttpBasicFactory** implements [SecurityFactoryInterface](securityfactoryinterface "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface") HttpBasicFactory creates services for HTTP basic authentication. Methods ------- | | | | | --- | --- | --- | | array | [create](#method_create)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProvider, string $defaultEntryPoint) Configures the container services required to use the authentication listener. | | | string | [getPosition](#method_getPosition)() Defines the position at which the provider is called. | | | string | [getKey](#method_getKey)() Defines the configuration key used to reference the provider in the firewall configuration. | | | | [addConfiguration](#method_addConfiguration)([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | | | | [createEntryPoint](#method_createEntryPoint)($container, $id, $config, $defaultEntryPoint) | | Details ------- ### array create([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProvider, string $defaultEntryPoint) Configures the container services required to use the authentication listener. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for the listener | | string | $userProvider | The service id of the user provider | | string | $defaultEntryPoint | | #### Return Value | | | | --- | --- | | array | containing three values: - the provider id - the listener id - the entry point id | ### string getPosition() Defines the position at which the provider is called. Possible values: pre\_auth, form, http, and remember\_me. #### Return Value | | | | --- | --- | | string | | ### string getKey() Defines the configuration key used to reference the provider in the firewall configuration. #### Return Value | | | | --- | --- | | string | | ### addConfiguration([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | ### protected createEntryPoint($container, $id, $config, $defaultEntryPoint) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | | | $defaultEntryPoint | | symfony GuardAuthenticationFactory GuardAuthenticationFactory =========================== class **GuardAuthenticationFactory** implements [SecurityFactoryInterface](securityfactoryinterface "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface") Configures the "guard" authentication provider key under a firewall. Methods ------- | | | | | --- | --- | --- | | string | [getPosition](#method_getPosition)() Defines the position at which the provider is called. | | | string | [getKey](#method_getKey)() Defines the configuration key used to reference the provider in the firewall configuration. | | | | [addConfiguration](#method_addConfiguration)([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | | | array | [create](#method_create)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProvider, string $defaultEntryPoint) Configures the container services required to use the authentication listener. | | Details ------- ### string getPosition() Defines the position at which the provider is called. Possible values: pre\_auth, form, http, and remember\_me. #### Return Value | | | | --- | --- | | string | | ### string getKey() Defines the configuration key used to reference the provider in the firewall configuration. #### Return Value | | | | --- | --- | | string | | ### addConfiguration([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | ### array create([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProvider, string $defaultEntryPoint) Configures the container services required to use the authentication listener. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for the listener | | string | $userProvider | The service id of the user provider | | string | $defaultEntryPoint | | #### Return Value | | | | --- | --- | | array | containing three values: - the provider id - the listener id - the entry point id | symfony X509Factory X509Factory ============ class **X509Factory** implements [SecurityFactoryInterface](securityfactoryinterface "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface") X509Factory creates services for X509 certificate authentication. Methods ------- | | | | | --- | --- | --- | | array | [create](#method_create)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProvider, string $defaultEntryPoint) Configures the container services required to use the authentication listener. | | | string | [getPosition](#method_getPosition)() Defines the position at which the provider is called. | | | string | [getKey](#method_getKey)() Defines the configuration key used to reference the provider in the firewall configuration. | | | | [addConfiguration](#method_addConfiguration)([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | | Details ------- ### array create([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProvider, string $defaultEntryPoint) Configures the container services required to use the authentication listener. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for the listener | | string | $userProvider | The service id of the user provider | | string | $defaultEntryPoint | | #### Return Value | | | | --- | --- | | array | containing three values: - the provider id - the listener id - the entry point id | ### string getPosition() Defines the position at which the provider is called. Possible values: pre\_auth, form, http, and remember\_me. #### Return Value | | | | --- | --- | | string | | ### string getKey() Defines the configuration key used to reference the provider in the firewall configuration. #### Return Value | | | | --- | --- | | string | | ### addConfiguration([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | |
programming_docs
symfony HttpBasicLdapFactory HttpBasicLdapFactory ===================== class **HttpBasicLdapFactory** extends [HttpBasicFactory](httpbasicfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\HttpBasicFactory") HttpBasicFactory creates services for HTTP basic authentication. Methods ------- | | | | | --- | --- | --- | | array | [create](#method_create)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProvider, string $defaultEntryPoint) Configures the container services required to use the authentication listener. | | | string | [getPosition](#method_getPosition)() Defines the position at which the provider is called. | from [HttpBasicFactory](httpbasicfactory#method_getPosition "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\HttpBasicFactory") | | string | [getKey](#method_getKey)() Defines the configuration key used to reference the provider in the firewall configuration. | | | | [addConfiguration](#method_addConfiguration)([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | | | | [createEntryPoint](#method_createEntryPoint)($container, $id, $config, $defaultEntryPoint) | from [HttpBasicFactory](httpbasicfactory#method_createEntryPoint "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\HttpBasicFactory") | Details ------- ### array create([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProvider, string $defaultEntryPoint) Configures the container services required to use the authentication listener. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for the listener | | string | $userProvider | The service id of the user provider | | string | $defaultEntryPoint | | #### Return Value | | | | --- | --- | | array | containing three values: - the provider id - the listener id - the entry point id | ### string getPosition() Defines the position at which the provider is called. Possible values: pre\_auth, form, http, and remember\_me. #### Return Value | | | | --- | --- | | string | | ### string getKey() Defines the configuration key used to reference the provider in the firewall configuration. #### Return Value | | | | --- | --- | | string | | ### addConfiguration([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | ### protected createEntryPoint($container, $id, $config, $defaultEntryPoint) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | | | $defaultEntryPoint | | symfony FormLoginFactory FormLoginFactory ================= class **FormLoginFactory** extends [AbstractFactory](abstractfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") FormLoginFactory creates services for form login authentication. Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $options | | from [AbstractFactory](abstractfactory#property_options "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | protected | $defaultSuccessHandlerOptions | | from [AbstractFactory](abstractfactory#property_defaultSuccessHandlerOptions "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | protected | $defaultFailureHandlerOptions | | from [AbstractFactory](abstractfactory#property_defaultFailureHandlerOptions "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | Methods ------- | | | | | --- | --- | --- | | array | [create](#method_create)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, $userProviderId, $defaultEntryPointId) Configures the container services required to use the authentication listener. | from [AbstractFactory](abstractfactory#method_create "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [addConfiguration](#method_addConfiguration)([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | | | | [addOption](#method_addOption)($name, $default = null) | from [AbstractFactory](abstractfactory#method_addOption "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | string | [createAuthProvider](#method_createAuthProvider)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProviderId) Subclasses must return the id of a service which implements the AuthenticationProviderInterface. | | | string | [getListenerId](#method_getListenerId)() Subclasses must return the id of the abstract listener template. | | | string | [createEntryPoint](#method_createEntryPoint)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, $defaultEntryPoint) Subclasses may create an entry point of their as they see fit. The default implementation does not change the default entry point. | | | bool | [isRememberMeAware](#method_isRememberMeAware)($config) Subclasses may disable remember-me features for the listener, by always returning false from this method. | from [AbstractFactory](abstractfactory#method_isRememberMeAware "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [createListener](#method_createListener)($container, $id, $config, $userProvider) | | | | [createAuthenticationSuccessHandler](#method_createAuthenticationSuccessHandler)($container, $id, $config) | from [AbstractFactory](abstractfactory#method_createAuthenticationSuccessHandler "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [createAuthenticationFailureHandler](#method_createAuthenticationFailureHandler)($container, $id, $config) | from [AbstractFactory](abstractfactory#method_createAuthenticationFailureHandler "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [getSuccessHandlerId](#method_getSuccessHandlerId)($id) | from [AbstractFactory](abstractfactory#method_getSuccessHandlerId "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [getFailureHandlerId](#method_getFailureHandlerId)($id) | from [AbstractFactory](abstractfactory#method_getFailureHandlerId "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [\_\_construct](#method___construct)() | | | string | [getPosition](#method_getPosition)() Defines the position at which the provider is called. | | | string | [getKey](#method_getKey)() Defines the configuration key used to reference the provider in the firewall configuration. | | Details ------- ### array create([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, $userProviderId, $defaultEntryPointId) Configures the container services required to use the authentication listener. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for the listener | | | $userProviderId | | | | $defaultEntryPointId | | #### Return Value | | | | --- | --- | | array | containing three values: - the provider id - the listener id - the entry point id | ### addConfiguration([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | ### final addOption($name, $default = null) #### Parameters | | | | | --- | --- | --- | | | $name | | | | $default | | ### protected string createAuthProvider([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProviderId) Subclasses must return the id of a service which implements the AuthenticationProviderInterface. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for this listener | | string | $userProviderId | The id of the user provider | #### Return Value | | | | --- | --- | | string | never null, the id of the authentication provider | ### protected string getListenerId() Subclasses must return the id of the abstract listener template. Listener definitions should inherit from the AbstractAuthenticationListener like this: In the above case, this method would return "my.listener.id". #### Return Value | | | | --- | --- | | string | | ### protected string createEntryPoint([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, $defaultEntryPoint) Subclasses may create an entry point of their as they see fit. The default implementation does not change the default entry point. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | | | array | $config | | | | $defaultEntryPoint | | #### Return Value | | | | --- | --- | | string | the entry point id | ### protected bool isRememberMeAware($config) Subclasses may disable remember-me features for the listener, by always returning false from this method. #### Parameters | | | | | --- | --- | --- | | | $config | | #### Return Value | | | | --- | --- | | bool | Whether a possibly configured RememberMeServices should be set for this listener | ### protected createListener($container, $id, $config, $userProvider) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | | | $userProvider | | ### protected createAuthenticationSuccessHandler($container, $id, $config) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | ### protected createAuthenticationFailureHandler($container, $id, $config) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | ### protected getSuccessHandlerId($id) #### Parameters | | | | | --- | --- | --- | | | $id | | ### protected getFailureHandlerId($id) #### Parameters | | | | | --- | --- | --- | | | $id | | ### \_\_construct() ### string getPosition() Defines the position at which the provider is called. Possible values: pre\_auth, form, http, and remember\_me. #### Return Value | | | | --- | --- | | string | | ### string getKey() Defines the configuration key used to reference the provider in the firewall configuration. #### Return Value | | | | --- | --- | | string | | symfony SimpleFormFactory SimpleFormFactory ================== class **SimpleFormFactory** extends [FormLoginFactory](formloginfactory "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FormLoginFactory") Properties ---------- | | | | | | --- | --- | --- | --- | | protected | $options | | from [AbstractFactory](abstractfactory#property_options "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | protected | $defaultSuccessHandlerOptions | | from [AbstractFactory](abstractfactory#property_defaultSuccessHandlerOptions "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | protected | $defaultFailureHandlerOptions | | from [AbstractFactory](abstractfactory#property_defaultFailureHandlerOptions "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | Methods ------- | | | | | --- | --- | --- | | array | [create](#method_create)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, $userProviderId, $defaultEntryPointId) Configures the container services required to use the authentication listener. | from [AbstractFactory](abstractfactory#method_create "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [addConfiguration](#method_addConfiguration)([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) | | | | [addOption](#method_addOption)($name, $default = null) | from [AbstractFactory](abstractfactory#method_addOption "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | string | [createAuthProvider](#method_createAuthProvider)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProviderId) Subclasses must return the id of a service which implements the AuthenticationProviderInterface. | | | string | [getListenerId](#method_getListenerId)() Subclasses must return the id of the abstract listener template. | | | string | [createEntryPoint](#method_createEntryPoint)([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, $defaultEntryPoint) Subclasses may create an entry point of their as they see fit. The default implementation does not change the default entry point. | from [FormLoginFactory](formloginfactory#method_createEntryPoint "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FormLoginFactory") | | bool | [isRememberMeAware](#method_isRememberMeAware)($config) Subclasses may disable remember-me features for the listener, by always returning false from this method. | from [AbstractFactory](abstractfactory#method_isRememberMeAware "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [createListener](#method_createListener)($container, $id, $config, $userProvider) | | | | [createAuthenticationSuccessHandler](#method_createAuthenticationSuccessHandler)($container, $id, $config) | from [AbstractFactory](abstractfactory#method_createAuthenticationSuccessHandler "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [createAuthenticationFailureHandler](#method_createAuthenticationFailureHandler)($container, $id, $config) | from [AbstractFactory](abstractfactory#method_createAuthenticationFailureHandler "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [getSuccessHandlerId](#method_getSuccessHandlerId)($id) | from [AbstractFactory](abstractfactory#method_getSuccessHandlerId "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [getFailureHandlerId](#method_getFailureHandlerId)($id) | from [AbstractFactory](abstractfactory#method_getFailureHandlerId "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory") | | | [\_\_construct](#method___construct)() | | | string | [getPosition](#method_getPosition)() Defines the position at which the provider is called. | from [FormLoginFactory](formloginfactory#method_getPosition "Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\FormLoginFactory") | | string | [getKey](#method_getKey)() Defines the configuration key used to reference the provider in the firewall configuration. | | Details ------- ### array create([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, $userProviderId, $defaultEntryPointId) Configures the container services required to use the authentication listener. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for the listener | | | $userProviderId | | | | $defaultEntryPointId | | #### Return Value | | | | --- | --- | | array | containing three values: - the provider id - the listener id - the entry point id | ### addConfiguration([NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") $node) #### Parameters | | | | | --- | --- | --- | | [NodeDefinition](../../../../../component/config/definition/builder/nodedefinition "Symfony\Component\Config\Definition\Builder\NodeDefinition") | $node | | ### final addOption($name, $default = null) #### Parameters | | | | | --- | --- | --- | | | $name | | | | $default | | ### protected string createAuthProvider([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, string $userProviderId) Subclasses must return the id of a service which implements the AuthenticationProviderInterface. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | The unique id of the firewall | | array | $config | The options array for this listener | | string | $userProviderId | The id of the user provider | #### Return Value | | | | --- | --- | | string | never null, the id of the authentication provider | ### protected string getListenerId() Subclasses must return the id of the abstract listener template. Listener definitions should inherit from the AbstractAuthenticationListener like this: In the above case, this method would return "my.listener.id". #### Return Value | | | | --- | --- | | string | | ### protected string createEntryPoint([ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") $container, string $id, array $config, $defaultEntryPoint) Subclasses may create an entry point of their as they see fit. The default implementation does not change the default entry point. #### Parameters | | | | | --- | --- | --- | | [ContainerBuilder](../../../../../component/dependencyinjection/containerbuilder "Symfony\Component\DependencyInjection\ContainerBuilder") | $container | | | string | $id | | | array | $config | | | | $defaultEntryPoint | | #### Return Value | | | | --- | --- | | string | the entry point id | ### protected bool isRememberMeAware($config) Subclasses may disable remember-me features for the listener, by always returning false from this method. #### Parameters | | | | | --- | --- | --- | | | $config | | #### Return Value | | | | --- | --- | | bool | Whether a possibly configured RememberMeServices should be set for this listener | ### protected createListener($container, $id, $config, $userProvider) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | | | $userProvider | | ### protected createAuthenticationSuccessHandler($container, $id, $config) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | ### protected createAuthenticationFailureHandler($container, $id, $config) #### Parameters | | | | | --- | --- | --- | | | $container | | | | $id | | | | $config | | ### protected getSuccessHandlerId($id) #### Parameters | | | | | --- | --- | --- | | | $id | | ### protected getFailureHandlerId($id) #### Parameters | | | | | --- | --- | --- | | | $id | | ### \_\_construct() ### string getPosition() Defines the position at which the provider is called. Possible values: pre\_auth, form, http, and remember\_me. #### Return Value | | | | --- | --- | | string | | ### string getKey() Defines the configuration key used to reference the provider in the firewall configuration. #### Return Value | | | | --- | --- | | string | |
programming_docs