Skip to content

Phalcon Container

Container\Container

Class Source on GitHub

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 = true
protectedarray$instanceLifetimes = []
protectedarray$instances = []
protectedarray$parameters = []
protectedarray$processors = []
protectedResolver$resolver
protectedarray$services = []
protectedarray$tags = []

Methods

Public · 35

__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

Class Source on GitHub

Uses Phalcon\Contracts\Container\ContainerTypes · Phalcon\Contracts\Container\Ioc\IocContainerFactory · Phalcon\Contracts\Container\Service\Provider

Method Summary

Properties

protectedarray$providers = []

Methods

Public · 2

addProvider()

public function addProvider( Provider $provider ): static;

Adds a provider

newContainer()

public function newContainer(): Container;

Returns a new container

Container\Definition\DefinitionType

Class Source on GitHub
  • Phalcon\Container\Definition\DefinitionType

Constants

stringCLOSURE_TYPE = "closure"
stringOBJECT_TYPE = "object"
stringPARAMETER_TYPE = "parameter"
stringSTRING_TYPE = "string"

Container\Definition\Processor\ClosureProcessor

Class Source on GitHub

Uses Closure · Phalcon\Container\Definition\DefinitionType · Phalcon\Container\Definition\ServiceDefinition

Method Summary

Methods

Public · 2

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

Class Source on GitHub

Uses Closure · Phalcon\Container\Definition\DefinitionType · Phalcon\Container\Definition\ServiceDefinition

Method Summary

Methods

Public · 2

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

Class Source on GitHub

Uses Closure · Phalcon\Container\Definition\DefinitionType · Phalcon\Container\Definition\ServiceDefinition

Method Summary

Methods

Public · 2

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

Interface Source on GitHub
  • Phalcon\Container\Definition\Processor\Processor

Uses Phalcon\Container\Definition\ServiceDefinition

Method Summary

Methods

Public · 2

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

Class Source on GitHub

Uses Phalcon\Container\Definition\DefinitionType · Phalcon\Container\Definition\ServiceDefinition

Method Summary

Methods

Public · 2

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

Class Source on GitHub
  • Phalcon\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. The setters call this method only when the

Properties

protectedarray$arguments = []
protectedstring|null$className = null
protectedarray$constructorArgs = []
protectedobject|null$container = null
protectedarray$extenders = []
protectedcallable|null$factory = null
protectedbool$frozen = false
protectedbool$isCacheable = false
protectedstring$lifetime = ServiceLifetime::SCOPED
protectedmixed$raw = null
protectedstring$serviceName
protectedarray$tags = []
protectedstring$type

Methods

Public · 29

__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

Protected · 1

checkFrozen()

protected function checkFrozen(): void;

Check if frozen. The setters call this method only when the definition is frozen: the method call costs more than the check.

Container\Definition\ServiceLifetime

Class Source on GitHub
  • Phalcon\Container\Definition\ServiceLifetime

Constants

stringSCOPED = "SCOPED"
stringSINGLETON = "SINGLETON"
stringTRANSIENT = "TRANSIENT"

Container\Exceptions\CannotExtendResolved

Class Source on GitHub

Method Summary

Methods

Public · 1

__construct()

public function __construct( string $name );

Cannot extend a resolved service

Container\Exceptions\CannotResolveParameter

Class Source on GitHub

Method Summary

Methods

Public · 1

__construct()

public function __construct(
    string $param,
    string $className
);

Cannot resolve a parameter

Container\Exceptions\CircularAliasFound

Class Source on GitHub

Method Summary

Methods

Public · 1

__construct()

public function __construct( string $name );

Circular Alias found

Container\Exceptions\ContainerThrowable

Interface Source on GitHub

Uses Phalcon\Contracts\Container\Ioc\IocThrowable · Phalcon\Contracts\Container\Resolver\ResolverThrowable · Phalcon\Contracts\Container\Service\Throwable

Container\Exceptions\EnvNotDefined

Final Source on GitHub

Method Summary

Methods

Public · 1

__construct()

public function __construct( string $varname );

Container\Exceptions\Exception

Class Source on GitHub

Uses Exception

Container\Exceptions\FrozenDefinition

Class Source on GitHub

Method Summary

Methods

Public · 1

__construct()

public function __construct( string $name );

Definition is frozen

Container\Exceptions\InstanceNotFound

Final Source on GitHub

Method Summary

Methods

Public · 1

__construct()

public function __construct( string $name );

Container\Exceptions\InvalidExtender

Class Source on GitHub

Method Summary

Methods

Public · 1

__construct()

public function __construct(
    string $service,
    string $key
);

Invalid extender (not callable)

Container\Exceptions\NoClassSet

Class Source on GitHub

Method Summary

Methods

Public · 1

__construct()

public function __construct( string $name );

No set for service

Container\Exceptions\NoFactorySet

Class Source on GitHub

Method Summary

Methods

Public · 1

__construct()

public function __construct( string $name );

No factory for service

Container\Exceptions\NoProcessorFound

Class Source on GitHub

Method Summary

Methods

Public · 1

__construct()

public function __construct();

No processor found

Container\Exceptions\ParameterNotFound

Final Source on GitHub

Method Summary

Methods

Public · 1

__construct()

public function __construct( string $name );

Container\Exceptions\ServiceNotFound

Class Source on GitHub

Method Summary

Methods

Public · 1

__construct()

public function __construct( string $name );

Service not found

Container\Exceptions\ServiceNotRegistered

Class Source on GitHub

Method Summary

Methods

Public · 1

__construct()

