Support\AbstractLocator
AbstractSource on GitHubAbstract base class for service locators.
Provides a unified way to register, validate, and resolve services from a DI container, with support for both legacy Di and new Container.
@template T of object
Phalcon\Support\AbstractLocator
Uses Phalcon\Contracts\Container\Service\Collection · Phalcon\Di\DiInterface · Throwable
Method Summary
public__construct(mixed$container,array$services = [])publicarraygetAll()Returns the full registered service map (defaults plus any added viapublicstringgetClass( string$name )Returns the class-string registered under the given name.publicboolhas( string$name )Whether a service with the given name is registered.publicobjectnewInstance( string$name )Retrieve a service instance from the container.publicstaticregister(string$name,string$definition)Register a service or override an existing one.protectedstringgetExceptionClass()Get the exception class to throw on errors.protectedstringgetInterfaceClass()Get the interface/class that all registered services must implement.protectedstringgetService( string$name )Get the service class name for a given name.protectedarraygetServices()Get the default services for this locator.Properties
protectedCollection|DiInterface$containerprotectedarray$services = []Methods
__construct()
public function __construct(
mixed $container,
array $services = []
);getAll()
public function getAll(): array;Returns the full registered service map (defaults plus any added via register()).
getClass()
public function getClass( string $name ): string;Returns the class-string registered under the given name.
has()
public function has( string $name ): bool;Whether a service with the given name is registered.
newInstance()
public function newInstance( string $name ): object;Retrieve a service instance from the container.
On the DiInterface path this returns the container’s shared
instance (getShared()) - despite the name, it is not a fresh build.
Locators whose services carry per-activation state should override this
method to resolve a fresh instance; see Auth\Access\AccessLocator, which uses
ContainerResolver::resolveFresh for exactly that reason.
register()
public function register(
string $name,
string $definition
): static;Register a service or override an existing one.
getExceptionClass()
abstract protected function getExceptionClass(): string;Get the exception class to throw on errors.
getInterfaceClass()
abstract protected function getInterfaceClass(): string;Get the interface/class that all registered services must implement. This allows different locators to enforce different contracts.
getService()
protected function getService( string $name ): string;Get the service class name for a given name.
getServices()
abstract protected function getServices(): array;Get the default services for this locator.
Support\Collection
ClassSource on GitHubPhalcon\Support\Collection is a supercharged object-oriented array. It implements:
It can be used in any part of the application that needs collection of data
Such implementations are for instance accessing globals $_GET, $_POST
etc.
@implements CollectionInterface<T>
@property array<string, T> $data @property bool $insensitive @property array<string, string> $lowerKeys @property bool $strictNull @property string|null $type
Phalcon\Support\Collection- implementsPhalcon\Support\Collection\CollectionInterface,\Countable,\JsonSerializable
Uses ArrayIterator · Countable · InvalidArgumentException · JsonSerializable · Phalcon\Support\Collection\CollectionInterface · Phalcon\Support\Collection\Exceptions\InvalidValueType · Phalcon\Support\Helper\Json\Encode · Traversable
Method Summary
public__construct(array$data = [],bool$insensitive = true,bool$strictNull = false,string|null$type = null)Collection constructor.publicmixed__get( string$element )Magic getter to get an element from the collectionpublicbool__isset( string$element )Magic isset to check whether an element exists or notpublicarray__serialize()Returns the state of the collection for serialization, includingpublicvoid__set(string$element,mixed$value)Magic setter to assign values to an elementpublicvoid__unserialize( array$data )Restores the collection state. Accepts both the structured formatpublicvoid__unset( string$element )Magic unset to remove an element from the collectionpublicvoidclear()Clears the internal collectionpublicarraycolumn( string$propertyOrMethod )Returns the values from a single property/method extracted from everypublicintcount()Count elements of an objectpublicstaticeach( callable$callback )Invokes the callback for every item in the collection. Returns thepublicstaticfilter( callable$callback )Returns a new collection of items for which the callback returns true.publicmixedfirst()Returns the first value in the collection, or null if empty.publicmixedget(string$element,mixed$defaultValue = null,string|null$cast = null)Get the element from the collectionpublicTraversablegetIterator()Returns the iterator of the classpublicarraygetKeys( bool$insensitive = true )Returns the keys (insensitive or not) of the collection.publicstring|nullgetType()Returns the configured runtime type guard, or null if none.publicarraygetValues()Returns the values of the internal array.publicboolhas( string$element )Get the element from the collectionpublicvoidinit( array$data = [] )Initialize internal arraypublicboolisEmpty()Return if the collection is emptypublicarrayjsonSerialize()Specify data which should be serialized to JSONpublicarraykeys( bool$insensitive = true )Returns the keys (insensitive or not) of the collection.publicmixedlast()Returns the last value in the collection, or null if empty.publicstaticmap( callable$callback )Returns a new collection with the callback applied to every value.publicbooloffsetExists( mixed$element )Whether a offset existspublicmixedoffsetGet( mixed$element )Offset to retrievepublicvoidoffsetSet(mixed$element,mixed$value)Offset to setpublicvoidoffsetUnset( mixed$element )Offset to unsetpublicmixedreduce(callable$callback,mixed$initial = null)Reduces the collection to a single value using the callback. Thepublicvoidremove( string$element )Delete the element from the collectionpublicvoidreplace( array$data )Replaces the collection data with a new array, clearing existing data firstpublicstring|nullserialize()BC - delegate to __serialize()publicvoidset(string$element,mixed$value)Set an element in the collectionpublicstaticsort(mixed$callback = null,int$order = 4)Returns a new collection sorted by value. Keys are preserved. When apublicarraytoArray()Returns the object in an array formatpublicstringtoJson( int$options = 4194383 )Returns the object in a JSON formatpublicvoidunserialize( string$data )BC - delegate to __unserialize()publicarrayvalues()Returns the values of the internal array.publicstaticwhere(string$propertyOrMethod,mixed$value)Returns a new collection containing only the items whoseprotectedstaticcloneEmpty( array$data = [] )Builds a new collection of the same concrete class, carrying over theprotectedmixedextractValue(mixed$item,string$propertyOrMethod)Extracts a single value from an item. For arrays returns the keyedprotectedstringprocessKey( string$element )Checks if we need insensitive keys and if so, converts the element toprotectedvoidsetData(string$element,mixed$value)Internal method to set dataprotectedvoidvalidateType( mixed$value )Validates the value against the configured $type guard. When $typeProperties
protectedarray<string, T>$data = []protectedbool$insensitive = trueprotectedarray<string, string>$lowerKeys = []Maps the case-insensitive key back to the original one it was stored under.protectedbool$strictNull = falseprotectedstring|null$type = nullMethods
__construct()
public function __construct(
array $data = [],
bool $insensitive = true,
bool $strictNull = false,
string|null $type = null
);Collection constructor.
__get()
public function __get( string $element ): mixed;Magic getter to get an element from the collection
__isset()
public function __isset( string $element ): bool;Magic isset to check whether an element exists or not
__serialize()
public function __serialize(): array;Returns the state of the collection for serialization, including configuration flags so the round-trip restores full state.
__set()
public function __set(
string $element,
mixed $value
): void;Magic setter to assign values to an element
__unserialize()
public function __unserialize( array $data ): void;Restores the collection state. Accepts both the structured format emitted by __serialize() and the legacy flat-array format for BC with previously serialized data.
__unset()
public function __unset( string $element ): void;Magic unset to remove an element from the collection
clear()
public function clear(): void;Clears the internal collection
column()
public function column( string $propertyOrMethod ): array;Returns the values from a single property/method extracted from every item in the collection, keyed by the original collection key.
count()
public function count(): int;Count elements of an object
each()
public function each( callable $callback ): static;Invokes the callback for every item in the collection. Returns the collection itself to allow chaining.
filter()
public function filter( callable $callback ): static;Returns a new collection of items for which the callback returns true. Keys are preserved.
first()
public function first(): mixed;Returns the first value in the collection, or null if empty.
get()
public function get(
string $element,
mixed $defaultValue = null,
string|null $cast = null
): mixed;Get the element from the collection
getIterator()
public function getIterator(): Traversable;Returns the iterator of the class
getKeys()
public function getKeys( bool $insensitive = true ): array;Returns the keys (insensitive or not) of the collection.
getType()
public function getType(): string|null;Returns the configured runtime type guard, or null if none.
getValues()
public function getValues(): array;Returns the values of the internal array.
has()
public function has( string $element ): bool;Get the element from the collection
init()
public function init( array $data = [] ): void;Initialize internal array
isEmpty()
public function isEmpty(): bool;Return if the collection is empty
jsonSerialize()
public function jsonSerialize(): array;Specify data which should be serialized to JSON
keys()
public function keys( bool $insensitive = true ): array;Returns the keys (insensitive or not) of the collection.
last()
public function last(): mixed;Returns the last value in the collection, or null if empty.
map()
public function map( callable $callback ): static;Returns a new collection with the callback applied to every value. Keys are preserved.
offsetExists()
public function offsetExists( mixed $element ): bool;Whether a offset exists
offsetGet()
public function offsetGet( mixed $element ): mixed;Offset to retrieve
offsetSet()
public function offsetSet(
mixed $element,
mixed $value
): void;Offset to set
offsetUnset()
public function offsetUnset( mixed $element ): void;Offset to unset
reduce()
public function reduce(
callable $callback,
mixed $initial = null
): mixed;Reduces the collection to a single value using the callback. The
callback receives ($accumulator, $value, $key).
remove()
public function remove( string $element ): void;Delete the element from the collection
replace()
public function replace( array $data ): void;Replaces the collection data with a new array, clearing existing data first
serialize()
public function serialize(): string|null;BC - delegate to __serialize()
set()
public function set(
string $element,
mixed $value
): void;Set an element in the collection
sort()
public function sort(
mixed $callback = null,
int $order = 4
): static;Returns a new collection sorted by value. Keys are preserved. When a
callback is supplied, uasort is used. Without a callback, the
comparison direction is controlled by the $order argument
(SORT_ASC or SORT_DESC).
toArray()
public function toArray(): array;Returns the object in an array format
toJson()
public function toJson( int $options = 4194383 ): string;Returns the object in a JSON format
The following options are used if none specified for json_encode
JSON_HEX_TAG, JSON_HEX_APOS, JSON_HEX_AMP, JSON_HEX_QUOT, JSON_UNESCAPED_SLASHES, JSON_THROW_ON_ERROR
@see https://www.ietf.org/rfc/rfc4627.txt
unserialize()
public function unserialize( string $data ): void;BC - delegate to __unserialize()
values()
public function values(): array;Returns the values of the internal array.
where()
public function where(
string $propertyOrMethod,
mixed $value
): static;Returns a new collection containing only the items whose
propertyOrMethod strictly equals $value.
cloneEmpty()
protected function cloneEmpty( array $data = [] ): static;Builds a new collection of the same concrete class, carrying over the configuration (insensitivity, strict-null, type) of the current one.
extractValue()
protected function extractValue(
mixed $item,
string $propertyOrMethod
): mixed;Extracts a single value from an item. For arrays returns the keyed entry; for objects, prefers a callable method, then a readable property. Returns null when nothing matches.
processKey()
protected function processKey( string $element ): string;Checks if we need insensitive keys and if so, converts the element to lowercase
setData()
protected function setData(
string $element,
mixed $value
): void;Internal method to set data
validateType()
protected function validateType( mixed $value ): void;Validates the value against the configured $type guard. When $type
is null this is a no-op. Scalar tokens (int, string, bool,
float, array, object) map to their is_* checks; anything else
is treated as a class/interface name and tested with instanceof.
Support\Collection\CollectionInterface
InterfaceSource on GitHubPhalcon\Support\Collection\CollectionInterface
@extends CollectionContract<T>
\ArrayAccessPhalcon\Contracts\Support\CollectionPhalcon\Support\Collection\CollectionInterface
Uses Phalcon\Contracts\Support\Collection
Support\Collection\Exception
ClassSource on GitHubExceptions for the Collection object
\ExceptionPhalcon\Support\ExceptionPhalcon\Support\Collection\Exception
Uses Phalcon\Support\Exception
Support\Collection\Exceptions\InvalidValueType
ClassSource on GitHub\InvalidArgumentExceptionPhalcon\Support\Collection\Exceptions\InvalidValueType
Uses InvalidArgumentException
Method Summary
Methods
__construct()
public function __construct(
string $type,
mixed $value
);Support\Collection\Exceptions\ReadOnlyViolation
ClassSource on GitHub\ExceptionPhalcon\Support\ExceptionPhalcon\Support\Collection\ExceptionPhalcon\Support\Collection\Exceptions\ReadOnlyViolation
Uses Phalcon\Support\Collection\Exception
Method Summary
Methods
__construct()
public function __construct();Support\Collection\ReadOnlyCollection
ClassSource on GitHubA read only Collection object
@extends Collection<T>
Phalcon\Support\CollectionPhalcon\Support\Collection\ReadOnlyCollection
Uses Phalcon\Support\Collection · Phalcon\Support\Collection\Exceptions\ReadOnlyViolation
Method Summary
public__construct(array$data = [],bool$insensitive = true,bool$strictNull = false,string|null$type = null)ReadOnlyCollection constructor.publicvoid__unserialize( array$data )Restores the collection state during unserialization.publicvoidclear()publicvoidinit( array$data = [] )publicvoidremove( string$element )Delete the element from the collectionpublicvoidreplace( array$data )Replaces the collection data with a new arraypublicvoidset(string$element,mixed$value)Set an element in the collectionProperties
protectedbool$constructed = falseMethods
__construct()
public function __construct(
array $data = [],
bool $insensitive = true,
bool $strictNull = false,
string|null $type = null
);ReadOnlyCollection constructor.
__unserialize()
public function __unserialize( array $data ): void;Restores the collection state during unserialization.
Temporarily disables the read-only guard so the parent class can restore the collection state. The guard is re-enabled before the method returns.
clear()
public function clear(): void;init()
public function init( array $data = [] ): void;remove()
public function remove( string $element ): void;Delete the element from the collection
replace()
public function replace( array $data ): void;Replaces the collection data with a new array
set()
public function set(
string $element,
mixed $value
): void;Set an element in the collection
Support\Debug
ClassSource on GitHubListens for uncaught exceptions and renders them. Acts as a thin coordinator delegating data collection to ReportBuilder and presentation to a Renderer.
Phalcon\Support\Debug
Uses Phalcon\Contracts\Support\Debug\Renderer · Phalcon\Contracts\Support\SupportTypes · Phalcon\Support\Debug\Exceptions\RequestHalted · Phalcon\Support\Debug\Exceptions\RuntimeWarning · Phalcon\Support\Debug\Renderer\HtmlRenderer · Phalcon\Support\Debug\ReportBuilder · Phalcon\Traits\Support\Helper\Arr\GetTrait · ReflectionException · Throwable
Method Summary
public__construct()publicstaticclearVars()Clears are variables added previouslypublicstaticdebugVar( mixed$variable )Adds a variable to the debug outputpublicstringgetCssSources()Returns the CSS sourcespublicstringgetJsSources()Returns the JavaScript sourcespublicRenderergetRenderer()Returns the renderer used to produce the outputpublicstringgetVersion()Generates a link to the current version documentationpublicvoidhalt()Halts the request showing a backtracepublicstaticlisten(bool$exceptions = true,bool$lowSeverity = false)Listen for uncaught exceptions and non silent notices or warningspublicstaticlistenExceptions()Listen for uncaught exceptionspublicstaticlistenLowSeverity()Listen for non silent notices or warningspublicboolonUncaughtException( \Throwable$exception )Handles uncaught exceptionspublicvoidonUncaughtLowSeverity(int$severity,string$message,string$file,int$line)Throws an exception when a notice or warning is raisedpublicstringrenderHtml( \Throwable$exception )Render exception to html format.publicstaticsetBlacklist( array$blacklist )Sets if files the exception's backtrace must be showedpublicstaticsetRenderer( Renderer$renderer )Sets the renderer used to produce the outputpublicstaticsetShowBackTrace( bool$showBackTrace )Sets if files the exception's backtrace must be showedpublicstaticsetShowFileFragment( bool$showFileFragment )Sets if files must be completely opened and showed in the outputpublicstaticsetShowFiles( bool$showFiles )Set if files part of the backtrace must be shown in the outputpublicstaticsetUri( string$uri )Change the base URI for static resourcesProperties
protectedarray$blacklist = […]protectedarray$data = []protectedbool$hideDocumentRoot = falseprotectedbool$isActive = falseprotectedRenderer$rendererprotectedReportBuilder$reportBuilderprotectedbool$showBackTrace = trueprotectedbool$showFileFragment = falseprotectedbool$showFiles = trueMethods
__construct()
public function __construct();clearVars()
public function clearVars(): static;Clears are variables added previously
debugVar()
public function debugVar( mixed $variable ): static;Adds a variable to the debug output
getCssSources()
public function getCssSources(): string;Returns the CSS sources
getJsSources()
public function getJsSources(): string;Returns the JavaScript sources
getRenderer()
public function getRenderer(): Renderer;Returns the renderer used to produce the output
getVersion()
public function getVersion(): string;Generates a link to the current version documentation
halt()
public function halt(): void;Halts the request showing a backtrace
listen()
public function listen(
bool $exceptions = true,
bool $lowSeverity = false
): static;Listen for uncaught exceptions and non silent notices or warnings
listenExceptions()
public function listenExceptions(): static;Listen for uncaught exceptions
listenLowSeverity()
public function listenLowSeverity(): static;Listen for non silent notices or warnings
onUncaughtException()
public function onUncaughtException( \Throwable $exception ): bool;Handles uncaught exceptions
onUncaughtLowSeverity()
public function onUncaughtLowSeverity(
int $severity,
string $message,
string $file,
int $line
): void;Throws an exception when a notice or warning is raised
renderHtml()
public function renderHtml( \Throwable $exception ): string;Render exception to html format.
setBlacklist()
public function setBlacklist( array $blacklist ): static;Sets if files the exception’s backtrace must be showed
setRenderer()
public function setRenderer( Renderer $renderer ): static;Sets the renderer used to produce the output
setShowBackTrace()
public function setShowBackTrace( bool $showBackTrace ): static;Sets if files the exception’s backtrace must be showed
setShowFileFragment()
public function setShowFileFragment( bool $showFileFragment ): static;Sets if files must be completely opened and showed in the output or just the fragment related to the exception
setShowFiles()
public function setShowFiles( bool $showFiles ): static;Set if files part of the backtrace must be shown in the output
setUri()
public function setUri( string $uri ): static;Change the base URI for static resources
Support\Debug\Dump
ClassSource on GitHubDumps information about a variable(s)
$foo = 123;
echo (new \Phalcon\Debug\Dump())->variable($foo, "foo");$foo = "string";
$bar = ["key" => "value"];
$baz = new stdClass();
echo (new \Phalcon\Debug\Dump())->variables($foo, $bar, $baz);Phalcon\Support\Debug\Dump- implementsPhalcon\Contracts\Support\Debug\TemplateAware
Uses InvalidArgumentException · JsonException · Phalcon\Container\Container · Phalcon\Contracts\Support\Debug\TemplateAware · Phalcon\Contracts\Support\SupportTypes · Phalcon\Di\DiInterface · Phalcon\Support\Debug\Traits\TemplateAwareTrait · Phalcon\Support\Helper\Json\Encode · Phalcon\Traits\Support\Helper\Str\InterpolateTrait · Reflection · ReflectionClass · ReflectionException · ReflectionProperty · stdClass
Method Summary
public__construct(array$styles = [],bool$detailed = false)Dump constructor.publicstringall()Alias of variables() methodpublicboolgetDetailed()publicstringone(mixed$variable,string|null$name = null)Alias of variable() methodpublicvoidsetDetailed( bool$flag )publicarraysetStyles( array$styles = [] )Set styles for vars typepublicstringtoJson( mixed$variable )Returns an JSON string of information about a single variable.publicstringvariable(mixed$variable,string|null$name = null)Returns an HTML string of information about a single variable.publicstringvariables()Returns an HTML string of debugging information about any number ofprotectedstringdefaultTemplate( string$name )Returns the embedded default template for the given name.protectedstringgetStyle( string$type )Get style for typeprotectedstringoutput(mixed$variable,string|null$name = null,int$tab = 1)Prepare an HTML string of information about a single variable.Properties
protectedbool$detailed = falseprotectedarray<array-key, class-string>$methods = []protectedarray$styles = []Methods
__construct()
public function __construct(
array $styles = [],
bool $detailed = false
);Dump constructor.
all()
public function all(): string;Alias of variables() method
getDetailed()
public function getDetailed(): bool;one()
public function one(
mixed $variable,
string|null $name = null
): string;Alias of variable() method
setDetailed()
public function setDetailed( bool $flag ): void;setStyles()
public function setStyles( array $styles = [] ): array;Set styles for vars type
toJson()
public function toJson( mixed $variable ): string;Returns an JSON string of information about a single variable.
$foo = [
"key" => "value",
];
echo (new \Phalcon\Debug\Dump())->toJson($foo);
$foo = new stdClass();
$foo->bar = "buz";
echo (new \Phalcon\Debug\Dump())->toJson($foo);variable()
public function variable(
mixed $variable,
string|null $name = null
): string;Returns an HTML string of information about a single variable.
echo (new \Phalcon\Debug\Dump())->variable($foo, "foo");variables()
public function variables(): string;Returns an HTML string of debugging information about any number of variables, each wrapped in a “pre” tag.
$foo = "string";
$bar = ["key" => "value"];
$baz = new stdClass();
echo (new \Phalcon\Debug\Dump())->variables($foo, $bar, $baz);defaultTemplate()
protected function defaultTemplate( string $name ): string;Returns the embedded default template for the given name.
getStyle()
protected function getStyle( string $type ): string;Get style for type
output()
protected function output(
mixed $variable,
string|null $name = null,
int $tab = 1
): string;Prepare an HTML string of information about a single variable.
Support\Debug\Exception
ClassSource on GitHubExceptions thrown in Phalcon\Debug will use this class
\ExceptionPhalcon\Support\ExceptionPhalcon\Support\Debug\Exception
Uses Phalcon\Support\Exception
Support\Debug\Exceptions\RequestHalted
ClassSource on GitHub\ExceptionPhalcon\Support\ExceptionPhalcon\Support\Debug\ExceptionPhalcon\Support\Debug\Exceptions\RequestHalted
Uses Phalcon\Support\Debug\Exception
Method Summary
Methods
__construct()
public function __construct();Support\Debug\Exceptions\RuntimeWarning
ClassSource on GitHub\ErrorExceptionPhalcon\Support\Debug\Exceptions\RuntimeWarning
Support\Debug\Renderer\HtmlRenderer
ClassSource on GitHubRenders an ExceptionReport as the HTML debug page using embedded, overridable template strings filled by the interpolator. All styling and interactivity (theme, tabs, syntax highlighting, copy/editor links) are provided by the external debug.css / debug.js assets.
Phalcon\Support\Debug\Renderer\HtmlRenderer- implementsPhalcon\Contracts\Support\Debug\Renderer
Uses Phalcon\Contracts\Support\Debug\Renderer · Phalcon\Contracts\Support\SupportTypes · Phalcon\Support\Debug\Report\BacktraceItem · Phalcon\Support\Debug\Report\ExceptionReport · Phalcon\Support\Debug\Traits\TemplateAwareTrait · Phalcon\Support\Version · Phalcon\Traits\Support\Helper\Str\InterpolateTrait
Method Summary
publicstringgetCssSources( string$uri )publicstringgetJsSources( string$uri )publicstringgetVersion()publicstringrender( ExceptionReport$report )protectedstringdefaultTemplate( string$name )Returns the embedded default template for the given name.protectedstringescapeString( string$value )Escapes a string with htmlentitiesprotectedstring|nullgetArrayDump(array$arguments,int$number = 0)Produces a recursive representation of an arrayprotectedstringgetVarDump( mixed$variable )Produces a string representation of a variableMethods
getCssSources()
public function getCssSources( string $uri ): string;getJsSources()
public function getJsSources( string $uri ): string;getVersion()
public function getVersion(): string;render()
public function render( ExceptionReport $report ): string;defaultTemplate()
protected function defaultTemplate( string $name ): string;Returns the embedded default template for the given name.
escapeString()
protected function escapeString( string $value ): string;Escapes a string with htmlentities
getArrayDump()
protected function getArrayDump(
array $arguments,
int $number = 0
): string|null;Produces a recursive representation of an array
getVarDump()
protected function getVarDump( mixed $variable ): string;Produces a string representation of a variable
Support\Debug\ReportBuilder
ClassSource on GitHubCollects the runtime data for an exception (backtrace, superglobals, included files, memory, variables) into an ExceptionReport. Holds no presentation logic.
Phalcon\Support\Debug\ReportBuilder
Uses Phalcon\Contracts\Support\SupportTypes · Phalcon\Support\Debug\Report\BacktraceItem · Phalcon\Support\Debug\Report\ExceptionReport · Phalcon\Traits\Php\InfoTrait · Phalcon\Traits\Support\Helper\Arr\GetTrait · ReflectionClass · ReflectionException · ReflectionFunction · Throwable
Method Summary
Methods
build()
public function build(
Throwable $exception,
array $blacklist,
bool $showBackTrace,
bool $showFiles,
bool $showFileFragment,
string $uri,
array $data
): ExceptionReport;Support\Debug\Report\BacktraceItem
FinalSource on GitHubRepresents a single resolved frame of an exception backtrace.
Phalcon\Support\Debug\Report\BacktraceItem
Uses Phalcon\Contracts\Support\SupportTypes
Method Summary
public__construct(string$functionName,string|null$type = null,string|null$className = null,string|null$classLink = null,string|null$functionLink = null,bool$hasArgs = false,array$args = [],string|null$file = null,int|null$line = null,mixed$fragment = null)publicarraygetArgs()publicstring|nullgetClassLink()publicstring|nullgetClassName()publicstring|nullgetFile()publicarray|nullgetFragment()publicstring|nullgetFunctionLink()publicstringgetFunctionName()publicint|nullgetLine()publicstring|nullgetType()publicboolhasArgs()Methods
__construct()
public function __construct(
string $functionName,
string|null $type = null,
string|null $className = null,
string|null $classLink = null,
string|null $functionLink = null,
bool $hasArgs = false,
array $args = [],
string|null $file = null,
int|null $line = null,
mixed $fragment = null
);getArgs()
public function getArgs(): array;getClassLink()
public function getClassLink(): string|null;getClassName()
public function getClassName(): string|null;getFile()
public function getFile(): string|null;getFragment()
public function getFragment(): array|null;getFunctionLink()
public function getFunctionLink(): string|null;getFunctionName()
public function getFunctionName(): string;getLine()
public function getLine(): int|null;getType()
public function getType(): string|null;hasArgs()
public function hasArgs(): bool;Support\Debug\Report\ExceptionReport
FinalSource on GitHubCarries all data collected for an exception, ready to be rendered. Holds no presentation logic.
Phalcon\Support\Debug\Report\ExceptionReport
Uses Phalcon\Contracts\Support\SupportTypes
Method Summary
public__construct(string$className,string$message,string$file,int$line,bool$showBackTrace,string$uri)publicarraygetBacktrace()publicstringgetClassName()publicstringgetFile()publicarraygetIncludedFiles()publicintgetLine()publicintgetMemoryUsage()publicstringgetMessage()publicintgetPeakMemoryUsage()publicarraygetRequest()publicarraygetServer()publicstringgetUri()publicarraygetVariables()publicboolhasVariables()publicboolisShowBackTrace()publicstaticsetBacktrace( array$backtrace )publicstaticsetIncludedFiles( array$includedFiles )publicstaticsetMemoryUsage( int$memoryUsage )publicstaticsetPeakMemoryUsage( int$peakMemoryUsage )publicstaticsetRequest( array$request )publicstaticsetServer( array$server )publicstaticsetVariables( array$variables )Methods
__construct()
public function __construct(
string $className,
string $message,
string $file,
int $line,
bool $showBackTrace,
string $uri
);getBacktrace()
public function getBacktrace(): array;getClassName()
public function getClassName(): string;getFile()
public function getFile(): string;getIncludedFiles()
public function getIncludedFiles(): array;getLine()
public function getLine(): int;getMemoryUsage()
public function getMemoryUsage(): int;getMessage()
public function getMessage(): string;getPeakMemoryUsage()
public function getPeakMemoryUsage(): int;getRequest()
public function getRequest(): array;getServer()
public function getServer(): array;getUri()
public function getUri(): string;getVariables()
public function getVariables(): array;hasVariables()
public function hasVariables(): bool;isShowBackTrace()
public function isShowBackTrace(): bool;setBacktrace()
public function setBacktrace( array $backtrace ): static;setIncludedFiles()
public function setIncludedFiles( array $includedFiles ): static;setMemoryUsage()
public function setMemoryUsage( int $memoryUsage ): static;setPeakMemoryUsage()
public function setPeakMemoryUsage( int $peakMemoryUsage ): static;setRequest()
public function setRequest( array $request ): static;setServer()
public function setServer( array $server ): static;setVariables()
public function setVariables( array $variables ): static;Support\Debug\Traits\TemplateAwareTrait
TraitSource on GitHubShared store for named, overridable template strings. A using class supplies the embedded defaults via defaultTemplate().
Note: this trait has no Zephir equivalent; the cphalcon mirror duplicates these members in each class until Zephir supports traits.
Phalcon\Support\Debug\Traits\TemplateAwareTrait
Used by Phalcon\Support\Debug\Dump · Phalcon\Support\Debug\Renderer\HtmlRenderer
Method Summary
publicstringgetTemplate( string$name )publicstaticsetTemplate(string$name,string$template)protectedstringdefaultTemplate( string$name )Returns the embedded default template for the given name.Properties
protectedarray$templates = []Methods
getTemplate()
public function getTemplate( string $name ): string;setTemplate()
public function setTemplate(
string $name,
string $template
): static;defaultTemplate()
abstract protected function defaultTemplate( string $name ): string;Returns the embedded default template for the given name.
Support\Exception
ClassSource on GitHubExceptions thrown in Phalcon\Support will use this class
\ExceptionPhalcon\Support\Exception
Support\HelperFactory
ClassSource on GitHubServiceLocator implementation for helpers
@method string basename(string $uri, string $suffix = null) @method support_collection blacklist(support_collection $collection, support_collection $blackList) @method string camelize(string $text, string $delimiters = null, bool $lowerFirst = false) @method support_collection chunk(support_collection $collection, int $size, bool $preserveKeys = false) @method string concat(string $delimiter, string $first, string $second, string …$arguments) @method int countVowels(string $text) @method string decapitalize(string $text, bool $upperRest = false, string $encoding = ‘UTF-8’) @method string decode(string $data, bool $associative = false, int $depth = 512, int $options = 0) @method string decrement(string $text, string $separator = ‘’) @method string dirFromFile(string $file) @method string dirSeparator(string $directory) @method string dynamic(string $text, string $leftDel = “{”, string $rightDel = “}”, string $separator = “|”) @method string encode($data, int $options = 0, int $depth = 512) @method bool endsWith(string $haystack, string $needle, bool $ignoreCase = true) @method mixed filter(support_collection $collection, callable|null $method) @method mixed first(support_collection $collection, callable $method = null) @method string firstBetween(string $text, string $start, string $end) @method mixed firstKey(support_collection $collection, callable $method = null) @method string friendly(string $text, string $separator = ‘-’, bool $lowercase = true, $replace = null) @method support_collection flatten(support_collection $collection, bool $deep = false) @method mixed get(support_collection $collection, $index, $defaultValue = null, string $cast = null) @method array<array-key, list<mixed>> group(support_collection $collection, $method) @method bool has(support_collection $collection, $index) @method string humanize(string $text) @method bool includes(string $haystack, string $needle) @method string increment(string $text, string $separator = ‘’) @method string interpolate(string $message, string[] $context=[], string $leftToken=“%”, string $rightToken=“%”) @method bool isAnagram(string $first, string $second) @method bool isBetween(int $value, int $start, int $end) @method bool isLower(string $text, string $encoding = ‘UTF-8’) @method bool isPalindrome(string $text) @method bool isUnique(support_collection $collection) @method bool isUpper(string $text, string $encoding = ‘UTF-8’) @method string kebabCase(string $text, string $delimiters = null) @method mixed last(support_collection $collection, callable $method = null) @method mixed lastKey(support_collection $collection, callable $method = null) @method int len(string $text, string $encoding = ‘UTF-8’) @method string lower(string $text, string $encoding = ‘UTF-8’) @method support_collection order(support_collection $collection, $attribute, string $order = ‘asc’) @method string pascalCase(string $text, string $delimiters = null) @method support_collection pluck(support_collection $collection, string $element) @method string prefix(string $text, string $prefix) @method string random(int $type = 0, int $length = 8) @method string reduceSlashes(string $text) @method support_collection set(support_collection $collection, $value, $index = null) @method support_collection sliceLeft(support_collection $collection, int $elements = 1) @method support_collection sliceRight(support_collection $collection, int $elements = 1) @method string snakeCase(string $text, string $delimiters = null) @method support_collection split(support_collection $collection) @method bool startsWith(string $haystack, string $needle, bool $ignoreCase = true) @method string suffix(string $text, string $suffix) @method object toObject(support_collection $collection) @method bool validateAll(support_collection $collection, callable $method) @method bool validateAny(support_collection $collection, callable $method) @method string ucwords(string $text, string $encoding = ‘UTF-8’) @method string uncamelize(string $text, string $delimiters = ‘_’) @method string underscore(string $text) @method string upper(string $text, string $encoding = ‘UTF-8’) @method support_collection whitelist(support_collection $collection, support_collection $whiteList)
Phalcon\Factory\AbstractConfigFactoryPhalcon\Factory\AbstractFactoryPhalcon\Support\HelperFactory
Uses Phalcon\Contracts\Support\SupportTypes · Phalcon\Factory\AbstractFactory · Phalcon\Support\Helper\Arr\Blacklist · Phalcon\Support\Helper\Arr\Chunk · Phalcon\Support\Helper\Arr\Filter · Phalcon\Support\Helper\Arr\First · Phalcon\Support\Helper\Arr\FirstKey · Phalcon\Support\Helper\Arr\Flatten · Phalcon\Support\Helper\Arr\Get · Phalcon\Support\Helper\Arr\Group · Phalcon\Support\Helper\Arr\Has · Phalcon\Support\Helper\Arr\IsUnique · Phalcon\Support\Helper\Arr\Last · Phalcon\Support\Helper\Arr\LastKey · Phalcon\Support\Helper\Arr\Order · Phalcon\Support\Helper\Arr\Pluck · Phalcon\Support\Helper\Arr\Set · Phalcon\Support\Helper\Arr\SliceLeft · Phalcon\Support\Helper\Arr\SliceRight · Phalcon\Support\Helper\Arr\Split · Phalcon\Support\Helper\Arr\ToObject · Phalcon\Support\Helper\Arr\ValidateAll · Phalcon\Support\Helper\Arr\ValidateAny · Phalcon\Support\Helper\Arr\Whitelist · Phalcon\Support\Helper\File\Basename · Phalcon\Support\Helper\Json\Decode · Phalcon\Support\Helper\Json\Encode · Phalcon\Support\Helper\Number\IsBetween · Phalcon\Support\Helper\Str\Camelize · Phalcon\Support\Helper\Str\Concat · Phalcon\Support\Helper\Str\CountVowels · Phalcon\Support\Helper\Str\Decapitalize · Phalcon\Support\Helper\Str\Decrement · Phalcon\Support\Helper\Str\DirFromFile · Phalcon\Support\Helper\Str\DirSeparator · Phalcon\Support\Helper\Str\Dynamic · Phalcon\Support\Helper\Str\EndsWith · Phalcon\Support\Helper\Str\FirstBetween · Phalcon\Support\Helper\Str\Friendly · Phalcon\Support\Helper\Str\Humanize · Phalcon\Support\Helper\Str\Includes · Phalcon\Support\Helper\Str\Increment · Phalcon\Support\Helper\Str\Interpolate · Phalcon\Support\Helper\Str\IsAnagram · Phalcon\Support\Helper\Str\IsLower · Phalcon\Support\Helper\Str\IsPalindrome · Phalcon\Support\Helper\Str\IsUpper · Phalcon\Support\Helper\Str\KebabCase · Phalcon\Support\Helper\Str\Len · Phalcon\Support\Helper\Str\Lower · Phalcon\Support\Helper\Str\PascalCase · Phalcon\Support\Helper\Str\Prefix · Phalcon\Support\Helper\Str\Random · Phalcon\Support\Helper\Str\ReduceSlashes · Phalcon\Support\Helper\Str\SnakeCase · Phalcon\Support\Helper\Str\StartsWith · Phalcon\Support\Helper\Str\Suffix · Phalcon\Support\Helper\Str\Ucwords · Phalcon\Support\Helper\Str\Uncamelize · Phalcon\Support\Helper\Str\Underscore · Phalcon\Support\Helper\Str\Upper · Throwable
Method Summary
public__call(string$name,array$arguments)public__construct( array$services = [] )Constructor.publicnewInstance( string$name )protectedstringgetExceptionClass()protectedarraygetServices()Returns the available adaptersMethods
__call()
public function __call(
string $name,
array $arguments
);__construct()
public function __construct( array $services = [] );Constructor.
newInstance()
public function newInstance( string $name );getExceptionClass()
protected function getExceptionClass(): string;getServices()
protected function getServices(): array;Returns the available adapters
Support\Helper\Arr\AbstractArr
AbstractSource on GitHub@internal
@todo Remove in v7. Kept only for backwards compatibility; compose Phalcon\Traits\Support\Helper\Arr\FilterTrait directly instead of extending this.
Phalcon\Support\Helper\Arr\AbstractArrPhalcon\Support\Helper\Arr\BlacklistPhalcon\Support\Helper\Arr\FilterPhalcon\Support\Helper\Arr\FirstPhalcon\Support\Helper\Arr\FirstKeyPhalcon\Support\Helper\Arr\LastPhalcon\Support\Helper\Arr\LastKeyPhalcon\Support\Helper\Arr\ValidateAllPhalcon\Support\Helper\Arr\ValidateAnyPhalcon\Support\Helper\Arr\Whitelist
Uses Phalcon\Traits\Support\Helper\Arr\FilterTrait
Support\Helper\Arr\Blacklist
ClassSource on GitHubBlack list filter by key: exclude elements of an array by the keys obtained from the elements of a blacklist
Phalcon\Support\Helper\Arr\AbstractArrPhalcon\Support\Helper\Arr\Blacklist
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
array $blackList
): array;Support\Helper\Arr\Chunk
ClassSource on GitHubChunks an array into smaller arrays of a specified size.
Phalcon\Support\Helper\Arr\Chunk
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
int $size,
bool $preserveKeys = false
): array;Support\Helper\Arr\Filter
ClassSource on GitHubFilters an array using array_filter. If a callback is supplied, it will be used.
Phalcon\Support\Helper\Arr\AbstractArrPhalcon\Support\Helper\Arr\Filter
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
mixed $method = null
): mixed;Support\Helper\Arr\First
ClassSource on GitHubReturns the first element of the collection. If a callable is passed, the element returned is the first that validates true
Phalcon\Support\Helper\Arr\AbstractArrPhalcon\Support\Helper\Arr\First
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
mixed $method = null
): mixed;Support\Helper\Arr\FirstKey
ClassSource on GitHubReturns the key of the first element of the collection. If a callable is passed, the element returned is the first that validates true
Phalcon\Support\Helper\Arr\AbstractArrPhalcon\Support\Helper\Arr\FirstKey
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
mixed $method = null
): mixed;Support\Helper\Arr\Flatten
ClassSource on GitHubFlattens an array up to the one level depth, unless $deep is set to
true
Phalcon\Support\Helper\Arr\Flatten
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
bool $deep = false
): array;Support\Helper\Arr\Get
ClassSource on GitHubGets an array element by key and if it does not exist returns the default.
It also allows for casting the returned value to a specific type using
settype internally
Phalcon\Support\Helper\Arr\Get
Uses Phalcon\Traits\Support\Helper\Arr\GetTrait
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
mixed $index,
mixed $defaultValue = null,
string|null $cast = null
): mixed;Support\Helper\Arr\Group
ClassSource on GitHubGroups the elements of an array based on the passed callable
Phalcon\Support\Helper\Arr\Group
Uses Phalcon\Traits\Php\InfoTrait
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
mixed $method
): array;Support\Helper\Arr\Has
ClassSource on GitHubChecks an array if it has an element with a specific key and returns
true/false accordingly
Phalcon\Support\Helper\Arr\Has
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
mixed $index
): bool;Support\Helper\Arr\IsUnique
ClassSource on GitHubChecks a flat list for duplicate values. Returns true if duplicate values exist and false if values are all unique.
Phalcon\Support\Helper\Arr\IsUnique
Uses Stringable
Method Summary
Methods
__invoke()
public function __invoke( array $collection ): bool;Support\Helper\Arr\Last
ClassSource on GitHubReturns the last element of the collection. If a callable is passed, the element returned is the first that validates true
Phalcon\Support\Helper\Arr\AbstractArrPhalcon\Support\Helper\Arr\Last
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
mixed $method = null
): mixed;Support\Helper\Arr\LastKey
ClassSource on GitHubReturns the key of the last element of the collection. If a callable is passed, the element returned is the first that validates true
Phalcon\Support\Helper\Arr\AbstractArrPhalcon\Support\Helper\Arr\LastKey
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
mixed $method = null
): mixed;Support\Helper\Arr\Order
ClassSource on GitHubSorts a collection of arrays or objects by an attribute of the object. It
supports ascending/descending sorts but also flags that are identical to
the ones used by ksort and krsort
Phalcon\Support\Helper\Arr\Order
Method Summary
Constants
intORDER_ASC = 1intORDER_DESC = 2Methods
__invoke()
public function __invoke(
array $collection,
mixed $attribute,
int $order = self::ORDER_ASC,
int $flags = 0
): array;Support\Helper\Arr\Pluck
ClassSource on GitHubReturns a subset of the collection based on the values of the collection
Phalcon\Support\Helper\Arr\Pluck
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
string $element
): array;Support\Helper\Arr\Set
ClassSource on GitHubSets an array element. Using a key is optional
Phalcon\Support\Helper\Arr\Set
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
mixed $value,
mixed $index = null
): array;Support\Helper\Arr\SliceLeft
ClassSource on GitHubReturns a new array with n elements removed from the left.
Phalcon\Support\Helper\Arr\SliceLeft
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
int $elements = 1
): array;Support\Helper\Arr\SliceRight
ClassSource on GitHubReturns a new array with n elements removed from the right.
Phalcon\Support\Helper\Arr\SliceRight
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
int $elements = 1
): array;Support\Helper\Arr\Split
ClassSource on GitHubReturns a new array with keys of the collection as one element and values as another
Phalcon\Support\Helper\Arr\Split
Method Summary
Methods
__invoke()
public function __invoke( array $collection ): array;Support\Helper\Arr\ToObject
ClassSource on GitHubReturns the passed array as an object.
Phalcon\Support\Helper\Arr\ToObject
Method Summary
Methods
__invoke()
public function __invoke( array $collection ): object;Support\Helper\Arr\ValidateAll
ClassSource on GitHubReturns true if the provided function returns true for all elements of
the collection, false otherwise.
Phalcon\Support\Helper\Arr\AbstractArrPhalcon\Support\Helper\Arr\ValidateAll
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
mixed $method
): bool;Support\Helper\Arr\ValidateAny
ClassSource on GitHubReturns true if the provided function returns true for at least one
element of the collection, false otherwise.
Phalcon\Support\Helper\Arr\AbstractArrPhalcon\Support\Helper\Arr\ValidateAny
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
mixed $method
): bool;Support\Helper\Arr\Whitelist
ClassSource on GitHubWhite list filter by key: obtain elements of an array filtering by the keys obtained from the elements of a whitelist
Phalcon\Support\Helper\Arr\AbstractArrPhalcon\Support\Helper\Arr\Whitelist
Method Summary
Methods
__invoke()
public function __invoke(
array $collection,
array $whiteList
): array;Support\Helper\Exception
ClassSource on GitHubExceptions thrown in Phalcon\Support\Helper will use this class
\Exception
Uses Phalcon\Support\Exception
Support\Helper\File\Basename
ClassSource on GitHubGets the filename from a given path, Same as PHP’s basename() but has
non-ASCII support. PHP’s basename() does not properly support streams or
filenames beginning with a non-US-ASCII character.
Phalcon\Support\Helper\File\Basename
Method Summary
publicstring__invoke(string$uri,string|null$suffix = null)@see https://bugs.php.net/bug.php?id=37738Methods
__invoke()
public function __invoke(
string $uri,
string|null $suffix = null
): string;@see https://bugs.php.net/bug.php?id=37738
Support\Helper\Json\Decode
ClassSource on GitHubDecodes a string using json_decode and throws an exception if the
JSON data cannot be decoded
The following options are used if none specified for json_encode
JSON_HEX_TAG, JSON_HEX_APOS, JSON_HEX_AMP, JSON_HEX_QUOT, JSON_UNESCAPED_SLASHES
If JSON_THROW_ON_ERROR is defined in the options a JsonException will be thrown in the case of an error. Otherwise, any error will throw JsonDecodeError
Phalcon\Support\Helper\Json\Decode
Uses JsonException · Phalcon\Support\Helper\Json\Exceptions\JsonDecodeError · Phalcon\Traits\Support\Helper\Json\DecodeTrait
Method Summary
Methods
__invoke()
public function __invoke(
string $data,
bool $associative = false,
int $depth = 512,
int $options = 79
);Support\Helper\Json\Encode
ClassSource on GitHubEncodes a string using json_encode and throws an exception if the
JSON data cannot be encoded
The following options are used if none specified for json_encode
JSON_HEX_TAG, JSON_HEX_APOS, JSON_HEX_AMP, JSON_HEX_QUOT, JSON_UNESCAPED_SLASHES
If JSON_THROW_ON_ERROR is defined in the options a JsonException will be thrown in the case of an error. Otherwise, any error will throw JsonEncodeError
@see https://www.ietf.org/rfc/rfc4627.txt
Phalcon\Support\Helper\Json\Encode
Uses JsonException · Phalcon\Support\Helper\Json\Exceptions\JsonEncodeError · Phalcon\Traits\Support\Helper\Json\EncodeTrait
Method Summary
Methods
__invoke()
public function __invoke(
mixed $data,
int $options = 79,
int $depth = 512
): string;Support\Helper\Json\Exceptions\JsonDecodeError
ClassSource on GitHub\InvalidArgumentExceptionPhalcon\Support\Helper\Json\Exceptions\JsonDecodeError
Uses InvalidArgumentException · Throwable
Method Summary
Methods
__construct()
public function __construct(
string $message = "",
int $code = 0,
Throwable|null $previous = null
);Support\Helper\Json\Exceptions\JsonEncodeError
ClassSource on GitHub\InvalidArgumentExceptionPhalcon\Support\Helper\Json\Exceptions\JsonEncodeError
Uses InvalidArgumentException · Throwable
Method Summary
Methods
__construct()
public function __construct(
string $message = "",
int $code = 0,
Throwable|null $previous = null
);Support\Helper\Number\IsBetween
ClassSource on GitHubChecks if a number is within a range
Phalcon\Support\Helper\Number\IsBetween
Method Summary
Methods
__invoke()
public function __invoke(
int $value,
int $start,
int $end
): bool;Support\Helper\Str\AbstractStr
AbstractSource on GitHubAbstract class offering methods to help with the Str namespace.
@internal
@todo Remove in v7. Kept only for backwards compatibility; compose the individual Phalcon\Traits\Support\Helper\Str* traits directly instead of extending this.
Phalcon\Support\Helper\Str\AbstractStrPhalcon\Support\Helper\Str\ConcatPhalcon\Support\Helper\Str\DecapitalizePhalcon\Support\Helper\Str\EndsWithPhalcon\Support\Helper\Str\FriendlyPhalcon\Support\Helper\Str\IsLowerPhalcon\Support\Helper\Str\IsUpperPhalcon\Support\Helper\Str\LowerPhalcon\Support\Helper\Str\StartsWithPhalcon\Support\Helper\Str\Upper
Uses Phalcon\Traits\Support\Helper\Str\EndsWithTrait · Phalcon\Traits\Support\Helper\Str\InterpolateTrait · Phalcon\Traits\Support\Helper\Str\LowerTrait · Phalcon\Traits\Support\Helper\Str\StartsWithTrait · Phalcon\Traits\Support\Helper\Str\UpperTrait
Support\Helper\Str\Camelize
ClassSource on GitHubConverts strings to upperCamelCase or lowerCamelCase
Phalcon\Support\Helper\Str\Camelize
Uses Phalcon\Traits\Support\Helper\Str\CamelizeTrait
Method Summary
Methods
__invoke()
public function __invoke(
string $text,
string|null $delimiters = null,
bool $lowerFirst = false
): string;Support\Helper\Str\Concat
ClassSource on GitHubConcatenates strings using the separator only once without duplication in places concatenation
Phalcon\Support\Helper\Str\AbstractStrPhalcon\Support\Helper\Str\Concat
Uses Phalcon\Support\Helper\Str\Exceptions\InsufficientArguments
Method Summary
Methods
__invoke()
public function __invoke(
string $delimiter,
string $many
): string;Support\Helper\Str\CountVowels
ClassSource on GitHubReturns number of vowels in provided string. Uses a regular expression to count the number of vowels (A, E, I, O, U) in a string.
Phalcon\Support\Helper\Str\CountVowels
Method Summary
Methods
__invoke()
public function __invoke( string $text ): int;Support\Helper\Str\Decapitalize
ClassSource on GitHubDecapitalizes the first letter of the string and then adds it with rest of the string. Omit the upperRest parameter to keep the rest of the string intact, or set it to true to convert to uppercase.
Phalcon\Support\Helper\Str\AbstractStrPhalcon\Support\Helper\Str\Decapitalize
Method Summary
Methods
__invoke()
public function __invoke(
string $text,
bool $upperRest = false,
string $encoding = "UTF-8"
): string;Support\Helper\Str\Decrement
ClassSource on GitHubRemoves a number from the end of a string or decrements that number if it is already defined
Phalcon\Support\Helper\Str\Decrement
Method Summary
Methods
__invoke()
public function __invoke(
string $text,
string $separator = "_"
): string;Support\Helper\Str\DirFromFile
ClassSource on GitHubAccepts a file name (without extension) and returns a calculated directory structure with the filename in the end
Phalcon\Support\Helper\Str\DirFromFile
Uses Phalcon\Traits\Support\Helper\Str\DirFromFileTrait
Method Summary
Methods
__invoke()
public function __invoke( string $file ): string;Support\Helper\Str\DirSeparator
ClassSource on GitHubAccepts a directory name and ensures that it ends with DIRECTORY_SEPARATOR
Phalcon\Support\Helper\Str\DirSeparator
Uses Phalcon\Traits\Support\Helper\Str\DirSeparatorTrait
Method Summary
Methods
__invoke()
public function __invoke( string $directory ): string;Support\Helper\Str\Dynamic
ClassSource on GitHubGenerates random text in accordance with the template. The template is defined by the left and right delimiter and it can contain values separated by the separator
Phalcon\Support\Helper\Str\Dynamic
Uses Phalcon\Support\Helper\Str\Exceptions\SyntaxError
Method Summary
Methods
__invoke()
public function __invoke(
string $text,
string $leftDelimiter = "{",
string $rightDelimiter = "}",
string $separator = "|"
): string;Support\Helper\Str\EndsWith
ClassSource on GitHubCheck if a string ends with a given string
Phalcon\Support\Helper\Str\AbstractStrPhalcon\Support\Helper\Str\EndsWith
Method Summary
Methods
__invoke()
public function __invoke(
string $haystack,
string $needle,
bool $ignoreCase = true
): bool;Support\Helper\Str\Exceptions\InsufficientArguments
ClassSource on GitHub\ExceptionPhalcon\Support\ExceptionPhalcon\Support\Helper\ExceptionPhalcon\Support\Helper\Str\Exceptions\InsufficientArguments
Uses Phalcon\Support\Helper\Exception
Support\Helper\Str\Exceptions\InvalidReplaceFormat
ClassSource on GitHub\ExceptionPhalcon\Support\ExceptionPhalcon\Support\Helper\ExceptionPhalcon\Support\Helper\Str\Exceptions\InvalidReplaceFormat
Uses Phalcon\Support\Helper\Exception
Support\Helper\Str\Exceptions\SyntaxError
ClassSource on GitHub\RuntimeExceptionPhalcon\Support\Helper\Str\Exceptions\SyntaxError
Uses RuntimeException
Method Summary
Methods
__construct()
public function __construct( string $text );Support\Helper\Str\FirstBetween
ClassSource on GitHubReturns the first string there is between the strings from the parameter start and end.
Phalcon\Support\Helper\Str\FirstBetween
Method Summary
Methods
__invoke()
public function __invoke(
string $text,
string $start,
string $end
): string;Support\Helper\Str\Friendly
ClassSource on GitHubChanges a text to a URL friendly one. Replaces commonly known accented
characters with their Latin equivalents. If a replace string or array
is passed, it will also be used to replace those characters with a space.
Phalcon\Support\Helper\Str\AbstractStrPhalcon\Support\Helper\Str\Friendly
Uses Phalcon\Support\Helper\Str\Exceptions\InvalidReplaceFormat
Method Summary
Methods
__invoke()
public function __invoke(
string $text,
string $separator = "-",
bool $lowercase = true,
mixed $replace = null
): string;Support\Helper\Str\Humanize
ClassSource on GitHubMakes an underscored or dashed text human-readable
Phalcon\Support\Helper\Str\Humanize
Method Summary
Methods
__invoke()
public function __invoke( string $text ): string;Support\Helper\Str\Includes
ClassSource on GitHubDetermines whether a string includes another string or not.
Phalcon\Support\Helper\Str\Includes
Method Summary
Methods
__invoke()
public function __invoke(
string $haystack,
string $needle
): bool;Support\Helper\Str\Increment
ClassSource on GitHubAdds a number to the end of a string or increments that number if it is already defined
Phalcon\Support\Helper\Str\Increment
Method Summary
Methods
__invoke()
public function __invoke(
string $text,
string $separator = "_"
): string;Support\Helper\Str\Interpolate
ClassSource on GitHubInterpolates context values into the message placeholders. By default, the
right and left tokens are %
@see https://www.php-fig.org/psr/psr-3/ Section 1.2 Message
Phalcon\Support\Helper\Str\Interpolate
Uses Phalcon\Traits\Support\Helper\Str\InterpolateTrait
Method Summary
Methods
__invoke()
public function __invoke(
string $message,
array $context = [],
string $leftToken = "%",
string $rightToken = "%"
): string;Support\Helper\Str\IsAnagram
ClassSource on GitHubCompare two strings and returns true if both strings are anagram,
false otherwise.
Phalcon\Support\Helper\Str\IsAnagram
Method Summary
Methods
__invoke()
public function __invoke(
string $first,
string $second
): bool;Support\Helper\Str\IsLower
ClassSource on GitHubReturns true if the given string is in lower case, false otherwise.
Phalcon\Support\Helper\Str\AbstractStrPhalcon\Support\Helper\Str\IsLower
Method Summary
Methods
__invoke()
public function __invoke(
string $text,
string $encoding = "UTF-8"
): bool;Support\Helper\Str\IsPalindrome
ClassSource on GitHubReturns true if the given string is a palindrome, false otherwise.
Phalcon\Support\Helper\Str\IsPalindrome
Method Summary
Methods
__invoke()
public function __invoke( string $text ): bool;Support\Helper\Str\IsUpper
ClassSource on GitHubReturns true if the given string is in upper case, false otherwise.
Phalcon\Support\Helper\Str\AbstractStrPhalcon\Support\Helper\Str\IsUpper
Method Summary
Methods
__invoke()
public function __invoke(
string $text,
string $encoding = "UTF-8"
): bool;Support\Helper\Str\KebabCase
ClassSource on GitHubConverts strings to kebab-case style
Phalcon\Support\Helper\Str\PascalCasePhalcon\Support\Helper\Str\KebabCase
Method Summary
Methods
__invoke()
public function __invoke(
string $text,
string|null $delimiters = null
): string;Support\Helper\Str\Len
ClassSource on GitHubCalculates the length of the string using mb_strlen
Phalcon\Support\Helper\Str\Len
Method Summary
Methods
__invoke()
public function __invoke(
string $text,
string $encoding = "UTF-8"
): int;Support\Helper\Str\Lower
ClassSource on GitHubConverts a string to lowercase using mbstring
Phalcon\Support\Helper\Str\AbstractStrPhalcon\Support\Helper\Str\Lower
Method Summary
Methods
__invoke()
public function __invoke(
string $text,
string $encoding = "UTF-8"
): string;Support\Helper\Str\PascalCase
ClassSource on GitHubConverts strings to PascalCase style
Phalcon\Support\Helper\Str\PascalCase
Method Summary
publicstring__invoke(string$text,string|null$delimiters = null)protectedarrayprocessArray(string$text,string|null$delimiters = null)Methods
__invoke()
public function __invoke(
string $text,
string|null $delimiters = null
): string;processArray()
protected function processArray(
string $text,
string|null $delimiters = null
): array;Support\Helper\Str\Prefix
ClassSource on GitHubPrefixes the text with the supplied prefix @todo v7 make text string
Phalcon\Support\Helper\Str\Prefix
Uses Stringable
Method Summary
Methods
__invoke()
public function __invoke(
mixed $text,
string $prefix
): string;Support\Helper\Str\Random
ClassSource on GitHubGenerates a random string based on the given type. Type is one of the RANDOM_* constants
Phalcon\Support\Helper\Str\Random
Method Summary
Constants
intRANDOM_ALNUM = 0Only alphanumeric characters [a-zA-Z0-9]intRANDOM_ALPHA = 1Only alphabetical characters [azAZ]intRANDOM_DISTINCT = 5Only alphanumeric uppercase characters exclude similar characters [2345679ACDEFHJKLMNPRSTUVWXYZ]intRANDOM_HEXDEC = 2Only hexadecimal characters [0-9a-f]intRANDOM_NOZERO = 4Only numbers without 0 [1-9]intRANDOM_NUMERIC = 3Only numbers [0-9]Methods
__invoke()
public function __invoke(
int $type = self::RANDOM_ALNUM,
int $length = 8
): string;Support\Helper\Str\ReduceSlashes
ClassSource on GitHubReduces multiple slashes in a string to single slashes
Phalcon\Support\Helper\Str\ReduceSlashes
Method Summary
Methods
__invoke()
public function __invoke( string $text ): string;Support\Helper\Str\SnakeCase
ClassSource on GitHubConverts strings to snake_case style
Phalcon\Support\Helper\Str\PascalCasePhalcon\Support\Helper\Str\SnakeCase
Method Summary
Methods
__invoke()
public function __invoke(
string $text,
string|null $delimiters = null
): string;Support\Helper\Str\StartsWith
ClassSource on GitHubCheck if a string starts with a given string
Phalcon\Support\Helper\Str\AbstractStrPhalcon\Support\Helper\Str\StartsWith
Method Summary
Methods
__invoke()
public function __invoke(
string $haystack,
string $needle,
bool $ignoreCase = true
): bool;Support\Helper\Str\Suffix
ClassSource on GitHubSuffixes the text with the supplied suffix @todo v7 make text string
Phalcon\Support\Helper\Str\Suffix
Uses Stringable
Method Summary
Methods
__invoke()
public function __invoke(
mixed $text,
string $suffix
): string;Support\Helper\Str\Ucwords
ClassSource on GitHubCapitalizes the first letter of each word
Phalcon\Support\Helper\Str\Ucwords
Method Summary
Methods
__invoke()
public function __invoke(
string $text,
string $encoding = "UTF-8"
): string;Support\Helper\Str\Uncamelize
ClassSource on GitHubConverts strings to non camelized style
Phalcon\Support\Helper\Str\Uncamelize
Uses Phalcon\Traits\Support\Helper\Str\UncamelizeTrait
Method Summary
Methods
__invoke()
public function __invoke(
string $text,
string $delimiter = "_"
): string;Support\Helper\Str\Underscore
ClassSource on GitHubMakes a text underscored instead of spaced
Phalcon\Support\Helper\Str\Underscore
Method Summary
Methods
__invoke()
public function __invoke( string $text ): string;Support\Helper\Str\Upper
ClassSource on GitHubConverts a string to uppercase using mbstring
Phalcon\Support\Helper\Str\AbstractStrPhalcon\Support\Helper\Str\Upper
Method Summary
Methods
__invoke()
public function __invoke(
string $text,
string $encoding = "UTF-8"
): string;Support\Registry
FinalSource on GitHubA registry is a container for storing objects and values in the application space. By storing the value in a registry, the same object is always available throughout your application.
$registry = new \Phalcon\Registry();
// Set value
$registry->something = "something";
// or
$registry["something"] = "something";
// Get value
$value = $registry->something;
// or
$value = $registry["something"];
// Check if the key exists
$exists = isset($registry->something);
// or
$exists = isset($registry["something"]);
// Unset
unset($registry->something);
// or
unset($registry["something"]);In addition to ArrayAccess, Phalcon\Registry also implements Countable (count($registry) will return the number of elements in the registry), Serializable and Iterator (you can iterate over the registry using a foreach loop) interfaces. For PHP 5.4 and higher, JsonSerializable interface is implemented.
Phalcon\Registry is very fast (it is typically faster than any userspace implementation of the registry); however, this comes at a price: Phalcon\Registry is a final class and cannot be inherited from.
Though Phalcon\Registry exposes methods like __get(), offsetGet(), count() etc, it is not recommended to invoke them manually (these methods exist mainly to match the interfaces the registry implements): $registry->__get(“property”) is several times slower than $registry->property.
Internally all the magic methods (and interfaces except JsonSerializable) are implemented using object handlers or similar techniques: this allows to bypass relatively slow method calls.
@extends Collection<mixed>
Phalcon\Support\CollectionPhalcon\Support\Registry
Uses Traversable
Method Summary
public__construct( array$data = [] )Constructorpublicmixed__get( string$element )Magic getter to get an element from the collectionpublicbool__isset( string$element )Magic isset to check whether an element exists or notpublicvoid__set(string$element,mixed$value)Magic setter to assign values to an elementpublicvoid__unset( string$element )Magic unset to remove an element from the collectionpublicvoidclear()Clears the internal collectionpublicintcount()Count elements of an objectpublicmixedget(string$element,mixed$defaultValue = null,string|null$cast = null)Get the element from the collectionpublicTraversablegetIterator()Returns the iterator of the classpublicboolhas( string$element )Determines whether an element is present in the collection.publicvoidinit( array$data = [] )Initialize internal arraypublicarrayjsonSerialize()Specify data which should be serialized to JSONpublicbooloffsetExists( mixed$element )Whether a offset existspublicmixedoffsetGet( mixed$element )Offset to retrievepublicvoidoffsetSet(mixed$element,mixed$value)Offset to setpublicvoidoffsetUnset( mixed$element )Offset to unsetpublicvoidremove( string$element )Delete the element from the collectionpublicstring|nullserialize()String representation of objectpublicvoidset(string$element,mixed$value)Set an element in the collectionpublicarraytoArray()Returns the object in an array formatpublicstringtoJson( int$options = 79 )Returns the object in a JSON formatpublicvoidunserialize( string$data )Unserializes the objectMethods
__construct()
final public function __construct( array $data = [] );Constructor
__get()
final public function __get( string $element ): mixed;Magic getter to get an element from the collection
__isset()
final public function __isset( string $element ): bool;Magic isset to check whether an element exists or not
__set()
final public function __set(
string $element,
mixed $value
): void;Magic setter to assign values to an element
__unset()
final public function __unset( string $element ): void;Magic unset to remove an element from the collection
clear()
final public function clear(): void;Clears the internal collection
count()
final public function count(): int;Count elements of an object
get()
final public function get(
string $element,
mixed $defaultValue = null,
string|null $cast = null
): mixed;Get the element from the collection
getIterator()
final public function getIterator(): Traversable;Returns the iterator of the class
has()
final public function has( string $element ): bool;Determines whether an element is present in the collection.
init()
final public function init( array $data = [] ): void;Initialize internal array
jsonSerialize()
final public function jsonSerialize(): array;Specify data which should be serialized to JSON
offsetExists()
final public function offsetExists( mixed $element ): bool;Whether a offset exists
offsetGet()
final public function offsetGet( mixed $element ): mixed;Offset to retrieve
offsetSet()
final public function offsetSet(
mixed $element,
mixed $value
): void;Offset to set
offsetUnset()
final public function offsetUnset( mixed $element ): void;Offset to unset
remove()
final public function remove( string $element ): void;Delete the element from the collection
serialize()
final public function serialize(): string|null;String representation of object
set()
final public function set(
string $element,
mixed $value
): void;Set an element in the collection
toArray()
final public function toArray(): array;Returns the object in an array format
toJson()
final public function toJson( int $options = 79 ): string;Returns the object in a JSON format
The default string uses the following options for json_encode
JSON_HEX_TAG, JSON_HEX_APOS, JSON_HEX_AMP, JSON_HEX_QUOT, JSON_UNESCAPED_SLASHES
unserialize()
final public function unserialize( string $data ): void;Unserializes the object
Support\Settings
ClassSource on GitHubPhalcon\Support\Settings
Provides a PHP-userland layer for reading and overriding the Phalcon extension’s ini settings (orm., db., form.*).
get() checks PHP-level overrides first, then falls back to globals_get() which reads the value configured in php.ini / .htaccess / per-virtualhost.
set() stores the value in the PHP-level overrides array only. It does NOT call globals_set(), so the change is confined to this static state and never modifies the underlying C struct. This prevents settings changed by one project from leaking into another project sharing the same PHP worker process.
NOTE: In non-ZTS (non-thread-safe) PHP builds, globals_get() reads from a process-level C struct. Because set() does not write to that struct, any value set via ini_set(“phalcon.orm.*”, …) or globals_set() by other code remains visible through get() as the fallback for keys that have no PHP-level override. In ZTS builds each thread has its own copy of the struct.
reset() clears only the keys that were previously set via set(), restoring those keys to their globals_get() fallback values.
Phalcon\Support\Settings
Method Summary
publicmixedget( string$key )Returns the value of a known setting.publicvoidreset()Clears all PHP-level overrides, restoring get() to return globals_get()publicvoidset(string$key,mixed$value)Overrides a setting at the PHP level.Properties
protectedarray$overrides = []PHP-level overrides. Keys stored here take priority over globals_get().Methods
get()
public static function get( string $key ): mixed;Returns the value of a known setting.
Resolution order:
- PHP-level override (set via Settings::set())
- globals_get() - the C-level value, honoring php.ini / .htaccess
- null - for unknown keys
reset()
public static function reset(): void;Clears all PHP-level overrides, restoring get() to return globals_get() fallback values (as configured in php.ini or .htaccess).
set()
public static function set(
string $key,
mixed $value
): void;Overrides a setting at the PHP level.
Does NOT call globals_set(), so the C-level struct is not modified and no other project sharing this PHP process is affected.
Unknown keys are silently ignored.
Support\Version
ClassSource on GitHubThis class allows to get the installed version of the framework
Phalcon\Support\Version
Method Summary
publicstringget()Returns the active version (string)publicstringgetId()Returns the numeric active versionpublicstringgetPart( int$part )Returns a specific part of the version. If the wrong parameter is passedprotectedstringgetSpecial( int$special )Translates a number to a special release.protectedarraygetVersion()Area where the version number is set. The format is as follows:Constants
intVERSION_MAJOR = 0The constant referencing the major version. Returns 0 <code>php echo (new Phalcon\Support\Version()) ->getPart(Phalcon\Support\Version::VERSION_MAJOR); </code>intVERSION_MEDIUM = 1The constant referencing the major version. Returns 1 <code>php echo (new Phalcon\Support\Version()) ->getPart(Phalcon\Support\Version::VERSION_MEDIUM); </code>intVERSION_MINOR = 2The constant referencing the major version. Returns 2 <code>php echo (new Phalcon\Support\Version()) ->getPart(Phalcon\Support\Version::VERSION_MINOR); </code>intVERSION_SPECIAL = 3The constant referencing the major version. Returns 3 <code>php echo (new Phalcon\Support\Version()) ->getPart(Phalcon\Support\Version::VERSION_SPECIAL); </code>intVERSION_SPECIAL_NUMBER = 4The constant referencing the major version. Returns 4 <code>php echo (new Phalcon\Support\Version()) ->getPart(Phalcon\Support\Version::VERSION_SPECIAL_NUMBER); </code>Methods
get()
public function get(): string;Returns the active version (string)
echo (new Phalcon\Version())->get();getId()
public function getId(): string;Returns the numeric active version
echo (new Phalcon\Version())->getId();getPart()
public function getPart( int $part ): string;Returns a specific part of the version. If the wrong parameter is passed it will return the full version
echo (new Phalcon\Version())->getPart(Phalcon\Version::VERSION_MAJOR);getSpecial()
final protected function getSpecial( int $special ): string;Translates a number to a special release.
getVersion()
protected function getVersion(): array;Area where the version number is set. The format is as follows: ABBCCDE
A - Major version B - Med version (two digits) C - Min version (two digits) D - Special release: 1 = alpha, 2 = beta, 3 = RC, 4 = stable E - Special release version i.e. RC1, Beta2 etc.