diff --git a/src/Acl/Adapter/AbstractAdapter.php b/src/Acl/Adapter/AbstractAdapter.php index 4d0cc899..5f40dca5 100644 --- a/src/Acl/Adapter/AbstractAdapter.php +++ b/src/Acl/Adapter/AbstractAdapter.php @@ -59,7 +59,7 @@ abstract class AbstractAdapter extends AbstractEventsAware implements \Phalcon\A * * @return string|null */ - public function getActiveAccess(): ?string + public function getActiveAccess(): string|null { } @@ -68,7 +68,7 @@ public function getActiveAccess(): ?string * * @return string|null */ - public function getActiveComponent(): ?string + public function getActiveComponent(): string|null { } @@ -78,7 +78,7 @@ public function getActiveComponent(): ?string * * @return string|null */ - public function getActiveRole(): ?string + public function getActiveRole(): string|null { } diff --git a/src/Acl/Adapter/AdapterInterface.php b/src/Acl/Adapter/AdapterInterface.php index 3ebef211..851d7d7a 100644 --- a/src/Acl/Adapter/AdapterInterface.php +++ b/src/Acl/Adapter/AdapterInterface.php @@ -93,7 +93,7 @@ public function dropComponentAccess(string $componentName, $accessList): void; * * @return string|null */ - public function getActiveAccess(): ?string; + public function getActiveAccess(): string|null; /** * Returns the role which the list is checking if it's allowed to certain @@ -101,7 +101,7 @@ public function getActiveAccess(): ?string; * * @return string|null */ - public function getActiveRole(): ?string; + public function getActiveRole(): string|null; /** * Returns the component which the list is checking if some role can access @@ -109,7 +109,7 @@ public function getActiveRole(): ?string; * * @return string|null */ - public function getActiveComponent(): ?string; + public function getActiveComponent(): string|null; /** * Return an array with every component registered in the list diff --git a/src/Acl/Adapter/Memory.php b/src/Acl/Adapter/Memory.php index 1379d130..ac536ab6 100644 --- a/src/Acl/Adapter/Memory.php +++ b/src/Acl/Adapter/Memory.php @@ -274,6 +274,7 @@ public function addRole($role, $accessInherits = null): bool * * // Allow access to any role to browse on any component * $acl->allow("", "", "browse"); + * ``` * * @param string $roleName * @param string $componentName @@ -328,7 +329,7 @@ public function dropComponentAccess(string $componentName, $accessList): void * * @return mixed */ - public function getActiveFunction() + public function getActiveFunction(): mixed { } @@ -346,7 +347,7 @@ public function getActiveFunctionCustomArgumentsCount(): int * * @return string|null */ - public function getActiveKey(): ?string + public function getActiveKey(): string|null { } @@ -465,7 +466,7 @@ private function allowOrDeny(string $roleName, string $componentName, $access, $ * @param string $access * @return string|bool */ - private function canAccess(string $roleName, string $componentName, string $access) + private function canAccess(string $roleName, string $componentName, string $access): bool|string { } diff --git a/src/Annotations/Adapter/Apcu.php b/src/Annotations/Adapter/Apcu.php index 7cb1d60b..7560a18a 100644 --- a/src/Annotations/Adapter/Apcu.php +++ b/src/Annotations/Adapter/Apcu.php @@ -50,7 +50,7 @@ public function __construct(array $options = []) * @param string $key * @return bool|Reflection */ - public function read(string $key) + public function read(string $key): Reflection|bool { } diff --git a/src/Annotations/Adapter/Memory.php b/src/Annotations/Adapter/Memory.php index 7e4194ec..3a76055e 100644 --- a/src/Annotations/Adapter/Memory.php +++ b/src/Annotations/Adapter/Memory.php @@ -28,7 +28,7 @@ class Memory extends \Phalcon\Annotations\Adapter\AbstractAdapter * @param string $key * @return bool|Reflection */ - public function read(string $key) + public function read(string $key): Reflection|bool { } diff --git a/src/Annotations/Adapter/Stream.php b/src/Annotations/Adapter/Stream.php index ead578fb..59f08df5 100644 --- a/src/Annotations/Adapter/Stream.php +++ b/src/Annotations/Adapter/Stream.php @@ -50,7 +50,7 @@ public function __construct(array $options = []) * @param string $key * @return bool|int|Reflection */ - public function read(string $key) + public function read(string $key): Reflection|int|bool { } diff --git a/src/Annotations/Annotation.php b/src/Annotations/Annotation.php index daa1d03a..56342289 100644 --- a/src/Annotations/Annotation.php +++ b/src/Annotations/Annotation.php @@ -50,7 +50,7 @@ public function __construct(array $reflectionData) * @param mixed $position * @return mixed|null */ - public function getArgument($position) + public function getArgument($position): mixed { } @@ -78,7 +78,7 @@ public function getExprArguments(): array * @param array $expr * @return mixed */ - public function getExpression(array $expr) + public function getExpression(array $expr): mixed { } @@ -87,7 +87,7 @@ public function getExpression(array $expr) * * @return string|null */ - public function getName(): ?string + public function getName(): string|null { } @@ -97,7 +97,7 @@ public function getName(): ?string * @param string $name * @return mixed|null */ - public function getNamedArgument(string $name) + public function getNamedArgument(string $name): mixed { } @@ -107,7 +107,7 @@ public function getNamedArgument(string $name) * @param string $name * @return mixed */ - public function getNamedParameter(string $name) + public function getNamedParameter(string $name): mixed { } diff --git a/src/Annotations/AnnotationsFactory.php b/src/Annotations/AnnotationsFactory.php index 94105e4d..27bcfdc5 100644 --- a/src/Annotations/AnnotationsFactory.php +++ b/src/Annotations/AnnotationsFactory.php @@ -40,7 +40,7 @@ public function __construct(array $services = []) * Factory to create an instance from a Config object * @return mixed */ - public function load($config) + public function load($config): mixed { } diff --git a/src/Annotations/Collection.php b/src/Annotations/Collection.php index 36300ede..db5deef4 100644 --- a/src/Annotations/Collection.php +++ b/src/Annotations/Collection.php @@ -64,7 +64,7 @@ public function count(): int * * @return mixed */ - public function current() + public function current(): mixed { } diff --git a/src/Annotations/Reflection.php b/src/Annotations/Reflection.php index 38069236..f5679926 100644 --- a/src/Annotations/Reflection.php +++ b/src/Annotations/Reflection.php @@ -66,7 +66,7 @@ public function __construct(array $reflectionData = []) * * @return Collection|null */ - public function getClassAnnotations(): ?Collection + public function getClassAnnotations(): Collection|null { } diff --git a/src/Application/AbstractApplication.php b/src/Application/AbstractApplication.php index b7a17fd1..0b3061ff 100644 --- a/src/Application/AbstractApplication.php +++ b/src/Application/AbstractApplication.php @@ -62,7 +62,7 @@ public function getDefaultModule(): string * * @return ManagerInterface|null */ - public function getEventsManager(): ?ManagerInterface + public function getEventsManager(): ManagerInterface|null { } @@ -72,7 +72,7 @@ public function getEventsManager(): ?ManagerInterface * @param string $name * * @return array|mixed */ - public function getModule(string $name) + public function getModule(string $name): object|array { } diff --git a/src/Assets/Asset.php b/src/Assets/Asset.php index 01030196..808febad 100644 --- a/src/Assets/Asset.php +++ b/src/Assets/Asset.php @@ -194,7 +194,7 @@ public function getType(): string * * @return string|null */ - public function getVersion(): ?string + public function getVersion(): string|null { } diff --git a/src/Assets/AssetInterface.php b/src/Assets/AssetInterface.php index d16d8a78..96840289 100644 --- a/src/Assets/AssetInterface.php +++ b/src/Assets/AssetInterface.php @@ -26,7 +26,7 @@ public function getAssetKey(): string; * * @return array|null */ - public function getAttributes(): ?array; + public function getAttributes(): array|null; /** * Gets if the asset must be filtered or not. diff --git a/src/Assets/Manager.php b/src/Assets/Manager.php index 8dd8923b..1e463562 100644 --- a/src/Assets/Manager.php +++ b/src/Assets/Manager.php @@ -272,7 +272,7 @@ public function has(string $name): bool * @return string|null * @throws Exception */ - public function output(Collection $collection, string $type): ?string + public function output(Collection $collection, string $type): string|null { } diff --git a/src/Autoload/Loader.php b/src/Autoload/Loader.php index b11e3f0e..24fd0eab 100644 --- a/src/Autoload/Loader.php +++ b/src/Autoload/Loader.php @@ -155,7 +155,7 @@ public function autoload(string $className): bool * * @return string|null */ - public function getCheckedPath(): ?string + public function getCheckedPath(): string|null { } @@ -209,7 +209,7 @@ public function getFiles(): array * * @return string|null */ - public function getFoundPath(): ?string + public function getFoundPath(): string|null { } diff --git a/src/Cli/Dispatcher.php b/src/Cli/Dispatcher.php index de1e7333..77eedc2f 100644 --- a/src/Cli/Dispatcher.php +++ b/src/Cli/Dispatcher.php @@ -38,6 +38,9 @@ */ class Dispatcher extends \Phalcon\Dispatcher\AbstractDispatcher implements \Phalcon\Cli\DispatcherInterface { + /** + * @var string + */ protected $defaultHandler = 'main'; /** @@ -63,7 +66,7 @@ class Dispatcher extends \Phalcon\Dispatcher\AbstractDispatcher implements \Phal * @param array $params * @return mixed */ - public function callActionMethod($handler, string $actionMethod, array $params = []) + public function callActionMethod($handler, string $actionMethod, array $params = []): mixed { } @@ -93,7 +96,7 @@ public function getLastTask(): TaskInterface * @param mixed $defaultValue * @return mixed */ - public function getOption($option, $filters = null, $defaultValue = null) + public function getOption($option, $filters = null, $defaultValue = null): mixed { } diff --git a/src/Cli/Router.php b/src/Cli/Router.php index 9c9247ee..a925d491 100644 --- a/src/Cli/Router.php +++ b/src/Cli/Router.php @@ -135,7 +135,7 @@ public function getActionName(): string * * @return RouteInterface|null */ - public function getMatchedRoute(): ?RouteInterface + public function getMatchedRoute(): RouteInterface|null { } @@ -182,7 +182,7 @@ public function getParameters(): array * @param int $id * @return bool|RouteInterface */ - public function getRouteById($id) + public function getRouteById($id): RouteInterface|bool { } @@ -192,7 +192,7 @@ public function getRouteById($id) * @param string $name * @return bool|RouteInterface */ - public function getRouteByName(string $name) + public function getRouteByName(string $name): RouteInterface|bool { } diff --git a/src/Cli/Router/Route.php b/src/Cli/Router/Route.php index 20c2ff6f..f6a9a637 100644 --- a/src/Cli/Router/Route.php +++ b/src/Cli/Router/Route.php @@ -130,7 +130,7 @@ public static function delimiter(string $delimiter = null): void * @param string $pattern * @return array|bool */ - public function extractNamedParams(string $pattern) + public function extractNamedParams(string $pattern): bool|array { } @@ -139,7 +139,7 @@ public function extractNamedParams(string $pattern) * * @return mixed */ - public function getBeforeMatch() + public function getBeforeMatch(): mixed { } diff --git a/src/Cli/RouterInterface.php b/src/Cli/RouterInterface.php index 2393d25b..66e4bfee 100644 --- a/src/Cli/RouterInterface.php +++ b/src/Cli/RouterInterface.php @@ -37,7 +37,7 @@ public function getActionName(): string; * * @return RouteInterface|null */ - public function getMatchedRoute(): ?RouteInterface; + public function getMatchedRoute(): RouteInterface|null; /** * Return the sub expressions in the regular expression matched diff --git a/src/Cli/Task.php b/src/Cli/Task.php index 96885d53..7ae41b08 100644 --- a/src/Cli/Task.php +++ b/src/Cli/Task.php @@ -56,7 +56,7 @@ final public function __construct() * * @return ManagerInterface|null */ - public function getEventsManager(): ?ManagerInterface + public function getEventsManager(): ManagerInterface|null { } diff --git a/src/Config/Adapter/Ini.php b/src/Config/Adapter/Ini.php index 846bbe9c..219cf4f3 100644 --- a/src/Config/Adapter/Ini.php +++ b/src/Config/Adapter/Ini.php @@ -75,9 +75,9 @@ public function __construct(string $filePath, int $mode = 1) * * @param mixed $ini * - * @return array|float|int|mixed|string|null + * @return mixed */ - protected function cast($ini) + protected function cast($ini): mixed { } diff --git a/src/Config/Config.php b/src/Config/Config.php index e31b4262..1cf7863a 100644 --- a/src/Config/Config.php +++ b/src/Config/Config.php @@ -91,7 +91,7 @@ public function merge($toMerge): ConfigInterface * * @return mixed */ - public function path(string $path, $defaultValue = null, string $delimiter = null) + public function path(string $path, $defaultValue = null, string $delimiter = null): mixed { } diff --git a/src/Config/ConfigInterface.php b/src/Config/ConfigInterface.php index 9445c4d1..690ec4a3 100644 --- a/src/Config/ConfigInterface.php +++ b/src/Config/ConfigInterface.php @@ -37,7 +37,7 @@ public function merge($toMerge): ConfigInterface; * * @return mixed */ - public function path(string $path, $defaultValue = null, string $delimiter = null); + public function path(string $path, $defaultValue = null, string $delimiter = null): mixed; /** * @param string|null $delimiter diff --git a/src/DataMapper/Pdo/Connection/AbstractConnection.php b/src/DataMapper/Pdo/Connection/AbstractConnection.php index 2de1d6ce..8bc3addc 100644 --- a/src/DataMapper/Pdo/Connection/AbstractConnection.php +++ b/src/DataMapper/Pdo/Connection/AbstractConnection.php @@ -82,7 +82,7 @@ abstract public function disconnect(): void; * * @return string|null */ - public function errorCode(): ?string + public function errorCode(): string|null { } @@ -195,7 +195,7 @@ public function fetchGroup(string $statement, array $values = [], int $flags = \ * @return object * @param string $className */ - public function fetchObject(string $statement, array $values = [], string $className = 'stdClass', array $arguments = []) + public function fetchObject(string $statement, array $values = [], string $className = 'stdClass', array $arguments = []): object { } @@ -274,7 +274,7 @@ public function getAdapter(): \PDO * * @return mixed */ - public function getAttribute(int $attribute) + public function getAttribute(int $attribute): mixed { } @@ -371,7 +371,7 @@ public function perform(string $statement, array $values = []): \PDOStatement * * @return \PDOStatement|false */ - public function prepare(string $statement, array $options = []) + public function prepare(string $statement, array $options = []): \PDOStatement|bool { } @@ -384,7 +384,7 @@ public function prepare(string $statement, array $options = []) * * @return \PDOStatement|false */ - public function query(string $statement) + public function query(string $statement): \PDOStatement|bool { } diff --git a/src/DataMapper/Pdo/Connection/ConnectionInterface.php b/src/DataMapper/Pdo/Connection/ConnectionInterface.php index 20bba058..09f9e2b0 100644 --- a/src/DataMapper/Pdo/Connection/ConnectionInterface.php +++ b/src/DataMapper/Pdo/Connection/ConnectionInterface.php @@ -111,7 +111,7 @@ public function fetchGroup(string $statement, array $values = [], int $flags = \ * @return object * @param string $className */ - public function fetchObject(string $statement, array $values = [], string $className = 'stdClass', array $arguments = []); + public function fetchObject(string $statement, array $values = [], string $className = 'stdClass', array $arguments = []): object; /** * Fetches a sequential array of rows from the database; the rows are @@ -162,7 +162,7 @@ public function fetchPairs(string $statement, array $values = []): array; * * @return mixed */ - public function fetchValue(string $statement, array $values = []); + public function fetchValue(string $statement, array $values = []): mixed; /** * Return the inner PDO (if any) diff --git a/src/DataMapper/Pdo/Connection/PdoInterface.php b/src/DataMapper/Pdo/Connection/PdoInterface.php index 14b42be3..25680ebe 100644 --- a/src/DataMapper/Pdo/Connection/PdoInterface.php +++ b/src/DataMapper/Pdo/Connection/PdoInterface.php @@ -35,7 +35,7 @@ public function commit(): bool; * * @return string|null */ - public function errorCode(): ?string; + public function errorCode(): string|null; /** * Gets the most recent error info. @@ -61,7 +61,7 @@ public function exec(string $statement): int; * * @return mixed */ - public function getAttribute(int $attribute); + public function getAttribute(int $attribute): mixed; /** * Return an array of available PDO drivers (empty array if none available) @@ -97,7 +97,7 @@ public function lastInsertId(string $name = null): string; * * @return \PDOStatement|false */ - public function prepare(string $statement, array $options = []); + public function prepare(string $statement, array $options = []): \PDOStatement|bool; /** * Queries the database and returns a PDOStatement. If the profiler is @@ -108,7 +108,7 @@ public function prepare(string $statement, array $options = []); * * @return \PDOStatement|false */ - public function query(string $statement); + public function query(string $statement): \PDOStatement|bool; /** * Quotes a value for use in an SQL statement. This differs from diff --git a/src/Db/Adapter/AbstractAdapter.php b/src/Db/Adapter/AbstractAdapter.php index 46a2ab92..40d76b08 100644 --- a/src/Db/Adapter/AbstractAdapter.php +++ b/src/Db/Adapter/AbstractAdapter.php @@ -428,7 +428,7 @@ public function fetchAll(string $sqlQuery, int $fetchMode = Enum::FETCH_ASSOC, a * @param mixed $column * @return string|bool */ - public function fetchColumn(string $sqlQuery, array $placeholders = [], $column = 0) + public function fetchColumn(string $sqlQuery, array $placeholders = [], $column = 0): bool|string { } @@ -581,7 +581,7 @@ public function getDialectType(): string * * @return ManagerInterface|null */ - public function getEventsManager(): ?ManagerInterface + public function getEventsManager(): ManagerInterface|null { } diff --git a/src/Db/Adapter/AdapterInterface.php b/src/Db/Adapter/AdapterInterface.php index 5441886f..a2a7a5ab 100644 --- a/src/Db/Adapter/AdapterInterface.php +++ b/src/Db/Adapter/AdapterInterface.php @@ -287,7 +287,7 @@ public function fetchAll(string $sqlQuery, int $fetchMode = 2, array $bindParams * @param mixed $column * @return string|bool */ - public function fetchColumn(string $sqlQuery, array $placeholders = [], $column = 0); + public function fetchColumn(string $sqlQuery, array $placeholders = [], $column = 0): bool|string; /** * Returns the first row in a SQL query result @@ -388,7 +388,7 @@ public function getDefaultValue(): RawValue; * * @return mixed */ - public function getInternalHandler(); + public function getInternalHandler(): mixed; /** * Returns the savepoint name to use for nested transactions @@ -488,7 +488,7 @@ public function isUnderTransaction(): bool; * @param string|null $name Name of the sequence object from which the ID should be returned. * @return string|bool */ - public function lastInsertId(string $name = null); + public function lastInsertId(string $name = null): bool|string; /** * Appends a LIMIT clause to sqlQuery argument @@ -536,7 +536,7 @@ public function modifyColumn(string $tableName, string $schemaName, \Phalcon\Db\ * @param array $bindTypes * @return bool|ResultInterface */ - public function query(string $sqlStatement, array $bindParams = [], array $bindTypes = []); + public function query(string $sqlStatement, array $bindParams = [], array $bindTypes = []): ResultInterface|bool; /** * Releases given savepoint diff --git a/src/Db/Adapter/Pdo/AbstractPdo.php b/src/Db/Adapter/Pdo/AbstractPdo.php index c89ae7b5..f5c8f894 100644 --- a/src/Db/Adapter/Pdo/AbstractPdo.php +++ b/src/Db/Adapter/Pdo/AbstractPdo.php @@ -259,7 +259,7 @@ public function getErrorInfo(): array * * @return mixed */ - public function getInternalHandler() + public function getInternalHandler(): mixed { } @@ -315,7 +315,7 @@ public function isUnderTransaction(): bool * @param string|null $name * @return string|bool */ - public function lastInsertId(string $name = null) + public function lastInsertId(string $name = null): bool|string { } @@ -371,7 +371,7 @@ public function prepare(string $sqlStatement): \PDOStatement * @param array $bindTypes * @return bool|ResultInterface */ - public function query(string $sqlStatement, array $bindParams = [], array $bindTypes = []) + public function query(string $sqlStatement, array $bindParams = [], array $bindTypes = []): ResultInterface|bool { } diff --git a/src/Db/Column.php b/src/Db/Column.php index d6ae2eae..a480b2bf 100644 --- a/src/Db/Column.php +++ b/src/Db/Column.php @@ -344,7 +344,7 @@ public function __construct(string $name, array $definition) * * @return string|null */ - public function getAfterPosition(): ?string + public function getAfterPosition(): string|null { } @@ -362,7 +362,7 @@ public function getBindType(): int * * @return string|null */ - public function getComment(): ?string + public function getComment(): string|null { } @@ -371,7 +371,7 @@ public function getComment(): ?string * * @return mixed */ - public function getDefault() + public function getDefault(): mixed { } @@ -398,7 +398,7 @@ public function getScale(): int * * @return int|string */ - public function getSize() + public function getSize(): int|string { } @@ -425,7 +425,7 @@ public function getTypeReference(): int * * @return array|string */ - public function getTypeValues() + public function getTypeValues(): string|array { } diff --git a/src/Db/ColumnInterface.php b/src/Db/ColumnInterface.php index 105a05aa..b0850240 100644 --- a/src/Db/ColumnInterface.php +++ b/src/Db/ColumnInterface.php @@ -19,7 +19,7 @@ interface ColumnInterface * * @return string|null */ - public function getAfterPosition(): ?string; + public function getAfterPosition(): string|null; /** * Returns the type of bind handling @@ -33,7 +33,7 @@ public function getBindType(): int; * * @return mixed */ - public function getDefault(); + public function getDefault(): mixed; /** * Returns column name @@ -54,7 +54,7 @@ public function getScale(): int; * * @return int|string */ - public function getSize(); + public function getSize(): int|string; /** * Returns column type @@ -75,7 +75,7 @@ public function getTypeReference(): int; * * @return array|string */ - public function getTypeValues(); + public function getTypeValues(): string|array; /** * Check whether column has default value diff --git a/src/Db/ResultInterface.php b/src/Db/ResultInterface.php index e080f615..34247cd8 100644 --- a/src/Db/ResultInterface.php +++ b/src/Db/ResultInterface.php @@ -38,7 +38,7 @@ public function execute(): bool; * * @return mixed */ - public function fetch(); + public function fetch(): mixed; /** * Returns an array of arrays containing all the records in the result. This @@ -56,7 +56,7 @@ public function fetchAll(): array; * * @return mixed */ - public function fetchArray(); + public function fetchArray(): mixed; /** * Gets the internal PDO result object diff --git a/src/Di/Di.php b/src/Di/Di.php index 8e0f8265..d6d36c81 100644 --- a/src/Di/Di.php +++ b/src/Di/Di.php @@ -104,7 +104,7 @@ public function __construct() * @param array $arguments * @return mixed|null */ - public function __call(string $method, array $arguments = []) + public function __call(string $method, array $arguments = []): mixed { } @@ -118,7 +118,7 @@ public function __call(string $method, array $arguments = []) * @param bool $shared * @return bool|ServiceInterface */ - public function attempt(string $name, $definition, bool $shared = false) + public function attempt(string $name, $definition, bool $shared = false): ServiceInterface|bool { } @@ -129,7 +129,7 @@ public function attempt(string $name, $definition, bool $shared = false) * @param mixed $parameters * @return mixed */ - public function get(string $name, $parameters = null) + public function get(string $name, $parameters = null): mixed { } @@ -138,7 +138,7 @@ public function get(string $name, $parameters = null) * * @return DiInterface|null */ - public static function getDefault(): ?DiInterface + public static function getDefault(): DiInterface|null { } @@ -147,7 +147,7 @@ public static function getDefault(): ?DiInterface * * @return ManagerInterface|null */ - public function getInternalEventsManager(): ?ManagerInterface + public function getInternalEventsManager(): ManagerInterface|null { } @@ -157,7 +157,7 @@ public function getInternalEventsManager(): ?ManagerInterface * @param string $name * @return mixed */ - public function getRaw(string $name) + public function getRaw(string $name): mixed { } @@ -188,7 +188,7 @@ public function getServices(): array * @param mixed $parameters * @return mixed */ - public function getShared(string $name, $parameters = null) + public function getShared(string $name, $parameters = null): mixed { } @@ -300,7 +300,7 @@ public function has(string $name): bool * @param mixed $name * @return mixed */ - public function offsetGet($name) + public function offsetGet($name): mixed { } @@ -321,11 +321,11 @@ public function offsetExists($name): bool * $di["request"] = new \Phalcon\Http\Request(); * ``` * - * @param mixed $name - * @param mixed $definition + * @param mixed $offset + * @param mixed $value * @return void */ - public function offsetSet($name, $definition): void + public function offsetSet($offset, $value): void { } diff --git a/src/Di/DiInterface.php b/src/Di/DiInterface.php index 45848f56..129a3627 100644 --- a/src/Di/DiInterface.php +++ b/src/Di/DiInterface.php @@ -26,7 +26,7 @@ interface DiInterface extends \ArrayAccess * @param bool $shared * @return bool|ServiceInterface */ - public function attempt(string $name, $definition, bool $shared = false); + public function attempt(string $name, $definition, bool $shared = false): ServiceInterface|bool; /** * Resolves the service based on its configuration @@ -35,14 +35,14 @@ public function attempt(string $name, $definition, bool $shared = false); * @param mixed $parameters * @return mixed */ - public function get(string $name, $parameters = null); + public function get(string $name, $parameters = null): mixed; /** * Return the last DI created * * @return DiInterface|null */ - public static function getDefault(): ?DiInterface; + public static function getDefault(): DiInterface|null; /** * Returns a service definition without resolving @@ -50,7 +50,7 @@ public static function getDefault(): ?DiInterface; * @param string $name * @return mixed */ - public function getRaw(string $name); + public function getRaw(string $name): mixed; /** * Returns the corresponding Phalcon\Di\Service instance for a service @@ -74,7 +74,7 @@ public function getServices(): array; * @param mixed $parameters * @return mixed */ - public function getShared(string $name, $parameters = null); + public function getShared(string $name, $parameters = null): mixed; /** * Check whether the DI contains a service by a name diff --git a/src/Di/Injectable.php b/src/Di/Injectable.php index 1d60e5a2..17acd61a 100644 --- a/src/Di/Injectable.php +++ b/src/Di/Injectable.php @@ -57,7 +57,7 @@ abstract class Injectable extends stdClass implements \Phalcon\Di\InjectionAware * @param string $propertyName * @return mixed|null */ - public function __get(string $propertyName) + public function __get(string $propertyName): mixed { } diff --git a/src/Di/Service.php b/src/Di/Service.php index 2c38e312..4b476eb2 100644 --- a/src/Di/Service.php +++ b/src/Di/Service.php @@ -62,7 +62,7 @@ final public function __construct($definition, bool $shared = false) * * @return mixed */ - public function getDefinition() + public function getDefinition(): mixed { } @@ -101,7 +101,7 @@ public function isShared(): bool * @param DiInterface $container * @return mixed */ - public function resolve($parameters = null, DiInterface $container = null) + public function resolve($parameters = null, DiInterface $container = null): mixed { } diff --git a/src/Di/ServiceInterface.php b/src/Di/ServiceInterface.php index 7d6db4dc..caae26ab 100644 --- a/src/Di/ServiceInterface.php +++ b/src/Di/ServiceInterface.php @@ -19,7 +19,7 @@ interface ServiceInterface * * @return mixed */ - public function getDefinition(); + public function getDefinition(): mixed; /** * Returns a parameter in a specific position @@ -50,7 +50,7 @@ public function isShared(): bool; * @param DiInterface $container * @return mixed */ - public function resolve($parameters = null, DiInterface $container = null); + public function resolve($parameters = null, DiInterface $container = null): mixed; /** * Set the service definition diff --git a/src/Dispatcher/AbstractDispatcher.php b/src/Dispatcher/AbstractDispatcher.php index 29adc1d9..85a14b7a 100644 --- a/src/Dispatcher/AbstractDispatcher.php +++ b/src/Dispatcher/AbstractDispatcher.php @@ -170,7 +170,7 @@ public function callActionMethod($handler, string $actionMethod, array $params = * * @throws \Exception if any uncaught or unhandled exception occurs during the dispatcher process. */ - public function dispatch() + public function dispatch(): mixed { } @@ -255,7 +255,7 @@ public function getDefaultNamespace(): string * * @return ManagerInterface|null */ - public function getEventsManager(): ?ManagerInterface + public function getEventsManager(): ManagerInterface|null { } @@ -273,7 +273,7 @@ public function getHandlerSuffix(): string * * @return BinderInterface|null */ - public function getModelBinder(): ?BinderInterface + public function getModelBinder(): BinderInterface|null { } @@ -282,7 +282,7 @@ public function getModelBinder(): ?BinderInterface * * @return string|null */ - public function getModuleName(): ?string + public function getModuleName(): string|null { } @@ -305,7 +305,7 @@ public function getNamespaceName(): string * * @todo remove this in future versions */ - public function getParam($param, $filters = null, $defaultValue = null) + public function getParam($param, $filters = null, $defaultValue = null): mixed { } @@ -317,7 +317,7 @@ public function getParam($param, $filters = null, $defaultValue = null) * @param mixed $defaultValue * @return mixed */ - public function getParameter($param, $filters = null, $defaultValue = null) + public function getParameter($param, $filters = null, $defaultValue = null): mixed { } @@ -546,7 +546,7 @@ public function setNamespaceName(string $namespaceName): void * * @return mixed */ - public function getReturnedValue() + public function getReturnedValue(): mixed { } diff --git a/src/Dispatcher/DispatcherInterface.php b/src/Dispatcher/DispatcherInterface.php index 564198c4..ec96fabc 100644 --- a/src/Dispatcher/DispatcherInterface.php +++ b/src/Dispatcher/DispatcherInterface.php @@ -19,7 +19,7 @@ interface DispatcherInterface * * @return mixed */ - public function dispatch(); + public function dispatch(): mixed; /** * Forwards the execution flow to another controller/action @@ -57,7 +57,7 @@ public function getHandlerSuffix(): string; * @param mixed $param * @return mixed */ - public function getParam($param, $filters = null); + public function getParam($param, $filters = null): mixed; /** * Gets a param by its name or numeric index @@ -66,7 +66,7 @@ public function getParam($param, $filters = null); * @param mixed $param * @return mixed */ - public function getParameter($param, $filters = null); + public function getParameter($param, $filters = null): mixed; /** * Gets action params @@ -87,7 +87,7 @@ public function getParameters(): array; * * @return mixed */ - public function getReturnedValue(); + public function getReturnedValue(): mixed; /** * Check if a param exists diff --git a/src/Domain/Payload/Payload.php b/src/Domain/Payload/Payload.php index 589c7c6f..82b43b93 100644 --- a/src/Domain/Payload/Payload.php +++ b/src/Domain/Payload/Payload.php @@ -63,7 +63,7 @@ class Payload implements \Phalcon\Domain\Payload\PayloadInterface * * @return Throwable|null */ - public function getException(): ?Throwable + public function getException(): Throwable|null { } @@ -72,7 +72,7 @@ public function getException(): ?Throwable * * @return mixed */ - public function getExtras() + public function getExtras(): mixed { } @@ -81,7 +81,7 @@ public function getExtras() * * @return mixed */ - public function getInput() + public function getInput(): mixed { } @@ -90,7 +90,7 @@ public function getInput() * * @return mixed */ - public function getMessages() + public function getMessages(): mixed { } @@ -99,7 +99,7 @@ public function getMessages() * * @return mixed */ - public function getStatus() + public function getStatus(): mixed { } @@ -108,7 +108,7 @@ public function getStatus() * * @return mixed */ - public function getOutput() + public function getOutput(): mixed { } diff --git a/src/Domain/Payload/ReadableInterface.php b/src/Domain/Payload/ReadableInterface.php index 7521e149..d59d23bf 100644 --- a/src/Domain/Payload/ReadableInterface.php +++ b/src/Domain/Payload/ReadableInterface.php @@ -21,40 +21,40 @@ interface ReadableInterface * * @return Throwable|null */ - public function getException(): ?Throwable; + public function getException(): Throwable|null; /** * Gets arbitrary extra values produced by the domain layer. * * @return mixed */ - public function getExtras(); + public function getExtras(): mixed; /** * Gets the input received by the domain layer. * * @return mixed */ - public function getInput(); + public function getInput(): mixed; /** * Gets the messages produced by the domain layer. * * @return mixed */ - public function getMessages(); + public function getMessages(): mixed; /** * Gets the output produced from the domain layer. * * @return mixed */ - public function getOutput(); + public function getOutput(): mixed; /** * Gets the status of this payload. * * @return mixed */ - public function getStatus(); + public function getStatus(): mixed; } diff --git a/src/Encryption/Crypt.php b/src/Encryption/Crypt.php index 810fa4f2..ffdbe90e 100644 --- a/src/Encryption/Crypt.php +++ b/src/Encryption/Crypt.php @@ -549,7 +549,7 @@ protected function phpFunctionExists(string $name): bool * @param string $cipher * @return int|bool */ - protected function phpOpensslCipherIvLength(string $cipher) + protected function phpOpensslCipherIvLength(string $cipher): int|bool { } diff --git a/src/Encryption/Security.php b/src/Encryption/Security.php index 70076691..a58e7621 100644 --- a/src/Encryption/Security.php +++ b/src/Encryption/Security.php @@ -222,7 +222,7 @@ public function getRandomBytes(): int * * @return string|null */ - public function getRequestToken(): ?string + public function getRequestToken(): string|null { } @@ -231,7 +231,7 @@ public function getRequestToken(): ?string * * @return string|null */ - public function getSessionToken(): ?string + public function getSessionToken(): string|null { } @@ -255,7 +255,7 @@ public function getSaltBytes(int $numberBytes = 0): string * @return string * @throws Exception */ - public function getToken(): ?string + public function getToken(): string|null { } @@ -266,7 +266,7 @@ public function getToken(): ?string * @return string|null * @throws Exception */ - public function getTokenKey(): ?string + public function getTokenKey(): string|null { } @@ -383,7 +383,7 @@ private function processCost(array $options = []): int * * @return string|null */ - private function processTokenKey(string $tokenKey = null): ?string + private function processTokenKey(string $tokenKey = null): string|null { } @@ -393,7 +393,7 @@ private function processTokenKey(string $tokenKey = null): ?string * * @return string|null */ - private function processUserToken(string $tokenKey, string $tokenValue = null): ?string + private function processUserToken(string $tokenKey, string $tokenValue = null): string|null { } } diff --git a/src/Encryption/Security/JWT/Builder.php b/src/Encryption/Security/JWT/Builder.php index cbda1190..1bc108c9 100644 --- a/src/Encryption/Security/JWT/Builder.php +++ b/src/Encryption/Security/JWT/Builder.php @@ -87,7 +87,7 @@ public function addClaim(string $name, $value): Builder } /** - * Adds a custom header + * Adds a custom claim * * @param string $name * @param mixed $value @@ -115,14 +115,14 @@ public function getClaims(): array /** * @return string|null */ - public function getContentType(): ?string + public function getContentType(): string|null { } /** * @return int|null */ - public function getExpirationTime(): ?int + public function getExpirationTime(): int|null { } @@ -136,35 +136,35 @@ public function getHeaders(): array /** * @return string|null */ - public function getId(): ?string + public function getId(): string|null { } /** * @return int|null */ - public function getIssuedAt(): ?int + public function getIssuedAt(): int|null { } /** * @return string|null */ - public function getIssuer(): ?string + public function getIssuer(): string|null { } /** * @return int|null */ - public function getNotBefore(): ?int + public function getNotBefore(): int|null { } /** * @return string|null */ - public function getSubject(): ?string + public function getSubject(): string|null { } diff --git a/src/Encryption/Security/JWT/Token/Item.php b/src/Encryption/Security/JWT/Token/Item.php index 6538eacd..abee784c 100644 --- a/src/Encryption/Security/JWT/Token/Item.php +++ b/src/Encryption/Security/JWT/Token/Item.php @@ -30,7 +30,7 @@ public function __construct(array $payload, string $encoded) * * @return mixed|null */ - public function get(string $name, $defaultValue = null) + public function get(string $name, $defaultValue = null): mixed { } diff --git a/src/Encryption/Security/JWT/Validator.php b/src/Encryption/Security/JWT/Validator.php index f6e7423a..bc99e75e 100644 --- a/src/Encryption/Security/JWT/Validator.php +++ b/src/Encryption/Security/JWT/Validator.php @@ -65,7 +65,7 @@ public function getErrors(): array * * @return mixed */ - public function get(string $claim) + public function get(string $claim): mixed { } diff --git a/src/Events/AbstractEventsAware.php b/src/Events/AbstractEventsAware.php index fbf20594..0122db1e 100644 --- a/src/Events/AbstractEventsAware.php +++ b/src/Events/AbstractEventsAware.php @@ -26,7 +26,7 @@ abstract class AbstractEventsAware * * @return ManagerInterface|null */ - public function getEventsManager(): ?ManagerInterface + public function getEventsManager(): ManagerInterface|null { } @@ -49,7 +49,7 @@ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager * * @return mixed|bool */ - protected function fireManagerEvent(string $eventName, $data = null, bool $cancellable = true) + protected function fireManagerEvent(string $eventName, $data = null, bool $cancellable = true): mixed { } } diff --git a/src/Events/Event.php b/src/Events/Event.php index 696cad71..da6a8e5a 100644 --- a/src/Events/Event.php +++ b/src/Events/Event.php @@ -74,14 +74,14 @@ public function __construct(string $type, $source = null, $data = null, bool $ca /** * @return mixed */ - public function getData() + public function getData(): mixed { } /** * @return object|null */ - public function getSource() + public function getSource(): object|null { } diff --git a/src/Events/EventInterface.php b/src/Events/EventInterface.php index 46826ae0..1dfbf6ea 100644 --- a/src/Events/EventInterface.php +++ b/src/Events/EventInterface.php @@ -19,14 +19,14 @@ interface EventInterface * * @return mixed */ - public function getData(); + public function getData(): mixed; /** * Gets event type * * @return mixed */ - public function getType(); + public function getType(): mixed; /** * Check whether the event is cancelable diff --git a/src/Events/EventsAwareInterface.php b/src/Events/EventsAwareInterface.php index 94fcc701..ce9e45c0 100644 --- a/src/Events/EventsAwareInterface.php +++ b/src/Events/EventsAwareInterface.php @@ -20,7 +20,7 @@ interface EventsAwareInterface * * @return ManagerInterface|null */ - public function getEventsManager(): ?ManagerInterface; + public function getEventsManager(): ManagerInterface|null; /** * Sets the events manager diff --git a/src/Factory/AbstractFactory.php b/src/Factory/AbstractFactory.php index c7cb8b99..49e9553e 100644 --- a/src/Factory/AbstractFactory.php +++ b/src/Factory/AbstractFactory.php @@ -44,7 +44,7 @@ abstract protected function getServices(): array; * @param string $name * @return mixed */ - protected function getService(string $name) + protected function getService(string $name): mixed { } diff --git a/src/Filter/Filter.php b/src/Filter/Filter.php index 094cbcdb..e6ba6da1 100644 --- a/src/Filter/Filter.php +++ b/src/Filter/Filter.php @@ -125,7 +125,7 @@ public function __call(string $name, array $args) * @return mixed * @throws Exception */ - public function get(string $name) + public function get(string $name): mixed { } @@ -150,7 +150,7 @@ public function has(string $name): bool * @return array|false|mixed|null * @throws Exception */ - public function sanitize($value, $sanitizers, bool $noRecursive = false) + public function sanitize($value, $sanitizers, bool $noRecursive = false): mixed { } diff --git a/src/Filter/FilterInterface.php b/src/Filter/FilterInterface.php index 53036b34..6ab06f35 100644 --- a/src/Filter/FilterInterface.php +++ b/src/Filter/FilterInterface.php @@ -23,5 +23,5 @@ interface FilterInterface * * @return mixed */ - public function sanitize($value, $sanitizers, bool $noRecursive = false); + public function sanitize($value, $sanitizers, bool $noRecursive = false): mixed; } diff --git a/src/Filter/Validation.php b/src/Filter/Validation.php index 8ff283f4..5e1f2c79 100644 --- a/src/Filter/Validation.php +++ b/src/Filter/Validation.php @@ -115,7 +115,7 @@ public function bind($entity, $data): ValidationInterface /** * @return mixed */ - public function getData() + public function getData(): mixed { } @@ -124,7 +124,7 @@ public function getData() * * @return object */ - public function getEntity() + public function getEntity(): mixed { } @@ -134,7 +134,7 @@ public function getEntity() * @param string $field * @return mixed|null */ - public function getFilters(string $field = null) + public function getFilters(string $field = null): mixed { } @@ -173,7 +173,7 @@ public function getValidators(): array * @param string $field * @return mixed|null */ - public function getValueByEntity($entity, string $field) + public function getValueByEntity($entity, string $field): mixed { } @@ -184,7 +184,7 @@ public function getValueByEntity($entity, string $field) * @param string $field * @return mixed|null */ - public function getValueByData($data, string $field) + public function getValueByData($data, string $field): mixed { } @@ -194,7 +194,7 @@ public function getValueByData($data, string $field) * @param string $field * @return mixed|null */ - public function getValue(string $field) + public function getValue(string $field): mixed { } diff --git a/src/Filter/Validation/AbstractValidator.php b/src/Filter/Validation/AbstractValidator.php index d25ac478..f5d1349c 100644 --- a/src/Filter/Validation/AbstractValidator.php +++ b/src/Filter/Validation/AbstractValidator.php @@ -55,7 +55,7 @@ public function __construct(array $options = []) * * @return mixed */ - public function getOption(string $key, $defaultValue = null) + public function getOption(string $key, $defaultValue = null): mixed { } @@ -166,7 +166,7 @@ protected function allowEmpty($field, $value): bool * * @return mixed */ - protected function checkArray($value, string $field) + protected function checkArray($value, string $field): mixed { } @@ -189,7 +189,7 @@ protected function prepareCode(string $field): int * * @return mixed */ - protected function prepareLabel(\Phalcon\Filter\Validation $validation, string $field) + protected function prepareLabel(\Phalcon\Filter\Validation $validation, string $field): mixed { } } diff --git a/src/Filter/Validation/ValidationInterface.php b/src/Filter/Validation/ValidationInterface.php index 9bbf9e15..9e1229b6 100644 --- a/src/Filter/Validation/ValidationInterface.php +++ b/src/Filter/Validation/ValidationInterface.php @@ -50,7 +50,7 @@ public function bind($entity, $data): ValidationInterface; * * @return object */ - public function getEntity(); + public function getEntity(): mixed; /** * Returns all the filters or a specific one @@ -58,7 +58,7 @@ public function getEntity(); * @param string $field * @return mixed|null */ - public function getFilters(string $field = null); + public function getFilters(string $field = null): mixed; /** * Get label for field @@ -88,7 +88,7 @@ public function getValidators(): array; * @param string $field * @return mixed|null */ - public function getValue(string $field); + public function getValue(string $field): mixed; /** * Alias of `add` method diff --git a/src/Filter/Validation/ValidatorInterface.php b/src/Filter/Validation/ValidatorInterface.php index 0b84f4b3..da611a6c 100644 --- a/src/Filter/Validation/ValidatorInterface.php +++ b/src/Filter/Validation/ValidatorInterface.php @@ -24,7 +24,7 @@ interface ValidatorInterface * @param string $key * @param mixed $defaultValue */ - public function getOption(string $key, $defaultValue = null); + public function getOption(string $key, $defaultValue = null): mixed; /** * Get the template message diff --git a/src/Flash/AbstractFlash.php b/src/Flash/AbstractFlash.php index 9ae7498d..d2f8d239 100644 --- a/src/Flash/AbstractFlash.php +++ b/src/Flash/AbstractFlash.php @@ -111,7 +111,7 @@ public function clear(): void * * @return string|null */ - public function error(string $message): ?string + public function error(string $message): string|null { } @@ -171,7 +171,7 @@ public function getEscaperService(): EscaperInterface * * @return string|null */ - public function notice(string $message): ?string + public function notice(string $message): string|null { } @@ -257,7 +257,7 @@ public function setImplicitFlush(bool $implicitFlush): AbstractFlash * * @return string|null */ - public function success(string $message): ?string + public function success(string $message): string|null { } @@ -274,7 +274,7 @@ public function success(string $message): ?string * @return string|null * @throws Exception */ - public function outputMessage(string $type, $message): ?string + public function outputMessage(string $type, $message): string|null { } @@ -289,7 +289,7 @@ public function outputMessage(string $type, $message): ?string * * @return string|null */ - public function warning(string $message): ?string + public function warning(string $message): string|null { } diff --git a/src/Flash/Direct.php b/src/Flash/Direct.php index 4c70a180..341a3d8e 100644 --- a/src/Flash/Direct.php +++ b/src/Flash/Direct.php @@ -25,7 +25,7 @@ class Direct extends \Phalcon\Flash\AbstractFlash * @return string|null * @throws Exception */ - public function message(string $type, $message): ?string + public function message(string $type, $message): string|null { } diff --git a/src/Flash/FlashInterface.php b/src/Flash/FlashInterface.php index df8d7519..f0450924 100644 --- a/src/Flash/FlashInterface.php +++ b/src/Flash/FlashInterface.php @@ -23,7 +23,7 @@ interface FlashInterface * * @return string|null */ - public function error(string $message): ?string; + public function error(string $message): string|null; /** * Outputs a message @@ -33,7 +33,7 @@ public function error(string $message): ?string; * * @return string|null */ - public function message(string $type, string $message): ?string; + public function message(string $type, string $message): string|null; /** * Shows a HTML notice/information message @@ -42,7 +42,7 @@ public function message(string $type, string $message): ?string; * * @return string|null */ - public function notice(string $message): ?string; + public function notice(string $message): string|null; /** * Shows a HTML success message @@ -51,7 +51,7 @@ public function notice(string $message): ?string; * * @return string|null */ - public function success(string $message): ?string; + public function success(string $message): string|null; /** * Shows a HTML warning message @@ -60,5 +60,5 @@ public function success(string $message): ?string; * * @return string|null */ - public function warning(string $message): ?string; + public function warning(string $message): string|null; } diff --git a/src/Flash/Session.php b/src/Flash/Session.php index 7850ac18..bea59799 100644 --- a/src/Flash/Session.php +++ b/src/Flash/Session.php @@ -69,7 +69,7 @@ public function has(string $type = null): bool * @return string|null * @throws Exception */ - public function message(string $type, $message): ?string + public function message(string $type, $message): string|null { } diff --git a/src/Forms/Element/AbstractElement.php b/src/Forms/Element/AbstractElement.php index 4121461a..b8dac501 100644 --- a/src/Forms/Element/AbstractElement.php +++ b/src/Forms/Element/AbstractElement.php @@ -156,7 +156,7 @@ public function clear(): ElementInterface * @param mixed $defaultValue * @return mixed */ - public function getAttribute(string $attribute, $defaultValue = null) + public function getAttribute(string $attribute, $defaultValue = null): mixed { } @@ -174,7 +174,7 @@ public function getAttributes(): array * * @return mixed */ - public function getDefault() + public function getDefault(): mixed { } @@ -229,7 +229,7 @@ public function getName(): string * * @return TagFactory|null */ - public function getTagFactory(): ?TagFactory + public function getTagFactory(): TagFactory|null { } @@ -240,7 +240,7 @@ public function getTagFactory(): ?TagFactory * @param mixed $defaultValue * @return mixed */ - public function getUserOption(string $option, $defaultValue = null) + public function getUserOption(string $option, $defaultValue = null): mixed { } @@ -267,7 +267,7 @@ public function getValidators(): array * * @return mixed */ - public function getValue() + public function getValue(): mixed { } diff --git a/src/Forms/Element/ElementInterface.php b/src/Forms/Element/ElementInterface.php index d5f76076..d8c94a93 100644 --- a/src/Forms/Element/ElementInterface.php +++ b/src/Forms/Element/ElementInterface.php @@ -66,7 +66,7 @@ public function clear(): ElementInterface; * @param mixed $defaultValue * @return mixed */ - public function getAttribute(string $attribute, $defaultValue = null); + public function getAttribute(string $attribute, $defaultValue = null): mixed; /** * Returns the default attributes for the element @@ -80,7 +80,7 @@ public function getAttributes(): array; * * @return mixed */ - public function getDefault(); + public function getDefault(): mixed; /** * Returns the element's filters @@ -125,7 +125,7 @@ public function getName(): string; * @param mixed $defaultValue * @return mixed */ - public function getUserOption(string $option, $defaultValue = null); + public function getUserOption(string $option, $defaultValue = null): mixed; /** * Returns the options for the element @@ -146,7 +146,7 @@ public function getValidators(): array; * * @return mixed */ - public function getValue(); + public function getValue(): mixed; /** * Checks whether there are messages attached to the element diff --git a/src/Forms/Form.php b/src/Forms/Form.php index 9042e5ee..6476bd9f 100644 --- a/src/Forms/Form.php +++ b/src/Forms/Form.php @@ -146,7 +146,7 @@ public function count(): int * * @return mixed */ - public function current() + public function current(): mixed { } @@ -202,7 +202,7 @@ public function getEntity() * @param string $name * @return mixed|null */ - public function getFilteredValue(string $name) + public function getFilteredValue(string $name): mixed { } @@ -231,7 +231,7 @@ public function getLabel(string $name): string * * @return array|Messages */ - public function getMessages() + public function getMessages(): Messages|array { } @@ -250,7 +250,7 @@ public function getMessagesFor(string $name): Messages * * @return TagFactory|null */ - public function getTagFactory(): ?TagFactory + public function getTagFactory(): TagFactory|null { } @@ -261,7 +261,7 @@ public function getTagFactory(): ?TagFactory * @param mixed $defaultValue * @return mixed */ - public function getUserOption(string $option, $defaultValue = null) + public function getUserOption(string $option, $defaultValue = null): mixed { } @@ -280,7 +280,7 @@ public function getUserOptions(): array * @param string $name * @return mixed|null */ - public function getValue(string $name) + public function getValue(string $name): mixed { } @@ -289,7 +289,7 @@ public function getValue(string $name) * * @return ValidationInterface|null */ - public function getValidation(): ?ValidationInterface + public function getValidation(): ValidationInterface|null { } diff --git a/src/Html/Escaper.php b/src/Html/Escaper.php index 8d76a301..ce4b1bcc 100644 --- a/src/Html/Escaper.php +++ b/src/Html/Escaper.php @@ -86,7 +86,7 @@ public function css(string $input): string * * @return string|null */ - final public function detectEncoding(string $input): ?string + final public function detectEncoding(string $input): string|null { } diff --git a/src/Html/Link/Serializer/Header.php b/src/Html/Link/Serializer/Header.php index 1c284ddf..e3363d1f 100644 --- a/src/Html/Link/Serializer/Header.php +++ b/src/Html/Link/Serializer/Header.php @@ -20,7 +20,7 @@ class Header implements \Phalcon\Html\Link\Serializer\SerializerInterface * @param array $links * @return string|null */ - public function serialize(array $links): ?string + public function serialize(array $links): string|null { } } diff --git a/src/Html/Link/Serializer/SerializerInterface.php b/src/Html/Link/Serializer/SerializerInterface.php index aa1a5032..7dbc437d 100644 --- a/src/Html/Link/Serializer/SerializerInterface.php +++ b/src/Html/Link/Serializer/SerializerInterface.php @@ -20,5 +20,5 @@ interface SerializerInterface * @param array $links * @return string|null */ - public function serialize(array $links): ?string; + public function serialize(array $links): string|null; } diff --git a/src/Html/TagFactory.php b/src/Html/TagFactory.php index 60a5e66f..6456dec2 100644 --- a/src/Html/TagFactory.php +++ b/src/Html/TagFactory.php @@ -149,7 +149,7 @@ public function has(string $name): bool * @return mixed * @throws Exception */ - public function newInstance(string $name) + public function newInstance(string $name): mixed { } diff --git a/src/Http/Cookie.php b/src/Http/Cookie.php index f3e7b36d..7984f4e9 100644 --- a/src/Http/Cookie.php +++ b/src/Http/Cookie.php @@ -194,7 +194,7 @@ public function getSecure(): bool * @param mixed $defaultValue * @return mixed */ - public function getValue($filters = null, $defaultValue = null) + public function getValue($filters = null, $defaultValue = null): mixed { } @@ -346,7 +346,7 @@ protected function assertSignKeyIsLongEnough(string $signKey): void * @param mixed $defaultValue * @return mixed */ - private function getArrVal(array $collection, $index, $defaultValue = null) + private function getArrVal(array $collection, $index, $defaultValue = null): mixed { } } diff --git a/src/Http/Cookie/CookieInterface.php b/src/Http/Cookie/CookieInterface.php index 9d3aecdc..13cace3a 100644 --- a/src/Http/Cookie/CookieInterface.php +++ b/src/Http/Cookie/CookieInterface.php @@ -76,7 +76,7 @@ public function getSecure(): bool; * @param mixed $defaultValue * @return mixed */ - public function getValue($filters = null, $defaultValue = null); + public function getValue($filters = null, $defaultValue = null): mixed; /** * Check if the cookie is using implicit encryption diff --git a/src/Http/Request.php b/src/Http/Request.php index 1b5e7549..d0ed35bd 100644 --- a/src/Http/Request.php +++ b/src/Http/Request.php @@ -103,7 +103,7 @@ class Request extends AbstractInjectionAware implements \Phalcon\Http\RequestInt * @param bool $noRecursive * @return mixed */ - public function get(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false) + public function get(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false): mixed { } @@ -123,7 +123,7 @@ public function getAcceptableContent(): array * * @return array|null */ - public function getBasicAuth(): ?array + public function getBasicAuth(): array|null { } @@ -190,7 +190,7 @@ public function getPreferredIsoLocaleVariant(): string * @param bool $trustForwardedHeader * @return string|bool */ - public function getClientAddress(bool $trustForwardedHeader = false) + public function getClientAddress(bool $trustForwardedHeader = false): bool|string { } @@ -209,7 +209,7 @@ public function getClientCharsets(): array * * @return string|null */ - public function getContentType(): ?string + public function getContentType(): string|null { } @@ -232,7 +232,7 @@ public function getDigestAuth(): array * @param bool $noRecursive * @return mixed */ - public function getFilteredQuery(string $name = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false) + public function getFilteredQuery(string $name = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false): mixed { } @@ -245,7 +245,7 @@ public function getFilteredQuery(string $name = null, $defaultValue = null, bool * @param bool $noRecursive * @return mixed */ - public function getFilteredPatch(string $name = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false) + public function getFilteredPatch(string $name = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false): mixed { } @@ -258,7 +258,7 @@ public function getFilteredPatch(string $name = null, $defaultValue = null, bool * @param bool $noRecursive * @return mixed */ - public function getFilteredPost(string $name = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false) + public function getFilteredPost(string $name = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false): mixed { } @@ -271,7 +271,7 @@ public function getFilteredPost(string $name = null, $defaultValue = null, bool * @param bool $noRecursive * @return mixed */ - public function getFilteredPut(string $name = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false) + public function getFilteredPut(string $name = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false): mixed { } @@ -360,7 +360,7 @@ public function getHTTPReferer(): string * @param bool $associative * @return array|bool|\stdClass */ - public function getJsonRawBody(bool $associative = false) + public function getJsonRawBody(bool $associative = false): \stdClass|bool|array { } @@ -409,7 +409,7 @@ final public function getMethod(): string * @param bool $noRecursive * @return mixed */ - public function getPatch(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false) + public function getPatch(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false): mixed { } @@ -441,7 +441,7 @@ public function getPort(): int * @param bool $noRecursive * @return mixed */ - public function getPost(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false) + public function getPost(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false): mixed { } @@ -463,7 +463,7 @@ public function getPost(string $name = null, $filters = null, $defaultValue = nu * @param bool $noRecursive * @return mixed */ - public function getPut(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false) + public function getPut(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false): mixed { } @@ -489,7 +489,7 @@ public function getPut(string $name = null, $filters = null, $defaultValue = nul * @param bool $noRecursive * @return mixed */ - public function getQuery(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false) + public function getQuery(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false): mixed { } @@ -517,7 +517,7 @@ public function getScheme(): string * @param string $name * @return string|null */ - public function getServer(string $name): ?string + public function getServer(string $name): string|null { } @@ -883,7 +883,7 @@ final protected function getBestQuality(array $qualityParts, string $name): stri * @param bool $noRecursive * @return mixed */ - final protected function getHelper(array $source, string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false) + final protected function getHelper(array $source, string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false): mixed { } @@ -960,7 +960,7 @@ private function getServerArray(): array * @param bool $noRecursive * @return mixed */ - public function getFilteredData(string $methodKey, string $method, string $name = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false) + public function getFilteredData(string $methodKey, string $method, string $name = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false): mixed { } @@ -983,7 +983,7 @@ public function getFilteredData(string $methodKey, string $method, string $name * @param bool $noRecursive * @return mixed */ - private function getPatchPut(string $collection, string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false) + private function getPatchPut(string $collection, string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false): mixed { } diff --git a/src/Http/Request/File.php b/src/Http/Request/File.php index 138aa83f..06d23426 100644 --- a/src/Http/Request/File.php +++ b/src/Http/Request/File.php @@ -87,7 +87,7 @@ public function __construct(array $file, $key = null) /** * @return string|null */ - public function getError(): ?string + public function getError(): string|null { } @@ -101,7 +101,7 @@ public function getExtension(): string /** * @return string|null */ - public function getKey(): ?string + public function getKey(): string|null { } @@ -177,7 +177,7 @@ public function moveTo(string $destination): bool * @param mixed $defaultValue * @return mixed */ - private function getArrVal(array $collection, $index, $defaultValue = null) + private function getArrVal(array $collection, $index, $defaultValue = null): mixed { } } diff --git a/src/Http/Request/FileInterface.php b/src/Http/Request/FileInterface.php index c380a1a9..51df3a2c 100644 --- a/src/Http/Request/FileInterface.php +++ b/src/Http/Request/FileInterface.php @@ -19,7 +19,7 @@ interface FileInterface * * @return string|null */ - public function getError(): ?string; + public function getError(): string|null; /** * Returns the real name of the uploaded file diff --git a/src/Http/RequestInterface.php b/src/Http/RequestInterface.php index f26fe459..4b007fe8 100644 --- a/src/Http/RequestInterface.php +++ b/src/Http/RequestInterface.php @@ -36,7 +36,7 @@ interface RequestInterface * @param bool $noRecursive * @return mixed */ - public function get(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false); + public function get(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false): mixed; /** * Gets an array with mime/types and their quality accepted by the @@ -52,7 +52,7 @@ public function getAcceptableContent(): array; * * @return array|null */ - public function getBasicAuth(): ?array; + public function getBasicAuth(): array|null; /** * Gets best mime/type accepted by the browser/client from @@ -86,7 +86,7 @@ public function getBestLanguage(): string; * @param bool $trustForwardedHeader * @return string|bool */ - public function getClientAddress(bool $trustForwardedHeader = false); + public function getClientAddress(bool $trustForwardedHeader = false): bool|string; /** * Gets a charsets array and their quality accepted by the browser/client @@ -101,7 +101,7 @@ public function getClientCharsets(): array; * * @return string|null */ - public function getContentType(): ?string; + public function getContentType(): string|null; /** * Gets auth info accepted by the browser/client from @@ -188,7 +188,7 @@ public function getHTTPReferer(): string; * @param bool $associative * @return array|bool|stdClass */ - public function getJsonRawBody(bool $associative = false); + public function getJsonRawBody(bool $associative = false): stdClass|bool|array; /** * Gets languages array and their quality accepted by the browser/client @@ -255,7 +255,7 @@ public function getURI(bool $onlyPath = false): string; * @param bool $noRecursive * @return mixed */ - public function getPost(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false); + public function getPost(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false): mixed; /** * Gets a variable from put request @@ -275,7 +275,7 @@ public function getPost(string $name = null, $filters = null, $defaultValue = nu * @param bool $noRecursive * @return mixed */ - public function getPut(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false); + public function getPut(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false): mixed; /** * Gets variable from $_GET superglobal applying filters if needed @@ -299,7 +299,7 @@ public function getPut(string $name = null, $filters = null, $defaultValue = nul * @param bool $noRecursive * @return mixed */ - public function getQuery(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false); + public function getQuery(string $name = null, $filters = null, $defaultValue = null, bool $notAllowEmpty = false, bool $noRecursive = false): mixed; /** * Gets HTTP raw request body @@ -321,7 +321,7 @@ public function getScheme(): string; * @param string $name * @return string|null */ - public function getServer(string $name): ?string; + public function getServer(string $name): string|null; /** * Gets active server address IP diff --git a/src/Http/Response.php b/src/Http/Response.php index 8d9113b7..63ad5bbf 100644 --- a/src/Http/Response.php +++ b/src/Http/Response.php @@ -139,7 +139,7 @@ public function getDI(): DiInterface * * @return ManagerInterface|null */ - public function getEventsManager(): ?ManagerInterface + public function getEventsManager(): ManagerInterface|null { } @@ -161,7 +161,7 @@ public function getHeaders(): HeadersInterface * * @return string|null */ - public function getReasonPhrase(): ?string + public function getReasonPhrase(): string|null { } @@ -174,7 +174,7 @@ public function getReasonPhrase(): ?string * * @return int|null */ - public function getStatusCode(): ?int + public function getStatusCode(): int|null { } @@ -275,7 +275,7 @@ public function sendCookies(): ResponseInterface * * @return bool|ResponseInterface */ - public function sendHeaders() + public function sendHeaders(): ResponseInterface|bool { } diff --git a/src/Http/Response/Headers.php b/src/Http/Response/Headers.php index bfc24a82..46836a16 100644 --- a/src/Http/Response/Headers.php +++ b/src/Http/Response/Headers.php @@ -32,7 +32,7 @@ class Headers implements \Phalcon\Http\Response\HeadersInterface * @param string $name * @return string|bool */ - public function get(string $name) + public function get(string $name): bool|string { } diff --git a/src/Http/Response/HeadersInterface.php b/src/Http/Response/HeadersInterface.php index 32948747..cb2c73ee 100644 --- a/src/Http/Response/HeadersInterface.php +++ b/src/Http/Response/HeadersInterface.php @@ -22,7 +22,7 @@ interface HeadersInterface * @param string $name * @return string|bool */ - public function get(string $name); + public function get(string $name): bool|string; /** * Checks if a header exists diff --git a/src/Http/ResponseInterface.php b/src/Http/ResponseInterface.php index 137e7083..8aba7056 100644 --- a/src/Http/ResponseInterface.php +++ b/src/Http/ResponseInterface.php @@ -39,7 +39,7 @@ public function getContent(): string; * * @return int|null */ - public function getStatusCode(): ?int; + public function getStatusCode(): int|null; /** * Returns headers set by the user @@ -190,5 +190,5 @@ public function sendCookies(): ResponseInterface; * * @return bool|ResponseInterface */ - public function sendHeaders(); + public function sendHeaders(): ResponseInterface|bool; } diff --git a/src/Image/ImageFactory.php b/src/Image/ImageFactory.php index 01482b5e..386e6699 100644 --- a/src/Image/ImageFactory.php +++ b/src/Image/ImageFactory.php @@ -82,7 +82,7 @@ protected function getServices(): array * @param mixed $defaultValue * @return mixed */ - private function getArrVal(array $collection, $index, $defaultValue = null) + private function getArrVal(array $collection, $index, $defaultValue = null): mixed { } } diff --git a/src/Logger/LoggerFactory.php b/src/Logger/LoggerFactory.php index 3a6ee3a3..ee90919c 100644 --- a/src/Logger/LoggerFactory.php +++ b/src/Logger/LoggerFactory.php @@ -73,7 +73,7 @@ public function newInstance(string $name, array $adapters = [], \DateTimeZone $t * @param mixed $defaultValue * @return mixed */ - protected function getArrVal(array $collection, $index, $defaultValue = null) + protected function getArrVal(array $collection, $index, $defaultValue = null): mixed { } diff --git a/src/Messages/Messages.php b/src/Messages/Messages.php index c8c8dbda..74fe9686 100644 --- a/src/Messages/Messages.php +++ b/src/Messages/Messages.php @@ -155,7 +155,7 @@ public function offsetExists($index): bool * @param mixed $index * @return mixed */ - public function offsetGet($index) + public function offsetGet($index): mixed { } @@ -167,10 +167,11 @@ public function offsetGet($index) * ``` * * @param \Phalcon\Messages\Message $message - * @param mixed $index + * @param mixed $offset + * @param mixed $value * @return void */ - public function offsetSet($index, $message): void + public function offsetSet($offset, $value): void { } diff --git a/src/Mvc/Application.php b/src/Mvc/Application.php index 8efa9900..46ab3e8e 100644 --- a/src/Mvc/Application.php +++ b/src/Mvc/Application.php @@ -87,7 +87,7 @@ class Application extends AbstractApplication * @param string $uri * @return bool|ResponseInterface */ - public function handle(string $uri) + public function handle(string $uri): ResponseInterface|bool { } diff --git a/src/Mvc/EntityInterface.php b/src/Mvc/EntityInterface.php index 1acac67c..15439c29 100644 --- a/src/Mvc/EntityInterface.php +++ b/src/Mvc/EntityInterface.php @@ -22,7 +22,7 @@ interface EntityInterface * @param string $attribute * @return mixed|null */ - public function readAttribute(string $attribute); + public function readAttribute(string $attribute): mixed; /** * Writes an attribute value by its name diff --git a/src/Mvc/Micro.php b/src/Mvc/Micro.php index 3bd057ea..77b3ff5f 100644 --- a/src/Mvc/Micro.php +++ b/src/Mvc/Micro.php @@ -230,7 +230,7 @@ public function getBoundModels(): array * * @return ManagerInterface|null */ - public function getEventsManager(): ?ManagerInterface + public function getEventsManager(): ManagerInterface|null { } @@ -258,7 +258,7 @@ public function getHandlers(): array * * @return BinderInterface|null */ - public function getModelBinder(): ?BinderInterface + public function getModelBinder(): BinderInterface|null { } @@ -387,7 +387,7 @@ public function offsetExists($offset): bool * @param mixed $offset * @return mixed */ - public function offsetGet($offset) + public function offsetGet($offset): mixed { } diff --git a/src/Mvc/Micro/Collection.php b/src/Mvc/Micro/Collection.php index 1344e3fc..393f5c60 100644 --- a/src/Mvc/Micro/Collection.php +++ b/src/Mvc/Micro/Collection.php @@ -79,7 +79,7 @@ public function get(string $routePattern, $handler, string $name = null): Collec * * @return mixed */ - public function getHandler() + public function getHandler(): mixed { } diff --git a/src/Mvc/Micro/CollectionInterface.php b/src/Mvc/Micro/CollectionInterface.php index d85c4575..dd5ca9e8 100644 --- a/src/Mvc/Micro/CollectionInterface.php +++ b/src/Mvc/Micro/CollectionInterface.php @@ -41,7 +41,7 @@ public function get(string $routePattern, $handler, string $name = null): Collec * * @return mixed */ - public function getHandler(); + public function getHandler(): mixed; /** * Returns the registered handlers diff --git a/src/Mvc/Micro/LazyLoader.php b/src/Mvc/Micro/LazyLoader.php index f28b691c..f56cef08 100644 --- a/src/Mvc/Micro/LazyLoader.php +++ b/src/Mvc/Micro/LazyLoader.php @@ -59,7 +59,7 @@ public function getDefinition(): string /** * @return object|null */ - public function getHandler() + public function getHandler(): object|null { } } diff --git a/src/Mvc/Model.php b/src/Mvc/Model.php index e53607f2..689437bf 100644 --- a/src/Mvc/Model.php +++ b/src/Mvc/Model.php @@ -412,7 +412,7 @@ public function assign(array $data, $whiteList = null, $dataColumnMap = null): M * @param array $parameters * @return float | ResultsetInterface */ - public static function average(array $parameters = []) + public static function average(array $parameters = []): ResultsetInterface|float { } @@ -508,7 +508,7 @@ protected function collectRelatedToSave(): array * @param array|string|null $parameters * @return int|ResultsetInterface */ - public static function count($parameters = null) + public static function count($parameters = null): ResultsetInterface|int { } @@ -852,7 +852,7 @@ public static function find($parameters = null): ResultsetInterface * * @return \Phalcon\Mvc\ModelInterface|\Phalcon\Mvc\Model\Row|null */ - public static function findFirst($parameters = null) + public static function findFirst($parameters = null): mixed { } @@ -913,7 +913,7 @@ public function getDirtyState(): int * * @return EventsManagerInterface|null */ - public function getEventsManager(): ?EventsManagerInterface + public function getEventsManager(): EventsManagerInterface|null { } @@ -1046,7 +1046,7 @@ public function isRelationshipLoaded(string $relationshipAlias): bool * * @return string|null */ - final public function getSchema(): ?string + final public function getSchema(): string|null { } @@ -1199,7 +1199,7 @@ public function jsonSerialize(): array * @param array $parameters * @return mixed */ - public static function maximum($parameters = null) + public static function maximum($parameters = null): mixed { } @@ -1231,7 +1231,7 @@ public static function maximum($parameters = null) * @param array $parameters * @return mixed */ - public static function minimum($parameters = null) + public static function minimum($parameters = null): mixed { } @@ -1255,7 +1255,7 @@ public static function query(\Phalcon\Di\DiInterface $container = null): Criteri * @param string $attribute * @return mixed|null */ - public function readAttribute(string $attribute) + public function readAttribute(string $attribute): mixed { } @@ -1342,7 +1342,7 @@ final public function setConnectionService(string $connectionService): void * @param int $dirtyState * @return bool|ModelInterface */ - public function setDirtyState(int $dirtyState) + public function setDirtyState(int $dirtyState): ModelInterface|bool { } @@ -1439,7 +1439,7 @@ public function setTransaction(\Phalcon\Mvc\Model\TransactionInterface $transact /** * @return TransactionInterface|null */ - public function getTransaction(): ?TransactionInterface + public function getTransaction(): TransactionInterface|null { } @@ -1501,7 +1501,7 @@ public function skipOperation(bool $skip): void * @param array $parameters * @return double | ResultsetInterface */ - public static function sum($parameters = null) + public static function sum($parameters = null): ResultsetInterface|float { } diff --git a/src/Mvc/Model/Binder.php b/src/Mvc/Model/Binder.php index dcbe2880..d2a5cf54 100644 --- a/src/Mvc/Model/Binder.php +++ b/src/Mvc/Model/Binder.php @@ -80,7 +80,7 @@ public function bindToHandler($handler, array $params, string $cacheKey, string * @param mixed $paramValue * @param string $className */ - protected function findBoundModel($paramValue, string $className) + protected function findBoundModel($paramValue, string $className): mixed { } @@ -117,7 +117,7 @@ public function getCache(): AdapterInterface * @param string $cacheKey * @return array|null */ - protected function getParamsFromCache(string $cacheKey): ?array + protected function getParamsFromCache(string $cacheKey): array|null { } diff --git a/src/Mvc/Model/Binder/BindableInterface.php b/src/Mvc/Model/Binder/BindableInterface.php index 9ce9cbb8..0e93da53 100644 --- a/src/Mvc/Model/Binder/BindableInterface.php +++ b/src/Mvc/Model/Binder/BindableInterface.php @@ -22,5 +22,5 @@ interface BindableInterface * * @return string|array */ - public function getModelName(); + public function getModelName(): string|array; } diff --git a/src/Mvc/Model/Criteria.php b/src/Mvc/Model/Criteria.php index c170f234..89669e77 100644 --- a/src/Mvc/Model/Criteria.php +++ b/src/Mvc/Model/Criteria.php @@ -213,7 +213,7 @@ public static function fromInput(\Phalcon\Di\DiInterface $container, string $mod * * @return string|array|null */ - public function getColumns() + public function getColumns(): string|array|null { } @@ -222,7 +222,7 @@ public function getColumns() * * @return string|null */ - public function getConditions(): ?string + public function getConditions(): string|null { } @@ -258,7 +258,7 @@ public function getHaving() * * @return int|array|null */ - public function getLimit() + public function getLimit(): int|array|null { } @@ -276,7 +276,7 @@ public function getModelName(): string * * @return string|null */ - public function getOrderBy(): ?string + public function getOrderBy(): string|null { } @@ -294,7 +294,7 @@ public function getParams(): array * * @return string|null */ - public function getWhere(): ?string + public function getWhere(): string|null { } diff --git a/src/Mvc/Model/CriteriaInterface.php b/src/Mvc/Model/CriteriaInterface.php index 196c32fe..0a487b2a 100644 --- a/src/Mvc/Model/CriteriaInterface.php +++ b/src/Mvc/Model/CriteriaInterface.php @@ -105,14 +105,14 @@ public function forUpdate(bool $forUpdate = true): CriteriaInterface; * * @return string|array|null */ - public function getColumns(); + public function getColumns(): string|array|null; /** * Returns the conditions parameter in the criteria * * @return string|null */ - public function getConditions(): ?string; + public function getConditions(): string|null; /** * Returns the group clause in the criteria @@ -133,7 +133,7 @@ public function getHaving(); * * @return int|array|null */ - public function getLimit(); + public function getLimit(): int|array|null; /** * Returns an internal model name on which the criteria will be applied @@ -147,7 +147,7 @@ public function getModelName(): string; * * @return string|null */ - public function getOrderBy(): ?string; + public function getOrderBy(): string|null; /** * Returns all the parameters defined in the criteria @@ -161,7 +161,7 @@ public function getParams(): array; * * @return string|null */ - public function getWhere(): ?string; + public function getWhere(): string|null; /** * Adds the group-by clause to the criteria diff --git a/src/Mvc/Model/Manager.php b/src/Mvc/Model/Manager.php index ba65c1f1..e78bbdfa 100644 --- a/src/Mvc/Model/Manager.php +++ b/src/Mvc/Model/Manager.php @@ -378,7 +378,7 @@ public function createQuery(string $phql): QueryInterface * * @return ResultsetInterface|StatusInterface */ - public function executeQuery(string $phql, $placeholders = null, $types = null) + public function executeQuery(string $phql, $placeholders = null, $types = null): mixed { } @@ -470,7 +470,7 @@ public function getBelongsTo(\Phalcon\Mvc\ModelInterface $model): array * * @return ResultsetInterface | bool */ - public function getBelongsToRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null) + public function getBelongsToRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null): ResultsetInterface|bool { } @@ -479,7 +479,7 @@ public function getBelongsToRecords(string $modelName, string $modelRelation, \P * * @return BuilderInterface | null */ - public function getBuilder(): ?BuilderInterface + public function getBuilder(): BuilderInterface|null { } @@ -504,7 +504,7 @@ public function getConnectionService(\Phalcon\Mvc\ModelInterface $model, array $ * * @return EventsManagerInterface | null */ - public function getCustomEventsManager(\Phalcon\Mvc\ModelInterface $model): ?EventsManagerInterface + public function getCustomEventsManager(\Phalcon\Mvc\ModelInterface $model): EventsManagerInterface|null { } @@ -522,7 +522,7 @@ public function getDI(): DiInterface * * @return EventsManagerInterface|null */ - public function getEventsManager(): ?EventsManagerInterface + public function getEventsManager(): EventsManagerInterface|null { } @@ -546,7 +546,7 @@ public function getHasMany(\Phalcon\Mvc\ModelInterface $model): array * @param string $method * @return bool|ResultsetInterface */ - public function getHasManyRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null) + public function getHasManyRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null): ResultsetInterface|bool { } @@ -590,7 +590,7 @@ public function getHasOneAndHasMany(\Phalcon\Mvc\ModelInterface $model): array * @param string $method * @return bool|ModelInterface */ - public function getHasOneRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null) + public function getHasOneRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null): ModelInterface|bool { } @@ -637,7 +637,7 @@ public function getModelPrefix(): string * @param \Phalcon\Mvc\ModelInterface $model * @return string|null */ - public function getModelSchema(\Phalcon\Mvc\ModelInterface $model): ?string + public function getModelSchema(\Phalcon\Mvc\ModelInterface $model): string|null { } @@ -678,7 +678,7 @@ public function getReadConnectionService(\Phalcon\Mvc\ModelInterface $model): st * @param string $alias * * @return RelationInterface|bool */ - public function getRelationByAlias(string $modelName, string $alias) + public function getRelationByAlias(string $modelName, string $alias): RelationInterface|bool { } @@ -715,7 +715,7 @@ public function getRelations(string $modelName): array * * @return RelationInterface[] | bool */ - public function getRelationsBetween(string $first, string $second) + public function getRelationsBetween(string $first, string $second): bool|array { } diff --git a/src/Mvc/Model/ManagerInterface.php b/src/Mvc/Model/ManagerInterface.php index a77aa767..35422717 100644 --- a/src/Mvc/Model/ManagerInterface.php +++ b/src/Mvc/Model/ManagerInterface.php @@ -120,7 +120,7 @@ public function createQuery(string $phql): QueryInterface; * @return ResultsetInterface|StatusInterface * @param string $phql */ - public function executeQuery(string $phql, $placeholders = null, $types = null); + public function executeQuery(string $phql, $placeholders = null, $types = null): mixed; /** * Gets belongsTo relations defined on a model @@ -140,14 +140,14 @@ public function getBelongsTo(\Phalcon\Mvc\ModelInterface $model): array; * @param string|null $method * @return bool|ResultsetInterface */ - public function getBelongsToRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null); + public function getBelongsToRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null): ResultsetInterface|bool; /** * Returns the newly created Phalcon\Mvc\Model\Query\Builder or null * * @return BuilderInterface|null */ - public function getBuilder(): ?BuilderInterface; + public function getBuilder(): BuilderInterface|null; /** * Gets hasMany relations defined on a model @@ -167,7 +167,7 @@ public function getHasMany(\Phalcon\Mvc\ModelInterface $model): array; * @param string|null $method * @return bool|ResultsetInterface */ - public function getHasManyRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null); + public function getHasManyRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null): ResultsetInterface|bool; /** * Gets hasManyToMany relations defined on a model @@ -211,7 +211,7 @@ public function getHasOneAndHasMany(\Phalcon\Mvc\ModelInterface $model): array; * @param string|null $method * @return bool|ModelInterface */ - public function getHasOneRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null); + public function getHasOneRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null): ModelInterface|bool; /** * Get last initialized model @@ -233,7 +233,7 @@ public function getLastQuery(): QueryInterface; * @param \Phalcon\Mvc\ModelInterface $model * @return string|null */ - public function getModelSchema(\Phalcon\Mvc\ModelInterface $model): ?string; + public function getModelSchema(\Phalcon\Mvc\ModelInterface $model): string|null; /** * Returns the mapped source for a model @@ -266,7 +266,7 @@ public function getReadConnectionService(\Phalcon\Mvc\ModelInterface $model): st * @param string $alias * * @return RelationInterface|bool */ - public function getRelationByAlias(string $modelName, string $alias); + public function getRelationByAlias(string $modelName, string $alias): RelationInterface|bool; /** * Helper method to query records based on a relation definition @@ -294,7 +294,7 @@ public function getRelations(string $modelName): array; * @param string $second * @return array|bool|RelationInterface[] */ - public function getRelationsBetween(string $first, string $second); + public function getRelationsBetween(string $first, string $second): bool|array; /** * Returns the connection to write data related to a model diff --git a/src/Mvc/Model/MetaData.php b/src/Mvc/Model/MetaData.php index 1504dc32..b7f1b78f 100644 --- a/src/Mvc/Model/MetaData.php +++ b/src/Mvc/Model/MetaData.php @@ -100,7 +100,7 @@ abstract class MetaData implements \Phalcon\Di\InjectionAwareInterface, \Phalcon * * @return CacheAdapterInterface|null */ - public function getAdapter(): ?CacheAdapterInterface + public function getAdapter(): CacheAdapterInterface|null { } @@ -190,7 +190,7 @@ public function getBindTypes(\Phalcon\Mvc\ModelInterface $model): array * @param \Phalcon\Mvc\ModelInterface $model * @return array|null */ - public function getColumnMap(\Phalcon\Mvc\ModelInterface $model): ?array + public function getColumnMap(\Phalcon\Mvc\ModelInterface $model): array|null { } @@ -289,7 +289,7 @@ public function getEmptyStringAttributes(\Phalcon\Mvc\ModelInterface $model): ar * @param \Phalcon\Mvc\ModelInterface $model * @return string|null */ - public function getIdentityField(\Phalcon\Mvc\ModelInterface $model): ?string + public function getIdentityField(\Phalcon\Mvc\ModelInterface $model): string|null { } @@ -361,7 +361,7 @@ public function getPrimaryKeyAttributes(\Phalcon\Mvc\ModelInterface $model): arr * @param \Phalcon\Mvc\ModelInterface $model * @return array|null */ - public function getReverseColumnMap(\Phalcon\Mvc\ModelInterface $model): ?array + public function getReverseColumnMap(\Phalcon\Mvc\ModelInterface $model): array|null { } @@ -415,7 +415,7 @@ public function isEmpty(): bool * @param string $key * @return array|null */ - public function read(string $key): ?array + public function read(string $key): array|null { } @@ -433,7 +433,7 @@ public function read(string $key): ?array * @param \Phalcon\Mvc\ModelInterface $model * @return array|null */ - final public function readColumnMap(\Phalcon\Mvc\ModelInterface $model): ?array + final public function readColumnMap(\Phalcon\Mvc\ModelInterface $model): array|null { } @@ -453,7 +453,7 @@ final public function readColumnMap(\Phalcon\Mvc\ModelInterface $model): ?array * @param int $index * @return array|null */ - final public function readColumnMapIndex(\Phalcon\Mvc\ModelInterface $model, int $index): ?array + final public function readColumnMapIndex(\Phalcon\Mvc\ModelInterface $model, int $index): array|null { } @@ -471,7 +471,7 @@ final public function readColumnMapIndex(\Phalcon\Mvc\ModelInterface $model, int * @param \Phalcon\Mvc\ModelInterface $model * @return array|null */ - final public function readMetaData(\Phalcon\Mvc\ModelInterface $model): ?array + final public function readMetaData(\Phalcon\Mvc\ModelInterface $model): array|null { } @@ -491,7 +491,7 @@ final public function readMetaData(\Phalcon\Mvc\ModelInterface $model): ?array * @param int $index * @return array|null */ - final public function readMetaDataIndex(\Phalcon\Mvc\ModelInterface $model, int $index): ?array + final public function readMetaDataIndex(\Phalcon\Mvc\ModelInterface $model, int $index): array|null { } @@ -624,7 +624,7 @@ final public function writeMetaDataIndex(\Phalcon\Mvc\ModelInterface $model, int } /** - * Initialize old behavior for compatability + * Initialize old behaviour for compatability * * @param \Phalcon\Mvc\ModelInterface $model * @param mixed $key @@ -674,7 +674,7 @@ private function throwWriteException($option): void * @param mixed $defaultValue * @return mixed */ - protected function getArrVal(array $collection, $index, $defaultValue = null) + protected function getArrVal(array $collection, $index, $defaultValue = null): mixed { } @@ -684,7 +684,7 @@ protected function getArrVal(array $collection, $index, $defaultValue = null) * @return string * @param \Phalcon\Mvc\ModelInterface $model */ - final public function getMetaDataUniqueKey(\Phalcon\Mvc\ModelInterface $model): ?string + final public function getMetaDataUniqueKey(\Phalcon\Mvc\ModelInterface $model): string|null { } @@ -694,7 +694,7 @@ final public function getMetaDataUniqueKey(\Phalcon\Mvc\ModelInterface $model): * @return string * @param \Phalcon\Mvc\ModelInterface $model */ - final public function getColumnMapUniqueKey(\Phalcon\Mvc\ModelInterface $model): ?string + final public function getColumnMapUniqueKey(\Phalcon\Mvc\ModelInterface $model): string|null { } } diff --git a/src/Mvc/Model/MetaData/Memory.php b/src/Mvc/Model/MetaData/Memory.php index d96e6081..a67c3b74 100644 --- a/src/Mvc/Model/MetaData/Memory.php +++ b/src/Mvc/Model/MetaData/Memory.php @@ -34,7 +34,7 @@ public function __construct($options = null) * @param string $key * @return array|null */ - public function read(string $key): ?array + public function read(string $key): array|null { } diff --git a/src/Mvc/Model/MetaData/Stream.php b/src/Mvc/Model/MetaData/Stream.php index 724f130c..d87ed956 100644 --- a/src/Mvc/Model/MetaData/Stream.php +++ b/src/Mvc/Model/MetaData/Stream.php @@ -47,7 +47,7 @@ public function __construct(array $options = []) * @param string $key * @return array|null */ - public function read(string $key): ?array + public function read(string $key): array|null { } diff --git a/src/Mvc/Model/MetaDataInterface.php b/src/Mvc/Model/MetaDataInterface.php index 6fed1245..2a15ee59 100644 --- a/src/Mvc/Model/MetaDataInterface.php +++ b/src/Mvc/Model/MetaDataInterface.php @@ -57,7 +57,7 @@ public function getBindTypes(\Phalcon\Mvc\ModelInterface $model): array; * @param \Phalcon\Mvc\ModelInterface $model * @return array|null */ - public function getColumnMap(\Phalcon\Mvc\ModelInterface $model): ?array; + public function getColumnMap(\Phalcon\Mvc\ModelInterface $model): array|null; /** * Returns attributes (which have default values) and their default values @@ -97,7 +97,7 @@ public function getEmptyStringAttributes(\Phalcon\Mvc\ModelInterface $model): ar * @param \Phalcon\Mvc\ModelInterface $model * @return string|null */ - public function getIdentityField(\Phalcon\Mvc\ModelInterface $model): ?string; + public function getIdentityField(\Phalcon\Mvc\ModelInterface $model): string|null; /** * Returns an array of fields which are not part of the primary key @@ -129,7 +129,7 @@ public function getPrimaryKeyAttributes(\Phalcon\Mvc\ModelInterface $model): arr * @param \Phalcon\Mvc\ModelInterface $model * @return array|null */ - public function getReverseColumnMap(\Phalcon\Mvc\ModelInterface $model): ?array; + public function getReverseColumnMap(\Phalcon\Mvc\ModelInterface $model): array|null; /** * Return the strategy to obtain the meta-data @@ -160,7 +160,7 @@ public function isEmpty(): bool; * @param string $key * @return array|null */ - public function read(string $key): ?array; + public function read(string $key): array|null; /** * Reads the ordered/reversed column map for certain model @@ -168,7 +168,7 @@ public function read(string $key): ?array; * @param \Phalcon\Mvc\ModelInterface $model * @return array|null */ - public function readColumnMap(\Phalcon\Mvc\ModelInterface $model): ?array; + public function readColumnMap(\Phalcon\Mvc\ModelInterface $model): array|null; /** * Reads column-map information for certain model using a MODEL_ constant @@ -177,7 +177,7 @@ public function readColumnMap(\Phalcon\Mvc\ModelInterface $model): ?array; * @param int $index * @return array|null */ - public function readColumnMapIndex(\Phalcon\Mvc\ModelInterface $model, int $index): ?array; + public function readColumnMapIndex(\Phalcon\Mvc\ModelInterface $model, int $index): array|null; /** * Reads meta-data for certain model @@ -185,7 +185,7 @@ public function readColumnMapIndex(\Phalcon\Mvc\ModelInterface $model, int $inde * @param \Phalcon\Mvc\ModelInterface $model * @return array|null */ - public function readMetaData(\Phalcon\Mvc\ModelInterface $model): ?array; + public function readMetaData(\Phalcon\Mvc\ModelInterface $model): array|null; /** * Reads meta-data for certain model using a MODEL_ constant @@ -194,7 +194,7 @@ public function readMetaData(\Phalcon\Mvc\ModelInterface $model): ?array; * @param int $index * @return array|null */ - public function readMetaDataIndex(\Phalcon\Mvc\ModelInterface $model, int $index): ?array; + public function readMetaDataIndex(\Phalcon\Mvc\ModelInterface $model, int $index): array|null; /** * Resets internal meta-data in order to regenerate it diff --git a/src/Mvc/Model/Query.php b/src/Mvc/Model/Query.php index 7556b344..4ade28e8 100644 --- a/src/Mvc/Model/Query.php +++ b/src/Mvc/Model/Query.php @@ -348,7 +348,7 @@ public function getUniqueRow(): bool /** * @return TransactionInterface|null */ - public function getTransaction(): ?TransactionInterface + public function getTransaction(): TransactionInterface|null { } @@ -482,7 +482,7 @@ final protected function executeInsert(array $intermediate, array $bindParams, a * @param bool $simulate * @return array|ResultsetInterface */ - final protected function executeSelect(array $intermediate, array $bindParams, array $bindTypes, bool $simulate = false) + final protected function executeSelect(array $intermediate, array $bindParams, array $bindTypes, bool $simulate = false): ResultsetInterface|array { } diff --git a/src/Mvc/Model/Query/Builder.php b/src/Mvc/Model/Query/Builder.php index d2725cd0..cf29076e 100644 --- a/src/Mvc/Model/Query/Builder.php +++ b/src/Mvc/Model/Query/Builder.php @@ -441,7 +441,7 @@ public function getLimit() * * @return string|array|null */ - public function getModels() + public function getModels(): string|array|null { } diff --git a/src/Mvc/Model/Query/BuilderInterface.php b/src/Mvc/Model/Query/BuilderInterface.php index b8c01135..5f1aba72 100644 --- a/src/Mvc/Model/Query/BuilderInterface.php +++ b/src/Mvc/Model/Query/BuilderInterface.php @@ -264,7 +264,7 @@ public function limit(int $limit, $offset = null): BuilderInterface; * * @return string|array|null */ - public function getModels(); + public function getModels(): string|array|null; /** * Appends a NOT BETWEEN condition to the current conditions diff --git a/src/Mvc/Model/ResultInterface.php b/src/Mvc/Model/ResultInterface.php index 2cbe045e..fc38462d 100644 --- a/src/Mvc/Model/ResultInterface.php +++ b/src/Mvc/Model/ResultInterface.php @@ -24,5 +24,5 @@ interface ResultInterface * @param int $dirtyState * @return bool|ModelInterface */ - public function setDirtyState(int $dirtyState); + public function setDirtyState(int $dirtyState): ModelInterface|bool; } diff --git a/src/Mvc/Model/Resultset.php b/src/Mvc/Model/Resultset.php index 8f85268f..d6fb6416 100644 --- a/src/Mvc/Model/Resultset.php +++ b/src/Mvc/Model/Resultset.php @@ -182,7 +182,7 @@ public function filter($filter): array * * @return CacheInterface|null */ - public function getCache(): ?CacheInterface + public function getCache(): CacheInterface|null { } @@ -211,7 +211,7 @@ public function getCache(): ?CacheInterface * * @return ModelInterface|Row|null */ - public function getFirst() + public function getFirst(): mixed { } @@ -229,7 +229,7 @@ public function getHydrateMode(): int * * @return ModelInterface|null */ - public function getLast(): ?ModelInterface + public function getLast(): ModelInterface|null { } @@ -281,7 +281,7 @@ public function jsonSerialize(): array * * @return int|null */ - public function key(): ?int + public function key(): int|null { } @@ -300,7 +300,7 @@ public function next(): void * @param mixed $index * @return mixed */ - public function offsetGet($index) + public function offsetGet($index): mixed { } @@ -317,11 +317,11 @@ public function offsetExists($index): bool /** * Resultsets cannot be changed. It has only been implemented to meet the definition of the ArrayAccess interface * - * @param int $index + * @param int $offset * @param \Phalcon\Mvc\ModelInterface $value * @return void */ - public function offsetSet($index, $value): void + public function offsetSet($offset, $value): void { } diff --git a/src/Mvc/Model/Resultset/Complex.php b/src/Mvc/Model/Resultset/Complex.php index ecbbe80f..fb9e19a9 100644 --- a/src/Mvc/Model/Resultset/Complex.php +++ b/src/Mvc/Model/Resultset/Complex.php @@ -58,7 +58,7 @@ public function __construct($columnTypes, \Phalcon\Db\ResultInterface $result = * * @return mixed */ - final public function current() + final public function current(): mixed { } diff --git a/src/Mvc/Model/Resultset/Simple.php b/src/Mvc/Model/Resultset/Simple.php index 10f7bb97..75183be4 100644 --- a/src/Mvc/Model/Resultset/Simple.php +++ b/src/Mvc/Model/Resultset/Simple.php @@ -59,7 +59,7 @@ public function __construct($columnMap, $model, $result, $cache = null, bool $ke * * @return ModelInterface|null */ - final public function current(): ?ModelInterface + final public function current(): ModelInterface|null { } diff --git a/src/Mvc/Model/ResultsetInterface.php b/src/Mvc/Model/ResultsetInterface.php index 8477d9a4..1c12957e 100644 --- a/src/Mvc/Model/ResultsetInterface.php +++ b/src/Mvc/Model/ResultsetInterface.php @@ -51,14 +51,14 @@ public function filter($filter): array; * * @return mixed|null */ - public function getCache(); + public function getCache(): mixed; /** * Get first row in the resultset * * @return ModelInterface|Row|null */ - public function getFirst(); + public function getFirst(): mixed; /** * Returns the current hydration mode @@ -72,7 +72,7 @@ public function getHydrateMode(): int; * * @return ModelInterface|null */ - public function getLast(): ?ModelInterface; + public function getLast(): ModelInterface|null; /** * Returns the error messages produced by a batch operation diff --git a/src/Mvc/Model/Row.php b/src/Mvc/Model/Row.php index 86e60957..0bb3dd44 100644 --- a/src/Mvc/Model/Row.php +++ b/src/Mvc/Model/Row.php @@ -35,7 +35,7 @@ public function jsonSerialize(): array * @param string|int $index * * @return string|ModelInterface */ - public function offsetGet($index) + public function offsetGet($index): mixed { } @@ -52,11 +52,12 @@ public function offsetExists($index): bool /** * Rows cannot be changed. It has only been implemented to meet the definition of the ArrayAccess interface * - * @param string|int $index + * @param string|int $offsetSet * @param ModelInterface $value + * @param mixed $offset * @return void */ - public function offsetSet($index, $value): void + public function offsetSet($offset, $value): void { } @@ -90,7 +91,7 @@ public function readAttribute(string $attribute) * @param int $dirtyState * @return bool|ModelInterface */ - public function setDirtyState(int $dirtyState) + public function setDirtyState(int $dirtyState): ModelInterface|bool { } diff --git a/src/Mvc/ModelInterface.php b/src/Mvc/ModelInterface.php index 7a0f2ed3..c7ad0b38 100644 --- a/src/Mvc/ModelInterface.php +++ b/src/Mvc/ModelInterface.php @@ -50,7 +50,7 @@ public function assign(array $data, $whiteList = null, $dataColumnMap = null): M * @param array $parameters * @return ResultsetInterface|float */ - public static function average(array $parameters = []); + public static function average(array $parameters = []): ResultsetInterface|float; /** * Assigns values to a model from an array returning a new model @@ -93,7 +93,7 @@ public static function cloneResultMapHydrate(array $data, $columnMap, int $hydra * @param array|string|null $parameters * @return int|ResultsetInterface */ - public static function count($parameters = null); + public static function count($parameters = null): ResultsetInterface|int; /** * Inserts a model instance. If the instance already exists in the @@ -129,7 +129,7 @@ public static function find($parameters = null): ResultsetInterface; * @see https://github.com/phalcon/cphalcon/issues/15212 * @see https://github.com/phalcon/cphalcon/issues/15883 */ - public static function findFirst($parameters = null); + public static function findFirst($parameters = null): mixed; /** * Fires an event, implicitly calls behaviors and listeners in the events @@ -208,7 +208,7 @@ public function getRelated(string $alias, $arguments = null); * * @return string|null */ - public function getSchema(): ?string; + public function getSchema(): string|null; /** * Returns table name mapped in the model @@ -238,7 +238,7 @@ public function getWriteConnectionService(): string; * @param array $parameters * @return mixed */ - public static function maximum($parameters = null); + public static function maximum($parameters = null): mixed; /** * Allows to get the minimum value of a column that match the specified @@ -247,7 +247,7 @@ public static function maximum($parameters = null); * @param array $parameters * @return mixed */ - public static function minimum($parameters = null); + public static function minimum($parameters = null): mixed; /** * Create a criteria for a specific model @@ -287,7 +287,7 @@ public function setConnectionService(string $connectionService): void; * @param int $dirtyState * @return bool|ModelInterface */ - public function setDirtyState(int $dirtyState); + public function setDirtyState(int $dirtyState): ModelInterface|bool; /** * Sets the DependencyInjection connection service used to read data @@ -337,7 +337,7 @@ public function skipOperation(bool $skip): void; * @param array $parameters * @return float|ResultsetInterface */ - public static function sum($parameters = null); + public static function sum($parameters = null): ResultsetInterface|float; /** * Check whether validation process has generated any messages diff --git a/src/Mvc/Router.php b/src/Mvc/Router.php index dc88de03..ce73a120 100644 --- a/src/Mvc/Router.php +++ b/src/Mvc/Router.php @@ -408,7 +408,7 @@ public function clear(): void * * @return ManagerInterface|null */ - public function getEventsManager(): ?ManagerInterface + public function getEventsManager(): ManagerInterface|null { } @@ -458,7 +458,7 @@ public function getKeyRouteIds(): array * * @return RouteInterface|null */ - public function getMatchedRoute(): ?RouteInterface + public function getMatchedRoute(): RouteInterface|null { } @@ -504,7 +504,7 @@ public function getParams(): array * @param mixed $id * * @return RouteInterface|bool */ - public function getRouteById($id) + public function getRouteById($id): RouteInterface|bool { } @@ -514,7 +514,7 @@ public function getRouteById($id) * @param string $name * * @return RouteInterface|bool */ - public function getRouteByName(string $name) + public function getRouteByName(string $name): RouteInterface|bool { } diff --git a/src/Mvc/Router/Group.php b/src/Mvc/Router/Group.php index 2532f8fb..44b9b505 100644 --- a/src/Mvc/Router/Group.php +++ b/src/Mvc/Router/Group.php @@ -333,7 +333,7 @@ public function getHostname(): string * * @return array|string */ - public function getPaths() + public function getPaths(): string|array { } diff --git a/src/Mvc/Router/GroupInterface.php b/src/Mvc/Router/GroupInterface.php index f8048fe9..a7648c12 100644 --- a/src/Mvc/Router/GroupInterface.php +++ b/src/Mvc/Router/GroupInterface.php @@ -197,7 +197,7 @@ public function getHostname(): string; * * @return array|string */ - public function getPaths(); + public function getPaths(): string|array; /** * Returns the common prefix for all the routes diff --git a/src/Mvc/Router/Route.php b/src/Mvc/Router/Route.php index a69e64e6..09052eba 100644 --- a/src/Mvc/Router/Route.php +++ b/src/Mvc/Router/Route.php @@ -145,7 +145,7 @@ public function convert(string $name, $converter): RouteInterface * @param string $pattern * @return array|bool */ - public function extractNamedParams(string $pattern) + public function extractNamedParams(string $pattern): bool|array { } @@ -181,7 +181,7 @@ public function getConverters(): array * * @return GroupInterface|null */ - public function getGroup(): ?GroupInterface + public function getGroup(): GroupInterface|null { } @@ -190,7 +190,7 @@ public function getGroup(): ?GroupInterface * * @return array|string */ - public function getHttpMethods() + public function getHttpMethods(): string|array { } @@ -199,7 +199,7 @@ public function getHttpMethods() * * @return string|null */ - public function getHostname(): ?string + public function getHostname(): string|null { } @@ -224,7 +224,7 @@ public function getMatch() * * @return string|null */ - public function getName(): ?string + public function getName(): string|null { } diff --git a/src/Mvc/Router/RouteInterface.php b/src/Mvc/Router/RouteInterface.php index e759ac83..c86190f7 100644 --- a/src/Mvc/Router/RouteInterface.php +++ b/src/Mvc/Router/RouteInterface.php @@ -45,21 +45,21 @@ public function getCompiledPattern(): string; * * @return string|null */ - public function getHostname(): ?string; + public function getHostname(): string|null; /** * Returns the HTTP methods that constraint matching the route * * @return string|array */ - public function getHttpMethods(); + public function getHttpMethods(): string|array; /** * Returns the route's name * * @return string|null */ - public function getName(): ?string; + public function getName(): string|null; /** * Returns the paths diff --git a/src/Mvc/RouterInterface.php b/src/Mvc/RouterInterface.php index bb1b0088..d6a55925 100644 --- a/src/Mvc/RouterInterface.php +++ b/src/Mvc/RouterInterface.php @@ -164,7 +164,7 @@ public function getControllerName(): string; * * @return RouteInterface|null */ - public function getMatchedRoute(): ?RouteInterface; + public function getMatchedRoute(): RouteInterface|null; /** * Return the sub expressions in the regular expression matched @@ -207,7 +207,7 @@ public function getRoutes(): array; * @return RouteInterface|bool * @param mixed $id */ - public function getRouteById($id); + public function getRouteById($id): RouteInterface|bool; /** * Returns a route object by its name @@ -215,7 +215,7 @@ public function getRouteById($id); * @return RouteInterface|bool * @param string $name */ - public function getRouteByName(string $name); + public function getRouteByName(string $name): RouteInterface|bool; /** * Handles routing information received from the rewrite engine diff --git a/src/Mvc/View.php b/src/Mvc/View.php index 99f0bd3c..b28624df 100644 --- a/src/Mvc/View.php +++ b/src/Mvc/View.php @@ -209,7 +209,7 @@ public function __construct(array $options = []) * @param string $key * @return mixed|null */ - public function __get(string $key) + public function __get(string $key): mixed { } @@ -328,7 +328,7 @@ public function getActionName(): string * * @return string|array */ - public function getActiveRenderPath() + public function getActiveRenderPath(): string|array { } @@ -385,7 +385,7 @@ public function getRenderLevel(): int * * @return ManagerInterface|null */ - public function getEventsManager(): ?ManagerInterface + public function getEventsManager(): ManagerInterface|null { } @@ -489,7 +489,7 @@ public function getRender(string $controllerName, string $actionName, array $par * @return mixed|null * @param string $key */ - public function getVar(string $key) + public function getVar(string $key): mixed { } @@ -498,7 +498,7 @@ public function getVar(string $key) * * @return string|array */ - public function getViewsDir() + public function getViewsDir(): string|array { } @@ -613,7 +613,7 @@ public function registerEngines(array $engines): View * @param array $params * @return bool|View */ - public function render(string $controllerName, string $actionName, array $params = []) + public function render(string $controllerName, string $actionName, array $params = []): View|bool { } diff --git a/src/Mvc/View/Engine/Volt.php b/src/Mvc/View/Engine/Volt.php index 8e75c451..dd16dd12 100644 --- a/src/Mvc/View/Engine/Volt.php +++ b/src/Mvc/View/Engine/Volt.php @@ -52,7 +52,7 @@ class Volt extends \Phalcon\Mvc\View\Engine\AbstractEngine implements \Phalcon\E * @param string $name * @param array $arguments */ - public function callMacro(string $name, array $arguments = []) + public function callMacro(string $name, array $arguments = []): mixed { } @@ -82,7 +82,7 @@ public function getCompiler(): Compiler * * @return ManagerInterface|null */ - public function getEventsManager(): ?ManagerInterface + public function getEventsManager(): ManagerInterface|null { } diff --git a/src/Mvc/View/Engine/Volt/Compiler.php b/src/Mvc/View/Engine/Volt/Compiler.php index 91aa4307..c97fba45 100644 --- a/src/Mvc/View/Engine/Volt/Compiler.php +++ b/src/Mvc/View/Engine/Volt/Compiler.php @@ -479,7 +479,7 @@ public function getFunctions(): array * @param string $option * * @return string|null */ - public function getOption(string $option): ?string + public function getOption(string $option): string|null { } diff --git a/src/Mvc/View/Simple.php b/src/Mvc/View/Simple.php index b1d8c9c9..87c3ce26 100644 --- a/src/Mvc/View/Simple.php +++ b/src/Mvc/View/Simple.php @@ -106,7 +106,7 @@ public function __construct(array $options = []) * @return mixed|null * @param string $key */ - public function __get(string $key) + public function __get(string $key): mixed { } @@ -148,7 +148,7 @@ public function getContent(): string * * @return ManagerInterface|null */ - public function getEventsManager(): ?ManagerInterface + public function getEventsManager(): ManagerInterface|null { } @@ -174,7 +174,7 @@ public function getRegisteredEngines(): array * @return mixed|null * @param string $key */ - public function getVar(string $key) + public function getVar(string $key): mixed { } diff --git a/src/Mvc/ViewBaseInterface.php b/src/Mvc/ViewBaseInterface.php index becc5b16..ddb5a697 100644 --- a/src/Mvc/ViewBaseInterface.php +++ b/src/Mvc/ViewBaseInterface.php @@ -37,7 +37,7 @@ public function getParamsToView(): array; * * @return string|array */ - public function getViewsDir(); + public function getViewsDir(): string|array; /** * Renders a partial view diff --git a/src/Mvc/ViewInterface.php b/src/Mvc/ViewInterface.php index 6e6caea1..735b6a30 100644 --- a/src/Mvc/ViewInterface.php +++ b/src/Mvc/ViewInterface.php @@ -53,7 +53,7 @@ public function getActionName(): string; * * @return string|array */ - public function getActiveRenderPath(); + public function getActiveRenderPath(): string|array; /** * Gets base path @@ -126,7 +126,7 @@ public function registerEngines(array $engines); * @param array $params * @return bool|ViewInterface */ - public function render(string $controllerName, string $actionName, array $params = []); + public function render(string $controllerName, string $actionName, array $params = []): ViewInterface|bool; /** * Resets the view component to its factory default values diff --git a/src/Paginator/Repository.php b/src/Paginator/Repository.php index ffa6ab77..a24211cb 100644 --- a/src/Paginator/Repository.php +++ b/src/Paginator/Repository.php @@ -34,7 +34,7 @@ class Repository implements \Phalcon\Paginator\RepositoryInterface, \JsonSeriali * @param string $property * @return mixed|null */ - public function __get(string $property) + public function __get(string $property): mixed { } @@ -70,7 +70,7 @@ public function getFirst(): int * * @return mixed */ - public function getItems() + public function getItems(): mixed { } @@ -155,7 +155,7 @@ public function setProperties(array $properties): RepositoryInterface * @param mixed $defaultValue * @return mixed */ - protected function getProperty(string $property, $defaultValue = null) + protected function getProperty(string $property, $defaultValue = null): mixed { } diff --git a/src/Paginator/RepositoryInterface.php b/src/Paginator/RepositoryInterface.php index 05c23ed4..c7ddb582 100644 --- a/src/Paginator/RepositoryInterface.php +++ b/src/Paginator/RepositoryInterface.php @@ -60,7 +60,7 @@ public function getFirst(): int; * * @return mixed */ - public function getItems(); + public function getItems(): mixed; /** * Gets number of the last page diff --git a/src/Session/Adapter/AbstractAdapter.php b/src/Session/Adapter/AbstractAdapter.php index 0d5a61b2..cb660ac5 100644 --- a/src/Session/Adapter/AbstractAdapter.php +++ b/src/Session/Adapter/AbstractAdapter.php @@ -52,7 +52,7 @@ public function destroy($sessionId): bool * @param int $maxlifetime * @return false|int */ - public function gc(int $maxlifetime) + public function gc(int $maxlifetime): int|false { } @@ -69,22 +69,22 @@ public function read($sessionId): string /** * Open * - * @param mixed $savePath - * @param mixed $sessionName + * @param mixed $path + * @param mixed $name * @return bool */ - public function open($savePath, $sessionName): bool + public function open($path, $name): bool { } /** * Write * - * @param mixed $sessionId + * @param mixed $id * @param mixed $data * @return bool */ - public function write($sessionId, $data): bool + public function write($id, $data): bool { } @@ -95,7 +95,7 @@ public function write($sessionId, $data): bool * @param mixed $defaultValue * @return mixed */ - protected function getArrVal(array $collection, $index, $defaultValue = null) + protected function getArrVal(array $collection, $index, $defaultValue = null): mixed { } } diff --git a/src/Session/Adapter/Noop.php b/src/Session/Adapter/Noop.php index fbebf45f..df2b3833 100644 --- a/src/Session/Adapter/Noop.php +++ b/src/Session/Adapter/Noop.php @@ -93,7 +93,7 @@ public function destroy($sessionId): bool * @param int $maxlifetime * @return false|int */ - public function gc(int $maxlifetime) + public function gc(int $maxlifetime): int|false { } @@ -110,22 +110,22 @@ public function read($sessionId): string /** * Open * - * @param mixed $savePath - * @param mixed $sessionName + * @param mixed $path + * @param mixed $name * @return bool */ - public function open($savePath, $sessionName): bool + public function open($path, $name): bool { } /** * Write * - * @param mixed $sessionId + * @param mixed $id * @param mixed $data * @return bool */ - public function write($sessionId, $data): bool + public function write($id, $data): bool { } diff --git a/src/Session/Adapter/Stream.php b/src/Session/Adapter/Stream.php index 02278ffa..1ba037b7 100644 --- a/src/Session/Adapter/Stream.php +++ b/src/Session/Adapter/Stream.php @@ -68,7 +68,7 @@ public function destroy($sessionId): bool * @param int $maxlifetime * @return false|int */ - public function gc(int $maxlifetime) + public function gc(int $maxlifetime): int|false { } @@ -76,10 +76,10 @@ public function gc(int $maxlifetime) * Ignore the savePath and use local defined path * * @return bool - * @param mixed $savePath - * @param mixed $sessionName + * @param mixed $path + * @param mixed $name */ - public function open($savePath, $sessionName): bool + public function open($path, $name): bool { } @@ -94,11 +94,11 @@ public function read($sessionId): string } /** - * @param mixed $sessionId + * @param mixed $id * @param mixed $data * @return bool */ - public function write($sessionId, $data): bool + public function write($id, $data): bool { } @@ -110,7 +110,7 @@ public function write($sessionId, $data): bool * @param string $cast * @return mixed */ - protected function getArrVal(array $collection, $index, $defaultValue = null, string $cast = null) + protected function getArrVal(array $collection, $index, $defaultValue = null, string $cast = null): mixed { } diff --git a/src/Session/BagInterface.php b/src/Session/BagInterface.php index 52e9d16e..ac0047da 100644 --- a/src/Session/BagInterface.php +++ b/src/Session/BagInterface.php @@ -20,7 +20,7 @@ interface BagInterface * @param string $element * @return mixed */ - public function __get(string $element); + public function __get(string $element): mixed; /** * @param string $element @@ -53,7 +53,7 @@ public function init(array $data = []): void; * @param string $cast * @return mixed */ - public function get(string $element, $defaultValue = null, string $cast = null); + public function get(string $element, $defaultValue = null, string $cast = null): mixed; /** * @param string $element diff --git a/src/Session/Manager.php b/src/Session/Manager.php index 475935ba..d080f84c 100644 --- a/src/Session/Manager.php +++ b/src/Session/Manager.php @@ -62,7 +62,7 @@ public function __construct(array $options = []) * * @return mixed */ - public function __get(string $key) + public function __get(string $key): mixed { } @@ -125,7 +125,7 @@ public function exists(): bool * * @return mixed|null */ - public function get(string $key, $defaultValue = null, bool $remove = false) + public function get(string $key, $defaultValue = null, bool $remove = false): mixed { } @@ -298,7 +298,7 @@ private function getUniqueKey(string $key): string * @param mixed $defaultValue * @return mixed */ - private function getArrVal(array $collection, $index, $defaultValue = null) + private function getArrVal(array $collection, $index, $defaultValue = null): mixed { } } diff --git a/src/Session/ManagerInterface.php b/src/Session/ManagerInterface.php index 9af730e7..247d9086 100644 --- a/src/Session/ManagerInterface.php +++ b/src/Session/ManagerInterface.php @@ -33,7 +33,7 @@ interface ManagerInterface * @param string $key * @return mixed */ - public function __get(string $key); + public function __get(string $key): mixed; /** * Alias: Check whether a session variable is set in an application context @@ -82,7 +82,7 @@ public function destroy(): void; * @param bool $remove * @return mixed */ - public function get(string $key, $defaultValue = null, bool $remove = false); + public function get(string $key, $defaultValue = null, bool $remove = false): mixed; /** * Returns the session id diff --git a/src/Storage/Adapter/AbstractAdapter.php b/src/Storage/Adapter/AbstractAdapter.php index eb053a09..d10da955 100644 --- a/src/Storage/Adapter/AbstractAdapter.php +++ b/src/Storage/Adapter/AbstractAdapter.php @@ -99,7 +99,7 @@ abstract public function clear(): bool; * * @return int | bool */ - abstract public function decrement(string $key, int $value = 1); + abstract public function decrement(string $key, int $value = 1): int|bool; /** * Deletes data from the adapter @@ -118,7 +118,7 @@ abstract public function delete(string $key): bool; * * @return mixed */ - public function get(string $key, $defaultValue = null) + public function get(string $key, $defaultValue = null): mixed { } @@ -127,7 +127,7 @@ public function get(string $key, $defaultValue = null) * * @return mixed */ - public function getAdapter() + public function getAdapter(): mixed { } @@ -175,7 +175,7 @@ abstract public function has(string $key): bool; * * @return int | bool */ - abstract public function increment(string $key, int $value = 1); + abstract public function increment(string $key, int $value = 1): int|bool; /** * Stores data in the adapter @@ -235,7 +235,7 @@ protected function getPrefixedKey($key): string * * @return mixed */ - protected function getSerializedData($content) + protected function getSerializedData($content): mixed { } @@ -259,7 +259,7 @@ protected function getTtl($ttl): int * * @return mixed */ - protected function getUnserializedData($content, $defaultValue = null) + protected function getUnserializedData($content, $defaultValue = null): mixed { } @@ -281,7 +281,7 @@ protected function initSerializer(): void * @param string $cast * @return mixed */ - protected function getArrVal(array $collection, $index, $defaultValue = null, string $cast = null) + protected function getArrVal(array $collection, $index, $defaultValue = null, string $cast = null): mixed { } } diff --git a/src/Storage/Adapter/AdapterInterface.php b/src/Storage/Adapter/AdapterInterface.php index 46e1c225..ec4ec5d7 100644 --- a/src/Storage/Adapter/AdapterInterface.php +++ b/src/Storage/Adapter/AdapterInterface.php @@ -30,7 +30,7 @@ public function clear(): bool; * @param int $value * @return int|bool */ - public function decrement(string $key, int $value = 1); + public function decrement(string $key, int $value = 1): int|bool; /** * Deletes data from the adapter @@ -47,7 +47,7 @@ public function delete(string $key): bool; * @param mixed|null $defaultValue * * @return mixed */ - public function get(string $key, $defaultValue = null); + public function get(string $key, $defaultValue = null): mixed; /** * Returns the already connected adapter or connects to the backend @@ -55,7 +55,7 @@ public function get(string $key, $defaultValue = null); * * @return mixed */ - public function getAdapter(); + public function getAdapter(): mixed; /** * Returns all the keys stored @@ -87,7 +87,7 @@ public function has(string $key): bool; * @param int $value * @return int|bool */ - public function increment(string $key, int $value = 1); + public function increment(string $key, int $value = 1): int|bool; /** * Stores data in the adapter. If the TTL is `null` (default) or not defined diff --git a/src/Storage/Adapter/Apcu.php b/src/Storage/Adapter/Apcu.php index fcec3424..c48fb2d8 100644 --- a/src/Storage/Adapter/Apcu.php +++ b/src/Storage/Adapter/Apcu.php @@ -56,7 +56,7 @@ public function clear(): bool * * @return bool|int */ - public function decrement(string $key, int $value = 1) + public function decrement(string $key, int $value = 1): int|bool { } @@ -101,7 +101,7 @@ public function has(string $key): bool * * @return bool|int */ - public function increment(string $key, int $value = 1) + public function increment(string $key, int $value = 1): int|bool { } @@ -153,7 +153,7 @@ protected function doGet(string $key) * @param int $ttl * @return bool|int */ - protected function phpApcuDec($key, int $step = 1, $success = null, int $ttl = 0) + protected function phpApcuDec($key, int $step = 1, $success = null, int $ttl = 0): int|bool { } @@ -161,7 +161,7 @@ protected function phpApcuDec($key, int $step = 1, $success = null, int $ttl = 0 * @param mixed $key * @return bool|array */ - protected function phpApcuDelete($key) + protected function phpApcuDelete($key): bool|array { } @@ -169,7 +169,7 @@ protected function phpApcuDelete($key) * @param mixed $key * @return bool|array */ - protected function phpApcuExists($key) + protected function phpApcuExists($key): bool|array { } @@ -180,7 +180,7 @@ protected function phpApcuExists($key) * @param int $ttl * @return bool|int */ - protected function phpApcuInc($key, int $step = 1, $success = null, int $ttl = 0) + protected function phpApcuInc($key, int $step = 1, $success = null, int $ttl = 0): int|bool { } @@ -189,7 +189,7 @@ protected function phpApcuInc($key, int $step = 1, $success = null, int $ttl = 0 * @param mixed $success * @return mixed */ - protected function phpApcuFetch($key, $success = null) + protected function phpApcuFetch($key, $success = null): mixed { } @@ -197,7 +197,7 @@ protected function phpApcuFetch($key, $success = null) * @param string $pattern * @return bool|APCUIterator */ - protected function phpApcuIterator(string $pattern) + protected function phpApcuIterator(string $pattern): APCUIterator|bool { } @@ -207,7 +207,7 @@ protected function phpApcuIterator(string $pattern) * @param int $ttl * @return bool|array */ - protected function phpApcuStore($key, $payload, int $ttl = 0) + protected function phpApcuStore($key, $payload, int $ttl = 0): bool|array { } } diff --git a/src/Storage/Adapter/Libmemcached.php b/src/Storage/Adapter/Libmemcached.php index e8ae138f..c88a711d 100644 --- a/src/Storage/Adapter/Libmemcached.php +++ b/src/Storage/Adapter/Libmemcached.php @@ -56,7 +56,7 @@ public function clear(): bool * @return bool|int * @throws StorageException */ - public function decrement(string $key, int $value = 1) + public function decrement(string $key, int $value = 1): int|bool { } @@ -79,7 +79,7 @@ public function delete(string $key): bool * @return \Memcached|null * @throws StorageException */ - public function getAdapter() + public function getAdapter(): mixed { } @@ -116,7 +116,7 @@ public function has(string $key): bool * @return bool|int * @throws StorageException */ - public function increment(string $key, int $value = 1) + public function increment(string $key, int $value = 1): int|bool { } diff --git a/src/Storage/Adapter/Memory.php b/src/Storage/Adapter/Memory.php index d9669d89..9537d7c8 100644 --- a/src/Storage/Adapter/Memory.php +++ b/src/Storage/Adapter/Memory.php @@ -56,7 +56,7 @@ public function clear(): bool * * @return bool|int */ - public function decrement(string $key, int $value = 1) + public function decrement(string $key, int $value = 1): int|bool { } @@ -101,7 +101,7 @@ public function has(string $key): bool * * @return bool|int */ - public function increment(string $key, int $value = 1) + public function increment(string $key, int $value = 1): int|bool { } diff --git a/src/Storage/Adapter/Redis.php b/src/Storage/Adapter/Redis.php index 8548d8d5..51eeb39c 100644 --- a/src/Storage/Adapter/Redis.php +++ b/src/Storage/Adapter/Redis.php @@ -70,7 +70,7 @@ public function clear(): bool * @return bool|int * @throws StorageException */ - public function decrement(string $key, int $value = 1) + public function decrement(string $key, int $value = 1): int|bool { } @@ -93,7 +93,7 @@ public function delete(string $key): bool * @return mixed|\Redis * @throws StorageException */ - public function getAdapter() + public function getAdapter(): mixed { } @@ -130,7 +130,7 @@ public function has(string $key): bool * @return bool|false|int * @throws StorageException */ - public function increment(string $key, int $value = 1) + public function increment(string $key, int $value = 1): int|bool { } diff --git a/src/Storage/Adapter/Stream.php b/src/Storage/Adapter/Stream.php index edb4c38f..1fe43d9a 100644 --- a/src/Storage/Adapter/Stream.php +++ b/src/Storage/Adapter/Stream.php @@ -71,7 +71,7 @@ public function clear(): bool * * @return bool|int */ - public function decrement(string $key, int $value = 1) + public function decrement(string $key, int $value = 1): int|bool { } @@ -94,7 +94,7 @@ public function delete(string $key): bool * * @return mixed|null */ - public function get(string $key, $defaultValue = null) + public function get(string $key, $defaultValue = null): mixed { } @@ -128,7 +128,7 @@ public function has(string $key): bool * * @return bool|int */ - public function increment(string $key, int $value = 1) + public function increment(string $key, int $value = 1): int|bool { } @@ -255,7 +255,7 @@ protected function phpFileExists(string $filename): bool * @param string $filename * @return string|bool */ - protected function phpFileGetContents(string $filename) + protected function phpFileGetContents(string $filename): bool|string { } @@ -266,7 +266,7 @@ protected function phpFileGetContents(string $filename) * @param mixed $context * @return int|bool */ - protected function phpFilePutContents(string $filename, $data, int $flags = 0, $context = null) + protected function phpFilePutContents(string $filename, $data, int $flags = 0, $context = null): int|bool { } @@ -275,7 +275,7 @@ protected function phpFilePutContents(string $filename, $data, int $flags = 0, $ * @param string $mode * @return mixed */ - protected function phpFopen(string $filename, string $mode) + protected function phpFopen(string $filename, string $mode): mixed { } diff --git a/src/Storage/Adapter/Weak.php b/src/Storage/Adapter/Weak.php index 53df27db..845f334b 100644 --- a/src/Storage/Adapter/Weak.php +++ b/src/Storage/Adapter/Weak.php @@ -63,7 +63,7 @@ public function clear(): bool * * @return bool|int */ - public function decrement(string $key, int $value = 1) + public function decrement(string $key, int $value = 1): int|bool { } @@ -97,7 +97,7 @@ public function getKeys(string $prefix = ''): array * * @return bool|int */ - public function increment(string $key, int $value = 1) + public function increment(string $key, int $value = 1): int|bool { } @@ -108,7 +108,7 @@ public function increment(string $key, int $value = 1) * @param mixed|null $defaultValue * * @return mixed */ - public function get(string $key, $defaultValue = null) + public function get(string $key, $defaultValue = null): mixed { } diff --git a/src/Storage/Serializer/Igbinary.php b/src/Storage/Serializer/Igbinary.php index 46d67f4d..99fc41de 100644 --- a/src/Storage/Serializer/Igbinary.php +++ b/src/Storage/Serializer/Igbinary.php @@ -46,7 +46,7 @@ public function unserialize($data): void * * @return string|null */ - protected function phpIgbinarySerialize($value): ?string + protected function phpIgbinarySerialize($value): string|null { } @@ -57,7 +57,7 @@ protected function phpIgbinarySerialize($value): ?string * * @return string|null */ - protected function doSerialize($value): ?string + protected function doSerialize($value): string|null { } diff --git a/src/Storage/Serializer/None.php b/src/Storage/Serializer/None.php index 59c7da77..53af81fb 100644 --- a/src/Storage/Serializer/None.php +++ b/src/Storage/Serializer/None.php @@ -24,7 +24,7 @@ class None extends \Phalcon\Storage\Serializer\AbstractSerializer * * @return mixed */ - public function serialize() + public function serialize(): mixed { } diff --git a/src/Storage/Serializer/Php.php b/src/Storage/Serializer/Php.php index 4b117985..a9ac87dc 100644 --- a/src/Storage/Serializer/Php.php +++ b/src/Storage/Serializer/Php.php @@ -46,7 +46,7 @@ public function unserialize($data): void * * @return mixed */ - private function phpUnserialize(string $data, array $options = []) + private function phpUnserialize(string $data, array $options = []): mixed { } } diff --git a/src/Storage/Serializer/SerializerInterface.php b/src/Storage/Serializer/SerializerInterface.php index 021ad6e5..b1246f95 100644 --- a/src/Storage/Serializer/SerializerInterface.php +++ b/src/Storage/Serializer/SerializerInterface.php @@ -24,7 +24,7 @@ interface SerializerInterface extends \Serializable /** * @return mixed */ - public function getData(); + public function getData(): mixed; /** * @param mixed $data diff --git a/src/Support/Collection.php b/src/Support/Collection.php index 0979f40b..81f5f7a1 100644 --- a/src/Support/Collection.php +++ b/src/Support/Collection.php @@ -68,7 +68,7 @@ public function __construct(array $data = [], bool $insensitive = true) * @param string $element * @return mixed */ - public function __get(string $element) + public function __get(string $element): mixed { } @@ -130,7 +130,7 @@ public function count(): int * @param string $cast * @return mixed */ - public function get(string $element, $defaultValue = null, string $cast = null) + public function get(string $element, $defaultValue = null, string $cast = null): mixed { } @@ -210,7 +210,7 @@ public function offsetExists($element): bool * @param mixed $element * @return mixed */ - public function offsetGet($element) + public function offsetGet($element): mixed { } @@ -218,11 +218,11 @@ public function offsetGet($element) * Offset to set * See [offsetSet](https://php.net/manual/en/arrayaccess.offsetset.php) * - * @param mixed $element + * @param mixed $offset * @param mixed $value * @return void */ - public function offsetSet($element, $value): void + public function offsetSet($offset, $value): void { } diff --git a/src/Support/Collection/CollectionInterface.php b/src/Support/Collection/CollectionInterface.php index 31de7e9f..ea00124a 100644 --- a/src/Support/Collection/CollectionInterface.php +++ b/src/Support/Collection/CollectionInterface.php @@ -20,7 +20,7 @@ interface CollectionInterface * @param string $element * @return mixed */ - public function __get(string $element); + public function __get(string $element): mixed; /** * @param string $element @@ -52,7 +52,7 @@ public function clear(): void; * @param string $cast * @return mixed */ - public function get(string $element, $defaultValue = null, string $cast = null); + public function get(string $element, $defaultValue = null, string $cast = null): mixed; /** * @param bool $insensitive diff --git a/src/Support/Debug.php b/src/Support/Debug.php index f3aa47a7..bb80025a 100644 --- a/src/Support/Debug.php +++ b/src/Support/Debug.php @@ -266,7 +266,7 @@ protected function escapeString(string $value): string * @param array $argument * @param mixed $n */ - protected function getArrayDump(array $argument, $n = 0): ?string + protected function getArrayDump(array $argument, $n = 0): string|null { } @@ -300,7 +300,7 @@ final protected function showTraceItem(int $n, array $trace): string * @param mixed $defaultValue * @return mixed */ - private function getArrVal(array $collection, $index, $defaultValue = null) + private function getArrVal(array $collection, $index, $defaultValue = null): mixed { } } diff --git a/src/Support/Helper/Arr/Filter.php b/src/Support/Helper/Arr/Filter.php index 519595d5..47aaf6b2 100644 --- a/src/Support/Helper/Arr/Filter.php +++ b/src/Support/Helper/Arr/Filter.php @@ -20,7 +20,7 @@ class Filter extends \Phalcon\Support\Helper\Arr\AbstractArr * * @return mixed */ - public function __invoke(array $collection, $method = null) + public function __invoke(array $collection, $method = null): mixed { } } diff --git a/src/Support/Helper/Arr/First.php b/src/Support/Helper/Arr/First.php index 5b2a4955..500b7674 100644 --- a/src/Support/Helper/Arr/First.php +++ b/src/Support/Helper/Arr/First.php @@ -21,7 +21,7 @@ class First extends \Phalcon\Support\Helper\Arr\AbstractArr * * @return mixed */ - public function __invoke(array $collection, $method = null) + public function __invoke(array $collection, $method = null): mixed { } } diff --git a/src/Support/Helper/Arr/FirstKey.php b/src/Support/Helper/Arr/FirstKey.php index b86b0a9a..e0760417 100644 --- a/src/Support/Helper/Arr/FirstKey.php +++ b/src/Support/Helper/Arr/FirstKey.php @@ -21,7 +21,7 @@ class FirstKey extends \Phalcon\Support\Helper\Arr\AbstractArr * * @return mixed */ - public function __invoke(array $collection, $method = null) + public function __invoke(array $collection, $method = null): mixed { } } diff --git a/src/Support/Helper/Arr/Get.php b/src/Support/Helper/Arr/Get.php index edc26e45..0099f4cd 100644 --- a/src/Support/Helper/Arr/Get.php +++ b/src/Support/Helper/Arr/Get.php @@ -24,7 +24,7 @@ class Get * * @return mixed|null */ - public function __invoke(array $collection, $index, $defaultValue = null, string $cast = null) + public function __invoke(array $collection, $index, $defaultValue = null, string $cast = null): mixed { } } diff --git a/src/Support/Helper/Arr/Last.php b/src/Support/Helper/Arr/Last.php index 469d599d..59323d7e 100644 --- a/src/Support/Helper/Arr/Last.php +++ b/src/Support/Helper/Arr/Last.php @@ -21,7 +21,7 @@ class Last extends \Phalcon\Support\Helper\Arr\AbstractArr * * @return mixed */ - public function __invoke(array $collection, $method = null) + public function __invoke(array $collection, $method = null): mixed { } } diff --git a/src/Support/Helper/Arr/LastKey.php b/src/Support/Helper/Arr/LastKey.php index a4ba6482..a53793a8 100644 --- a/src/Support/Helper/Arr/LastKey.php +++ b/src/Support/Helper/Arr/LastKey.php @@ -21,7 +21,7 @@ class LastKey extends \Phalcon\Support\Helper\Arr\AbstractArr * * @return mixed */ - public function __invoke(array $collection, $method = null) + public function __invoke(array $collection, $method = null): mixed { } } diff --git a/src/Support/Helper/Arr/ToObject.php b/src/Support/Helper/Arr/ToObject.php index 4a24639c..5155fe80 100644 --- a/src/Support/Helper/Arr/ToObject.php +++ b/src/Support/Helper/Arr/ToObject.php @@ -19,7 +19,7 @@ class ToObject * * @return object */ - public function __invoke(array $collection) + public function __invoke(array $collection): object { } } diff --git a/src/Support/Registry.php b/src/Support/Registry.php index 9d7bb0d3..420cb074 100644 --- a/src/Support/Registry.php +++ b/src/Support/Registry.php @@ -79,7 +79,7 @@ final public function __construct(array $data = []) * @param string $element * @return mixed */ - final public function __get(string $element) + final public function __get(string $element): mixed { } @@ -141,7 +141,7 @@ final public function count(): int * @param string $cast * @return mixed */ - final public function get(string $element, $defaultValue = null, string $cast = null) + final public function get(string $element, $defaultValue = null, string $cast = null): mixed { } @@ -202,7 +202,7 @@ final public function offsetExists($element): bool * @param mixed $element * @return mixed */ - final public function offsetGet($element) + final public function offsetGet($element): mixed { } @@ -210,11 +210,11 @@ final public function offsetGet($element) * Offset to set * * @link https://php.net/manual/en/arrayaccess.offsetset.php - * @param mixed $element + * @param mixed $offset * @param mixed $value * @return void */ - final public function offsetSet($element, $value): void + final public function offsetSet($offset, $value): void { } diff --git a/src/Tag.php b/src/Tag.php index a46538f4..43f2819f 100644 --- a/src/Tag.php +++ b/src/Tag.php @@ -284,7 +284,7 @@ public static function getDocType(): string * @param array $params * @return EscaperInterface|null */ - public static function getEscaper(array $params): ?EscaperInterface + public static function getEscaper(array $params): EscaperInterface|null { } diff --git a/src/Translate/Adapter/AbstractAdapter.php b/src/Translate/Adapter/AbstractAdapter.php index 9571e206..0f298b4d 100644 --- a/src/Translate/Adapter/AbstractAdapter.php +++ b/src/Translate/Adapter/AbstractAdapter.php @@ -73,7 +73,7 @@ public function offsetExists($translateKey): bool * * @return mixed */ - public function offsetGet($translateKey) + public function offsetGet($translateKey): mixed { } diff --git a/src/Translate/Adapter/Csv.php b/src/Translate/Adapter/Csv.php index d14a0098..00dbfed6 100644 --- a/src/Translate/Adapter/Csv.php +++ b/src/Translate/Adapter/Csv.php @@ -14,10 +14,6 @@ use Phalcon\Translate\InterpolatorFactory; /** - * Class Csv - * - * @package Phalcon\Translate\Adapter - * * @property array $translate */ class Csv extends \Phalcon\Translate\Adapter\AbstractAdapter implements \ArrayAccess diff --git a/src/Translate/Adapter/Gettext.php b/src/Translate/Adapter/Gettext.php index 79a0ac4c..ec5715bf 100644 --- a/src/Translate/Adapter/Gettext.php +++ b/src/Translate/Adapter/Gettext.php @@ -104,7 +104,7 @@ public function getDefaultDomain(): string /** * @return string|array */ - public function getDirectory() + public function getDirectory(): string|array { } @@ -228,7 +228,7 @@ public function setDomain(string $domain = null): string * * @return false|string */ - public function setLocale(int $category, array $localeArray = []) + public function setLocale(int $category, array $localeArray = []): bool|string { }