public function __construct( string $name );

Service not registered

Container\Provider\Cli

Class Source on GitHub

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

Public · 1

provide()

public function provide( Collection $services ): void;

Provider for commonly used CLI applications

Container\Provider\Web

Class Source on GitHub

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

Public · 1

provide()

public function provide( Collection $services ): void;

Provider for commonly used Web applications

Container\Resolver\Lazy\ArrayValues

Class Source on GitHub

@implements ArrayAccess<array-key, mixed> @implements IteratorAggregate<array-key, mixed>

Uses ArrayAccess · ArrayIterator · Countable · IteratorAggregate · Phalcon\Contracts\Container\ContainerTypes

Method Summary

Properties

protectedarray$values = []

Methods

Public · 9

__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.

Protected · 2

resolveValue()

protected function resolveValue(
    object $ioc,
    mixed $value
): mixed;

resolveValues()

protected function resolveValues(
    object $ioc,
    array $values
): array;

Container\Resolver\Lazy\Call

Class Source on GitHub

Method Summary

Properties

protectedmixed$callableObject

Methods

Public · 2

__construct()

public function __construct( callable $callableObject );

resolve()

public function resolve( object $ioc ): mixed;

Resolve the callable

Container\Resolver\Lazy\CallableGet

Class Source on GitHub

Uses Phalcon\Contracts\Container\Service\Collection

Method Summary

Properties

protectedLazy|string$id

Methods

Public · 2

__construct()

public function __construct( mixed $id );

resolve()

public function resolve( object $ioc ): mixed;

Resolve to a closure on a get()

Container\Resolver\Lazy\CallableNew

Class Source on GitHub

Uses Phalcon\Contracts\Container\Service\Collection

Method Summary

Properties

protectedLazy|string$id

Methods

Public · 2

__construct()

public function __construct( mixed $id );

resolve()

public function resolve( object $ioc ): mixed;

Resolve to a closure on a new()

Container\Resolver\Lazy\CsEnv

Class Source on GitHub

Uses Phalcon\Container\Exceptions\EnvNotDefined · Phalcon\Contracts\Container\ContainerTypes

Method Summary

Methods

Public · 1

resolve()

public function resolve( object $ioc ): array;

Resolve the getEnv() from keys as a comma separated list

Container\Resolver\Lazy\Env

Class Source on GitHub

Uses Phalcon\Container\Exceptions\EnvNotDefined

Method Summary

Properties

protectedstring$varname
protectedstring|null$vartype = null

Methods

Public · 2

__construct()

public function __construct(
    string $varname,
    string|null $vartype = null
);

resolve()

public function resolve( object $ioc ): mixed;

Resolve an environment variable

Protected · 2

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

Class Source on GitHub

Uses Phalcon\Container\Exceptions\EnvNotDefined

Method Summary

Methods

Public · 2

__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

Class Source on GitHub

Uses Phalcon\Contracts\Container\ContainerTypes

Method Summary

Properties

protectedarray$arguments
protectedstring$functionName

Methods

Public · 2

__construct()

public function __construct(
    string $functionName,
    array $arguments
);

resolve()

public function resolve( object $ioc ): mixed;

Resolve a function

Container\Resolver\Lazy\Get

Class Source on GitHub

Uses Phalcon\Contracts\Container\Service\Collection

Method Summary

Properties

protectedLazy|string$id

Methods

Public · 2

__construct()

public function __construct( mixed $id );

resolve()

public function resolve( object $ioc ): mixed;

Resolve a shared instance

Container\Resolver\Lazy\GetCall

Class Source on GitHub

Uses Phalcon\Contracts\Container\ContainerTypes · Phalcon\Contracts\Container\Service\Collection

Method Summary

Properties

protectedarray$arguments
protectedLazy|string$id
protectedstring$method

Methods

Public · 2

__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

Abstract Source on GitHub

Uses Phalcon\Contracts\Container\ContainerTypes · Phalcon\Contracts\Container\Resolver\Resolvable

Method Summary

Methods

Public · 2

__invoke()

public function __invoke( object $ioc ): mixed;

resolve()

abstract public function resolve( object $ioc ): mixed;
Protected · 2

resolveArgument()

protected function resolveArgument(
    object $ioc,
    mixed $argument
): mixed;

resolveArguments()

protected function resolveArguments(
    object $ioc,
    array $arguments
): array;

Container\Resolver\Lazy\LazyFactory

Class Source on GitHub
  • Phalcon\Container\Resolver\Lazy\LazyFactory

Uses Phalcon\Contracts\Container\ContainerTypes

Method Summary

Methods

Public · 13

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

Class Source on GitHub

Uses Phalcon\Contracts\Container\ContainerTypes · Phalcon\Contracts\Container\Service\Collection

Method Summary

Properties

protectedarray$arguments
protectedLazy|string$id
protectedstring$method

Methods

Public · 2

__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

Class Source on GitHub

Uses Phalcon\Contracts\Container\Service\Collection

Method Summary

Properties

protectedLazy|string$id

Methods

Public · 2

__construct()

public function __construct( mixed $id );

resolve()

public function resolve( object $ioc ): mixed;

Resolve a new instance

Container\Resolver\Lazy\StaticCall

Class Source on GitHub

Uses Phalcon\Contracts\Container\ContainerTypes

Method Summary

Properties

protectedarray$arguments
protectedLazy|string$className
protectedstring$method

Methods

Public · 2

__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

Class Source on GitHub

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

Methods

Public · 7

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

Navigation

Type to search…

↑↓ navigate↵ selectEsc close