Container\Container
ClassSource on GitHubPhalcon\Container\Container- implementsPhalcon\Contracts\Container\Service\Collection,Phalcon\Contracts\Container\Service\Enumerable
Uses Closure · Phalcon\Container\Definition\Processor\ClosureProcessor · Phalcon\Container\Definition\Processor\ObjectProcessor · Phalcon\Container\Definition\Processor\Processor · Phalcon\Container\Definition\Processor\StringProcessor · Phalcon\Container\Definition\ServiceDefinition · Phalcon\Container\Definition\ServiceLifetime · Phalcon\Container\Exceptions\CannotExtendResolved · Phalcon\Container\Exceptions\CircularAliasFound · Phalcon\Container\Exceptions\InstanceNotFound · Phalcon\Container\Exceptions\NoProcessorFound · Phalcon\Container\Exceptions\ParameterNotFound · Phalcon\Container\Exceptions\ServiceNotFound · Phalcon\Container\Exceptions\ServiceNotRegistered · Phalcon\Container\Resolver\Lazy\Lazy · Phalcon\Container\Resolver\Resolver · Phalcon\Contracts\Container\ContainerTypes · Phalcon\Contracts\Container\Service\Collection · Phalcon\Contracts\Container\Service\Enumerable · Phalcon\Di\InjectionAwareInterface · ReflectionException
Method Summary
public__construct()publicServiceDefinitionbind(string $interfaceName,string $concrete)Bind an interface to a concrete class
publicClosurecallableGet(string $name)Resolve to a closure on a get()
publicClosurecallableNew(string $name)Resolve to a closure on a new()
publicvoidextend(string $name,callable $callableObject)Extends the definition
publicmixedget(string $name)Resolve and return an element registerd in the container
publicstringgetAlias(string $name)Return an alias
publicarraygetByTag(string $tag)Return services by tag
publicServiceDefinitiongetDefinition(string $name)Return the service definition
publicobjectgetInstance(string $name)Return a stored instance
publicmixedgetParameter(string $name)Return a parameter
publicResolvergetResolver()Return the resolver
publicobjectgetService(string $serviceName)Resolve an return a service
publicarraygetServiceNames()Returns the names of every registered service definition. Names that
publicboolhas(string $name)Does the container have a particular service
publicboolhasAlias(string $name)Does the service have an alias
publicboolhasDefinition(string $name)Does the service have a definition
publicboolhasInstance(string $name)Does the service have an instance
publicboolhasParameter(string $name)Does the service have a parameter
publicboolhasService(string $serviceName)Does the container have a particular service
publicboolisAutowireEnabled()Is AutoWiring enabled
publicmixednew(string $name)Resolve and return a new service
publicServiceDefinitionnewDefinition(string $name)Return a new service definition
publicServiceDefinitionset(string $name,mixed $definition)Set a service
publicstaticsetAlias(string $name,string $alias)Set an alias
publicstaticsetAutowire(bool $enabled)Set AutoWire
publicstaticsetDefinition(string $name,ServiceDefinition $definition)Set a definition
publicstaticsetInstance(string $name,object $instance,string $lifetime)Set an instance
publicstaticsetParameter(string $name,mixed $value)Set a parameter
publicvoidsetTag(string $tag,string $serviceName)Register a tag with a service
publicvoidunsetAlias(string $name)Remove an alias
publicvoidunsetDefinition(string $name)Remove a definition
publicvoidunsetInstance(string $name)Remove an instance
publicvoidunsetInstances(string $lifetime)Remove instances based on lifetime
publicvoidunsetParameter(string $name)Remove a parameter
Properties
protectedarray$aliases = []protectedbool$autowire = trueprotectedarray$instanceLifetimes = []protectedarray$instances = []protectedarray$parameters = []protectedarray$processors = []protectedResolver$resolverprotectedarray$services = []protectedarray$tags = []Methods
__construct()
public function __construct();bind()
public function bind(
string $interfaceName,
string $concrete
): ServiceDefinition;Bind an interface to a concrete class
callableGet()
public function callableGet( string $name ): Closure;Resolve to a closure on a get()
callableNew()
public function callableNew( string $name ): Closure;Resolve to a closure on a new()
extend()
public function extend(
string $name,
callable $callableObject
): void;Extends the definition
get()
public function get( string $name ): mixed;Resolve and return an element registerd in the container
getAlias()
public function getAlias( string $name ): string;Return an alias
getByTag()
public function getByTag( string $tag ): array;Return services by tag
getDefinition()
public function getDefinition( string $name ): ServiceDefinition;Return the service definition
getInstance()
public function getInstance( string $name ): object;Return a stored instance
getParameter()
public function getParameter( string $name ): mixed;Return a parameter
getResolver()
public function getResolver(): Resolver;Return the resolver
getService()
public function getService( string $serviceName ): object;Resolve an return a service
getServiceNames()
public function getServiceNames(): array;Returns the names of every registered service definition. Names that only exist as an alias, a pre-set instance or a parameter are not included.
has()
public function has( string $name ): bool;Does the container have a particular service
hasAlias()
public function hasAlias( string $name ): bool;Does the service have an alias
hasDefinition()
public function hasDefinition( string $name ): bool;Does the service have a definition
hasInstance()
public function hasInstance( string $name ): bool;Does the service have an instance
hasParameter()
public function hasParameter( string $name ): bool;Does the service have a parameter
hasService()
public function hasService( string $serviceName ): bool;Does the container have a particular service
isAutowireEnabled()
public function isAutowireEnabled(): bool;Is AutoWiring enabled
new()
public function new( string $name ): mixed;Resolve and return a new service
newDefinition()
public function newDefinition( string $name ): ServiceDefinition;Return a new service definition
set()
public function set(
string $name,
mixed $definition
): ServiceDefinition;Set a service
setAlias()
public function setAlias(
string $name,
string $alias
): static;Set an alias
setAutowire()
public function setAutowire( bool $enabled ): static;Set AutoWire
setDefinition()
public function setDefinition(
string $name,
ServiceDefinition $definition
): static;Set a definition
setInstance()
public function setInstance(
string $name,
object $instance,
string $lifetime
): static;Set an instance
setParameter()
public function setParameter(
string $name,
mixed $value
): static;Set a parameter
setTag()
public function setTag(
string $tag,
string $serviceName
): void;Register a tag with a service
unsetAlias()
public function unsetAlias( string $name ): void;Remove an alias
unsetDefinition()
public function unsetDefinition( string $name ): void;Remove a definition
unsetInstance()
public function unsetInstance( string $name ): void;Remove an instance
unsetInstances()
public function unsetInstances( string $lifetime ): void;Remove instances based on lifetime
unsetParameter()
public function unsetParameter( string $name ): void;Remove a parameter
Container\ContainerFactory
ClassSource on GitHubPhalcon\Container\ContainerFactory- implementsPhalcon\Contracts\Container\Ioc\IocContainerFactory
Uses Phalcon\Contracts\Container\ContainerTypes · Phalcon\Contracts\Container\Ioc\IocContainerFactory · Phalcon\Contracts\Container\Service\Provider
Method Summary
publicstaticaddProvider(Provider $provider)Adds a provider
publicContainernewContainer()Returns a new container
Properties
protectedarray$providers = []Methods
addProvider()
public function addProvider( Provider $provider ): static;Adds a provider
newContainer()
public function newContainer(): Container;Returns a new container
Container\Definition\DefinitionType
ClassSource on GitHubPhalcon\Container\Definition\DefinitionType
Constants
stringCLOSURE_TYPE = "closure"stringOBJECT_TYPE = "object"stringPARAMETER_TYPE = "parameter"stringSTRING_TYPE = "string"Container\Definition\Processor\ClosureProcessor
ClassSource on GitHubPhalcon\Container\Definition\Processor\ClosureProcessor- implementsPhalcon\Container\Definition\Processor\Processor
Uses Closure · Phalcon\Container\Definition\DefinitionType · Phalcon\Container\Definition\ServiceDefinition
Method Summary
publicboolcanProcess(mixed $definition)Wheteher the definition is a Closure
publicServiceDefinitionprocess(string $name,mixed $definition,object $container)Process the Closure
Methods
canProcess()
public function canProcess( mixed $definition ): bool;Wheteher the definition is a Closure
process()
public function process(
string $name,
mixed $definition,
object $container
): ServiceDefinition;Process the Closure
Container\Definition\Processor\ObjectProcessor
ClassSource on GitHubPhalcon\Container\Definition\Processor\ObjectProcessor- implementsPhalcon\Container\Definition\Processor\Processor
Uses Closure · Phalcon\Container\Definition\DefinitionType · Phalcon\Container\Definition\ServiceDefinition
Method Summary
publicboolcanProcess(mixed $definition)Whether the definition is an Object (not Closure)
publicServiceDefinitionprocess(string $name,mixed $definition,object $container)Process the Object
Methods
canProcess()
public function canProcess( mixed $definition ): bool;Whether the definition is an Object (not Closure)
process()
public function process(
string $name,
mixed $definition,
object $container
): ServiceDefinition;Process the Object
Container\Definition\Processor\ParameterProcessor
ClassSource on GitHubPhalcon\Container\Definition\Processor\ParameterProcessor- implementsPhalcon\Container\Definition\Processor\Processor
Uses Closure · Phalcon\Container\Definition\DefinitionType · Phalcon\Container\Definition\ServiceDefinition
Method Summary
publicboolcanProcess(mixed $definition)Whetehr the definition is a parameter
publicServiceDefinitionprocess(string $name,mixed $definition,object $container)Process the parameter
Methods
canProcess()
public function canProcess( mixed $definition ): bool;Whetehr the definition is a parameter
process()
public function process(
string $name,
mixed $definition,
object $container
): ServiceDefinition;Process the parameter
Container\Definition\Processor\Processor
InterfaceSource on GitHubPhalcon\Container\Definition\Processor\Processor
Uses Phalcon\Container\Definition\ServiceDefinition
Method Summary
publicboolcanProcess(mixed $definition)Can this definition be processed?
publicServiceDefinitionprocess(string $name,mixed $definition,object $container)Process the definition
Methods
canProcess()
public function canProcess( mixed $definition ): bool;Can this definition be processed?
process()
public function process(
string $name,
mixed $definition,
object $container
): ServiceDefinition;Process the definition
Container\Definition\Processor\StringProcessor
ClassSource on GitHubPhalcon\Container\Definition\Processor\StringProcessor- implementsPhalcon\Container\Definition\Processor\Processor
Uses Phalcon\Container\Definition\DefinitionType · Phalcon\Container\Definition\ServiceDefinition
Method Summary
publicboolcanProcess(mixed $definition)Whether the definition is a class string
publicServiceDefinitionprocess(string $name,mixed $definition,object $container)Process the class string
Methods
canProcess()
public function canProcess( mixed $definition ): bool;Whether the definition is a class string
process()
public function process(
string $name,
mixed $definition,
object $container
): ServiceDefinition;Process the class string
Container\Definition\ServiceDefinition
ClassSource on GitHubPhalcon\Container\Definition\ServiceDefinition
Uses Phalcon\Container\Exceptions\FrozenDefinition · Phalcon\Container\Exceptions\InvalidExtender · Phalcon\Container\Exceptions\NoClassSet · Phalcon\Container\Exceptions\NoFactorySet · Phalcon\Contracts\Container\ContainerTypes · Phalcon\Contracts\Container\Ioc\IocContainer · Phalcon\Contracts\Container\Resolver\Resolvable · Phalcon\Contracts\Container\Service\Collection · ReflectionClass · ReflectionException
Method Summary
public__construct(string $serviceName,string $type,mixed $raw = null)publicstaticaddExtender(callable $extender)Adds an extender
publicstaticaddTag(string $tag)Adds a tag
publicobjectbuildService(object $container)Builds a service and returns the instance back
publicvoidfreeze(object $container)Freezes the container
publicarraygetArguments()Returns the arguments
publicstringgetClass()Returns the class
publicarraygetConstructorArgs()Returns the constructor arguments
publicarraygetExtenders()Returns the extenders
publiccallablegetFactory()Returns the factory
publicstringgetLifetime()Returns the lifetime
publicstringgetServiceName()Returns the name of the service
publicarraygetTags()Returns the tags
publicstringgetType()Returns the type
publicboolhasClass()Does it have a class
publicboolhasExtenders()Do we have extenders
publicboolhasFactory()Does it have a factory
publicboolisCacheable()Is it cacheable
publicboolisFrozen()Is it frozen
publicstaticsetArgument(mixed $param,mixed $value)Set an argument
publicstaticsetClass(string $className)Set a class
publicstaticsetContainer(object $container)Set the container
publicstaticsetExtenders(array $extenders)Set extenders
publicstaticsetFactory(callable $factory)Set a factory
publicstaticsetIsCacheable(bool $isCacheable)Set cachable
publicstaticsetLifetime(string $lifetime)Set lifetime
publicstaticunsetClass()Unset class
publicstaticunsetExtenders()Unset extenders
publicstaticunsetFactory()Unset the factory
protectedvoidcheckFrozen()Check if frozen
Properties
protectedarray$arguments = []protectedstring|null$className = nullprotectedarray$constructorArgs = []protectedobject|null$container = nullprotectedarray$extenders = []protectedcallable|null$factory = nullprotectedbool$frozen = falseprotectedbool$isCacheable = falseprotectedstring$lifetime = ServiceLifetime::SCOPEDprotectedmixed$raw = nullprotectedstring$serviceNameprotectedarray$tags = []protectedstring$typeMethods
__construct()
public function __construct(
string $serviceName,
string $type,
mixed $raw = null
);addExtender()
public function addExtender( callable $extender ): static;Adds an extender
addTag()
public function addTag( string $tag ): static;Adds a tag
buildService()
public function buildService( object $container ): object;Builds a service and returns the instance back
freeze()
public function freeze( object $container ): void;Freezes the container
getArguments()
public function getArguments(): array;Returns the arguments
getClass()
public function getClass(): string;Returns the class
getConstructorArgs()
public function getConstructorArgs(): array;Returns the constructor arguments
getExtenders()
public function getExtenders(): array;Returns the extenders
getFactory()
public function getFactory(): callable;Returns the factory
getLifetime()
public function getLifetime(): string;Returns the lifetime
getServiceName()
public function getServiceName(): string;Returns the name of the service
getTags()
public function getTags(): array;Returns the tags
getType()
public function getType(): string;Returns the type
hasClass()
public function hasClass(): bool;Does it have a class
hasExtenders()
public function hasExtenders(): bool;Do we have extenders
hasFactory()
public function hasFactory(): bool;Does it have a factory
isCacheable()
public function isCacheable(): bool;Is it cacheable
isFrozen()
public function isFrozen(): bool;Is it frozen
setArgument()
public function setArgument(
mixed $param,
mixed $value
): static;Set an argument
setClass()
public function setClass( string $className ): static;Set a class
setContainer()
public function setContainer( object $container ): static;Set the container
setExtenders()
public function setExtenders( array $extenders ): static;Set extenders
setFactory()
public function setFactory( callable $factory ): static;Set a factory
setIsCacheable()
public function setIsCacheable( bool $isCacheable ): static;Set cachable
setLifetime()
public function setLifetime( string $lifetime ): static;Set lifetime
unsetClass()
public function unsetClass(): static;Unset class
unsetExtenders()
public function unsetExtenders(): static;Unset extenders
unsetFactory()
public function unsetFactory(): static;Unset the factory
checkFrozen()
protected function checkFrozen(): void;Check if frozen
Container\Definition\ServiceLifetime
ClassSource on GitHubPhalcon\Container\Definition\ServiceLifetime
Constants
stringSCOPED = "SCOPED"stringSINGLETON = "SINGLETON"stringTRANSIENT = "TRANSIENT"Container\Exceptions\CannotExtendResolved
ClassSource on GitHub\ExceptionPhalcon\Container\Exceptions\ExceptionPhalcon\Container\Exceptions\CannotExtendResolved
Method Summary
Methods
__construct()
public function __construct( string $name );Cannot extend a resolved service
Container\Exceptions\CannotResolveParameter
ClassSource on GitHub\ExceptionPhalcon\Container\Exceptions\ExceptionPhalcon\Container\Exceptions\CannotResolveParameter
Method Summary
Methods
__construct()
public function __construct(
string $param,
string $className
);Cannot resolve a parameter
Container\Exceptions\CircularAliasFound
ClassSource on GitHub\ExceptionPhalcon\Container\Exceptions\ExceptionPhalcon\Container\Exceptions\CircularAliasFound
Method Summary
Methods
__construct()
public function __construct( string $name );Circular Alias found
Container\Exceptions\ContainerThrowable
InterfaceSource on GitHub\ThrowablePhalcon\Contracts\Container\Ioc\IocThrowablePhalcon\Container\Exceptions\ContainerThrowable- extendsPhalcon\Contracts\Container\Ioc\IocThrowable,Phalcon\Contracts\Container\Resolver\ResolverThrowable,Phalcon\Contracts\Container\Service\Throwable
Uses Phalcon\Contracts\Container\Ioc\IocThrowable · Phalcon\Contracts\Container\Resolver\ResolverThrowable · Phalcon\Contracts\Container\Service\Throwable
Container\Exceptions\EnvNotDefined
FinalSource on GitHub\ExceptionPhalcon\Container\Exceptions\ExceptionPhalcon\Container\Exceptions\EnvNotDefined
Method Summary
Methods
__construct()
public function __construct( string $varname );Container\Exceptions\Exception
ClassSource on GitHub\ExceptionPhalcon\Container\Exceptions\Exception- implementsPhalcon\Container\Exceptions\ContainerThrowablePhalcon\Container\Exceptions\CannotExtendResolvedPhalcon\Container\Exceptions\CannotResolveParameterPhalcon\Container\Exceptions\CircularAliasFoundPhalcon\Container\Exceptions\EnvNotDefinedPhalcon\Container\Exceptions\FrozenDefinitionPhalcon\Container\Exceptions\InstanceNotFoundPhalcon\Container\Exceptions\InvalidExtenderPhalcon\Container\Exceptions\NoClassSetPhalcon\Container\Exceptions\NoFactorySetPhalcon\Container\Exceptions\NoProcessorFoundPhalcon\Container\Exceptions\ParameterNotFoundPhalcon\Container\Exceptions\ServiceNotFoundPhalcon\Container\Exceptions\ServiceNotRegistered
Uses Exception
Container\Exceptions\FrozenDefinition
ClassSource on GitHub\ExceptionPhalcon\Container\Exceptions\ExceptionPhalcon\Container\Exceptions\FrozenDefinition
Method Summary
Methods
__construct()
public function __construct( string $name );Definition is frozen
Container\Exceptions\InstanceNotFound
FinalSource on GitHub\ExceptionPhalcon\Container\Exceptions\ExceptionPhalcon\Container\Exceptions\InstanceNotFound
Method Summary
Methods
__construct()
public function __construct( string $name );Container\Exceptions\InvalidExtender
ClassSource on GitHub\ExceptionPhalcon\Container\Exceptions\ExceptionPhalcon\Container\Exceptions\InvalidExtender
Method Summary
Methods
__construct()
public function __construct(
string $service,
string $key
);Invalid extender (not callable)
Container\Exceptions\NoClassSet
ClassSource on GitHub\ExceptionPhalcon\Container\Exceptions\ExceptionPhalcon\Container\Exceptions\NoClassSet
Method Summary
Methods
__construct()
public function __construct( string $name );No set for service
Container\Exceptions\NoFactorySet
ClassSource on GitHub\ExceptionPhalcon\Container\Exceptions\ExceptionPhalcon\Container\Exceptions\NoFactorySet
Method Summary
Methods
__construct()
public function __construct( string $name );No factory for service
Container\Exceptions\NoProcessorFound
ClassSource on GitHub\ExceptionPhalcon\Container\Exceptions\ExceptionPhalcon\Container\Exceptions\NoProcessorFound
Method Summary
Methods
__construct()
public function __construct();No processor found
Container\Exceptions\ParameterNotFound
FinalSource on GitHub\ExceptionPhalcon\Container\Exceptions\ExceptionPhalcon\Container\Exceptions\ParameterNotFound
Method Summary
Methods
__construct()
public function __construct( string $name );Container\Exceptions\ServiceNotFound
ClassSource on GitHub\ExceptionPhalcon\Container\Exceptions\ExceptionPhalcon\Container\Exceptions\ServiceNotFound
Method Summary
Methods
__construct()
public function __construct( string $name );Service not found
Container\Exceptions\ServiceNotRegistered
ClassSource on GitHub\ExceptionPhalcon\Container\Exceptions\ExceptionPhalcon\Container\Exceptions\ServiceNotRegistered
Method Summary
Methods
__construct()
public function __construct( string $name );Service not registered
Container\Provider\Cli
ClassSource on GitHubPhalcon\Container\Provider\Cli- implementsPhalcon\Contracts\Container\Service\Provider
Uses Phalcon\Annotations\Adapter\Memory · Phalcon\Auth\Access\AccessLocator · Phalcon\Cli\Dispatcher · Phalcon\Cli\DispatcherInterface · Phalcon\Cli\Router · Phalcon\Cli\RouterInterface · Phalcon\Contracts\Container\Service\Collection · Phalcon\Contracts\Container\Service\Provider · Phalcon\Contracts\Encryption\Security\Security · Phalcon\Encryption\Security · Phalcon\Events\Manager · Phalcon\Events\ManagerInterface · Phalcon\Filter\FilterFactory · Phalcon\Filter\FilterInterface · Phalcon\Html\Escaper · Phalcon\Html\Escaper\EscaperInterface · Phalcon\Html\TagFactory · Phalcon\Mvc\Model\Manager · Phalcon\Mvc\Model\ManagerInterface · Phalcon\Mvc\Model\MetaDataInterface · Phalcon\Mvc\Model\MetaData\Memory · Phalcon\Mvc\Model\Transaction\Manager · Phalcon\Mvc\Model\Transaction\ManagerInterface · Phalcon\Storage\SerializerFactory · Phalcon\Support\HelperFactory · Phalcon\Support\Settings
Method Summary
Methods
provide()
public function provide( Collection $services ): void;Provider for commonly used CLI applications
Container\Provider\Web
ClassSource on GitHubPhalcon\Container\Provider\Web- implementsPhalcon\Contracts\Container\Service\Provider
Uses Phalcon\Annotations\Adapter\Memory · Phalcon\Assets\Manager · Phalcon\Auth\Access\AccessLocator · Phalcon\Contracts\Container\Service\Collection · Phalcon\Contracts\Container\Service\Provider · Phalcon\Contracts\Encryption\Security\Security · Phalcon\Encryption\Crypt · Phalcon\Encryption\Crypt\CryptInterface · Phalcon\Encryption\Security · Phalcon\Events\Manager · Phalcon\Events\ManagerInterface · Phalcon\Filter\FilterFactory · Phalcon\Filter\FilterInterface · Phalcon\Flash\Direct · Phalcon\Flash\Session · Phalcon\Html\Escaper · Phalcon\Html\Escaper\EscaperInterface · Phalcon\Html\TagFactory · Phalcon\Http\Request · Phalcon\Http\RequestInterface · Phalcon\Http\Response · Phalcon\Http\ResponseInterface · Phalcon\Http\Response\Cookies · Phalcon\Http\Response\CookiesInterface · Phalcon\Mvc\Dispatcher · Phalcon\Mvc\DispatcherInterface · Phalcon\Mvc\Model\Manager · Phalcon\Mvc\Model\ManagerInterface · Phalcon\Mvc\Model\MetaDataInterface · Phalcon\Mvc\Model\MetaData\Memory · Phalcon\Mvc\Model\Transaction\Manager · Phalcon\Mvc\Model\Transaction\ManagerInterface · Phalcon\Mvc\Router · Phalcon\Mvc\RouterInterface · Phalcon\Mvc\Url · Phalcon\Mvc\Url\UrlInterface · Phalcon\Storage\SerializerFactory · Phalcon\Support\HelperFactory · Phalcon\Support\Settings
Method Summary
Methods
provide()
public function provide( Collection $services ): void;Provider for commonly used Web applications
Container\Resolver\Lazy\ArrayValues
ClassSource on GitHub@implements ArrayAccess<array-key, mixed> @implements IteratorAggregate<array-key, mixed>
Phalcon\Container\Resolver\Lazy\LazyPhalcon\Container\Resolver\Lazy\ArrayValues- implements\ArrayAccess,\Countable,\IteratorAggregate
Uses ArrayAccess · ArrayIterator · Countable · IteratorAggregate · Phalcon\Contracts\Container\ContainerTypes
Method Summary
public__construct(array $values = [])publicintcount()publicArrayIteratorgetIterator()publicvoidmerge(mixed $values)publicbooloffsetExists(mixed $offset)publicmixedoffsetGet(mixed $offset)publicvoidoffsetSet(mixed $offset,mixed $value)publicvoidoffsetUnset(mixed $offset)publicarrayresolve(object $ioc)Resolve to an array, where each element has itself been lazy-resolved.
protectedmixedresolveValue(object $ioc,mixed $value)protectedarrayresolveValues(object $ioc,array $values)Properties
protectedarray$values = []Methods
__construct()
public function __construct( array $values = [] );count()
public function count(): int;getIterator()
public function getIterator(): ArrayIterator;merge()
public function merge( mixed $values ): void;offsetExists()
public function offsetExists( mixed $offset ): bool;offsetGet()
public function offsetGet( mixed $offset ): mixed;offsetSet()
public function offsetSet(
mixed $offset,
mixed $value
): void;offsetUnset()
public function offsetUnset( mixed $offset ): void;resolve()
public function resolve( object $ioc ): array;Resolve to an array, where each element has itself been lazy-resolved.
resolveValue()
protected function resolveValue(
object $ioc,
mixed $value
): mixed;resolveValues()
protected function resolveValues(
object $ioc,
array $values
): array;Container\Resolver\Lazy\Call
ClassSource on GitHubPhalcon\Container\Resolver\Lazy\LazyPhalcon\Container\Resolver\Lazy\Call
Method Summary
Properties
protectedmixed$callableObjectMethods
__construct()
public function __construct( callable $callableObject );resolve()
public function resolve( object $ioc ): mixed;Resolve the callable
Container\Resolver\Lazy\CallableGet
ClassSource on GitHubPhalcon\Container\Resolver\Lazy\LazyPhalcon\Container\Resolver\Lazy\CallableGet
Uses Phalcon\Contracts\Container\Service\Collection
Method Summary
Properties
protectedLazy|string$idMethods
__construct()
public function __construct( mixed $id );resolve()
public function resolve( object $ioc ): mixed;Resolve to a closure on a get()
Container\Resolver\Lazy\CallableNew
ClassSource on GitHubPhalcon\Container\Resolver\Lazy\LazyPhalcon\Container\Resolver\Lazy\CallableNew
Uses Phalcon\Contracts\Container\Service\Collection
Method Summary
Properties
protectedLazy|string$idMethods
__construct()
public function __construct( mixed $id );resolve()
public function resolve( object $ioc ): mixed;Resolve to a closure on a new()
Container\Resolver\Lazy\CsEnv
ClassSource on GitHubPhalcon\Container\Resolver\Lazy\LazyPhalcon\Container\Resolver\Lazy\EnvPhalcon\Container\Resolver\Lazy\CsEnv
Uses Phalcon\Container\Exceptions\EnvNotDefined · Phalcon\Contracts\Container\ContainerTypes
Method Summary
Methods
resolve()
public function resolve( object $ioc ): array;Resolve the getEnv() from keys as a comma separated list
Container\Resolver\Lazy\Env
ClassSource on GitHubPhalcon\Container\Resolver\Lazy\LazyPhalcon\Container\Resolver\Lazy\Env
Uses Phalcon\Container\Exceptions\EnvNotDefined
Method Summary
public__construct(string $varname,string|null $vartype = null)publicmixedresolve(object $ioc)Resolve an environment variable
protectedmixedcast(mixed $value)Cast a value to the defined type (if any)
protectedstringgetEnv()Return the env value
Properties
protectedstring$varnameprotectedstring|null$vartype = nullMethods
__construct()
public function __construct(
string $varname,
string|null $vartype = null
);resolve()
public function resolve( object $ioc ): mixed;Resolve an environment variable
cast()
protected function cast( mixed $value ): mixed;Cast a value to the defined type (if any)
getEnv()
protected function getEnv(): string;Return the env value
Container\Resolver\Lazy\EnvDefault
ClassSource on GitHubPhalcon\Container\Resolver\Lazy\LazyPhalcon\Container\Resolver\Lazy\EnvPhalcon\Container\Resolver\Lazy\EnvDefault
Uses Phalcon\Container\Exceptions\EnvNotDefined
Method Summary
public__construct(string $varname,mixed $defaultValue,string|null $vartype = null)publicmixedresolve(object $ioc)Resolve an environment variable, returning the default if not defined
Methods
__construct()
public function __construct(
string $varname,
mixed $defaultValue,
string|null $vartype = null
);resolve()
public function resolve( object $ioc ): mixed;Resolve an environment variable, returning the default if not defined
Container\Resolver\Lazy\FunctionCall
ClassSource on GitHubPhalcon\Container\Resolver\Lazy\LazyPhalcon\Container\Resolver\Lazy\FunctionCall
Uses Phalcon\Contracts\Container\ContainerTypes
Method Summary
public__construct(string $functionName,array $arguments)publicmixedresolve(object $ioc)Resolve a function
Properties
protectedarray$argumentsprotectedstring$functionNameMethods
__construct()
public function __construct(
string $functionName,
array $arguments
);resolve()
public function resolve( object $ioc ): mixed;Resolve a function
Container\Resolver\Lazy\Get
ClassSource on GitHubPhalcon\Container\Resolver\Lazy\LazyPhalcon\Container\Resolver\Lazy\Get
Uses Phalcon\Contracts\Container\Service\Collection
Method Summary
Properties
protectedLazy|string$idMethods
__construct()
public function __construct( mixed $id );resolve()
public function resolve( object $ioc ): mixed;Resolve a shared instance
Container\Resolver\Lazy\GetCall
ClassSource on GitHubPhalcon\Container\Resolver\Lazy\LazyPhalcon\Container\Resolver\Lazy\GetCall
Uses Phalcon\Contracts\Container\ContainerTypes · Phalcon\Contracts\Container\Service\Collection
Method Summary
public__construct(mixed $id,string $method,array $arguments)publicmixedresolve(object $ioc)Resolve a shared instance method call
Properties
protectedarray$argumentsprotectedLazy|string$idprotectedstring$methodMethods
__construct()
public function __construct(
mixed $id,
string $method,
array $arguments
);resolve()
public function resolve( object $ioc ): mixed;Resolve a shared instance method call
Container\Resolver\Lazy\Lazy
AbstractSource on GitHubPhalcon\Container\Resolver\Lazy\Lazy- implementsPhalcon\Contracts\Container\Resolver\ResolvablePhalcon\Container\Resolver\Lazy\ArrayValuesPhalcon\Container\Resolver\Lazy\CallPhalcon\Container\Resolver\Lazy\CallableGetPhalcon\Container\Resolver\Lazy\CallableNewPhalcon\Container\Resolver\Lazy\EnvPhalcon\Container\Resolver\Lazy\FunctionCallPhalcon\Container\Resolver\Lazy\GetPhalcon\Container\Resolver\Lazy\GetCallPhalcon\Container\Resolver\Lazy\NewCallPhalcon\Container\Resolver\Lazy\NewInstancePhalcon\Container\Resolver\Lazy\StaticCall
Uses Phalcon\Contracts\Container\ContainerTypes · Phalcon\Contracts\Container\Resolver\Resolvable
Method Summary
publicmixed__invoke(object $ioc)publicmixedresolve(object $ioc)protectedmixedresolveArgument(object $ioc,mixed $argument)protectedarrayresolveArguments(object $ioc,array $arguments)Methods
__invoke()
public function __invoke( object $ioc ): mixed;resolve()
abstract public function resolve( object $ioc ): mixed;resolveArgument()
protected function resolveArgument(
object $ioc,
mixed $argument
): mixed;resolveArguments()
protected function resolveArguments(
object $ioc,
array $arguments
): array;Container\Resolver\Lazy\LazyFactory
ClassSource on GitHubPhalcon\Container\Resolver\Lazy\LazyFactory
Uses Phalcon\Contracts\Container\ContainerTypes
Method Summary
publicArrayValuesarrayValues(array $values)publicCallcall(callable $callableObject)publicCallableGetcallableGet(string $id)publicCallableNewcallableNew(string $id)publicCsEnvcsEnv(string $name,string|null $type = null)publicEnvenv(string $name,string|null $type = null)publicEnvDefaultenvDefault(string $name,mixed $defaultValue,string|null $type = null)publicFunctionCallfunctionCall(string $functionName,array $args)publicGetget(string $id)publicGetCallgetCall(string $id,string $method,array $args)publicNewCallnewCall(string $id,string $method,array $args)publicNewInstancenewInstance(string $id)publicStaticCallstaticCall(string $className,string $method,array $args)Methods
arrayValues()
public static function arrayValues( array $values ): ArrayValues;call()
public static function call( callable $callableObject ): Call;callableGet()
public static function callableGet( string $id ): CallableGet;callableNew()
public static function callableNew( string $id ): CallableNew;csEnv()
public static function csEnv(
string $name,
string|null $type = null
): CsEnv;env()
public static function env(
string $name,
string|null $type = null
): Env;envDefault()
public static function envDefault(
string $name,
mixed $defaultValue,
string|null $type = null
): EnvDefault;functionCall()
public static function functionCall(
string $functionName,
array $args
): FunctionCall;get()
public static function get( string $id ): Get;getCall()
public static function getCall(
string $id,
string $method,
array $args
): GetCall;newCall()
public static function newCall(
string $id,
string $method,
array $args
): NewCall;newInstance()
public static function newInstance( string $id ): NewInstance;staticCall()
public static function staticCall(
string $className,
string $method,
array $args
): StaticCall;Container\Resolver\Lazy\NewCall
ClassSource on GitHubPhalcon\Container\Resolver\Lazy\LazyPhalcon\Container\Resolver\Lazy\NewCall
Uses Phalcon\Contracts\Container\ContainerTypes · Phalcon\Contracts\Container\Service\Collection
Method Summary
public__construct(mixed $id,string $method,array $arguments)publicmixedresolve(object $ioc)Resolve a new instance method call
Properties
protectedarray$argumentsprotectedstring|Lazy$idprotectedstring$methodMethods
__construct()
public function __construct(
mixed $id,
string $method,
array $arguments
);resolve()
public function resolve( object $ioc ): mixed;Resolve a new instance method call
Container\Resolver\Lazy\NewInstance
ClassSource on GitHubPhalcon\Container\Resolver\Lazy\LazyPhalcon\Container\Resolver\Lazy\NewInstance
Uses Phalcon\Contracts\Container\Service\Collection
Method Summary
Properties
protectedstring|Lazy$idMethods
__construct()
public function __construct( mixed $id );resolve()
public function resolve( object $ioc ): mixed;Resolve a new instance
Container\Resolver\Lazy\StaticCall
ClassSource on GitHubPhalcon\Container\Resolver\Lazy\LazyPhalcon\Container\Resolver\Lazy\StaticCall
Uses Phalcon\Contracts\Container\ContainerTypes
Method Summary
public__construct(mixed $className,string $method,array $arguments)publicmixedresolve(object $ioc)Resolve a static method call
Properties
protectedarray$argumentsprotectedstring|Lazy$classNameprotectedstring$methodMethods
__construct()
public function __construct(
mixed $className,
string $method,
array $arguments
);resolve()
public function resolve( object $ioc ): mixed;Resolve a static method call
Container\Resolver\Resolver
ClassSource on GitHubPhalcon\Container\Resolver\Resolver- implementsPhalcon\Contracts\Container\Resolver\ResolverService
Uses Closure · Phalcon\Container\Exceptions\CannotResolveParameter · Phalcon\Container\Resolver\Lazy\Lazy · Phalcon\Contracts\Container\ContainerTypes · Phalcon\Contracts\Container\Resolver\ResolverService · Phalcon\Contracts\Container\Service\Collection · ReflectionClass · ReflectionException · ReflectionFunction · ReflectionMethod · ReflectionNamedType · ReflectionParameter · ReflectionType
Method Summary
publicboolisResolvableClass(string $className)Is this a resolvable class?
publicmixedresolveCall(object $ioc,callable $callableObject,array $arguments)Resolve a call
publicobjectresolveClass(object $ioc,string $className,array $arguments)Resolve a class
publicvoidresolveMethod(object $ioc,ReflectionMethod $method,object $instance)Resolve a method
publicmixedresolveParameter(object $ioc,ReflectionParameter $parameter)Resolve parameters
publicarrayresolveParameters(object $ioc,array $parameters,array $arguments)Resolve parameters
publicmixedresolveType(object $ioc,mixed $type)type is ReflectionType
Methods
isResolvableClass()
public function isResolvableClass( string $className ): bool;Is this a resolvable class?
resolveCall()
public function resolveCall(
object $ioc,
callable $callableObject,
array $arguments
): mixed;Resolve a call
resolveClass()
public function resolveClass(
object $ioc,
string $className,
array $arguments
): object;Resolve a class
resolveMethod()
public function resolveMethod(
object $ioc,
ReflectionMethod $method,
object $instance
): void;Resolve a method
resolveParameter()
public function resolveParameter(
object $ioc,
ReflectionParameter $parameter
): mixed;Resolve parameters
resolveParameters()
public function resolveParameters(
object $ioc,
array $parameters,
array $arguments
): array;Resolve parameters
resolveType()
public function resolveType(
object $ioc,
mixed $type
): mixed;type is ReflectionType