diff --git a/src/Phalcon/acl/adapter/AbstractAdapter.php b/src/Phalcon/Acl/Adapter/AbstractAdapter.php similarity index 88% rename from src/Phalcon/acl/adapter/AbstractAdapter.php rename to src/Phalcon/Acl/Adapter/AbstractAdapter.php index 96992459..d7ea0d05 100644 --- a/src/Phalcon/acl/adapter/AbstractAdapter.php +++ b/src/Phalcon/Acl/Adapter/AbstractAdapter.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Acl\Adapter; use Phalcon\Events\ManagerInterface; @@ -94,7 +101,7 @@ public function getDefaultAction(): int /** * Returns the internal event manager * - * @return \Phalcon\Events\ManagerInterface + * @return ManagerInterface */ public function getEventsManager(): ManagerInterface { @@ -104,6 +111,7 @@ public function getEventsManager(): ManagerInterface * Sets the default access level (Phalcon\Acl::ALLOW or Phalcon\Acl::DENY) * * @param int $defaultAccess + * @return void */ public function setDefaultAction(int $defaultAccess) { @@ -113,6 +121,7 @@ public function setDefaultAction(int $defaultAccess) * Sets the events manager * * @param \Phalcon\Events\ManagerInterface $eventsManager + * @return void */ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager) { diff --git a/src/Phalcon/acl/adapter/AdapterInterface.php b/src/Phalcon/Acl/Adapter/AdapterInterface.php similarity index 92% rename from src/Phalcon/acl/adapter/AdapterInterface.php rename to src/Phalcon/Acl/Adapter/AdapterInterface.php index bd8a7852..50dcf539 100644 --- a/src/Phalcon/acl/adapter/AdapterInterface.php +++ b/src/Phalcon/Acl/Adapter/AdapterInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Acl\Adapter; /** @@ -55,6 +62,7 @@ public function addComponentAccess(string $componentName, $accessList): bool; * @param string $componentName * @param mixed $access * @param mixed $func + * @return void */ public function allow(string $roleName, string $componentName, $access, $func = null); @@ -65,6 +73,7 @@ public function allow(string $roleName, string $componentName, $access, $func = * @param string $componentName * @param mixed $access * @param mixed $func + * @return void */ public function deny(string $roleName, string $componentName, $access, $func = null); @@ -73,6 +82,7 @@ public function deny(string $roleName, string $componentName, $access, $func = n * * @param string $componentName * @param mixed $accessList + * @return void */ public function dropComponentAccess(string $componentName, $accessList); @@ -117,14 +127,14 @@ public function getNoArgumentsDefaultAction(): int; /** * Return an array with every role registered in the list * - * @return array|\Phalcon\Acl\RoleInterface[] + * @return array */ public function getRoles(): array; /** * Return an array with every component registered in the list * - * @return array|\Phalcon\Acl\ComponentInterface[] + * @return array */ public function getComponents(): array; @@ -159,6 +169,7 @@ public function isRole(string $roleName): bool; * Sets the default access level (Phalcon\Ac\Enuml::ALLOW or Phalcon\Acl\Enum::DENY) * * @param int $defaultAccess + * @return void */ public function setDefaultAction(int $defaultAccess); @@ -168,6 +179,7 @@ public function setDefaultAction(int $defaultAccess); * accessKey * * @param int $defaultAccess + * @return void */ public function setNoArgumentsDefaultAction(int $defaultAccess); } diff --git a/src/Phalcon/acl/adapter/Memory.php b/src/Phalcon/Acl/Adapter/Memory.php similarity index 96% rename from src/Phalcon/acl/adapter/Memory.php rename to src/Phalcon/Acl/Adapter/Memory.php index 21231cb4..6a243609 100644 --- a/src/Phalcon/acl/adapter/Memory.php +++ b/src/Phalcon/Acl/Adapter/Memory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Acl\Adapter; use Phalcon\Acl\Enum; @@ -67,7 +74,7 @@ * } * ``` */ -class Memory extends AbstractAdapter +class Memory extends \Phalcon\Acl\Adapter\AbstractAdapter { /** * Access @@ -298,6 +305,7 @@ public function addRole($role, $accessInherits = null): bool * @param string $componentName * @param mixed $access * @param mixed $func + * @return void */ public function allow(string $roleName, string $componentName, $access, $func = null) { @@ -324,6 +332,7 @@ public function allow(string $roleName, string $componentName, $access, $func = * @param string $componentName * @param mixed $access * @param mixed $func + * @return void */ public function deny(string $roleName, string $componentName, $access, $func = null) { @@ -334,6 +343,7 @@ public function deny(string $roleName, string $componentName, $access, $func = n * * @param string $componentName * @param mixed $accessList + * @return void */ public function dropComponentAccess(string $componentName, $accessList) { @@ -352,7 +362,7 @@ public function getNoArgumentsDefaultAction(): int /** * Return an array with every role registered in the list * - * @return array|\Phalcon\Acl\RoleInterface[] + * @return array */ public function getRoles(): array { @@ -361,7 +371,7 @@ public function getRoles(): array /** * Return an array with every component registered in the list * - * @return array|\Phalcon\Acl\ComponentInterface[] + * @return array */ public function getComponents(): array { @@ -414,6 +424,7 @@ public function isComponent(string $componentName): bool * accessKey * * @param int $defaultAccess + * @return void */ public function setNoArgumentsDefaultAction(int $defaultAccess) { @@ -427,6 +438,7 @@ public function setNoArgumentsDefaultAction(int $defaultAccess) * @param mixed $access * @param mixed $action * @param mixed $func + * @return void */ private function allowOrDeny(string $roleName, string $componentName, $access, $action, $func = null) { diff --git a/src/Phalcon/acl/Component.php b/src/Phalcon/Acl/Component.php similarity index 80% rename from src/Phalcon/acl/Component.php rename to src/Phalcon/Acl/Component.php index 8f068fd1..3de82caf 100644 --- a/src/Phalcon/acl/Component.php +++ b/src/Phalcon/Acl/Component.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Acl; /** diff --git a/src/Phalcon/acl/ComponentAware.php b/src/Phalcon/Acl/ComponentAware.php similarity index 53% rename from src/Phalcon/acl/ComponentAware.php rename to src/Phalcon/Acl/ComponentAware.php index 412164f1..a631e35b 100644 --- a/src/Phalcon/acl/ComponentAware.php +++ b/src/Phalcon/Acl/ComponentAware.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Acl; /** diff --git a/src/Phalcon/acl/ComponentInterface.php b/src/Phalcon/Acl/ComponentInterface.php similarity index 67% rename from src/Phalcon/acl/ComponentInterface.php rename to src/Phalcon/Acl/ComponentInterface.php index 2a98bb5b..3cc7b050 100644 --- a/src/Phalcon/acl/ComponentInterface.php +++ b/src/Phalcon/Acl/ComponentInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Acl; /** diff --git a/src/Phalcon/Acl/Enum.php b/src/Phalcon/Acl/Enum.php new file mode 100644 index 00000000..b6d62470 --- /dev/null +++ b/src/Phalcon/Acl/Enum.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Acl; + +/** + * Constants for Phalcon\Acl\Adapter adapters + */ +class Enum +{ + + const ALLOW = 1; + + + const DENY = 0; +} diff --git a/src/Phalcon/factory/Exception.php b/src/Phalcon/Acl/Exception.php similarity index 66% rename from src/Phalcon/factory/Exception.php rename to src/Phalcon/Acl/Exception.php index 05f51397..2f61c57f 100644 --- a/src/Phalcon/factory/Exception.php +++ b/src/Phalcon/Acl/Exception.php @@ -1,15 +1,17 @@ * * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ +namespace Phalcon\Acl; + +/** + * Class for exceptions thrown by Phalcon\Acl + */ class Exception extends \Phalcon\Exception { diff --git a/src/Phalcon/acl/Role.php b/src/Phalcon/Acl/Role.php similarity index 79% rename from src/Phalcon/acl/Role.php rename to src/Phalcon/Acl/Role.php index 563e1dc0..0618f41a 100644 --- a/src/Phalcon/acl/Role.php +++ b/src/Phalcon/Acl/Role.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Acl; /** diff --git a/src/Phalcon/acl/RoleAware.php b/src/Phalcon/Acl/RoleAware.php similarity index 52% rename from src/Phalcon/acl/RoleAware.php rename to src/Phalcon/Acl/RoleAware.php index b568a8bf..2ffaf09f 100644 --- a/src/Phalcon/acl/RoleAware.php +++ b/src/Phalcon/Acl/RoleAware.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Acl; /** diff --git a/src/Phalcon/acl/RoleInterface.php b/src/Phalcon/Acl/RoleInterface.php similarity index 66% rename from src/Phalcon/acl/RoleInterface.php rename to src/Phalcon/Acl/RoleInterface.php index 0d22ff31..87beb275 100644 --- a/src/Phalcon/acl/RoleInterface.php +++ b/src/Phalcon/Acl/RoleInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Acl; /** diff --git a/src/Phalcon/annotations/adapter/AbstractAdapter.php b/src/Phalcon/Annotations/Adapter/AbstractAdapter.php similarity index 85% rename from src/Phalcon/annotations/adapter/AbstractAdapter.php rename to src/Phalcon/Annotations/Adapter/AbstractAdapter.php index a1c84925..97373f18 100644 --- a/src/Phalcon/annotations/adapter/AbstractAdapter.php +++ b/src/Phalcon/Annotations/Adapter/AbstractAdapter.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Annotations\Adapter; use Phalcon\Annotations\Collection; @@ -27,7 +34,7 @@ abstract class AbstractAdapter implements \Phalcon\Annotations\Adapter\AdapterIn * Parses or retrieves all the annotations found in a class * * @param mixed $className - * @return \Phalcon\Annotations\Reflection + * @return Reflection */ public function get($className): Reflection { @@ -38,7 +45,7 @@ public function get($className): Reflection * * @param string $className * @param string $methodName - * @return \Phalcon\Annotations\Collection + * @return Collection */ public function getMethod(string $className, string $methodName): Collection { @@ -59,7 +66,7 @@ public function getMethods(string $className): array * * @param string $className * @param string $propertyName - * @return \Phalcon\Annotations\Collection + * @return Collection */ public function getProperty(string $className, string $propertyName): Collection { @@ -78,7 +85,7 @@ public function getProperties(string $className): array /** * Returns the annotation reader * - * @return \Phalcon\Annotations\ReaderInterface + * @return ReaderInterface */ public function getReader(): ReaderInterface { diff --git a/src/Phalcon/annotations/adapter/AdapterInterface.php b/src/Phalcon/Annotations/Adapter/AdapterInterface.php similarity index 82% rename from src/Phalcon/annotations/adapter/AdapterInterface.php rename to src/Phalcon/Annotations/Adapter/AdapterInterface.php index e316bb87..6f851a21 100644 --- a/src/Phalcon/annotations/adapter/AdapterInterface.php +++ b/src/Phalcon/Annotations/Adapter/AdapterInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Annotations\Adapter; use Phalcon\Annotations\Collection; @@ -16,7 +23,7 @@ interface AdapterInterface * Parses or retrieves all the annotations found in a class * * @param string $className - * @return \Phalcon\Annotations\Reflection + * @return Reflection */ public function get(string $className): Reflection; @@ -25,7 +32,7 @@ public function get(string $className): Reflection; * * @param string $className * @param string $methodName - * @return \Phalcon\Annotations\Collection + * @return Collection */ public function getMethod(string $className, string $methodName): Collection; @@ -42,7 +49,7 @@ public function getMethods(string $className): array; * * @param string $className * @param string $propertyName - * @return \Phalcon\Annotations\Collection + * @return Collection */ public function getProperty(string $className, string $propertyName): Collection; @@ -57,7 +64,7 @@ public function getProperties(string $className): array; /** * Returns the annotation reader * - * @return \Phalcon\Annotations\ReaderInterface + * @return ReaderInterface */ public function getReader(): ReaderInterface; diff --git a/src/Phalcon/annotations/adapter/Apcu.php b/src/Phalcon/Annotations/Adapter/Apcu.php similarity index 75% rename from src/Phalcon/annotations/adapter/Apcu.php rename to src/Phalcon/Annotations/Adapter/Apcu.php index 434ce2e9..00e61855 100644 --- a/src/Phalcon/annotations/adapter/Apcu.php +++ b/src/Phalcon/Annotations/Adapter/Apcu.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Annotations\Adapter; /** @@ -11,7 +18,7 @@ * $annotations = new Apcu(); * ``` */ -class Apcu extends AbstractAdapter +class Apcu extends \Phalcon\Annotations\Adapter\AbstractAdapter { /** * @var string @@ -37,7 +44,7 @@ public function __construct(array $options = array()) * Reads parsed annotations from APCu * * @param string $key - * @return bool|\Phalcon\Annotations\Reflection + * @return mixed */ public function read(string $key) { diff --git a/src/Phalcon/annotations/adapter/Memory.php b/src/Phalcon/Annotations/Adapter/Memory.php similarity index 63% rename from src/Phalcon/annotations/adapter/Memory.php rename to src/Phalcon/Annotations/Adapter/Memory.php index 1a70e83b..cce0444f 100644 --- a/src/Phalcon/annotations/adapter/Memory.php +++ b/src/Phalcon/Annotations/Adapter/Memory.php @@ -1,12 +1,19 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Annotations\Adapter; /** * Stores the parsed annotations in memory. This adapter is the suitable * development/testing */ -class Memory extends AbstractAdapter +class Memory extends \Phalcon\Annotations\Adapter\AbstractAdapter { /** * @var mixed @@ -18,7 +25,7 @@ class Memory extends AbstractAdapter * Reads parsed annotations from memory * * @param string $key - * @return bool|\Phalcon\Annotations\Reflection + * @return mixed */ public function read(string $key) { @@ -29,6 +36,7 @@ public function read(string $key) * * @param string $key * @param \Phalcon\Annotations\Reflection $data + * @return void */ public function write(string $key, \Phalcon\Annotations\Reflection $data) { diff --git a/src/Phalcon/annotations/adapter/Stream.php b/src/Phalcon/Annotations/Adapter/Stream.php similarity index 73% rename from src/Phalcon/annotations/adapter/Stream.php rename to src/Phalcon/Annotations/Adapter/Stream.php index 6ef35cde..da16f41b 100644 --- a/src/Phalcon/annotations/adapter/Stream.php +++ b/src/Phalcon/Annotations/Adapter/Stream.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Annotations\Adapter; /** @@ -15,7 +22,7 @@ * ); * ``` */ -class Stream extends AbstractAdapter +class Stream extends \Phalcon\Annotations\Adapter\AbstractAdapter { /** * @var string @@ -36,7 +43,7 @@ public function __construct(array $options = array()) * Reads parsed annotations from files * * @param string $key - * @return bool|int|\Phalcon\Annotations\Reflection + * @return mixed */ public function read(string $key) { @@ -47,6 +54,7 @@ public function read(string $key) * * @param string $key * @param \Phalcon\Annotations\Reflection $data + * @return void */ public function write(string $key, \Phalcon\Annotations\Reflection $data) { diff --git a/src/Phalcon/annotations/Annotation.php b/src/Phalcon/Annotations/Annotation.php similarity index 89% rename from src/Phalcon/annotations/Annotation.php rename to src/Phalcon/Annotations/Annotation.php index 3e108679..243f63a8 100644 --- a/src/Phalcon/annotations/Annotation.php +++ b/src/Phalcon/Annotations/Annotation.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Annotations; /** diff --git a/src/Phalcon/annotations/AnnotationsFactory.php b/src/Phalcon/Annotations/AnnotationsFactory.php similarity index 71% rename from src/Phalcon/annotations/AnnotationsFactory.php rename to src/Phalcon/Annotations/AnnotationsFactory.php index 1879fbe6..f72f80a1 100644 --- a/src/Phalcon/annotations/AnnotationsFactory.php +++ b/src/Phalcon/Annotations/AnnotationsFactory.php @@ -1,8 +1,15 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Annotations; -use Phalcon\Annotations\Adapter\AbstractAdapter; +use Phalcon\Annotations\Adapter\AdapterInterface; use Phalcon\Factory\AbstractFactory; /** @@ -35,9 +42,9 @@ public function load($config) * * @param string $name * @param array $options - * @return \Phalcon\Annotations\Adapter\AbstractAdapter + * @return AdapterInterface */ - public function newInstance(string $name, array $options = array()): AbstractAdapter + public function newInstance(string $name, array $options = array()): AdapterInterface { } diff --git a/src/Phalcon/annotations/Collection.php b/src/Phalcon/Annotations/Collection.php similarity index 86% rename from src/Phalcon/annotations/Collection.php rename to src/Phalcon/Annotations/Collection.php index fbe9063f..d949b7c4 100644 --- a/src/Phalcon/annotations/Collection.php +++ b/src/Phalcon/Annotations/Collection.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Annotations; /** @@ -53,7 +60,7 @@ public function count(): int /** * Returns the current annotation in the iterator * - * @return bool|\Phalcon\Annotations\Annotation + * @return mixed */ public function current() { @@ -63,7 +70,7 @@ public function current() * Returns the first annotation that match a name * * @param string $name - * @return \Phalcon\Annotations\Annotation + * @return Annotation */ public function get(string $name): Annotation { @@ -73,7 +80,7 @@ public function get(string $name): Annotation * Returns all the annotations that match a name * * @param string $name - * @return array|\Phalcon\Annotations\Annotation[] + * @return array */ public function getAll(string $name): array { @@ -82,7 +89,7 @@ public function getAll(string $name): array /** * Returns the internal annotations as an array * - * @return array|\Phalcon\Annotations\Annotation[] + * @return array */ public function getAnnotations(): array { @@ -109,6 +116,8 @@ public function key(): int /** * Moves the internal iteration pointer to the next position + * + * @return void */ public function next() { @@ -116,6 +125,8 @@ public function next() /** * Rewinds the internal iterator + * + * @return void */ public function rewind() { diff --git a/src/Phalcon/Annotations/Exception.php b/src/Phalcon/Annotations/Exception.php new file mode 100644 index 00000000..cb1aad5b --- /dev/null +++ b/src/Phalcon/Annotations/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Annotations; + +/** + * Class for exceptions thrown by Phalcon\Annotations + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/annotations/Reader.php b/src/Phalcon/Annotations/Reader.php similarity index 75% rename from src/Phalcon/annotations/Reader.php rename to src/Phalcon/Annotations/Reader.php index d9e3f689..ddccab04 100644 --- a/src/Phalcon/annotations/Reader.php +++ b/src/Phalcon/Annotations/Reader.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Annotations; /** diff --git a/src/Phalcon/annotations/ReaderInterface.php b/src/Phalcon/Annotations/ReaderInterface.php similarity index 73% rename from src/Phalcon/annotations/ReaderInterface.php rename to src/Phalcon/Annotations/ReaderInterface.php index 0d319b13..af370c66 100644 --- a/src/Phalcon/annotations/ReaderInterface.php +++ b/src/Phalcon/Annotations/ReaderInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Annotations; /** diff --git a/src/Phalcon/annotations/Reflection.php b/src/Phalcon/Annotations/Reflection.php similarity index 83% rename from src/Phalcon/annotations/Reflection.php rename to src/Phalcon/Annotations/Reflection.php index 5d73a94b..fdcb7760 100644 --- a/src/Phalcon/annotations/Reflection.php +++ b/src/Phalcon/Annotations/Reflection.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Annotations; /** @@ -49,7 +56,7 @@ public function __construct(array $reflectionData = array()) /** * Returns the annotations found in the class docblock * - * @return bool|\Phalcon\Annotations\Collection + * @return mixed */ public function getClassAnnotations() { @@ -58,7 +65,7 @@ public function getClassAnnotations() /** * Returns the annotations found in the methods' docblocks * - * @return array|bool|\Phalcon\Annotations\Collection[] + * @return array|bool */ public function getMethodsAnnotations() { @@ -67,7 +74,7 @@ public function getMethodsAnnotations() /** * Returns the annotations found in the properties' docblocks * - * @return array|bool|\Phalcon\Annotations\Collection[] + * @return array|bool */ public function getPropertiesAnnotations() { diff --git a/src/Phalcon/application/AbstractApplication.php b/src/Phalcon/Application/AbstractApplication.php similarity index 90% rename from src/Phalcon/application/AbstractApplication.php rename to src/Phalcon/Application/AbstractApplication.php index 52f5e994..9b1a733f 100644 --- a/src/Phalcon/application/AbstractApplication.php +++ b/src/Phalcon/Application/AbstractApplication.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Application; use Phalcon\Di\DiInterface; @@ -53,7 +60,7 @@ public function getDefaultModule(): string /** * Returns the internal event manager * - * @return \Phalcon\Events\ManagerInterface + * @return ManagerInterface */ public function getEventsManager(): ManagerInterface { @@ -118,6 +125,7 @@ public function setDefaultModule(string $defaultModule): AbstractApplication * Sets the events manager * * @param \Phalcon\Events\ManagerInterface $eventsManager + * @return void */ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager) { diff --git a/src/Phalcon/Application/Exception.php b/src/Phalcon/Application/Exception.php new file mode 100644 index 00000000..dd402a69 --- /dev/null +++ b/src/Phalcon/Application/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Application; + +/** + * Exceptions thrown in Phalcon\Application class will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/assets/Asset.php b/src/Phalcon/Assets/Asset.php similarity index 95% rename from src/Phalcon/assets/Asset.php rename to src/Phalcon/Assets/Asset.php index b65b304b..59669813 100644 --- a/src/Phalcon/assets/Asset.php +++ b/src/Phalcon/Assets/Asset.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Assets; /** diff --git a/src/Phalcon/assets/asset/Css.php b/src/Phalcon/Assets/Asset/Css.php similarity index 70% rename from src/Phalcon/assets/asset/Css.php rename to src/Phalcon/Assets/Asset/Css.php index 4ee16acd..a730da27 100644 --- a/src/Phalcon/assets/asset/Css.php +++ b/src/Phalcon/Assets/Asset/Css.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Assets\Asset; /** diff --git a/src/Phalcon/assets/asset/Js.php b/src/Phalcon/Assets/Asset/Js.php similarity index 70% rename from src/Phalcon/assets/asset/Js.php rename to src/Phalcon/Assets/Asset/Js.php index 07e78f19..80c4b120 100644 --- a/src/Phalcon/assets/asset/Js.php +++ b/src/Phalcon/Assets/Asset/Js.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Assets\Asset; /** diff --git a/src/Phalcon/assets/AssetInterface.php b/src/Phalcon/Assets/AssetInterface.php similarity index 83% rename from src/Phalcon/assets/AssetInterface.php rename to src/Phalcon/Assets/AssetInterface.php index 44bbc9ea..bbc486c9 100644 --- a/src/Phalcon/assets/AssetInterface.php +++ b/src/Phalcon/Assets/AssetInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Assets; /** diff --git a/src/Phalcon/assets/Collection.php b/src/Phalcon/Assets/Collection.php similarity index 94% rename from src/Phalcon/assets/Collection.php rename to src/Phalcon/Assets/Collection.php index e81ae5af..e4fd9766 100644 --- a/src/Phalcon/assets/Collection.php +++ b/src/Phalcon/Assets/Collection.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Assets; /** @@ -233,20 +240,20 @@ public function addCss(string $path, $local = null, bool $filter = true, $attrib /** * Adds a filter to the collection * - * @param \Phalcon\Assets\FilterInterface $filter + * @param FilterInterface $filter * @return Collection */ - public function addFilter(\Phalcon\Assets\FilterInterface $filter): Collection + public function addFilter(FilterInterface $filter): Collection { } /** * Adds an inline code to the collection * - * @param \Phalcon\Assets\Inline $code + * @param Inline $code * @return Collection */ - public function addInline(\Phalcon\Assets\Inline $code): Collection + public function addInline(Inline $code): Collection { } @@ -301,7 +308,7 @@ public function count(): int /** * Returns the current asset in the iterator * - * @return \Phalcon\Assets\Asset + * @return Asset */ public function current(): Asset { @@ -371,6 +378,8 @@ public function key(): int /** * Moves the internal iteration pointer to the next position + * + * @return void */ public function next() { @@ -378,6 +387,8 @@ public function next() /** * Rewinds the internal iterator + * + * @return void */ public function rewind() { diff --git a/src/Phalcon/Assets/Exception.php b/src/Phalcon/Assets/Exception.php new file mode 100644 index 00000000..6ec2c5b5 --- /dev/null +++ b/src/Phalcon/Assets/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Assets; + +/** + * Exceptions thrown in Phalcon\Assets will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/assets/FilterInterface.php b/src/Phalcon/Assets/FilterInterface.php similarity index 58% rename from src/Phalcon/assets/FilterInterface.php rename to src/Phalcon/Assets/FilterInterface.php index f933b5ed..a93e24c8 100644 --- a/src/Phalcon/assets/FilterInterface.php +++ b/src/Phalcon/Assets/FilterInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Assets; /** diff --git a/src/Phalcon/assets/filters/Cssmin.php b/src/Phalcon/Assets/Filters/Cssmin.php similarity index 67% rename from src/Phalcon/assets/filters/Cssmin.php rename to src/Phalcon/Assets/Filters/Cssmin.php index fe03b48b..8c2698e6 100644 --- a/src/Phalcon/assets/filters/Cssmin.php +++ b/src/Phalcon/Assets/Filters/Cssmin.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Assets\Filters; /** diff --git a/src/Phalcon/assets/filters/Jsmin.php b/src/Phalcon/Assets/Filters/Jsmin.php similarity index 71% rename from src/Phalcon/assets/filters/Jsmin.php rename to src/Phalcon/Assets/Filters/Jsmin.php index 691af3bf..e0701838 100644 --- a/src/Phalcon/assets/filters/Jsmin.php +++ b/src/Phalcon/Assets/Filters/Jsmin.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Assets\Filters; /** diff --git a/src/Phalcon/assets/filters/None.php b/src/Phalcon/Assets/Filters/None.php similarity index 61% rename from src/Phalcon/assets/filters/None.php rename to src/Phalcon/Assets/Filters/None.php index 7b07ff7f..a5e19df9 100644 --- a/src/Phalcon/assets/filters/None.php +++ b/src/Phalcon/Assets/Filters/None.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Assets\Filters; /** diff --git a/src/Phalcon/assets/Inline.php b/src/Phalcon/Assets/Inline.php similarity index 89% rename from src/Phalcon/assets/Inline.php rename to src/Phalcon/Assets/Inline.php index 6cffc46d..8a76055b 100644 --- a/src/Phalcon/assets/Inline.php +++ b/src/Phalcon/Assets/Inline.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Assets; /** diff --git a/src/Phalcon/assets/inline/Css.php b/src/Phalcon/Assets/Inline/Css.php similarity index 62% rename from src/Phalcon/assets/inline/Css.php rename to src/Phalcon/Assets/Inline/Css.php index ed9f6c35..2353cd4e 100644 --- a/src/Phalcon/assets/inline/Css.php +++ b/src/Phalcon/Assets/Inline/Css.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Assets\Inline; /** diff --git a/src/Phalcon/assets/inline/Js.php b/src/Phalcon/Assets/Inline/Js.php similarity index 63% rename from src/Phalcon/assets/inline/Js.php rename to src/Phalcon/Assets/Inline/Js.php index 3606be6b..1ec6fd4e 100644 --- a/src/Phalcon/assets/inline/Js.php +++ b/src/Phalcon/Assets/Inline/Js.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Assets\Inline; /** diff --git a/src/Phalcon/assets/Manager.php b/src/Phalcon/Assets/Manager.php similarity index 86% rename from src/Phalcon/assets/Manager.php rename to src/Phalcon/Assets/Manager.php index e618f536..9386ec9a 100644 --- a/src/Phalcon/assets/Manager.php +++ b/src/Phalcon/Assets/Manager.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Assets; use Phalcon\Di\AbstractInjectionAware; @@ -45,10 +52,10 @@ public function __construct(array $options = array()) * ); * ``` * - * @param \Phalcon\Assets\Asset $asset + * @param Asset $asset * @return Manager */ - public function addAsset(\Phalcon\Assets\Asset $asset): Manager + public function addAsset(Asset $asset): Manager { } @@ -63,10 +70,10 @@ public function addAsset(\Phalcon\Assets\Asset $asset): Manager * ``` * * @param string $type - * @param \Phalcon\Assets\Asset $asset + * @param Asset $asset * @return Manager */ - public function addAssetByType(string $type, \Phalcon\Assets\Asset $asset): Manager + public function addAssetByType(string $type, Asset $asset): Manager { } @@ -159,7 +166,7 @@ public function addJs(string $path, $local = true, bool $filter = true, $attribu * Creates/Returns a collection of assets * * @param string $name - * @return \Phalcon\Assets\Collection + * @return Collection */ public function collection(string $name): Collection { @@ -201,7 +208,7 @@ public function exists(string $id): bool * ``` * * @param string $id - * @return \Phalcon\Assets\Collection + * @return Collection */ public function get(string $id): Collection { @@ -210,7 +217,7 @@ public function get(string $id): Collection /** * Returns existing collections in the manager * - * @return array|\Phalcon\Assets\Collection[] + * @return array */ public function getCollections(): array { @@ -219,7 +226,7 @@ public function getCollections(): array /** * Returns the CSS collection of assets * - * @return \Phalcon\Assets\Collection + * @return Collection */ public function getCss(): Collection { @@ -228,7 +235,7 @@ public function getCss(): Collection /** * Returns the CSS collection of assets * - * @return \Phalcon\Assets\Collection + * @return Collection */ public function getJs(): Collection { @@ -248,10 +255,10 @@ public function getOptions(): array * * @param callback $callback * @param string $type - * @param \Phalcon\Assets\Collection $collection + * @param Collection $collection * @return string|null */ - public function output(\Phalcon\Assets\Collection $collection, $callback, $type): ?string + public function output(Collection $collection, $callback, $type): ?string { } @@ -269,10 +276,10 @@ public function outputCss(string $collectionName = null): string * Traverses a collection and generate its HTML * * @param string $type - * @param \Phalcon\Assets\Collection $collection + * @param Collection $collection * @return string */ - public function outputInline(\Phalcon\Assets\Collection $collection, $type): string + public function outputInline(Collection $collection, $type): string { } @@ -314,10 +321,10 @@ public function outputJs(string $collectionName = null): string * ``` * * @param string $id - * @param \Phalcon\Assets\Collection $collection + * @param Collection $collection * @return Manager */ - public function set(string $id, \Phalcon\Assets\Collection $collection): Manager + public function set(string $id, Collection $collection): Manager { } @@ -344,11 +351,11 @@ public function useImplicitOutput(bool $implicitOutput): Manager /** * Returns the prefixed path * - * @param \Phalcon\Assets\Collection $collection + * @param Collection $collection * @param string $path * @return string */ - private function getPrefixedPath(\Phalcon\Assets\Collection $collection, string $path): string + private function getPrefixedPath(Collection $collection, string $path): string { } } diff --git a/src/Phalcon/Cache.php b/src/Phalcon/Cache.php index 40cd8611..cf660ec4 100644 --- a/src/Phalcon/Cache.php +++ b/src/Phalcon/Cache.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; use Phalcon\Cache\Adapter\AdapterInterface; @@ -23,7 +30,7 @@ class Cache implements \Psr\SimpleCache\CacheInterface /** * The adapter * - * @return AdapterInterface + * @return mixed */ public function getAdapter() { @@ -76,8 +83,8 @@ public function deleteMultiple($keys): bool /** * Fetches a value from the cache. * - * @param string $key The unique key of this item in the cache. - * @param mixed $defaultValue Default value to return if the key does not exist. + * @param string $key The unique key of this item in the cache. + * @param mixed $defaultValue Default value to return if the key does not exist. * * @return mixed The value of the item from the cache, or $default in case of cache miss. * @@ -90,8 +97,8 @@ public function get($key, $defaultValue = null) /** * Obtains multiple cache items by their unique keys. * - * @param iterable $keys A list of keys that can obtained in a single operation. - * @param mixed $defaultValue Default value to return for keys that do not exist. + * @param iterable $keys A list of keys that can obtained in a single operation. + * @param mixed $defaultValue Default value to return for keys that do not exist. * * @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value. * @@ -117,9 +124,9 @@ public function has($key): bool /** * Persists data in the cache, uniquely referenced by a key with an optional expiration TTL time. * - * @param string $key The key of the item to store. - * @param mixed $value The value of the item to store. Must be serializable. - * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and + * @param string $key The key of the item to store. + * @param mixed $value The value of the item to store. Must be serializable. + * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and * the driver supports TTL then the library may set a default value * for it or let the driver take care of that. * @@ -134,8 +141,8 @@ public function set($key, $value, $ttl = null): bool /** * Persists a set of key => value pairs in the cache, with an optional TTL. * - * @param iterable $values A list of key => value pairs for a multiple-set operation. - * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and + * @param iterable $values A list of key => value pairs for a multiple-set operation. + * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and * the driver supports TTL then the library may set a default value * for it or let the driver take care of that. * @@ -151,6 +158,7 @@ public function setMultiple($values, $ttl = null): bool * Checks the key. If it contains invalid characters an exception is thrown * * @param mixed $key + * @return void */ protected function checkKey($key) { @@ -160,6 +168,7 @@ protected function checkKey($key) * Checks the key. If it contains invalid characters an exception is thrown * * @param mixed $keys + * @return void */ protected function checkKeys($keys) { diff --git a/src/Phalcon/Cache/Adapter/AdapterInterface.php b/src/Phalcon/Cache/Adapter/AdapterInterface.php new file mode 100644 index 00000000..d22f7ece --- /dev/null +++ b/src/Phalcon/Cache/Adapter/AdapterInterface.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Cache\Adapter; + +use Phalcon\Storage\Adapter\AdapterInterface as StorageAdapterInterface; + +/** + * Interface for Phalcon\Cache adapters + */ +interface AdapterInterface extends StorageAdapterInterface +{ + +} diff --git a/src/Phalcon/Cache/Adapter/Apcu.php b/src/Phalcon/Cache/Adapter/Apcu.php new file mode 100644 index 00000000..01481ad0 --- /dev/null +++ b/src/Phalcon/Cache/Adapter/Apcu.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Cache\Adapter; + +use Phalcon\Cache\Adapter\AdapterInterface as CacheAdapterInterface; + +/** + * Apcu adapter + */ +class Apcu extends \Phalcon\Storage\Adapter\Apcu implements CacheAdapterInterface +{ + +} diff --git a/src/Phalcon/Cache/Adapter/Libmemcached.php b/src/Phalcon/Cache/Adapter/Libmemcached.php new file mode 100644 index 00000000..43526134 --- /dev/null +++ b/src/Phalcon/Cache/Adapter/Libmemcached.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Cache\Adapter; + +use Phalcon\Cache\Adapter\AdapterInterface as CacheAdapterInterface; + +/** + * Libmemcached adapter + */ +class Libmemcached extends \Phalcon\Storage\Adapter\Libmemcached implements CacheAdapterInterface +{ + +} diff --git a/src/Phalcon/Cache/Adapter/Memory.php b/src/Phalcon/Cache/Adapter/Memory.php new file mode 100644 index 00000000..4cbe2d5e --- /dev/null +++ b/src/Phalcon/Cache/Adapter/Memory.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Cache\Adapter; + +use Phalcon\Cache\Adapter\AdapterInterface as CacheAdapterInterface; + +/** + * Memory adapter + */ +class Memory extends \Phalcon\Storage\Adapter\Memory implements CacheAdapterInterface +{ + +} diff --git a/src/Phalcon/Cache/Adapter/Redis.php b/src/Phalcon/Cache/Adapter/Redis.php new file mode 100644 index 00000000..c3c8ce7a --- /dev/null +++ b/src/Phalcon/Cache/Adapter/Redis.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Cache\Adapter; + +use Phalcon\Cache\Adapter\AdapterInterface as CacheAdapterInterface; + +/** + * Redis adapter + */ +class Redis extends \Phalcon\Storage\Adapter\Redis implements CacheAdapterInterface +{ + +} diff --git a/src/Phalcon/Cache/Adapter/Stream.php b/src/Phalcon/Cache/Adapter/Stream.php new file mode 100644 index 00000000..7002ae87 --- /dev/null +++ b/src/Phalcon/Cache/Adapter/Stream.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Cache\Adapter; + +use Phalcon\Cache\Adapter\AdapterInterface as CacheAdapterInterface; + +/** + * Stream adapter + */ +class Stream extends \Phalcon\Storage\Adapter\Stream implements CacheAdapterInterface +{ + +} diff --git a/src/Phalcon/cache/AdapterFactory.php b/src/Phalcon/Cache/AdapterFactory.php similarity index 78% rename from src/Phalcon/cache/AdapterFactory.php rename to src/Phalcon/Cache/AdapterFactory.php index 04895e44..baee1b7e 100644 --- a/src/Phalcon/cache/AdapterFactory.php +++ b/src/Phalcon/Cache/AdapterFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Cache; use Phalcon\Cache\Adapter\AdapterInterface; @@ -32,7 +39,7 @@ public function __construct(\Phalcon\Storage\SerializerFactory $factory = null, * * @param string $name * @param array $options - * @return \Phalcon\Cache\Adapter\AdapterInterface + * @return AdapterInterface */ public function newInstance(string $name, array $options = array()): AdapterInterface { diff --git a/src/Phalcon/cache/CacheFactory.php b/src/Phalcon/Cache/CacheFactory.php similarity index 65% rename from src/Phalcon/cache/CacheFactory.php rename to src/Phalcon/Cache/CacheFactory.php index 27f02fc5..794af9f5 100644 --- a/src/Phalcon/cache/CacheFactory.php +++ b/src/Phalcon/Cache/CacheFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Cache; use Psr\SimpleCache\CacheInterface; @@ -18,9 +25,9 @@ class CacheFactory /** * Constructor * - * @param \Phalcon\Cache\AdapterFactory $factory + * @param AdapterFactory $factory */ - public function __construct(\Phalcon\Cache\AdapterFactory $factory) + public function __construct(AdapterFactory $factory) { } @@ -39,7 +46,7 @@ public function load($config) * * @param string $name * @param array $options - * @return \Psr\SimpleCache\CacheInterface + * @return CacheInterface */ public function newInstance(string $name, array $options = array()): CacheInterface { diff --git a/src/Phalcon/Cache/Exception/Exception.php b/src/Phalcon/Cache/Exception/Exception.php new file mode 100644 index 00000000..d8df7b13 --- /dev/null +++ b/src/Phalcon/Cache/Exception/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Cache\Exception; + +/** + * Exceptions thrown in Phalcon\Cache will use this class + */ +class Exception extends \Phalcon\Exception implements \Psr\SimpleCache\CacheException +{ + +} diff --git a/src/Phalcon/Cache/Exception/InvalidArgumentException.php b/src/Phalcon/Cache/Exception/InvalidArgumentException.php new file mode 100644 index 00000000..fead573d --- /dev/null +++ b/src/Phalcon/Cache/Exception/InvalidArgumentException.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Cache\Exception; + +/** + * Exceptions thrown in Phalcon\Cache will use this class + */ +class InvalidArgumentException extends \Phalcon\Exception implements \Psr\SimpleCache\InvalidArgumentException +{ + +} diff --git a/src/Phalcon/cli/Console.php b/src/Phalcon/Cli/Console.php similarity index 77% rename from src/Phalcon/cli/Console.php rename to src/Phalcon/Cli/Console.php index 82bfad9a..b0b15ca9 100644 --- a/src/Phalcon/cli/Console.php +++ b/src/Phalcon/Cli/Console.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Cli; use Phalcon\Application\AbstractApplication; diff --git a/src/Phalcon/Cli/Console/Exception.php b/src/Phalcon/Cli/Console/Exception.php new file mode 100644 index 00000000..6cbea0f4 --- /dev/null +++ b/src/Phalcon/Cli/Console/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Cli\Console; + +/** + * Exceptions thrown in Phalcon\Cli\Console will use this class + */ +class Exception extends \Phalcon\Application\Exception +{ + +} diff --git a/src/Phalcon/cli/Dispatcher.php b/src/Phalcon/Cli/Dispatcher.php similarity index 89% rename from src/Phalcon/cli/Dispatcher.php rename to src/Phalcon/Cli/Dispatcher.php index 47179b40..aa31c964 100644 --- a/src/Phalcon/cli/Dispatcher.php +++ b/src/Phalcon/Cli/Dispatcher.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Cli; /** @@ -80,9 +87,9 @@ public function getLastTask(): TaskInterface /** * Gets an option by its name or numeric index * - * @param mixed $option - * @param string|array $filters - * @param mixed $defaultValue + * @param mixed $option + * @param string|array $filters + * @param mixed $defaultValue * @return mixed */ public function getOption($option, $filters = null, $defaultValue = null) @@ -130,6 +137,7 @@ public function hasOption($option): bool * Sets the default task name * * @param string $taskName + * @return void */ public function setDefaultTask(string $taskName) { @@ -139,6 +147,7 @@ public function setDefaultTask(string $taskName) * Set the options to be dispatched * * @param array $options + * @return void */ public function setOptions(array $options) { @@ -148,6 +157,7 @@ public function setOptions(array $options) * Sets the task name to be dispatched * * @param string $taskName + * @return void */ public function setTaskName(string $taskName) { @@ -157,6 +167,7 @@ public function setTaskName(string $taskName) * Sets the default task suffix * * @param string $taskSuffix + * @return void */ public function setTaskSuffix(string $taskSuffix) { diff --git a/src/Phalcon/Cli/Dispatcher/Exception.php b/src/Phalcon/Cli/Dispatcher/Exception.php new file mode 100644 index 00000000..592e140f --- /dev/null +++ b/src/Phalcon/Cli/Dispatcher/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Cli\Dispatcher; + +/** + * Exceptions thrown in Phalcon\Cli\Dispatcher will use this class + */ +class Exception extends \Phalcon\Dispatcher\Exception +{ + +} diff --git a/src/Phalcon/cli/DispatcherInterface.php b/src/Phalcon/Cli/DispatcherInterface.php similarity index 75% rename from src/Phalcon/cli/DispatcherInterface.php rename to src/Phalcon/Cli/DispatcherInterface.php index 58ca9c1f..f4f6c0f5 100644 --- a/src/Phalcon/cli/DispatcherInterface.php +++ b/src/Phalcon/Cli/DispatcherInterface.php @@ -1,11 +1,20 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Cli; +use Phalcon\Dispatcher\DispatcherInterface as DispatcherInterfaceBase; + /** * Interface for Phalcon\Cli\Dispatcher */ -interface DispatcherInterface extends \Phalcon\Dispatcher\DispatcherInterface +interface DispatcherInterface extends DispatcherInterfaceBase { /** @@ -47,6 +56,7 @@ public function getTaskSuffix(): string; * Sets the default task name * * @param string $taskName + * @return void */ public function setDefaultTask(string $taskName); @@ -54,6 +64,7 @@ public function setDefaultTask(string $taskName); * Set the options to be dispatched * * @param array $options + * @return void */ public function setOptions(array $options); @@ -61,6 +72,7 @@ public function setOptions(array $options); * Sets the task name to be dispatched * * @param string $taskName + * @return void */ public function setTaskName(string $taskName); @@ -68,6 +80,7 @@ public function setTaskName(string $taskName); * Sets the default task suffix * * @param string $taskSuffix + * @return void */ public function setTaskSuffix(string $taskSuffix); } diff --git a/src/Phalcon/cli/Router.php b/src/Phalcon/Cli/Router.php similarity index 91% rename from src/Phalcon/cli/Router.php rename to src/Phalcon/Cli/Router.php index a6956eff..861414e1 100644 --- a/src/Phalcon/cli/Router.php +++ b/src/Phalcon/Cli/Router.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Cli; use Phalcon\Cli\Router\RouteInterface; @@ -86,7 +93,7 @@ public function __construct(bool $defaultRoutes = true) * * @param string|array $paths * @param string $pattern - * @return \Phalcon\Cli\Router\RouteInterface + * @return RouteInterface */ public function add(string $pattern, $paths = null): RouteInterface { @@ -104,7 +111,7 @@ public function getActionName(): string /** * Returns the route that matches the handled URI * - * @return \Phalcon\Cli\Router\RouteInterface + * @return RouteInterface */ public function getMatchedRoute(): RouteInterface { @@ -141,7 +148,7 @@ public function getParams(): array * Returns a route object by its id * * @param int $id - * @return bool|\Phalcon\Cli\Router\RouteInterface + * @return mixed */ public function getRouteById($id) { @@ -151,7 +158,7 @@ public function getRouteById($id) * Returns a route object by its name * * @param string $name - * @return bool|\Phalcon\Cli\Router\RouteInterface + * @return mixed */ public function getRouteByName(string $name) { @@ -160,7 +167,7 @@ public function getRouteByName(string $name) /** * Returns all the routes defined in the router * - * @return array|\Phalcon\Cli\Router\Route[] + * @return array */ public function getRoutes(): array { @@ -227,6 +234,7 @@ public function setDefaults(array $defaults): Router * Sets the default controller name * * @param string $taskName + * @return void */ public function setDefaultTask(string $taskName) { diff --git a/src/Phalcon/Cli/Router/Exception.php b/src/Phalcon/Cli/Router/Exception.php new file mode 100644 index 00000000..4b4bc526 --- /dev/null +++ b/src/Phalcon/Cli/Router/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Cli\Router; + +/** + * Exceptions thrown in Phalcon\Cli\Router will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/cli/router/Route.php b/src/Phalcon/Cli/Router/Route.php similarity index 90% rename from src/Phalcon/cli/router/Route.php rename to src/Phalcon/Cli/Router/Route.php index 8ff80394..eb98027e 100644 --- a/src/Phalcon/cli/router/Route.php +++ b/src/Phalcon/Cli/Router/Route.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Cli\Router; /** @@ -58,7 +65,7 @@ public function __construct(string $pattern, $paths = null) * If the callback returns false the route is treated as not matched * * @param callback $callback - * @return \Phalcon\Cli\Router\RouteInterface + * @return RouteInterface */ public function beforeMatch($callback): RouteInterface { @@ -81,7 +88,7 @@ public function compilePattern(string $pattern): string * * @param callable $converter * @param string $name - * @return \Phalcon\Cli\Router\RouteInterface + * @return RouteInterface */ public function convert(string $name, $converter): RouteInterface { @@ -91,6 +98,7 @@ public function convert(string $name, $converter): RouteInterface * Set the routing delimiter * * @param string $delimiter + * @return void */ public static function delimiter(string $delimiter = null) { @@ -201,6 +209,7 @@ public function getRouteId(): string * * @param array|string $paths * @param string $pattern + * @return void */ public function reConfigure(string $pattern, $paths = null) { @@ -208,6 +217,8 @@ public function reConfigure(string $pattern, $paths = null) /** * Resets the internal route id generator + * + * @return void */ public static function reset() { @@ -217,7 +228,7 @@ public static function reset() * Sets the route's description * * @param string $description - * @return \Phalcon\Cli\Router\RouteInterface + * @return RouteInterface */ public function setDescription(string $description): RouteInterface { @@ -236,7 +247,7 @@ public function setDescription(string $description): RouteInterface * ``` * * @param string $name - * @return \Phalcon\Cli\Router\RouteInterface + * @return RouteInterface */ public function setName(string $name): RouteInterface { diff --git a/src/Phalcon/cli/router/RouteInterface.php b/src/Phalcon/Cli/Router/RouteInterface.php similarity index 88% rename from src/Phalcon/cli/router/RouteInterface.php rename to src/Phalcon/Cli/Router/RouteInterface.php index f87e2b98..de7f9f28 100644 --- a/src/Phalcon/cli/router/RouteInterface.php +++ b/src/Phalcon/Cli/Router/RouteInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Cli\Router; /** @@ -85,11 +92,14 @@ public function getRouteId(): string; * * @param string $pattern * @param mixed $paths + * @return void */ public function reConfigure(string $pattern, $paths = null); /** * Resets the internal route id generator + * + * @return void */ public static function reset(); diff --git a/src/Phalcon/cli/RouterInterface.php b/src/Phalcon/Cli/RouterInterface.php similarity index 84% rename from src/Phalcon/cli/RouterInterface.php rename to src/Phalcon/Cli/RouterInterface.php index 5f2f0ba6..7c6c9571 100644 --- a/src/Phalcon/cli/RouterInterface.php +++ b/src/Phalcon/Cli/RouterInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Cli; use Phalcon\Cli\Router\RouteInterface; @@ -15,7 +22,7 @@ interface RouterInterface * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Cli\Router\RouteInterface + * @return RouteInterface */ public function add(string $pattern, $paths = null): RouteInterface; @@ -29,7 +36,7 @@ public function getActionName(): string; /** * Returns the route that matches the handled URI * - * @return \Phalcon\Cli\Router\RouteInterface + * @return RouteInterface */ public function getMatchedRoute(): RouteInterface; @@ -58,7 +65,7 @@ public function getParams(): array; * Returns a route object by its id * * @param mixed $id - * @return \Phalcon\Cli\Router\RouteInterface + * @return RouteInterface */ public function getRouteById($id): RouteInterface; @@ -66,14 +73,14 @@ public function getRouteById($id): RouteInterface; * Returns a route object by its name * * @param string $name - * @return \Phalcon\Cli\Router\RouteInterface + * @return RouteInterface */ public function getRouteByName(string $name): RouteInterface; /** * Return all the routes defined in the router * - * @return array|\Phalcon\Cli\Router\RouteInterface[] + * @return array */ public function getRoutes(): array; @@ -95,6 +102,7 @@ public function handle($arguments = null); * Sets the default action name * * @param string $actionName + * @return void */ public function setDefaultAction(string $actionName); @@ -102,6 +110,7 @@ public function setDefaultAction(string $actionName); * Sets the name of the default module * * @param string $moduleName + * @return void */ public function setDefaultModule(string $moduleName); @@ -109,6 +118,7 @@ public function setDefaultModule(string $moduleName); * Sets an array of default paths * * @param array $defaults + * @return void */ public function setDefaults(array $defaults); @@ -116,6 +126,7 @@ public function setDefaults(array $defaults); * Sets the default task name * * @param string $taskName + * @return void */ public function setDefaultTask(string $taskName); diff --git a/src/Phalcon/cli/Task.php b/src/Phalcon/Cli/Task.php similarity index 82% rename from src/Phalcon/cli/Task.php rename to src/Phalcon/Cli/Task.php index 8fe41590..02010ee6 100644 --- a/src/Phalcon/cli/Task.php +++ b/src/Phalcon/Cli/Task.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Cli; use Phalcon\Di\Injectable; @@ -45,7 +52,7 @@ final public function __construct() /** * Returns the internal event manager * - * @return null|\Phalcon\Events\ManagerInterface + * @return mixed */ public function getEventsManager(): ?ManagerInterface { @@ -55,6 +62,7 @@ public function getEventsManager(): ?ManagerInterface * Sets the events manager * * @param \Phalcon\Events\ManagerInterface $eventsManager + * @return void */ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager) { diff --git a/src/Phalcon/Cli/TaskInterface.php b/src/Phalcon/Cli/TaskInterface.php new file mode 100644 index 00000000..9b469f64 --- /dev/null +++ b/src/Phalcon/Cli/TaskInterface.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Cli; + +/** + * Interface for task handlers + */ +interface TaskInterface +{ + +} diff --git a/src/Phalcon/Collection.php b/src/Phalcon/Collection.php index 0047e935..0c8dd5af 100644 --- a/src/Phalcon/Collection.php +++ b/src/Phalcon/Collection.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; use Traversable; @@ -69,6 +76,7 @@ public function __isset(string $element): bool * * @param string $element * @param mixed $value + * @return void */ public function __set(string $element, $value) { @@ -78,6 +86,7 @@ public function __set(string $element, $value) * Magic unset to remove an element from the collection * * @param string $element + * @return void */ public function __unset(string $element) { @@ -85,6 +94,8 @@ public function __unset(string $element) /** * Clears the internal collection + * + * @return void */ public function clear() { @@ -115,12 +126,27 @@ public function get(string $element, $defaultValue = null, string $cast = null) /** * Returns the iterator of the class * - * @return \Traversable + * @return Traversable */ public function getIterator(): Traversable { } + /** + * @param bool $insensitive + * @return array + */ + public function getKeys(bool $insensitive = true): array + { + } + + /** + * @return array + */ + public function getValues(): array + { + } + /** * Get the element from the collection * @@ -135,6 +161,7 @@ public function has(string $element): bool * Initialize internal array * * @param array $data + * @return void */ public function init(array $data = array()) { @@ -177,6 +204,7 @@ public function offsetGet($element) * * @param mixed $element * @param mixed $value + * @return void */ public function offsetSet($element, $value) { @@ -187,6 +215,7 @@ public function offsetSet($element, $value) * See [offsetUnset](https://php.net/manual/en/arrayaccess.offsetunset.php) * * @param mixed $element + * @return void */ public function offsetUnset($element) { @@ -196,6 +225,7 @@ public function offsetUnset($element) * Delete the element from the collection * * @param string $element + * @return void */ public function remove(string $element) { @@ -206,6 +236,7 @@ public function remove(string $element) * * @param string $element * @param mixed $value + * @return void */ public function set(string $element, $value) { @@ -252,6 +283,7 @@ public function toJson(int $options = 79): string * See [unserialize](https://php.net/manual/en/serializable.unserialize.php) * * @param mixed $serialized + * @return void */ public function unserialize($serialized) { @@ -262,6 +294,7 @@ public function unserialize($serialized) * * @param string $element * @param mixed $value + * @return void */ protected function setData(string $element, $value) { diff --git a/src/Phalcon/Collection/Exception.php b/src/Phalcon/Collection/Exception.php new file mode 100644 index 00000000..5b84c7ed --- /dev/null +++ b/src/Phalcon/Collection/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Collection; + +/** + * Exceptions for the Collection object + */ +class Exception extends \Phalcon\Exception implements \Throwable +{ + +} diff --git a/src/Phalcon/collection/ReadOnly.php b/src/Phalcon/Collection/ReadOnly.php similarity index 65% rename from src/Phalcon/collection/ReadOnly.php rename to src/Phalcon/Collection/ReadOnly.php index d5709a3c..28ca4011 100644 --- a/src/Phalcon/collection/ReadOnly.php +++ b/src/Phalcon/Collection/ReadOnly.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Collection; use Phalcon\Collection; @@ -14,6 +21,7 @@ class ReadOnly extends Collection * Delete the element from the collection * * @param string $element + * @return void */ public function remove(string $element) { @@ -24,6 +32,7 @@ public function remove(string $element) * * @param string $element * @param mixed $value + * @return void */ public function set(string $element, $value) { diff --git a/src/Phalcon/Config.php b/src/Phalcon/Config.php index aef376b8..6339dff4 100644 --- a/src/Phalcon/Config.php +++ b/src/Phalcon/Config.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; /** @@ -125,6 +132,7 @@ final protected function internalMerge(array $source, array $target): array * * @param mixed $element * @param mixed $value + * @return void */ protected function setData($element, $value) { diff --git a/src/Phalcon/config/adapter/Grouped.php b/src/Phalcon/Config/Adapter/Grouped.php similarity index 85% rename from src/Phalcon/config/adapter/Grouped.php rename to src/Phalcon/Config/Adapter/Grouped.php index 46564c81..23fb326f 100644 --- a/src/Phalcon/config/adapter/Grouped.php +++ b/src/Phalcon/Config/Adapter/Grouped.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Config\Adapter; use Phalcon\Config; diff --git a/src/Phalcon/config/adapter/Ini.php b/src/Phalcon/Config/Adapter/Ini.php similarity index 88% rename from src/Phalcon/config/adapter/Ini.php rename to src/Phalcon/Config/Adapter/Ini.php index 79a0f125..2d94f022 100644 --- a/src/Phalcon/config/adapter/Ini.php +++ b/src/Phalcon/Config/Adapter/Ini.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Config\Adapter; use Phalcon\Config; diff --git a/src/Phalcon/config/adapter/Json.php b/src/Phalcon/Config/Adapter/Json.php similarity index 75% rename from src/Phalcon/config/adapter/Json.php rename to src/Phalcon/Config/Adapter/Json.php index b2df23b3..4c4b1e3f 100644 --- a/src/Phalcon/config/adapter/Json.php +++ b/src/Phalcon/Config/Adapter/Json.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Config\Adapter; use Phalcon\Config; diff --git a/src/Phalcon/config/adapter/Php.php b/src/Phalcon/Config/Adapter/Php.php similarity index 81% rename from src/Phalcon/config/adapter/Php.php rename to src/Phalcon/Config/Adapter/Php.php index c1e91821..30ee68a9 100644 --- a/src/Phalcon/config/adapter/Php.php +++ b/src/Phalcon/Config/Adapter/Php.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Config\Adapter; use Phalcon\Config; diff --git a/src/Phalcon/config/adapter/Yaml.php b/src/Phalcon/Config/Adapter/Yaml.php similarity index 81% rename from src/Phalcon/config/adapter/Yaml.php rename to src/Phalcon/Config/Adapter/Yaml.php index f545b2a2..b4713fba 100644 --- a/src/Phalcon/config/adapter/Yaml.php +++ b/src/Phalcon/Config/Adapter/Yaml.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Config\Adapter; use Phalcon\Config; diff --git a/src/Phalcon/config/ConfigFactory.php b/src/Phalcon/Config/ConfigFactory.php similarity index 83% rename from src/Phalcon/config/ConfigFactory.php rename to src/Phalcon/Config/ConfigFactory.php index c26fcb48..be130d32 100644 --- a/src/Phalcon/config/ConfigFactory.php +++ b/src/Phalcon/Config/ConfigFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Config; use Phalcon\Factory\AbstractFactory; diff --git a/src/Phalcon/Config/Exception.php b/src/Phalcon/Config/Exception.php new file mode 100644 index 00000000..64615c1c --- /dev/null +++ b/src/Phalcon/Config/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Config; + +/** + * Exceptions thrown in Phalcon\Config will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/Container.php b/src/Phalcon/Container.php index 45d76bd2..fe533a3c 100644 --- a/src/Phalcon/Container.php +++ b/src/Phalcon/Container.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; use Phalcon\Di\DiInterface; diff --git a/src/Phalcon/Crypt.php b/src/Phalcon/Crypt.php index ba879ba2..add83cf9 100644 --- a/src/Phalcon/Crypt.php +++ b/src/Phalcon/Crypt.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; use Phalcon\Crypt\CryptInterface; @@ -156,11 +163,11 @@ public function decrypt(string $text, string $key = null): string /** * Decrypt a text that is coded as a base64 string. * + * @throws \Phalcon\Crypt\Mismatch * @param string $text * @param mixed $key * @param bool $safe * @return string - * @throws \Phalcon\Crypt\Mismatch */ public function decryptBase64(string $text, $key = null, bool $safe = false): string { @@ -243,7 +250,7 @@ public function getKey(): string /** * @param string $tag - * @return \Phalcon\Crypt\CryptInterface + * @return CryptInterface */ public function setAuthTag(string $tag): CryptInterface { @@ -251,7 +258,7 @@ public function setAuthTag(string $tag): CryptInterface /** * @param string $data - * @return \Phalcon\Crypt\CryptInterface + * @return CryptInterface */ public function setAuthData(string $data): CryptInterface { @@ -259,7 +266,7 @@ public function setAuthData(string $data): CryptInterface /** * @param int $length - * @return \Phalcon\Crypt\CryptInterface + * @return CryptInterface */ public function setAuthTagLength(int $length): CryptInterface { @@ -275,7 +282,7 @@ public function setAuthTagLength(int $length): CryptInterface * algorithm for current openssl library version. * * @param string $cipher - * @return \Phalcon\Crypt\CryptInterface + * @return CryptInterface */ public function setCipher(string $cipher): CryptInterface { @@ -284,9 +291,9 @@ public function setCipher(string $cipher): CryptInterface /** * Set the name of hashing algorithm. * - * @param string $hashAlgo - * @return \Phalcon\Crypt\CryptInterface * @throws \Phalcon\Crypt\Exception + * @param string $hashAlgo + * @return CryptInterface */ public function setHashAlgo(string $hashAlgo): CryptInterface { @@ -308,7 +315,7 @@ public function setHashAlgo(string $hashAlgo): CryptInterface * "T4\xb1\x8d\xa9\x98\x05\\\x8c\xbe\x1d\x07&[\x99\x18\xa4~Lc1\xbeW\xb3" * * @param string $key - * @return \Phalcon\Crypt\CryptInterface + * @return CryptInterface */ public function setKey(string $key): CryptInterface { @@ -318,7 +325,7 @@ public function setKey(string $key): CryptInterface * Changes the padding scheme used. * * @param int $scheme - * @return \Phalcon\Crypt\CryptInterface + * @return CryptInterface */ public function setPadding(int $scheme): CryptInterface { @@ -328,7 +335,7 @@ public function setPadding(int $scheme): CryptInterface * Sets if the calculating message digest must used. * * @param bool $useSigning - * @return \Phalcon\Crypt\CryptInterface + * @return CryptInterface */ public function useSigning(bool $useSigning): CryptInterface { @@ -338,6 +345,7 @@ public function useSigning(bool $useSigning): CryptInterface * Assert the cipher is available. * * @param string $cipher + * @return void */ protected function assertCipherIsAvailable(string $cipher) { @@ -347,6 +355,7 @@ protected function assertCipherIsAvailable(string $cipher) * Assert the hash algorithm is available. * * @param string $hashAlgo + * @return void */ protected function assertHashAlgorithmAvailable(string $hashAlgo) { @@ -364,6 +373,8 @@ protected function getIvLength(string $cipher): int /** * Initialize available cipher algorithms. + * + * @return void */ protected function initializeAvailableCiphers() { diff --git a/src/Phalcon/crypt/CryptInterface.php b/src/Phalcon/Crypt/CryptInterface.php similarity index 92% rename from src/Phalcon/crypt/CryptInterface.php rename to src/Phalcon/Crypt/CryptInterface.php index 7248875f..d33f3ddc 100644 --- a/src/Phalcon/crypt/CryptInterface.php +++ b/src/Phalcon/Crypt/CryptInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Crypt; /** diff --git a/src/Phalcon/Crypt/Exception.php b/src/Phalcon/Crypt/Exception.php new file mode 100644 index 00000000..c3b74384 --- /dev/null +++ b/src/Phalcon/Crypt/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Crypt; + +/** + * Exceptions thrown in Phalcon\Crypt use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/Crypt/Mismatch.php b/src/Phalcon/Crypt/Mismatch.php new file mode 100644 index 00000000..e747b732 --- /dev/null +++ b/src/Phalcon/Crypt/Mismatch.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Crypt; + +/** + * Exceptions thrown in Phalcon\Crypt will use this class. + */ +class Mismatch extends \Phalcon\Crypt\Exception +{ + +} diff --git a/src/Phalcon/db/AbstractDb.php b/src/Phalcon/Db/AbstractDb.php similarity index 85% rename from src/Phalcon/db/AbstractDb.php rename to src/Phalcon/Db/AbstractDb.php index d99eee40..7ee0ca46 100644 --- a/src/Phalcon/db/AbstractDb.php +++ b/src/Phalcon/Db/AbstractDb.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db; /** @@ -52,6 +59,7 @@ abstract class AbstractDb * Enables/disables options in the Database component * * @param array $options + * @return void */ public static function setup(array $options) { diff --git a/src/Phalcon/db/adapter/AbstractAdapter.php b/src/Phalcon/Db/Adapter/AbstractAdapter.php similarity index 97% rename from src/Phalcon/db/adapter/AbstractAdapter.php rename to src/Phalcon/Db/Adapter/AbstractAdapter.php index f4891771..d09a00f4 100644 --- a/src/Phalcon/db/adapter/AbstractAdapter.php +++ b/src/Phalcon/Db/Adapter/AbstractAdapter.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db\Adapter; use Phalcon\Db\DialectInterface; @@ -240,7 +247,7 @@ public function delete($table, $whereCondition = null, $placeholders = null, $da * * @param string $table * @param string $schema - * @return array|\Phalcon\Db\IndexInterface[] + * @return array */ public function describeIndexes(string $table, string $schema = null): array { @@ -257,7 +264,7 @@ public function describeIndexes(string $table, string $schema = null): array * * @param string $table * @param string $schema - * @return array|\Phalcon\Db\ReferenceInterface[] + * @return array */ public function describeReferences(string $table, string $schema = null): array { @@ -504,7 +511,7 @@ public function getConnectionId(): string * ); * ``` * - * @return \Phalcon\Db\RawValue + * @return RawValue */ public function getDefaultIdValue(): RawValue { @@ -529,7 +536,7 @@ public function getDefaultIdValue(): RawValue * ); * ``` * - * @return \Phalcon\Db\RawValue + * @return RawValue */ public function getDefaultValue(): RawValue { @@ -547,7 +554,7 @@ public function getDescriptor(): array /** * Returns internal dialect instance * - * @return \Phalcon\Db\DialectInterface + * @return DialectInterface */ public function getDialect(): DialectInterface { @@ -556,7 +563,7 @@ public function getDialect(): DialectInterface /** * Returns the internal event manager * - * @return \Phalcon\Events\ManagerInterface + * @return ManagerInterface */ public function getEventsManager(): ManagerInterface { @@ -742,6 +749,7 @@ public function rollbackSavepoint(string $name): bool * Sets the event manager * * @param \Phalcon\Events\ManagerInterface $eventsManager + * @return void */ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager) { @@ -760,7 +768,7 @@ public function setDialect(\Phalcon\Db\DialectInterface $dialect) * Set if nested transactions should use savepoints * * @param bool $nestedTransactionsWithSavepoints - * @return \Phalcon\Db\Adapter\AdapterInterface + * @return AdapterInterface */ public function setNestedTransactionsWithSavepoints(bool $nestedTransactionsWithSavepoints): AdapterInterface { diff --git a/src/Phalcon/db/adapter/AdapterInterface.php b/src/Phalcon/Db/Adapter/AdapterInterface.php similarity index 97% rename from src/Phalcon/db/adapter/AdapterInterface.php rename to src/Phalcon/Db/Adapter/AdapterInterface.php index cc9e7e03..2e2e691f 100644 --- a/src/Phalcon/db/adapter/AdapterInterface.php +++ b/src/Phalcon/Db/Adapter/AdapterInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db\Adapter; use Phalcon\Db\DialectInterface; @@ -136,7 +143,7 @@ public function delete($table, $whereCondition = null, $placeholders = null, $da * * @param string $table * @param string $schema - * @return array|\Phalcon\Db\ColumnInterface[] + * @return array */ public function describeColumns(string $table, string $schema = null): array; @@ -145,7 +152,7 @@ public function describeColumns(string $table, string $schema = null): array; * * @param string $table * @param string $schema - * @return array|\Phalcon\Db\IndexInterface[] + * @return array */ public function describeIndexes(string $table, string $schema = null): array; @@ -154,7 +161,7 @@ public function describeIndexes(string $table, string $schema = null): array; * * @param string $table * @param string $schema - * @return array|\Phalcon\Db\ReferenceInterface[] + * @return array */ public function describeReferences(string $table, string $schema = null): array; @@ -329,7 +336,7 @@ public function getDescriptor(): array; /** * Returns internal dialect instance * - * @return \Phalcon\Db\DialectInterface + * @return DialectInterface */ public function getDialect(): DialectInterface; @@ -343,7 +350,7 @@ public function getDialectType(): string; /** * Return the default identity value to insert in an identity column * - * @return \Phalcon\Db\RawValue + * @return RawValue */ public function getDefaultIdValue(): RawValue; @@ -497,7 +504,7 @@ public function modifyColumn(string $tableName, string $schemaName, \Phalcon\Db\ * @param string $sqlStatement * @param mixed $placeholders * @param mixed $dataTypes - * @return bool|\Phalcon\Db\ResultInterface + * @return mixed */ public function query(string $sqlStatement, $placeholders = null, $dataTypes = null); diff --git a/src/Phalcon/db/adapter/pdo/AbstractPdo.php b/src/Phalcon/Db/Adapter/Pdo/AbstractPdo.php similarity index 97% rename from src/Phalcon/db/adapter/pdo/AbstractPdo.php rename to src/Phalcon/Db/Adapter/Pdo/AbstractPdo.php index 053c10bd..87b45d63 100644 --- a/src/Phalcon/db/adapter/pdo/AbstractPdo.php +++ b/src/Phalcon/Db/Adapter/Pdo/AbstractPdo.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db\Adapter\Pdo; use Phalcon\Db\Adapter\AbstractAdapter; @@ -344,7 +351,7 @@ public function prepare(string $sqlStatement): \PDOStatement * @param string $sqlStatement * @param mixed $bindParams * @param mixed $bindTypes - * @return bool|\Phalcon\Db\ResultInterface + * @return mixed */ public function query(string $sqlStatement, $bindParams = null, $bindTypes = null) { diff --git a/src/Phalcon/db/adapter/pdo/Mysql.php b/src/Phalcon/Db/Adapter/Pdo/Mysql.php similarity index 87% rename from src/Phalcon/db/adapter/pdo/Mysql.php rename to src/Phalcon/Db/Adapter/Pdo/Mysql.php index 53e1b091..c72a284f 100644 --- a/src/Phalcon/db/adapter/pdo/Mysql.php +++ b/src/Phalcon/Db/Adapter/Pdo/Mysql.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db\Adapter\Pdo; /** @@ -55,7 +62,7 @@ public function addForeignKey(string $tableName, string $schemaName, \Phalcon\Db * * @param string $table * @param string $schema - * @return array|\Phalcon\Db\ColumnInterface[] + * @return array */ public function describeColumns(string $table, string $schema = null): array { @@ -72,7 +79,7 @@ public function describeColumns(string $table, string $schema = null): array * * @param string $table * @param string $schema - * @return array|\Phalcon\Db\IndexInterface[] + * @return array */ public function describeIndexes(string $table, string $schema = null): array { @@ -89,7 +96,7 @@ public function describeIndexes(string $table, string $schema = null): array * * @param string $table * @param string $schema - * @return array|\Phalcon\Db\ReferenceInterface[] + * @return array */ public function describeReferences(string $table, string $schema = null): array { diff --git a/src/Phalcon/db/adapter/pdo/Postgresql.php b/src/Phalcon/Db/Adapter/Pdo/Postgresql.php similarity index 92% rename from src/Phalcon/db/adapter/pdo/Postgresql.php rename to src/Phalcon/Db/Adapter/Pdo/Postgresql.php index 40012014..5235f722 100644 --- a/src/Phalcon/db/adapter/pdo/Postgresql.php +++ b/src/Phalcon/Db/Adapter/Pdo/Postgresql.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db\Adapter\Pdo; use Phalcon\Db\RawValue; @@ -77,7 +84,7 @@ public function createTable(string $tableName, string $schemaName, array $defini * * @param string $table * @param string $schema - * @return array|\Phalcon\Db\ColumnInterface[] + * @return array */ public function describeColumns(string $table, string $schema = null): array { @@ -94,7 +101,7 @@ public function describeColumns(string $table, string $schema = null): array * * @param string $table * @param string $schema - * @return array|\Phalcon\Db\ReferenceInterface[] + * @return array */ public function describeReferences(string $table, string $schema = null): array { @@ -120,7 +127,7 @@ public function describeReferences(string $table, string $schema = null): array * ); * ``` * - * @return \Phalcon\Db\RawValue + * @return RawValue */ public function getDefaultIdValue(): RawValue { diff --git a/src/Phalcon/db/adapter/pdo/Sqlite.php b/src/Phalcon/Db/Adapter/Pdo/Sqlite.php similarity index 89% rename from src/Phalcon/db/adapter/pdo/Sqlite.php rename to src/Phalcon/Db/Adapter/Pdo/Sqlite.php index f0243b91..ebec76be 100644 --- a/src/Phalcon/db/adapter/pdo/Sqlite.php +++ b/src/Phalcon/Db/Adapter/Pdo/Sqlite.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db\Adapter\Pdo; use Phalcon\Db\RawValue; @@ -61,7 +68,7 @@ public function connect(array $descriptor = null): bool * * @param string $table * @param string $schema - * @return array|\Phalcon\Db\ColumnInterface[] + * @return array */ public function describeColumns(string $table, string $schema = null): array { @@ -78,7 +85,7 @@ public function describeColumns(string $table, string $schema = null): array * * @param string $table * @param string $schema - * @return array|\Phalcon\Db\IndexInterface[] + * @return array */ public function describeIndexes(string $table, string $schema = null): array { @@ -89,7 +96,7 @@ public function describeIndexes(string $table, string $schema = null): array * * @param string $table * @param string $schema - * @return array|\Phalcon\Db\ReferenceInterface[] + * @return array */ public function describeReferences(string $table, string $schema = null): array { @@ -114,7 +121,7 @@ public function describeReferences(string $table, string $schema = null): array * ); * ``` * - * @return \Phalcon\Db\RawValue + * @return RawValue */ public function getDefaultValue(): RawValue { diff --git a/src/Phalcon/db/adapter/PdoFactory.php b/src/Phalcon/Db/Adapter/PdoFactory.php similarity index 72% rename from src/Phalcon/db/adapter/PdoFactory.php rename to src/Phalcon/Db/Adapter/PdoFactory.php index d24a0621..b243a7d7 100644 --- a/src/Phalcon/db/adapter/PdoFactory.php +++ b/src/Phalcon/Db/Adapter/PdoFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db\Adapter; use Phalcon\Factory\AbstractFactory; @@ -28,9 +35,9 @@ public function __construct(array $services = array()) * Factory to create an instace from a Config object * * @param mixed $config - * @return mixed + * @return AdapterInterface */ - public function load($config) + public function load($config): AdapterInterface { } @@ -39,9 +46,9 @@ public function load($config) * * @param string $name * @param array $options - * @return \Phalcon\Db\Adapter\AbstractAdapter + * @return AdapterInterface */ - public function newInstance(string $name, array $options = array()): AbstractAdapter + public function newInstance(string $name, array $options = array()): AdapterInterface { } diff --git a/src/Phalcon/db/Column.php b/src/Phalcon/Db/Column.php similarity index 96% rename from src/Phalcon/db/Column.php rename to src/Phalcon/Db/Column.php index f8fb568d..bfadbc3e 100644 --- a/src/Phalcon/db/Column.php +++ b/src/Phalcon/Db/Column.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db; /** diff --git a/src/Phalcon/db/ColumnInterface.php b/src/Phalcon/Db/ColumnInterface.php similarity index 90% rename from src/Phalcon/db/ColumnInterface.php rename to src/Phalcon/Db/ColumnInterface.php index d76627d2..4860a22b 100644 --- a/src/Phalcon/db/ColumnInterface.php +++ b/src/Phalcon/Db/ColumnInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db; /** diff --git a/src/Phalcon/db/Dialect.php b/src/Phalcon/Db/Dialect.php similarity index 98% rename from src/Phalcon/db/Dialect.php rename to src/Phalcon/Db/Dialect.php index 1644f7dd..63bd2a63 100644 --- a/src/Phalcon/db/Dialect.php +++ b/src/Phalcon/Db/Dialect.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db; /** diff --git a/src/Phalcon/db/dialect/Mysql.php b/src/Phalcon/Db/Dialect/Mysql.php similarity index 97% rename from src/Phalcon/db/dialect/Mysql.php rename to src/Phalcon/Db/Dialect/Mysql.php index 0a35e0ef..eeef5199 100644 --- a/src/Phalcon/db/dialect/Mysql.php +++ b/src/Phalcon/Db/Dialect/Mysql.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db\Dialect; use Phalcon\Db\Dialect; diff --git a/src/Phalcon/db/dialect/Postgresql.php b/src/Phalcon/Db/Dialect/Postgresql.php similarity index 97% rename from src/Phalcon/db/dialect/Postgresql.php rename to src/Phalcon/Db/Dialect/Postgresql.php index 99a4f307..4e57d5f8 100644 --- a/src/Phalcon/db/dialect/Postgresql.php +++ b/src/Phalcon/Db/Dialect/Postgresql.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db\Dialect; use Phalcon\Db\Dialect; diff --git a/src/Phalcon/db/dialect/Sqlite.php b/src/Phalcon/Db/Dialect/Sqlite.php similarity index 97% rename from src/Phalcon/db/dialect/Sqlite.php rename to src/Phalcon/Db/Dialect/Sqlite.php index 5ac53f17..3b2a56cc 100644 --- a/src/Phalcon/db/dialect/Sqlite.php +++ b/src/Phalcon/Db/Dialect/Sqlite.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db\Dialect; use Phalcon\Db\Dialect; diff --git a/src/Phalcon/db/DialectInterface.php b/src/Phalcon/Db/DialectInterface.php similarity index 90% rename from src/Phalcon/db/DialectInterface.php rename to src/Phalcon/Db/DialectInterface.php index 5fc159d5..fa6b3057 100644 --- a/src/Phalcon/db/DialectInterface.php +++ b/src/Phalcon/Db/DialectInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db; /** @@ -13,40 +20,40 @@ interface DialectInterface * * @param string $tableName * @param string $schemaName - * @param \Phalcon\Db\ColumnInterface $column + * @param ColumnInterface $column * @return string */ - public function addColumn(string $tableName, string $schemaName, \Phalcon\Db\ColumnInterface $column): string; + public function addColumn(string $tableName, string $schemaName, ColumnInterface $column): string; /** * Generates SQL to add an index to a table * * @param string $tableName * @param string $schemaName - * @param \Phalcon\Db\ReferenceInterface $reference + * @param ReferenceInterface $reference * @return string */ - public function addForeignKey(string $tableName, string $schemaName, \Phalcon\Db\ReferenceInterface $reference): string; + public function addForeignKey(string $tableName, string $schemaName, ReferenceInterface $reference): string; /** * Generates SQL to add an index to a table * * @param string $tableName * @param string $schemaName - * @param \Phalcon\Db\IndexInterface $index + * @param IndexInterface $index * @return string */ - public function addIndex(string $tableName, string $schemaName, \Phalcon\Db\IndexInterface $index): string; + public function addIndex(string $tableName, string $schemaName, IndexInterface $index): string; /** * Generates SQL to add the primary key to a table * * @param string $tableName * @param string $schemaName - * @param \Phalcon\Db\IndexInterface $index + * @param IndexInterface $index * @return string */ - public function addPrimaryKey(string $tableName, string $schemaName, \Phalcon\Db\IndexInterface $index): string; + public function addPrimaryKey(string $tableName, string $schemaName, IndexInterface $index): string; /** * Generate SQL to create a new savepoint @@ -172,10 +179,10 @@ public function forUpdate(string $sqlQuery): string; /** * Gets the column name in RDBMS * - * @param \Phalcon\Db\ColumnInterface $column + * @param ColumnInterface $column * @return string */ - public function getColumnDefinition(\Phalcon\Db\ColumnInterface $column): string; + public function getColumnDefinition(ColumnInterface $column): string; /** * Gets a list of columns @@ -225,11 +232,11 @@ public function listTables(string $schemaName = null): string; * * @param string $tableName * @param string $schemaName - * @param \Phalcon\Db\ColumnInterface $column - * @param \Phalcon\Db\ColumnInterface $currentColumn + * @param ColumnInterface $column + * @param ColumnInterface $currentColumn * @return string */ - public function modifyColumn(string $tableName, string $schemaName, \Phalcon\Db\ColumnInterface $column, \Phalcon\Db\ColumnInterface $currentColumn = null): string; + public function modifyColumn(string $tableName, string $schemaName, ColumnInterface $column, ColumnInterface $currentColumn = null): string; /** * Registers custom SQL functions diff --git a/src/Phalcon/db/Enum.php b/src/Phalcon/Db/Enum.php similarity index 72% rename from src/Phalcon/db/Enum.php rename to src/Phalcon/Db/Enum.php index 6c105d89..cff4d17c 100644 --- a/src/Phalcon/db/Enum.php +++ b/src/Phalcon/Db/Enum.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db; /** diff --git a/src/Phalcon/image/Exception.php b/src/Phalcon/Db/Exception.php similarity index 65% rename from src/Phalcon/image/Exception.php rename to src/Phalcon/Db/Exception.php index 16aca798..059b85db 100644 --- a/src/Phalcon/image/Exception.php +++ b/src/Phalcon/Db/Exception.php @@ -1,15 +1,17 @@ * * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ +namespace Phalcon\Db; + +/** + * Exceptions thrown in Phalcon\Db will use this class + */ class Exception extends \Phalcon\Exception { diff --git a/src/Phalcon/db/Index.php b/src/Phalcon/Db/Index.php similarity index 87% rename from src/Phalcon/db/Index.php rename to src/Phalcon/Db/Index.php index f80a22bd..1832a2f8 100644 --- a/src/Phalcon/db/Index.php +++ b/src/Phalcon/Db/Index.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db; /** diff --git a/src/Phalcon/db/IndexInterface.php b/src/Phalcon/Db/IndexInterface.php similarity index 67% rename from src/Phalcon/db/IndexInterface.php rename to src/Phalcon/Db/IndexInterface.php index 38d385a8..d981c426 100644 --- a/src/Phalcon/db/IndexInterface.php +++ b/src/Phalcon/Db/IndexInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db; /** diff --git a/src/Phalcon/db/Profiler.php b/src/Phalcon/Db/Profiler.php similarity index 91% rename from src/Phalcon/db/Profiler.php rename to src/Phalcon/Db/Profiler.php index 9c3aa351..96fe89e0 100644 --- a/src/Phalcon/db/Profiler.php +++ b/src/Phalcon/Db/Profiler.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db; use Phalcon\Db\Profiler\Item; @@ -81,7 +88,7 @@ class Profiler /** * Returns the last profile executed in the profiler * - * @return \Phalcon\Db\Profiler\Item + * @return Item */ public function getLastProfile(): Item { @@ -99,7 +106,7 @@ public function getNumberTotalStatements(): int /** * Returns the total time in seconds spent by the profiles * - * @return double + * @return float */ public function getTotalElapsedSeconds(): float { @@ -108,7 +115,7 @@ public function getTotalElapsedSeconds(): float /** * Returns all the processed profiles * - * @return array|\Phalcon\Db\Profiler\Item[] + * @return array */ public function getProfiles(): array { diff --git a/src/Phalcon/db/profiler/Item.php b/src/Phalcon/Db/Profiler/Item.php similarity index 89% rename from src/Phalcon/db/profiler/Item.php rename to src/Phalcon/Db/Profiler/Item.php index e4244b58..71b5487b 100644 --- a/src/Phalcon/db/profiler/Item.php +++ b/src/Phalcon/Db/Profiler/Item.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db\Profiler; /** @@ -55,7 +62,7 @@ public function setFinalTime(float $finalTime) /** * Timestamp when the profile ended * - * @return double + * @return float */ public function getFinalTime(): float { @@ -73,7 +80,7 @@ public function setInitialTime(float $initialTime) /** * Timestamp when the profile started * - * @return double + * @return float */ public function getInitialTime(): float { @@ -136,7 +143,7 @@ public function getSqlVariables(): array /** * Returns the total time in seconds spent by the profile * - * @return double + * @return float */ public function getTotalElapsedSeconds(): float { diff --git a/src/Phalcon/db/RawValue.php b/src/Phalcon/Db/RawValue.php similarity index 80% rename from src/Phalcon/db/RawValue.php rename to src/Phalcon/Db/RawValue.php index e89199da..1ecfc9b1 100644 --- a/src/Phalcon/db/RawValue.php +++ b/src/Phalcon/Db/RawValue.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db; /** diff --git a/src/Phalcon/db/Reference.php b/src/Phalcon/Db/Reference.php similarity index 91% rename from src/Phalcon/db/Reference.php rename to src/Phalcon/Db/Reference.php index 8d88dc19..04964948 100644 --- a/src/Phalcon/db/Reference.php +++ b/src/Phalcon/Db/Reference.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db; /** diff --git a/src/Phalcon/db/ReferenceInterface.php b/src/Phalcon/Db/ReferenceInterface.php similarity index 83% rename from src/Phalcon/db/ReferenceInterface.php rename to src/Phalcon/Db/ReferenceInterface.php index 056b8049..c28ff533 100644 --- a/src/Phalcon/db/ReferenceInterface.php +++ b/src/Phalcon/Db/ReferenceInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db; /** diff --git a/src/Phalcon/db/result/Pdo.php b/src/Phalcon/Db/Result/Pdo.php similarity index 95% rename from src/Phalcon/db/result/Pdo.php rename to src/Phalcon/Db/Result/Pdo.php index c7f012c7..ab2ffa8f 100644 --- a/src/Phalcon/db/result/Pdo.php +++ b/src/Phalcon/Db/Result/Pdo.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db\Result; use Phalcon\Db\Enum; @@ -82,6 +89,7 @@ public function __construct(\Phalcon\Db\Adapter\AdapterInterface $connection, \P * ``` * * @param long $number + * @return void */ public function dataSeek(int $number) { diff --git a/src/Phalcon/db/ResultInterface.php b/src/Phalcon/Db/ResultInterface.php similarity index 89% rename from src/Phalcon/db/ResultInterface.php rename to src/Phalcon/Db/ResultInterface.php index 7ce90cb1..5f7abd5c 100644 --- a/src/Phalcon/db/ResultInterface.php +++ b/src/Phalcon/Db/ResultInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Db; /** diff --git a/src/Phalcon/Debug.php b/src/Phalcon/Debug.php index a6203126..8911041f 100644 --- a/src/Phalcon/Debug.php +++ b/src/Phalcon/Debug.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; /** @@ -95,6 +102,8 @@ public function getVersion(): string /** * Halts the request showing a backtrace + * + * @return void */ public function halt() { @@ -147,6 +156,7 @@ public function onUncaughtException(\Exception $exception): bool * @param mixed $file * @param mixed $line * @param mixed $context + * @return void */ public function onUncaughtLowSeverity($severity, $message, $file, $line, $context) { diff --git a/src/Phalcon/debug/Dump.php b/src/Phalcon/Debug/Dump.php similarity index 93% rename from src/Phalcon/debug/Dump.php rename to src/Phalcon/Debug/Dump.php index cc2fbf6a..aad14563 100644 --- a/src/Phalcon/debug/Dump.php +++ b/src/Phalcon/Debug/Dump.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Debug; /** diff --git a/src/Phalcon/Debug/Exception.php b/src/Phalcon/Debug/Exception.php new file mode 100644 index 00000000..9b59519b --- /dev/null +++ b/src/Phalcon/Debug/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Debug; + +/** + * Exceptions thrown in Phalcon\Debug will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/Di.php b/src/Phalcon/Di.php index 4ae0d207..d5194233 100644 --- a/src/Phalcon/Di.php +++ b/src/Phalcon/Di.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; use Phalcon\Di\DiInterface; @@ -95,7 +102,7 @@ public function __call(string $method, array $arguments = array()) * @param string $name * @param mixed $definition * @param bool $shared - * @return bool|\Phalcon\Di\ServiceInterface + * @return mixed */ public function attempt(string $name, $definition, bool $shared = false) { @@ -115,7 +122,7 @@ public function get(string $name, $parameters = null) /** * Return the latest DI created * - * @return null|\Phalcon\Di\DiInterface + * @return mixed */ public static function getDefault(): ?DiInterface { @@ -124,7 +131,7 @@ public static function getDefault(): ?DiInterface /** * Returns the internal event manager * - * @return \Phalcon\Events\ManagerInterface + * @return ManagerInterface */ public function getInternalEventsManager(): ManagerInterface { @@ -144,7 +151,7 @@ public function getRaw(string $name) * Returns a Phalcon\Di\Service instance * * @param string $name - * @return \Phalcon\Di\ServiceInterface + * @return ServiceInterface */ public function getService(string $name): ServiceInterface { @@ -153,7 +160,7 @@ public function getService(string $name): ServiceInterface /** * Return the services registered in the DI * - * @return array|\Phalcon\Di\ServiceInterface[] + * @return array */ public function getServices(): array { @@ -174,9 +181,10 @@ public function getShared(string $name, $parameters = null) /** * Loads services from a Config object. * - * @param \Phalcon\Config $config + * @param Config $config + * @return void */ - protected function loadFromConfig(\Phalcon\Config $config) + protected function loadFromConfig(Config $config) { } @@ -212,6 +220,7 @@ protected function loadFromConfig(\Phalcon\Config $config) * * @link https://docs.phalcon.io/en/latest/reference/di.html * @param string $filePath + * @return void */ public function loadFromPhp(string $filePath) { @@ -251,6 +260,7 @@ public function loadFromPhp(string $filePath) * @link https://docs.phalcon.io/en/latest/reference/di.html * @param string $filePath * @param array $callbacks + * @return void */ public function loadFromYaml(string $filePath, array $callbacks = null) { @@ -299,6 +309,7 @@ public function offsetExists($name): bool * * @param mixed $name * @param mixed $definition + * @return void */ public function offsetSet($name, $definition) { @@ -308,6 +319,7 @@ public function offsetSet($name, $definition) * Removes a service from the services container using the array syntax * * @param mixed $name + * @return void */ public function offsetUnset($name) { @@ -335,6 +347,7 @@ public function offsetUnset($name) * ``` * * @param \Phalcon\Di\ServiceProviderInterface $provider + * @return void */ public function register(\Phalcon\Di\ServiceProviderInterface $provider) { @@ -345,6 +358,7 @@ public function register(\Phalcon\Di\ServiceProviderInterface $provider) * It also removes any shared instance created for the service * * @param string $name + * @return void */ public function remove(string $name) { @@ -352,6 +366,8 @@ public function remove(string $name) /** * Resets the internal default DI + * + * @return void */ public static function reset() { @@ -363,7 +379,7 @@ public static function reset() * @param string $name * @param mixed $definition * @param bool $shared - * @return \Phalcon\Di\ServiceInterface + * @return ServiceInterface */ public function set(string $name, $definition, bool $shared = false): ServiceInterface { @@ -374,6 +390,7 @@ public function set(string $name, $definition, bool $shared = false): ServiceInt * methods * * @param \Phalcon\Di\DiInterface $container + * @return void */ public static function setDefault(\Phalcon\Di\DiInterface $container) { @@ -393,7 +410,7 @@ public function setInternalEventsManager(\Phalcon\Events\ManagerInterface $event * * @param string $name * @param \Phalcon\Di\ServiceInterface $rawDefinition - * @return \Phalcon\Di\ServiceInterface + * @return ServiceInterface */ public function setRaw(string $name, \Phalcon\Di\ServiceInterface $rawDefinition): ServiceInterface { @@ -404,7 +421,7 @@ public function setRaw(string $name, \Phalcon\Di\ServiceInterface $rawDefinition * * @param string $name * @param mixed $definition - * @return \Phalcon\Di\ServiceInterface + * @return ServiceInterface */ public function setShared(string $name, $definition): ServiceInterface { diff --git a/src/Phalcon/di/AbstractInjectionAware.php b/src/Phalcon/Di/AbstractInjectionAware.php similarity index 57% rename from src/Phalcon/di/AbstractInjectionAware.php rename to src/Phalcon/Di/AbstractInjectionAware.php index bdb18ca2..d9f43b71 100644 --- a/src/Phalcon/di/AbstractInjectionAware.php +++ b/src/Phalcon/Di/AbstractInjectionAware.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Di; /** @@ -18,7 +25,7 @@ abstract class AbstractInjectionAware implements \Phalcon\Di\InjectionAwareInter /** * Returns the internal dependency injector * - * @return \Phalcon\Di\DiInterface + * @return DiInterface */ public function getDI(): DiInterface { @@ -27,9 +34,10 @@ public function getDI(): DiInterface /** * Sets the dependency injector * - * @param \Phalcon\Di\DiInterface $container + * @param DiInterface $container + * @return void */ - public function setDI(\Phalcon\Di\DiInterface $container) + public function setDI(DiInterface $container) { } } diff --git a/src/Phalcon/di/DiInterface.php b/src/Phalcon/Di/DiInterface.php similarity index 81% rename from src/Phalcon/di/DiInterface.php rename to src/Phalcon/Di/DiInterface.php index 9f170fce..0afcd9a9 100644 --- a/src/Phalcon/di/DiInterface.php +++ b/src/Phalcon/Di/DiInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Di; /** @@ -16,7 +23,7 @@ interface DiInterface extends \ArrayAccess * @param mixed $definition * @param string $name * @param bool $shared - * @return bool|\Phalcon\Di\ServiceInterface + * @return mixed */ public function attempt(string $name, $definition, bool $shared = false); @@ -32,7 +39,7 @@ public function get(string $name, $parameters = null); /** * Return the last DI created * - * @return null|DiInterface + * @return mixed */ public static function getDefault(): ?DiInterface; @@ -48,14 +55,14 @@ public function getRaw(string $name); * Returns the corresponding Phalcon\Di\Service instance for a service * * @param string $name - * @return \Phalcon\Di\ServiceInterface + * @return ServiceInterface */ public function getService(string $name): ServiceInterface; /** * Return the services registered in the DI * - * @return array|\Phalcon\Di\ServiceInterface[] + * @return array */ public function getServices(): array; @@ -80,11 +87,14 @@ public function has(string $name): bool; * Removes a service in the services container * * @param string $name + * @return void */ public function remove(string $name); /** * Resets the internal default DI + * + * @return void */ public static function reset(); @@ -94,7 +104,7 @@ public static function reset(); * @param string $name * @param mixed $definition * @param bool $shared - * @return \Phalcon\Di\ServiceInterface + * @return ServiceInterface */ public function set(string $name, $definition, bool $shared = false): ServiceInterface; @@ -103,6 +113,7 @@ public function set(string $name, $definition, bool $shared = false): ServiceInt * methods * * @param DiInterface $container + * @return void */ public static function setDefault(DiInterface $container); @@ -110,17 +121,17 @@ public static function setDefault(DiInterface $container); * Sets a service using a raw Phalcon\Di\Service definition * * @param string $name - * @param \Phalcon\Di\ServiceInterface $rawDefinition - * @return \Phalcon\Di\ServiceInterface + * @param ServiceInterface $rawDefinition + * @return ServiceInterface */ - public function setRaw(string $name, \Phalcon\Di\ServiceInterface $rawDefinition): ServiceInterface; + public function setRaw(string $name, ServiceInterface $rawDefinition): ServiceInterface; /** * Registers an "always shared" service in the services container * * @param string $name * @param mixed $definition - * @return \Phalcon\Di\ServiceInterface + * @return ServiceInterface */ public function setShared(string $name, $definition): ServiceInterface; } diff --git a/src/Phalcon/Di/Exception.php b/src/Phalcon/Di/Exception.php new file mode 100644 index 00000000..6b048c47 --- /dev/null +++ b/src/Phalcon/Di/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Di; + +/** + * Exceptions thrown in Phalcon\Di will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/Di/Exception/ServiceResolutionException.php b/src/Phalcon/Di/Exception/ServiceResolutionException.php new file mode 100644 index 00000000..bee2d1e1 --- /dev/null +++ b/src/Phalcon/Di/Exception/ServiceResolutionException.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Di\Exception; + +/** + * Phalcon\Di\Exception\ServiceResolutionException + */ +class ServiceResolutionException extends \Phalcon\Di\Exception +{ + +} diff --git a/src/Phalcon/di/FactoryDefault.php b/src/Phalcon/Di/FactoryDefault.php similarity index 66% rename from src/Phalcon/di/FactoryDefault.php rename to src/Phalcon/Di/FactoryDefault.php index 3478549d..6d8546f6 100644 --- a/src/Phalcon/di/FactoryDefault.php +++ b/src/Phalcon/Di/FactoryDefault.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Di; /** diff --git a/src/Phalcon/di/factorydefault/Cli.php b/src/Phalcon/Di/FactoryDefault/Cli.php similarity index 70% rename from src/Phalcon/di/factorydefault/Cli.php rename to src/Phalcon/Di/FactoryDefault/Cli.php index f7c4b2d3..d2d3c9be 100644 --- a/src/Phalcon/di/factorydefault/Cli.php +++ b/src/Phalcon/Di/FactoryDefault/Cli.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Di\FactoryDefault; use Phalcon\Di\FactoryDefault; diff --git a/src/Phalcon/di/Injectable.php b/src/Phalcon/Di/Injectable.php similarity index 87% rename from src/Phalcon/di/Injectable.php rename to src/Phalcon/Di/Injectable.php index f7382c65..6fab0c01 100644 --- a/src/Phalcon/di/Injectable.php +++ b/src/Phalcon/Di/Injectable.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Di; use Phalcon\Session\BagInterface; @@ -66,7 +73,7 @@ public function __isset(string $name): bool /** * Returns the internal dependency injector * - * @return \Phalcon\Di\DiInterface + * @return DiInterface */ public function getDI(): DiInterface { @@ -75,9 +82,10 @@ public function getDI(): DiInterface /** * Sets the dependency injector * - * @param \Phalcon\Di\DiInterface $container + * @param DiInterface $container + * @return void */ - public function setDI(\Phalcon\Di\DiInterface $container) + public function setDI(DiInterface $container) { } } diff --git a/src/Phalcon/di/InjectionAwareInterface.php b/src/Phalcon/Di/InjectionAwareInterface.php similarity index 50% rename from src/Phalcon/di/InjectionAwareInterface.php rename to src/Phalcon/Di/InjectionAwareInterface.php index 3bf3ec3b..97b68a27 100644 --- a/src/Phalcon/di/InjectionAwareInterface.php +++ b/src/Phalcon/Di/InjectionAwareInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Di; /** @@ -12,14 +19,15 @@ interface InjectionAwareInterface /** * Sets the dependency injector * - * @param \Phalcon\Di\DiInterface $container + * @param DiInterface $container + * @return void */ - public function setDI(\Phalcon\Di\DiInterface $container); + public function setDI(DiInterface $container); /** * Returns the internal dependency injector * - * @return \Phalcon\Di\DiInterface + * @return DiInterface */ public function getDI(): DiInterface; } diff --git a/src/Phalcon/di/Service.php b/src/Phalcon/Di/Service.php similarity index 83% rename from src/Phalcon/di/Service.php rename to src/Phalcon/Di/Service.php index 3de49845..f3db7b4a 100644 --- a/src/Phalcon/di/Service.php +++ b/src/Phalcon/Di/Service.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Di; /** @@ -55,8 +62,8 @@ public function getDefinition() /** * Returns a parameter in a specific position * - * @param int $position * @return array + * @param int $position */ public function getParameter(int $position) { @@ -84,10 +91,10 @@ public function isShared(): bool * Resolves the service * * @param array $parameters - * @param \Phalcon\Di\DiInterface $container + * @param DiInterface $container * @return mixed */ - public function resolve($parameters = null, \Phalcon\Di\DiInterface $container = null) + public function resolve($parameters = null, DiInterface $container = null) { } @@ -95,6 +102,7 @@ public function resolve($parameters = null, \Phalcon\Di\DiInterface $container = * Set the service definition * * @param mixed $definition + * @return void */ public function setDefinition($definition) { @@ -105,7 +113,7 @@ public function setDefinition($definition) * * @param int $position * @param array $parameter - * @return \Phalcon\Di\ServiceInterface + * @return ServiceInterface */ public function setParameter(int $position, array $parameter): ServiceInterface { @@ -115,6 +123,7 @@ public function setParameter(int $position, array $parameter): ServiceInterface * Sets if the service is shared or not * * @param bool $shared + * @return void */ public function setShared(bool $shared) { @@ -124,6 +133,7 @@ public function setShared(bool $shared) * Sets/Resets the shared instance related to the service * * @param mixed $sharedInstance + * @return void */ public function setSharedInstance($sharedInstance) { diff --git a/src/Phalcon/di/service/Builder.php b/src/Phalcon/Di/Service/Builder.php similarity index 82% rename from src/Phalcon/di/service/Builder.php rename to src/Phalcon/Di/Service/Builder.php index 2886678e..b8a5a1f3 100644 --- a/src/Phalcon/di/service/Builder.php +++ b/src/Phalcon/Di/Service/Builder.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Di\Service; /** @@ -14,9 +21,9 @@ class Builder * Builds a service using a complex service definition * * @param array $parameters + * @return mixed * @param \Phalcon\Di\DiInterface $container * @param array $definition - * @return mixed */ public function build(\Phalcon\Di\DiInterface $container, array $definition, $parameters = null) { @@ -25,10 +32,10 @@ public function build(\Phalcon\Di\DiInterface $container, array $definition, $pa /** * Resolves a constructor/call parameter * + * @return mixed * @param \Phalcon\Di\DiInterface $container * @param int $position * @param array $argument - * @return mixed */ private function buildParameter(\Phalcon\Di\DiInterface $container, int $position, array $argument) { diff --git a/src/Phalcon/di/ServiceInterface.php b/src/Phalcon/Di/ServiceInterface.php similarity index 79% rename from src/Phalcon/di/ServiceInterface.php rename to src/Phalcon/Di/ServiceInterface.php index 7771819c..52c09130 100644 --- a/src/Phalcon/di/ServiceInterface.php +++ b/src/Phalcon/Di/ServiceInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Di; /** @@ -18,8 +25,8 @@ public function getDefinition(); /** * Returns a parameter in a specific position * - * @param int $position * @return array + * @param int $position */ public function getParameter(int $position); @@ -41,10 +48,10 @@ public function isShared(): bool; * Resolves the service * * @param array $parameters - * @param \Phalcon\Di\DiInterface $container + * @param DiInterface $container * @return mixed */ - public function resolve($parameters = null, \Phalcon\Di\DiInterface $container = null); + public function resolve($parameters = null, DiInterface $container = null); /** * Set the service definition diff --git a/src/Phalcon/di/ServiceProviderInterface.php b/src/Phalcon/Di/ServiceProviderInterface.php similarity index 67% rename from src/Phalcon/di/ServiceProviderInterface.php rename to src/Phalcon/Di/ServiceProviderInterface.php index 6756aa83..497bac34 100644 --- a/src/Phalcon/di/ServiceProviderInterface.php +++ b/src/Phalcon/Di/ServiceProviderInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Di; /** @@ -32,7 +39,8 @@ interface ServiceProviderInterface /** * Registers a service provider. * - * @param \Phalcon\Di\DiInterface $di + * @param DiInterface $di + * @return void */ - public function register(\Phalcon\Di\DiInterface $di); + public function register(DiInterface $di); } diff --git a/src/Phalcon/dispatcher/AbstractDispatcher.php b/src/Phalcon/Dispatcher/AbstractDispatcher.php similarity index 93% rename from src/Phalcon/dispatcher/AbstractDispatcher.php rename to src/Phalcon/Dispatcher/AbstractDispatcher.php index ec2af170..7b307449 100644 --- a/src/Phalcon/dispatcher/AbstractDispatcher.php +++ b/src/Phalcon/Dispatcher/AbstractDispatcher.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Dispatcher; use Phalcon\Di\AbstractInjectionAware; @@ -146,8 +153,9 @@ public function dispatch(): bool * ); * ``` * - * @param array $forward * @throws \Phalcon\Exception + * @param array $forward + * @return void */ public function forward(array $forward) { @@ -212,7 +220,7 @@ public function getDefaultNamespace(): string /** * Returns the internal event manager * - * @return \Phalcon\Events\ManagerInterface + * @return ManagerInterface */ public function getEventsManager(): ManagerInterface { @@ -230,7 +238,7 @@ public function getHandlerSuffix(): string /** * Gets model binder * - * @return null|\Phalcon\Mvc\Model\BinderInterface + * @return mixed */ public function getModelBinder(): ?BinderInterface { @@ -299,6 +307,7 @@ public function isFinished(): bool * Sets the action name to be dispatched * * @param string $actionName + * @return void */ public function setActionName(string $actionName) { @@ -308,6 +317,7 @@ public function setActionName(string $actionName) * Sets the default action name * * @param string $actionName + * @return void */ public function setDefaultAction(string $actionName) { @@ -317,6 +327,7 @@ public function setDefaultAction(string $actionName) * Sets the default namespace * * @param string $namespaceName + * @return void */ public function setDefaultNamespace(string $namespaceName) { @@ -336,6 +347,7 @@ public function getHandlerClass(): string * * @param mixed $param * @param mixed $value + * @return void */ public function setParam($param, $value) { @@ -345,6 +357,7 @@ public function setParam($param, $value) * Sets action params to be dispatched * * @param array $params + * @return void */ public function setParams(array $params) { @@ -354,6 +367,7 @@ public function setParams(array $params) * Sets the latest returned value by an action manually * * @param mixed $value + * @return void */ public function setReturnedValue($value) { @@ -363,6 +377,7 @@ public function setReturnedValue($value) * Sets the default action suffix * * @param string $actionSuffix + * @return void */ public function setActionSuffix(string $actionSuffix) { @@ -372,6 +387,7 @@ public function setActionSuffix(string $actionSuffix) * Sets the events manager * * @param \Phalcon\Events\ManagerInterface $eventsManager + * @return void */ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager) { @@ -381,6 +397,7 @@ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager * Sets the default suffix for the handler * * @param string $handlerSuffix + * @return void */ public function setHandlerSuffix(string $handlerSuffix) { @@ -407,7 +424,7 @@ public function setHandlerSuffix(string $handlerSuffix) * * @param \Phalcon\Mvc\Model\BinderInterface $modelBinder * @param mixed $cache - * @return \Phalcon\Dispatcher\DispatcherInterface + * @return DispatcherInterface */ public function setModelBinder(\Phalcon\Mvc\Model\BinderInterface $modelBinder, $cache = null): DispatcherInterface { @@ -417,6 +434,7 @@ public function setModelBinder(\Phalcon\Mvc\Model\BinderInterface $modelBinder, * Sets the module where the controller is (only informative) * * @param string $moduleName + * @return void */ public function setModuleName(string $moduleName) { @@ -426,6 +444,7 @@ public function setModuleName(string $moduleName) * Sets the namespace where the controller class is * * @param string $namespaceName + * @return void */ public function setNamespaceName(string $namespaceName) { @@ -451,6 +470,8 @@ public function wasForwarded(): bool /** * Set empty properties to their defaults (where defaults are available) + * + * @return void */ protected function resolveEmptyProperties() { diff --git a/src/Phalcon/dispatcher/DispatcherInterface.php b/src/Phalcon/Dispatcher/DispatcherInterface.php similarity index 87% rename from src/Phalcon/dispatcher/DispatcherInterface.php rename to src/Phalcon/Dispatcher/DispatcherInterface.php index c8ff6675..8b7244f9 100644 --- a/src/Phalcon/dispatcher/DispatcherInterface.php +++ b/src/Phalcon/Dispatcher/DispatcherInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Dispatcher; /** @@ -19,6 +26,7 @@ public function dispatch(): bool; * Forwards the execution flow to another controller/action * * @param array $forward + * @return void */ public function forward(array $forward); @@ -86,6 +94,7 @@ public function isFinished(): bool; * Sets the action name to be dispatched * * @param string $actionName + * @return void */ public function setActionName(string $actionName); @@ -93,6 +102,7 @@ public function setActionName(string $actionName); * Sets the default action suffix * * @param string $actionSuffix + * @return void */ public function setActionSuffix(string $actionSuffix); @@ -100,6 +110,7 @@ public function setActionSuffix(string $actionSuffix); * Sets the default action name * * @param string $actionName + * @return void */ public function setDefaultAction(string $actionName); @@ -107,6 +118,7 @@ public function setDefaultAction(string $actionName); * Sets the default namespace * * @param string $defaultNamespace + * @return void */ public function setDefaultNamespace(string $defaultNamespace); @@ -114,6 +126,7 @@ public function setDefaultNamespace(string $defaultNamespace); * Sets the default suffix for the handler * * @param string $handlerSuffix + * @return void */ public function setHandlerSuffix(string $handlerSuffix); @@ -121,6 +134,7 @@ public function setHandlerSuffix(string $handlerSuffix); * Sets the module name which the application belongs to * * @param string $moduleName + * @return void */ public function setModuleName(string $moduleName); @@ -128,6 +142,7 @@ public function setModuleName(string $moduleName); * Sets the namespace which the controller belongs to * * @param string $namespaceName + * @return void */ public function setNamespaceName(string $namespaceName); @@ -136,6 +151,7 @@ public function setNamespaceName(string $namespaceName); * * @param mixed $value * @param mixed $param + * @return void */ public function setParam($param, $value); @@ -143,6 +159,7 @@ public function setParam($param, $value); * Sets action params to be dispatched * * @param array $params + * @return void */ public function setParams(array $params); } diff --git a/src/Phalcon/dispatcher/Exception.php b/src/Phalcon/Dispatcher/Exception.php similarity index 64% rename from src/Phalcon/dispatcher/Exception.php rename to src/Phalcon/Dispatcher/Exception.php index cad099de..940db816 100644 --- a/src/Phalcon/dispatcher/Exception.php +++ b/src/Phalcon/Dispatcher/Exception.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Dispatcher; /** diff --git a/src/Phalcon/domain/payload/Payload.php b/src/Phalcon/Domain/Payload/Payload.php similarity index 82% rename from src/Phalcon/domain/payload/Payload.php rename to src/Phalcon/Domain/Payload/Payload.php index 8be33d5e..1046c7ac 100644 --- a/src/Phalcon/domain/payload/Payload.php +++ b/src/Phalcon/Domain/Payload/Payload.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Domain\Payload; /** @@ -92,7 +99,7 @@ public function getOutput() * Sets arbitrary extra domain information. * * @param mixed $extras - * @return \Phalcon\Domain\Payload\PayloadInterface + * @return PayloadInterface */ public function setExtras($extras): PayloadInterface { @@ -102,7 +109,7 @@ public function setExtras($extras): PayloadInterface * Sets the domain input. * * @param mixed $input - * @return \Phalcon\Domain\Payload\PayloadInterface + * @return PayloadInterface */ public function setInput($input): PayloadInterface { @@ -112,7 +119,7 @@ public function setInput($input): PayloadInterface * Sets the domain messages. * * @param mixed $messages - * @return \Phalcon\Domain\Payload\PayloadInterface + * @return PayloadInterface */ public function setMessages($messages): PayloadInterface { @@ -122,7 +129,7 @@ public function setMessages($messages): PayloadInterface * Sets the domain output. * * @param mixed $output - * @return \Phalcon\Domain\Payload\PayloadInterface + * @return PayloadInterface */ public function setOutput($output): PayloadInterface { @@ -132,7 +139,7 @@ public function setOutput($output): PayloadInterface * Sets the payload status. * * @param mixed $status - * @return \Phalcon\Domain\Payload\PayloadInterface + * @return PayloadInterface */ public function setStatus($status): PayloadInterface { diff --git a/src/Phalcon/Domain/Payload/PayloadFactory.php b/src/Phalcon/Domain/Payload/PayloadFactory.php new file mode 100644 index 00000000..adc02bfd --- /dev/null +++ b/src/Phalcon/Domain/Payload/PayloadFactory.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Domain\Payload; + +/** + * Factory to create payload objects + */ +class PayloadFactory +{ + + /** + * Instantiate a new object + * + * @return PayloadInterface + */ + public function newInstance(): PayloadInterface + { + } +} diff --git a/src/Phalcon/Domain/Payload/PayloadInterface.php b/src/Phalcon/Domain/Payload/PayloadInterface.php new file mode 100644 index 00000000..a96ecd8e --- /dev/null +++ b/src/Phalcon/Domain/Payload/PayloadInterface.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Domain\Payload; + +/** + * This interface is used for consumers + */ +interface PayloadInterface extends \Phalcon\Domain\Payload\ReadableInterface, \Phalcon\Domain\Payload\WriteableInterface +{ + +} diff --git a/src/Phalcon/domain/payload/ReadableInterface.php b/src/Phalcon/Domain/Payload/ReadableInterface.php similarity index 77% rename from src/Phalcon/domain/payload/ReadableInterface.php rename to src/Phalcon/Domain/Payload/ReadableInterface.php index cac33ff9..c482a277 100644 --- a/src/Phalcon/domain/payload/ReadableInterface.php +++ b/src/Phalcon/Domain/Payload/ReadableInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Domain\Payload; /** diff --git a/src/Phalcon/domain/payload/Status.php b/src/Phalcon/Domain/Payload/Status.php similarity index 80% rename from src/Phalcon/domain/payload/Status.php rename to src/Phalcon/Domain/Payload/Status.php index 6d3b632c..292e2da0 100644 --- a/src/Phalcon/domain/payload/Status.php +++ b/src/Phalcon/Domain/Payload/Status.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Domain\Payload; /** diff --git a/src/Phalcon/domain/payload/WriteableInterface.php b/src/Phalcon/Domain/Payload/WriteableInterface.php similarity index 75% rename from src/Phalcon/domain/payload/WriteableInterface.php rename to src/Phalcon/Domain/Payload/WriteableInterface.php index 08bbd422..bd44b3e0 100644 --- a/src/Phalcon/domain/payload/WriteableInterface.php +++ b/src/Phalcon/Domain/Payload/WriteableInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Domain\Payload; /** @@ -12,7 +19,7 @@ interface WriteableInterface * Sets the status of this payload. * * @param mixed $status The status for this payload. - * @return \Phalcon\Domain\Payload\PayloadInterface + * @return PayloadInterface */ public function setStatus($status): PayloadInterface; @@ -22,7 +29,7 @@ public function setStatus($status): PayloadInterface; * * @param mixed $input The input received by the domain layer. * - * @return \Phalcon\Domain\Payload\PayloadInterface + * @return PayloadInterface */ public function setInput($input): PayloadInterface; @@ -30,7 +37,7 @@ public function setInput($input): PayloadInterface; * Sets the output produced from the domain layer. * * @param mixed $output The output produced from the domain layer. - * @return \Phalcon\Domain\Payload\PayloadInterface + * @return PayloadInterface */ public function setOutput($output): PayloadInterface; @@ -38,7 +45,7 @@ public function setOutput($output): PayloadInterface; * Sets the messages produced by the domain layer. * * @param mixed $messages The messages produced by the domain layer. - * @return \Phalcon\Domain\Payload\PayloadInterface + * @return PayloadInterface */ public function setMessages($messages): PayloadInterface; @@ -46,7 +53,7 @@ public function setMessages($messages): PayloadInterface; * Sets arbitrary extra values produced by the domain layer. * * @param mixed $extras Arbitrary extra values produced by the domain layer. - * @return \Phalcon\Domain\Payload\PayloadInterface + * @return PayloadInterface */ public function setExtras($extras): PayloadInterface; } diff --git a/src/Phalcon/Escaper.php b/src/Phalcon/Escaper.php index 5e8c1236..01954765 100644 --- a/src/Phalcon/Escaper.php +++ b/src/Phalcon/Escaper.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; /** @@ -129,6 +136,7 @@ final public function normalizeEncoding(string $str): string * ``` * * @param bool $doubleEncode + * @return void */ public function setDoubleEncode(bool $doubleEncode) { @@ -142,6 +150,7 @@ public function setDoubleEncode(bool $doubleEncode) * ``` * * @param string $encoding + * @return void */ public function setEncoding(string $encoding) { @@ -155,6 +164,7 @@ public function setEncoding(string $encoding) * ``` * * @param int $quoteType + * @return void */ public function setHtmlQuoteType(int $quoteType) { diff --git a/src/Phalcon/escaper/EscaperInterface.php b/src/Phalcon/Escaper/EscaperInterface.php similarity index 85% rename from src/Phalcon/escaper/EscaperInterface.php rename to src/Phalcon/Escaper/EscaperInterface.php index 282aa24c..09e2ba21 100644 --- a/src/Phalcon/escaper/EscaperInterface.php +++ b/src/Phalcon/Escaper/EscaperInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Escaper; /** @@ -61,6 +68,7 @@ public function getEncoding(): string; * Sets the encoding to be used by the escaper * * @param string $encoding + * @return void */ public function setEncoding(string $encoding); @@ -68,6 +76,7 @@ public function setEncoding(string $encoding); * Sets the HTML quoting type for htmlspecialchars * * @param int $quoteType + * @return void */ public function setHtmlQuoteType(int $quoteType); } diff --git a/src/Phalcon/Escaper/Exception.php b/src/Phalcon/Escaper/Exception.php new file mode 100644 index 00000000..6e3b8bd3 --- /dev/null +++ b/src/Phalcon/Escaper/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Escaper; + +/** + * Exceptions thrown in Phalcon\Escaper will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/events/Event.php b/src/Phalcon/Events/Event.php similarity index 91% rename from src/Phalcon/events/Event.php rename to src/Phalcon/Events/Event.php index 87441b61..a2c97950 100644 --- a/src/Phalcon/events/Event.php +++ b/src/Phalcon/Events/Event.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Events; /** diff --git a/src/Phalcon/events/EventInterface.php b/src/Phalcon/Events/EventInterface.php similarity index 82% rename from src/Phalcon/events/EventInterface.php rename to src/Phalcon/Events/EventInterface.php index 8ac004c0..51e4b8e8 100644 --- a/src/Phalcon/events/EventInterface.php +++ b/src/Phalcon/Events/EventInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Events; /** diff --git a/src/Phalcon/events/EventsAwareInterface.php b/src/Phalcon/Events/EventsAwareInterface.php similarity index 65% rename from src/Phalcon/events/EventsAwareInterface.php rename to src/Phalcon/Events/EventsAwareInterface.php index 971d263e..f35d4f45 100644 --- a/src/Phalcon/events/EventsAwareInterface.php +++ b/src/Phalcon/Events/EventsAwareInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Events; /** @@ -14,7 +21,7 @@ interface EventsAwareInterface /** * Returns the internal event manager * - * @return null|ManagerInterface + * @return mixed */ public function getEventsManager(): ?ManagerInterface; @@ -22,6 +29,7 @@ public function getEventsManager(): ?ManagerInterface; * Sets the events manager * * @param ManagerInterface $eventsManager + * @return void */ public function setEventsManager(ManagerInterface $eventsManager); } diff --git a/src/Phalcon/Events/Exception.php b/src/Phalcon/Events/Exception.php new file mode 100644 index 00000000..fe8199d5 --- /dev/null +++ b/src/Phalcon/Events/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Events; + +/** + * Phalcon\Events\Exception + * + * Exceptions thrown in Phalcon\Events will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/events/Manager.php b/src/Phalcon/Events/Manager.php similarity index 91% rename from src/Phalcon/events/Manager.php rename to src/Phalcon/Events/Manager.php index ed672b84..90fc951f 100644 --- a/src/Phalcon/events/Manager.php +++ b/src/Phalcon/Events/Manager.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Events; /** @@ -38,6 +45,7 @@ class Manager implements \Phalcon\Events\ManagerInterface * @param object|callable $handler * @param string $eventType * @param int $priority + * @return void */ public function attach(string $eventType, $handler, int $priority = self::DEFAULT_PRIORITY) { @@ -57,6 +65,7 @@ public function arePrioritiesEnabled(): bool * by every registered listener in a single fire * * @param bool $collect + * @return void */ public function collectResponses(bool $collect) { @@ -67,6 +76,7 @@ public function collectResponses(bool $collect) * * @param object $handler * @param string $eventType + * @return void */ public function detach(string $eventType, $handler) { @@ -76,6 +86,7 @@ public function detach(string $eventType, $handler) * Removes all events from the EventsManager * * @param string $type + * @return void */ public function detachAll(string $type = null) { @@ -85,6 +96,7 @@ public function detachAll(string $type = null) * Set if priorities are enabled in the EventsManager * * @param bool $enablePriorities + * @return void */ public function enablePriorities(bool $enablePriorities) { @@ -100,9 +112,9 @@ public function enablePriorities(bool $enablePriorities) * * @param object $source * @param mixed $data + * @return mixed * @param string $eventType * @param bool $cancelable - * @return mixed */ public function fire(string $eventType, $source, $data = null, bool $cancelable = true) { @@ -111,9 +123,9 @@ public function fire(string $eventType, $source, $data = null, bool $cancelable /** * Internal handler to call a queue of events * + * @return mixed * @param \SplPriorityQueue $queue * @param EventInterface $event - * @return mixed */ final public function fireQueue(\SplPriorityQueue $queue, EventInterface $event) { diff --git a/src/Phalcon/events/ManagerInterface.php b/src/Phalcon/Events/ManagerInterface.php similarity index 85% rename from src/Phalcon/events/ManagerInterface.php rename to src/Phalcon/Events/ManagerInterface.php index bad1e4bb..6e491e8a 100644 --- a/src/Phalcon/events/ManagerInterface.php +++ b/src/Phalcon/Events/ManagerInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Events; /** @@ -18,6 +25,7 @@ interface ManagerInterface * * @param object|callable $handler * @param string $eventType + * @return void */ public function attach(string $eventType, $handler); @@ -26,6 +34,7 @@ public function attach(string $eventType, $handler); * * @param object $handler * @param string $eventType + * @return void */ public function detach(string $eventType, $handler); @@ -33,6 +42,7 @@ public function detach(string $eventType, $handler); * Removes all events from the EventsManager * * @param string $type + * @return void */ public function detachAll(string $type = null); @@ -42,9 +52,9 @@ public function detachAll(string $type = null); * * @param object $source * @param mixed $data + * @return mixed * @param string $eventType * @param bool $cancelable - * @return mixed */ public function fire(string $eventType, $source, $data = null, bool $cancelable = true); diff --git a/src/Phalcon/Exception.php b/src/Phalcon/Exception.php index 2c453056..09a741b3 100644 --- a/src/Phalcon/Exception.php +++ b/src/Phalcon/Exception.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; /** diff --git a/src/Phalcon/factory/AbstractFactory.php b/src/Phalcon/Factory/AbstractFactory.php similarity index 80% rename from src/Phalcon/factory/AbstractFactory.php rename to src/Phalcon/Factory/AbstractFactory.php index 7c7a381f..d4feaa9b 100644 --- a/src/Phalcon/factory/AbstractFactory.php +++ b/src/Phalcon/Factory/AbstractFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Factory; /** @@ -27,6 +34,7 @@ abstract class AbstractFactory * Checks if a service exists and throws an exception * * @param string $name + * @return void */ protected function checkService(string $name) { @@ -53,6 +61,7 @@ abstract protected function getAdapters(): array; * AdapterFactory constructor. * * @param array $services + * @return void */ protected function init(array $services = array()) { diff --git a/src/Phalcon/Factory/Exception.php b/src/Phalcon/Factory/Exception.php new file mode 100644 index 00000000..7561e49a --- /dev/null +++ b/src/Phalcon/Factory/Exception.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Factory; + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/Filter.php b/src/Phalcon/Filter.php index 93fff9a7..cf5fcae8 100644 --- a/src/Phalcon/Filter.php +++ b/src/Phalcon/Filter.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; /** @@ -129,6 +136,7 @@ public function sanitize($value, $sanitizers, bool $noRecursive = false) * * @param string $name * @param callable $service + * @return void */ public function set(string $name, $service) { @@ -138,6 +146,7 @@ public function set(string $name, $service) * Loads the objects in the internal mapper array * * @param array $mapper + * @return void */ protected function init(array $mapper) { diff --git a/src/Phalcon/Filter/Exception.php b/src/Phalcon/Filter/Exception.php new file mode 100644 index 00000000..d1dd3b40 --- /dev/null +++ b/src/Phalcon/Filter/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Filter; + +/** + * Phalcon\Filter\Exception + * + * Exceptions thrown in Phalcon\Filter will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/filter/FilterFactory.php b/src/Phalcon/Filter/FilterFactory.php similarity index 68% rename from src/Phalcon/filter/FilterFactory.php rename to src/Phalcon/Filter/FilterFactory.php index e79b82ae..649ba460 100644 --- a/src/Phalcon/filter/FilterFactory.php +++ b/src/Phalcon/Filter/FilterFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter; /** @@ -17,7 +24,7 @@ class FilterFactory * Returns a Locator object with all the helpers defined in anonynous * functions * - * @return \Phalcon\Filter\FilterInterface + * @return FilterInterface */ public function newInstance(): FilterInterface { diff --git a/src/Phalcon/filter/FilterInterface.php b/src/Phalcon/Filter/FilterInterface.php similarity index 64% rename from src/Phalcon/filter/FilterInterface.php rename to src/Phalcon/Filter/FilterInterface.php index ffa0fea8..f7922641 100644 --- a/src/Phalcon/filter/FilterInterface.php +++ b/src/Phalcon/Filter/FilterInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter; /** diff --git a/src/Phalcon/filter/sanitize/AbsInt.php b/src/Phalcon/Filter/Sanitize/AbsInt.php similarity index 53% rename from src/Phalcon/filter/sanitize/AbsInt.php rename to src/Phalcon/Filter/Sanitize/AbsInt.php index 8cceb179..3aabb4f2 100644 --- a/src/Phalcon/filter/sanitize/AbsInt.php +++ b/src/Phalcon/Filter/Sanitize/AbsInt.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/Alnum.php b/src/Phalcon/Filter/Sanitize/Alnum.php similarity index 53% rename from src/Phalcon/filter/sanitize/Alnum.php rename to src/Phalcon/Filter/Sanitize/Alnum.php index 533abeff..a715f0df 100644 --- a/src/Phalcon/filter/sanitize/Alnum.php +++ b/src/Phalcon/Filter/Sanitize/Alnum.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/Alpha.php b/src/Phalcon/Filter/Sanitize/Alpha.php similarity index 53% rename from src/Phalcon/filter/sanitize/Alpha.php rename to src/Phalcon/Filter/Sanitize/Alpha.php index 5c4a764b..33eefae7 100644 --- a/src/Phalcon/filter/sanitize/Alpha.php +++ b/src/Phalcon/Filter/Sanitize/Alpha.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/BoolVal.php b/src/Phalcon/Filter/Sanitize/BoolVal.php similarity index 52% rename from src/Phalcon/filter/sanitize/BoolVal.php rename to src/Phalcon/Filter/Sanitize/BoolVal.php index d3d4708c..67d8ec37 100644 --- a/src/Phalcon/filter/sanitize/BoolVal.php +++ b/src/Phalcon/Filter/Sanitize/BoolVal.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/Email.php b/src/Phalcon/Filter/Sanitize/Email.php similarity index 52% rename from src/Phalcon/filter/sanitize/Email.php rename to src/Phalcon/Filter/Sanitize/Email.php index 6efc92fa..26f81b73 100644 --- a/src/Phalcon/filter/sanitize/Email.php +++ b/src/Phalcon/Filter/Sanitize/Email.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/FloatVal.php b/src/Phalcon/Filter/Sanitize/FloatVal.php similarity index 52% rename from src/Phalcon/filter/sanitize/FloatVal.php rename to src/Phalcon/Filter/Sanitize/FloatVal.php index 916a7c04..8ab85789 100644 --- a/src/Phalcon/filter/sanitize/FloatVal.php +++ b/src/Phalcon/Filter/Sanitize/FloatVal.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/IntVal.php b/src/Phalcon/Filter/Sanitize/IntVal.php similarity index 52% rename from src/Phalcon/filter/sanitize/IntVal.php rename to src/Phalcon/Filter/Sanitize/IntVal.php index 98445ffc..dac4e5c3 100644 --- a/src/Phalcon/filter/sanitize/IntVal.php +++ b/src/Phalcon/Filter/Sanitize/IntVal.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/Lower.php b/src/Phalcon/Filter/Sanitize/Lower.php similarity index 53% rename from src/Phalcon/filter/sanitize/Lower.php rename to src/Phalcon/Filter/Sanitize/Lower.php index 19aaad22..c25fda7c 100644 --- a/src/Phalcon/filter/sanitize/Lower.php +++ b/src/Phalcon/Filter/Sanitize/Lower.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/LowerFirst.php b/src/Phalcon/Filter/Sanitize/LowerFirst.php similarity index 54% rename from src/Phalcon/filter/sanitize/LowerFirst.php rename to src/Phalcon/Filter/Sanitize/LowerFirst.php index 70f5a0bc..9595ffff 100644 --- a/src/Phalcon/filter/sanitize/LowerFirst.php +++ b/src/Phalcon/Filter/Sanitize/LowerFirst.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/Regex.php b/src/Phalcon/Filter/Sanitize/Regex.php similarity index 60% rename from src/Phalcon/filter/sanitize/Regex.php rename to src/Phalcon/Filter/Sanitize/Regex.php index f7aa7910..7441191b 100644 --- a/src/Phalcon/filter/sanitize/Regex.php +++ b/src/Phalcon/Filter/Sanitize/Regex.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/Remove.php b/src/Phalcon/Filter/Sanitize/Remove.php similarity index 57% rename from src/Phalcon/filter/sanitize/Remove.php rename to src/Phalcon/Filter/Sanitize/Remove.php index a556ef0f..a8225560 100644 --- a/src/Phalcon/filter/sanitize/Remove.php +++ b/src/Phalcon/Filter/Sanitize/Remove.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/Replace.php b/src/Phalcon/Filter/Sanitize/Replace.php similarity index 59% rename from src/Phalcon/filter/sanitize/Replace.php rename to src/Phalcon/Filter/Sanitize/Replace.php index 6117afa9..6a60ca8f 100644 --- a/src/Phalcon/filter/sanitize/Replace.php +++ b/src/Phalcon/Filter/Sanitize/Replace.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/Special.php b/src/Phalcon/Filter/Sanitize/Special.php similarity index 53% rename from src/Phalcon/filter/sanitize/Special.php rename to src/Phalcon/Filter/Sanitize/Special.php index fe890c36..9ab25623 100644 --- a/src/Phalcon/filter/sanitize/Special.php +++ b/src/Phalcon/Filter/Sanitize/Special.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/SpecialFull.php b/src/Phalcon/Filter/Sanitize/SpecialFull.php similarity index 57% rename from src/Phalcon/filter/sanitize/SpecialFull.php rename to src/Phalcon/Filter/Sanitize/SpecialFull.php index 04564d3a..f57bad76 100644 --- a/src/Phalcon/filter/sanitize/SpecialFull.php +++ b/src/Phalcon/Filter/Sanitize/SpecialFull.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/StringVal.php b/src/Phalcon/Filter/Sanitize/StringVal.php similarity index 52% rename from src/Phalcon/filter/sanitize/StringVal.php rename to src/Phalcon/Filter/Sanitize/StringVal.php index db0866a0..a2fcb069 100644 --- a/src/Phalcon/filter/sanitize/StringVal.php +++ b/src/Phalcon/Filter/Sanitize/StringVal.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/Striptags.php b/src/Phalcon/Filter/Sanitize/Striptags.php similarity index 53% rename from src/Phalcon/filter/sanitize/Striptags.php rename to src/Phalcon/Filter/Sanitize/Striptags.php index 72f8bf05..0b8a60b2 100644 --- a/src/Phalcon/filter/sanitize/Striptags.php +++ b/src/Phalcon/Filter/Sanitize/Striptags.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/Trim.php b/src/Phalcon/Filter/Sanitize/Trim.php similarity index 55% rename from src/Phalcon/filter/sanitize/Trim.php rename to src/Phalcon/Filter/Sanitize/Trim.php index c325fc47..4d20bd15 100644 --- a/src/Phalcon/filter/sanitize/Trim.php +++ b/src/Phalcon/Filter/Sanitize/Trim.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/Upper.php b/src/Phalcon/Filter/Sanitize/Upper.php similarity index 53% rename from src/Phalcon/filter/sanitize/Upper.php rename to src/Phalcon/Filter/Sanitize/Upper.php index 3baed094..73eaa13a 100644 --- a/src/Phalcon/filter/sanitize/Upper.php +++ b/src/Phalcon/Filter/Sanitize/Upper.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/UpperFirst.php b/src/Phalcon/Filter/Sanitize/UpperFirst.php similarity index 54% rename from src/Phalcon/filter/sanitize/UpperFirst.php rename to src/Phalcon/Filter/Sanitize/UpperFirst.php index afbc238b..52a48308 100644 --- a/src/Phalcon/filter/sanitize/UpperFirst.php +++ b/src/Phalcon/Filter/Sanitize/UpperFirst.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/UpperWords.php b/src/Phalcon/Filter/Sanitize/UpperWords.php similarity index 57% rename from src/Phalcon/filter/sanitize/UpperWords.php rename to src/Phalcon/Filter/Sanitize/UpperWords.php index 8f24dc60..a0ffce76 100644 --- a/src/Phalcon/filter/sanitize/UpperWords.php +++ b/src/Phalcon/Filter/Sanitize/UpperWords.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/filter/sanitize/Url.php b/src/Phalcon/Filter/Sanitize/Url.php similarity index 51% rename from src/Phalcon/filter/sanitize/Url.php rename to src/Phalcon/Filter/Sanitize/Url.php index ac80afde..8a9ee8d9 100644 --- a/src/Phalcon/filter/sanitize/Url.php +++ b/src/Phalcon/Filter/Sanitize/Url.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Filter\Sanitize; /** diff --git a/src/Phalcon/firewall/adapter/AbstractAdapter.php b/src/Phalcon/Firewall/Adapter/AbstractAdapter.php similarity index 92% rename from src/Phalcon/firewall/adapter/AbstractAdapter.php rename to src/Phalcon/Firewall/Adapter/AbstractAdapter.php index 5f9c0c44..8b1b5e98 100644 --- a/src/Phalcon/firewall/adapter/AbstractAdapter.php +++ b/src/Phalcon/Firewall/Adapter/AbstractAdapter.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Firewall\Adapter; use Closure; @@ -92,7 +99,7 @@ public function getDefaultAccess(): int /** * Returns the internal event manager * - * @return \Phalcon\Events\ManagerInterface + * @return ManagerInterface */ public function getEventsManager(): ManagerInterface { @@ -101,7 +108,7 @@ public function getEventsManager(): ManagerInterface /** * Gets role callback to fetch role name * - * @return \Closure + * @return Closure */ public function getRoleCallback(): Closure { @@ -140,6 +147,7 @@ public function setDefaultAccess(int $defaultAccess): AdapterInterface * Sets the events manager * * @param \Phalcon\Events\ManagerInterface $eventsManager + * @return void */ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager) { @@ -159,6 +167,7 @@ public function setRoleCallback(\Closure $callback): AdapterInterface * Sets always resolving role option * * @param bool $alwaysResolvingRole + * @return void */ public function setAlwaysResolvingRole(bool $alwaysResolvingRole) { @@ -166,6 +175,7 @@ public function setAlwaysResolvingRole(bool $alwaysResolvingRole) /** * @param \Phalcon\Di\DiInterface $container + * @return void */ protected function callRoleCallback(\Phalcon\Di\DiInterface $container) { @@ -209,6 +219,7 @@ protected function fireEventOrThrowException($role, string $actionName, string $ * * @param string $key * @param bool $access + * @return void */ protected function saveAccessInCache(string $key, bool $access) { diff --git a/src/Phalcon/firewall/adapter/Acl.php b/src/Phalcon/Firewall/Adapter/Acl.php similarity index 92% rename from src/Phalcon/firewall/adapter/Acl.php rename to src/Phalcon/Firewall/Adapter/Acl.php index c45de4ce..a7cd0383 100644 --- a/src/Phalcon/firewall/adapter/Acl.php +++ b/src/Phalcon/Firewall/Adapter/Acl.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Firewall\Adapter; use Phalcon\Mvc\DispatcherInterface; @@ -7,7 +14,7 @@ /** * FirewallZ for Phalcon\Application which depends on acl and dispatcher */ -class Acl extends AbstractAdapter +class Acl extends \Phalcon\Firewall\Adapter\AbstractAdapter { /** * Acl service name @@ -158,7 +165,7 @@ public function beforeExecuteRoute(\Phalcon\Events\Event $event, \Phalcon\Mvc\Di /** * Gets dispatcher * - * @return \Phalcon\Mvc\DispatcherInterface + * @return DispatcherInterface */ public function getDispatcher(): DispatcherInterface { @@ -202,6 +209,7 @@ protected function handleDispatcher(\Phalcon\Mvc\DispatcherInterface $dispatcher /** * @param string $key * @param bool $access + * @return void */ protected function saveAccessInCache(string $key, bool $access) { diff --git a/src/Phalcon/firewall/adapter/AdapterInterface.php b/src/Phalcon/Firewall/Adapter/AdapterInterface.php similarity index 83% rename from src/Phalcon/firewall/adapter/AdapterInterface.php rename to src/Phalcon/Firewall/Adapter/AdapterInterface.php index 24eed8aa..e356e610 100644 --- a/src/Phalcon/firewall/adapter/AdapterInterface.php +++ b/src/Phalcon/Firewall/Adapter/AdapterInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Firewall\Adapter; use Closure; @@ -20,7 +27,7 @@ public function getDefaultAccess(): int; /** * Gets role callback to fetch role name * - * @return \Closure + * @return Closure */ public function getRoleCallback(): Closure; @@ -35,6 +42,7 @@ public function isAlwaysResolvingRole(): bool; * Sets always resolving role option * * @param bool $alwaysResolvingRole + * @return void */ public function setAlwaysResolvingRole(bool $alwaysResolvingRole); diff --git a/src/Phalcon/firewall/adapter/Annotations.php b/src/Phalcon/Firewall/Adapter/Annotations.php similarity index 89% rename from src/Phalcon/firewall/adapter/Annotations.php rename to src/Phalcon/Firewall/Adapter/Annotations.php index 610d81f0..38def960 100644 --- a/src/Phalcon/firewall/adapter/Annotations.php +++ b/src/Phalcon/Firewall/Adapter/Annotations.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Firewall\Adapter; use Phalcon\Mvc\DispatcherInterface; @@ -7,7 +14,7 @@ /** * Firewall which depends on annotations and dispatcher */ -class Annotations extends AbstractAdapter +class Annotations extends \Phalcon\Firewall\Adapter\AbstractAdapter { /** * Number of active active arguments in active annotation @@ -75,7 +82,7 @@ public function beforeExecuteRoute(\Phalcon\Events\Event $event, \Phalcon\Mvc\Di /** * Gets dispatcher * - * @return \Phalcon\Mvc\DispatcherInterface + * @return DispatcherInterface */ public function getDispatcher(): DispatcherInterface { diff --git a/src/Phalcon/firewall/adapter/micro/Acl.php b/src/Phalcon/Firewall/Adapter/Micro/Acl.php similarity index 94% rename from src/Phalcon/firewall/adapter/micro/Acl.php rename to src/Phalcon/Firewall/Adapter/Micro/Acl.php index bc3227c6..0d54d50a 100644 --- a/src/Phalcon/firewall/adapter/micro/Acl.php +++ b/src/Phalcon/Firewall/Adapter/Micro/Acl.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Firewall\Adapter\Micro; use Phalcon\Firewall\Adapter\AbstractAdapter; @@ -181,7 +188,7 @@ public function beforeExecuteRoute(\Phalcon\Events\Event $event, \Phalcon\Mvc\Mi /** * Gets micro * - * @return \Phalcon\Mvc\Micro + * @return Micro */ public function getMicro(): Micro { @@ -228,6 +235,7 @@ protected function handleRouter(\Phalcon\Mvc\Micro $micro) /** * @param string $key * @param bool $access + * @return void */ protected function saveAccessInCache(string $key, bool $access) { diff --git a/src/Phalcon/Firewall/Exception.php b/src/Phalcon/Firewall/Exception.php new file mode 100644 index 00000000..df1a6c70 --- /dev/null +++ b/src/Phalcon/Firewall/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Firewall; + +/** + * Exceptions thrown in Phalcon\Firewall will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/flash/AbstractFlash.php b/src/Phalcon/Flash/AbstractFlash.php similarity index 94% rename from src/Phalcon/flash/AbstractFlash.php rename to src/Phalcon/Flash/AbstractFlash.php index e37abb3a..cb3086e4 100644 --- a/src/Phalcon/flash/AbstractFlash.php +++ b/src/Phalcon/Flash/AbstractFlash.php @@ -1,9 +1,17 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Flash; use Phalcon\Di\AbstractInjectionAware; use Phalcon\Escaper\EscaperInterface; +use Phalcon\Session\ManagerInterface as SessionInterface; /** * Shows HTML notifications related to different circumstances. Classes can be @@ -90,6 +98,8 @@ public function __construct(\Phalcon\Escaper\EscaperInterface $escaper = null, \ /** * Clears accumulated messages when implicit flush is disabled + * + * @return void */ public function clear() { @@ -112,7 +122,7 @@ public function error(string $message): string /** * Returns the Escaper Service * - * @return \Phalcon\Escaper\EscaperInterface + * @return EscaperInterface */ public function getEscaperService(): EscaperInterface { @@ -215,8 +225,8 @@ public function success(string $message): string * ``` * * @param string|array $message - * @param string $type * @return string|void + * @param string $type */ public function outputMessage(string $type, $message) { diff --git a/src/Phalcon/flash/Direct.php b/src/Phalcon/Flash/Direct.php similarity index 63% rename from src/Phalcon/flash/Direct.php rename to src/Phalcon/Flash/Direct.php index 92ba9061..e4a809ee 100644 --- a/src/Phalcon/flash/Direct.php +++ b/src/Phalcon/Flash/Direct.php @@ -1,12 +1,19 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Flash; /** * This is a variant of the Phalcon\Flash that immediately outputs any message * passed to it */ -class Direct extends AbstractFlash +class Direct extends \Phalcon\Flash\AbstractFlash { /** @@ -24,6 +31,7 @@ public function message(string $type, $message): ?string * Prints the messages accumulated in the flasher * * @param bool $remove + * @return void */ public function output(bool $remove = true) { diff --git a/src/Phalcon/Flash/Exception.php b/src/Phalcon/Flash/Exception.php new file mode 100644 index 00000000..cc2e3fea --- /dev/null +++ b/src/Phalcon/Flash/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Flash; + +/** + * Exceptions thrown in Phalcon\Flash will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/flash/FlashInterface.php b/src/Phalcon/Flash/FlashInterface.php similarity index 81% rename from src/Phalcon/flash/FlashInterface.php rename to src/Phalcon/Flash/FlashInterface.php index b5161398..d311b268 100644 --- a/src/Phalcon/flash/FlashInterface.php +++ b/src/Phalcon/Flash/FlashInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Flash; /** diff --git a/src/Phalcon/flash/Session.php b/src/Phalcon/Flash/Session.php similarity index 82% rename from src/Phalcon/flash/Session.php rename to src/Phalcon/Flash/Session.php index 9a36708b..4bf0687f 100644 --- a/src/Phalcon/flash/Session.php +++ b/src/Phalcon/Flash/Session.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Flash; use Phalcon\Session\ManagerInterface; @@ -8,11 +15,13 @@ * Temporarily stores the messages in session, then messages can be printed in * the next request */ -class Session extends AbstractFlash +class Session extends \Phalcon\Flash\AbstractFlash { /** * Clear messages in the session messenger + * + * @return void */ public function clear() { @@ -54,6 +63,7 @@ public function message(string $type, string $message): ?string * Prints the messages in the session flasher * * @param bool $remove + * @return void */ public function output(bool $remove = true) { @@ -83,7 +93,7 @@ protected function setSessionMessages(array $messages): array /** * Returns the Session Service * - * @return \Phalcon\Session\ManagerInterface + * @return ManagerInterface */ public function getSessionService(): ManagerInterface { diff --git a/src/Phalcon/forms/element/AbstractElement.php b/src/Phalcon/Forms/Element/AbstractElement.php similarity index 96% rename from src/Phalcon/forms/element/AbstractElement.php rename to src/Phalcon/Forms/Element/AbstractElement.php index 9bae5d4a..8dbc902e 100644 --- a/src/Phalcon/forms/element/AbstractElement.php +++ b/src/Phalcon/Forms/Element/AbstractElement.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Forms\Element; use Phalcon\Forms\Form; @@ -152,7 +159,7 @@ public function getFilters() /** * Returns the parent form to the element * - * @return \Phalcon\Forms\Form + * @return Form */ public function getForm(): Form { @@ -171,7 +178,7 @@ public function getLabel(): string * Returns the messages that belongs to the element * The element needs to be attached to a form * - * @return \Phalcon\Messages\Messages + * @return Messages */ public function getMessages(): Messages { @@ -209,7 +216,7 @@ public function getUserOptions(): array /** * Returns the validators registered for the element * - * @return array|\Phalcon\Validation\ValidatorInterface[] + * @return array */ public function getValidators(): array { diff --git a/src/Phalcon/forms/element/Check.php b/src/Phalcon/Forms/Element/Check.php similarity index 53% rename from src/Phalcon/forms/element/Check.php rename to src/Phalcon/Forms/Element/Check.php index 68472d21..252045d6 100644 --- a/src/Phalcon/forms/element/Check.php +++ b/src/Phalcon/Forms/Element/Check.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Forms\Element; /** @@ -7,7 +14,7 @@ * * Component INPUT[type=check] for forms */ -class Check extends AbstractElement +class Check extends \Phalcon\Forms\Element\AbstractElement { /** diff --git a/src/Phalcon/forms/element/Date.php b/src/Phalcon/Forms/Element/Date.php similarity index 51% rename from src/Phalcon/forms/element/Date.php rename to src/Phalcon/Forms/Element/Date.php index 56000b1b..fc2cc229 100644 --- a/src/Phalcon/forms/element/Date.php +++ b/src/Phalcon/Forms/Element/Date.php @@ -1,11 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Forms\Element; /** * Component INPUT[type=date] for forms */ -class Date extends AbstractElement +class Date extends \Phalcon\Forms\Element\AbstractElement { /** diff --git a/src/Phalcon/forms/element/ElementInterface.php b/src/Phalcon/Forms/Element/ElementInterface.php similarity index 95% rename from src/Phalcon/forms/element/ElementInterface.php rename to src/Phalcon/Forms/Element/ElementInterface.php index fbde7685..4274309b 100644 --- a/src/Phalcon/forms/element/ElementInterface.php +++ b/src/Phalcon/Forms/Element/ElementInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Forms\Element; use Phalcon\Forms\Form; @@ -86,7 +93,7 @@ public function getFilters(); /** * Returns the parent form to the element * - * @return \Phalcon\Forms\Form + * @return Form */ public function getForm(): Form; @@ -101,7 +108,7 @@ public function getLabel(): string; * Returns the messages that belongs to the element * The element needs to be attached to a form * - * @return \Phalcon\Messages\Messages + * @return Messages */ public function getMessages(): Messages; @@ -131,7 +138,7 @@ public function getUserOptions(): array; /** * Returns the validators registered for the element * - * @return array|\Phalcon\Validation\ValidatorInterface[] + * @return array */ public function getValidators(): array; diff --git a/src/Phalcon/forms/element/Email.php b/src/Phalcon/Forms/Element/Email.php similarity index 53% rename from src/Phalcon/forms/element/Email.php rename to src/Phalcon/Forms/Element/Email.php index d008a2a0..d89895dd 100644 --- a/src/Phalcon/forms/element/Email.php +++ b/src/Phalcon/Forms/Element/Email.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Forms\Element; /** @@ -7,7 +14,7 @@ * * Component INPUT[type=email] for forms */ -class Email extends AbstractElement +class Email extends \Phalcon\Forms\Element\AbstractElement { /** diff --git a/src/Phalcon/forms/element/File.php b/src/Phalcon/Forms/Element/File.php similarity index 51% rename from src/Phalcon/forms/element/File.php rename to src/Phalcon/Forms/Element/File.php index 89f91f29..7085a434 100644 --- a/src/Phalcon/forms/element/File.php +++ b/src/Phalcon/Forms/Element/File.php @@ -1,11 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Forms\Element; /** * Component INPUT[type=file] for forms */ -class File extends AbstractElement +class File extends \Phalcon\Forms\Element\AbstractElement { /** diff --git a/src/Phalcon/forms/element/Hidden.php b/src/Phalcon/Forms/Element/Hidden.php similarity index 53% rename from src/Phalcon/forms/element/Hidden.php rename to src/Phalcon/Forms/Element/Hidden.php index 8821861c..faa70448 100644 --- a/src/Phalcon/forms/element/Hidden.php +++ b/src/Phalcon/Forms/Element/Hidden.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Forms\Element; /** @@ -7,7 +14,7 @@ * * Component INPUT[type=hidden] for forms */ -class Hidden extends AbstractElement +class Hidden extends \Phalcon\Forms\Element\AbstractElement { /** diff --git a/src/Phalcon/forms/element/Numeric.php b/src/Phalcon/Forms/Element/Numeric.php similarity index 53% rename from src/Phalcon/forms/element/Numeric.php rename to src/Phalcon/Forms/Element/Numeric.php index 2a348713..384b8af1 100644 --- a/src/Phalcon/forms/element/Numeric.php +++ b/src/Phalcon/Forms/Element/Numeric.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Forms\Element; /** @@ -7,7 +14,7 @@ * * Component INPUT[type=number] for forms */ -class Numeric extends AbstractElement +class Numeric extends \Phalcon\Forms\Element\AbstractElement { /** diff --git a/src/Phalcon/forms/element/Password.php b/src/Phalcon/Forms/Element/Password.php similarity index 53% rename from src/Phalcon/forms/element/Password.php rename to src/Phalcon/Forms/Element/Password.php index 23f775ed..a914d3c0 100644 --- a/src/Phalcon/forms/element/Password.php +++ b/src/Phalcon/Forms/Element/Password.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Forms\Element; /** @@ -7,7 +14,7 @@ * * Component INPUT[type=password] for forms */ -class Password extends AbstractElement +class Password extends \Phalcon\Forms\Element\AbstractElement { /** diff --git a/src/Phalcon/forms/element/Radio.php b/src/Phalcon/Forms/Element/Radio.php similarity index 53% rename from src/Phalcon/forms/element/Radio.php rename to src/Phalcon/Forms/Element/Radio.php index 1a6b4e25..c3ce28db 100644 --- a/src/Phalcon/forms/element/Radio.php +++ b/src/Phalcon/Forms/Element/Radio.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Forms\Element; /** @@ -7,7 +14,7 @@ * * Component INPUT[type=radio] for forms */ -class Radio extends AbstractElement +class Radio extends \Phalcon\Forms\Element\AbstractElement { /** diff --git a/src/Phalcon/forms/element/Select.php b/src/Phalcon/Forms/Element/Select.php similarity index 75% rename from src/Phalcon/forms/element/Select.php rename to src/Phalcon/Forms/Element/Select.php index 4c2c5c4c..7796f076 100644 --- a/src/Phalcon/forms/element/Select.php +++ b/src/Phalcon/Forms/Element/Select.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Forms\Element; /** @@ -7,7 +14,7 @@ * * Component SELECT (choice) for forms */ -class Select extends AbstractElement +class Select extends \Phalcon\Forms\Element\AbstractElement { protected $optionsValues; @@ -28,7 +35,7 @@ public function __construct(string $name, $options = null, $attributes = null) * Adds an option to the current options * * @param array|string $option - * @return \Phalcon\Forms\Element\ElementInterface + * @return ElementInterface */ public function addOption($option): ElementInterface { @@ -57,7 +64,7 @@ public function render(array $attributes = array()): string * Set the choice's options * * @param array|object $options - * @return \Phalcon\Forms\Element\ElementInterface + * @return ElementInterface */ public function setOptions($options): ElementInterface { diff --git a/src/Phalcon/Forms/Element/Submit.php b/src/Phalcon/Forms/Element/Submit.php new file mode 100644 index 00000000..36dfea82 --- /dev/null +++ b/src/Phalcon/Forms/Element/Submit.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Forms\Element; + +/** + * Component INPUT[type=submit] for forms + */ +class Submit extends \Phalcon\Forms\Element\AbstractElement +{ + + /** + * Renders the element widget + * + * @param array $attributes + * @return string + */ + public function render(array $attributes = array()): string + { + } +} diff --git a/src/Phalcon/forms/element/Text.php b/src/Phalcon/Forms/Element/Text.php similarity index 52% rename from src/Phalcon/forms/element/Text.php rename to src/Phalcon/Forms/Element/Text.php index 32aeaf71..f66ebf22 100644 --- a/src/Phalcon/forms/element/Text.php +++ b/src/Phalcon/Forms/Element/Text.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Forms\Element; /** @@ -7,7 +14,7 @@ * * Component INPUT[type=text] for forms */ -class Text extends AbstractElement +class Text extends \Phalcon\Forms\Element\AbstractElement { /** diff --git a/src/Phalcon/Forms/Element/TextArea.php b/src/Phalcon/Forms/Element/TextArea.php new file mode 100644 index 00000000..b316bbf2 --- /dev/null +++ b/src/Phalcon/Forms/Element/TextArea.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Forms\Element; + +/** + * Component TEXTAREA for forms + */ +class TextArea extends \Phalcon\Forms\Element\AbstractElement +{ + + /** + * Renders the element widget + * + * @param array $attributes + * @return string + */ + public function render(array $attributes = array()): string + { + } +} diff --git a/src/Phalcon/Forms/Exception.php b/src/Phalcon/Forms/Exception.php new file mode 100644 index 00000000..87d1a846 --- /dev/null +++ b/src/Phalcon/Forms/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Forms; + +/** + * Exceptions thrown in Phalcon\Forms will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/forms/Form.php b/src/Phalcon/Forms/Form.php similarity index 93% rename from src/Phalcon/forms/Form.php rename to src/Phalcon/Forms/Form.php index 18cdb99d..01e9d411 100644 --- a/src/Phalcon/forms/Form.php +++ b/src/Phalcon/Forms/Form.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Forms; use Phalcon\Di\Injectable; @@ -111,7 +118,7 @@ public function count(): int /** * Returns the current element in the iterator * - * @return bool|\Phalcon\Forms\Element\ElementInterface + * @return mixed */ public function current() { @@ -121,7 +128,7 @@ public function current() * Returns an element added to the form by its name * * @param string $name - * @return \Phalcon\Forms\Element\ElementInterface + * @return ElementInterface */ public function get(string $name): ElementInterface { @@ -139,7 +146,7 @@ public function getAction(): string /** * Get Form attributes collection * - * @return \Phalcon\Html\Attributes + * @return Attributes */ public function getAttributes(): Attributes { @@ -148,7 +155,7 @@ public function getAttributes(): Attributes /** * Returns the form elements added to the form * - * @return array|\Phalcon\Forms\Element\ElementInterface[] + * @return array */ public function getElements(): array { @@ -186,7 +193,7 @@ public function getLabel(string $name): string * } * ``` * - * @return array|\Phalcon\Messages\Messages + * @return mixed */ public function getMessages() { @@ -196,7 +203,7 @@ public function getMessages() * Returns the messages generated for a specific element * * @param string $name - * @return \Phalcon\Messages\Messages + * @return Messages */ public function getMessagesFor(string $name): Messages { @@ -285,6 +292,8 @@ public function label(string $name, array $attributes = null): string /** * Moves the internal iteration pointer to the next position + * + * @return void */ public function next() { @@ -313,6 +322,8 @@ public function remove(string $name): bool /** * Rewinds the internal iterator + * + * @return void */ public function rewind() { @@ -321,8 +332,8 @@ public function rewind() /** * Sets the form's action * - * @param string $action * @return Form + * @param string $action */ public function setAction(string $action): Form { @@ -342,7 +353,7 @@ public function setEntity($entity): Form * Set form attributes collection * * @param \Phalcon\Html\Attributes $attributes - * @return \Phalcon\Html\Attributes\AttributesInterface + * @return AttributesInterface */ public function setAttributes(\Phalcon\Html\Attributes $attributes): AttributesInterface { diff --git a/src/Phalcon/forms/Manager.php b/src/Phalcon/Forms/Manager.php similarity index 80% rename from src/Phalcon/forms/Manager.php rename to src/Phalcon/Forms/Manager.php index 42aeafcc..89f01681 100644 --- a/src/Phalcon/forms/Manager.php +++ b/src/Phalcon/Forms/Manager.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Forms; /** diff --git a/src/Phalcon/helper/Arr.php b/src/Phalcon/Helper/Arr.php similarity index 88% rename from src/Phalcon/helper/Arr.php rename to src/Phalcon/Helper/Arr.php index 70f8dd5a..4181a55a 100644 --- a/src/Phalcon/helper/Arr.php +++ b/src/Phalcon/Helper/Arr.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Helper; /** @@ -12,8 +19,8 @@ class Arr * Chunks an array into smaller arrays of a specified size. * * @param array $collection - * @param int $size - * @param bool $preserveKeys + * @param int $size + * @param bool $preserveKeys * * @return array */ @@ -25,7 +32,7 @@ final public static function chunk(array $collection, int $size, bool $preserveK * Returns the first element of the collection. If a callable is passed, the * element returned is the first that validates true * - * @param array $collection + * @param array $collection * @param callable $method * * @return mixed @@ -38,7 +45,7 @@ final public static function first(array $collection, $method = null) * Returns the key of the first element of the collection. If a callable * is passed, the element returned is the first that validates true * - * @param array $collection + * @param array $collection * @param callable $method * * @return mixed @@ -51,7 +58,7 @@ final public static function firstKey(array $collection, $method = null) * Flattens an array up to the one level depth, unless `$deep` is set to `true` * * @param array $collection - * @param bool $deep + * @param bool $deep * * @return array */ @@ -75,7 +82,7 @@ final public static function get(array $collection, $index, $defaultValue = null /** * Groups the elements of an array based on the passed callable * - * @param array $collection + * @param array $collection * @param callable $method * * @return array @@ -113,7 +120,7 @@ final public static function isUnique(array $collection): bool * Returns the last element of the collection. If a callable is passed, the * element returned is the first that validates true * - * @param array $collection + * @param array $collection * @param callable $method * * return mixed @@ -127,7 +134,7 @@ final public static function last(array $collection, $method = null) * Returns the key of the last element of the collection. If a callable is * passed, the element returned is the first that validates true * - * @param array $collection + * @param array $collection * @param callable $method * * @return mixed @@ -139,8 +146,8 @@ final public static function lastKey(array $collection, $method = null) /** * Sorts a collection of arrays or objects by key * - * @param array $collection - * @param mixed $attribute + * @param array $collection + * @param mixed $attribute * @param string $order * * @return array @@ -152,7 +159,7 @@ final public static function order(array $collection, $attribute, string $order /** * Retrieves all of the values for a given key: * - * @param array $collection + * @param array $collection * @param string $element * * @return array @@ -178,7 +185,7 @@ final public static function set(array $collection, $value, $index = null): arra * Returns a new array with n elements removed from the right. * * @param array $collection - * @param int $elements + * @param int $elements * * @return array */ @@ -190,7 +197,7 @@ final public static function sliceLeft(array $collection, int $elements = 1): ar * Returns a new array with the X elements from the right * * @param array $collection - * @param int $elements + * @param int $elements * * @return array */ @@ -223,7 +230,7 @@ final public static function toObject(array $collection) * Returns true if the provided function returns true for all elements of * the collection, false otherwise. * - * @param array $collection + * @param array $collection * @param callable $method * * @return bool @@ -236,7 +243,7 @@ final public static function validateAll(array $collection, $method): bool * Returns true if the provided function returns true for at least one * element fo the collection, false otherwise. * - * @param array $collection + * @param array $collection * @param callable $method * * @return bool @@ -248,7 +255,7 @@ final public static function validateAny(array $collection, $method): bool /** * Helper method to filter the collection * - * @param array $collection + * @param array $collection * @param callable $method * * @return array diff --git a/src/Phalcon/Helper/Exception.php b/src/Phalcon/Helper/Exception.php new file mode 100644 index 00000000..3235d7fa --- /dev/null +++ b/src/Phalcon/Helper/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Helper; + +/** + * Exceptions thrown in Phalcon\Helper will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/helper/Fs.php b/src/Phalcon/Helper/Fs.php similarity index 71% rename from src/Phalcon/helper/Fs.php rename to src/Phalcon/Helper/Fs.php index 04e5c383..b0ad9265 100644 --- a/src/Phalcon/helper/Fs.php +++ b/src/Phalcon/Helper/Fs.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Helper; /** diff --git a/src/Phalcon/helper/Number.php b/src/Phalcon/Helper/Number.php similarity index 64% rename from src/Phalcon/helper/Number.php rename to src/Phalcon/Helper/Number.php index 63d21e47..09e62a95 100644 --- a/src/Phalcon/helper/Number.php +++ b/src/Phalcon/Helper/Number.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Helper; /** diff --git a/src/Phalcon/helper/Str.php b/src/Phalcon/Helper/Str.php similarity index 96% rename from src/Phalcon/helper/Str.php rename to src/Phalcon/Helper/Str.php index 60e6890a..7d3de81d 100644 --- a/src/Phalcon/helper/Str.php +++ b/src/Phalcon/Helper/Str.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Helper; /** @@ -38,7 +45,7 @@ class Str * ``` * * @param string $text - * @param mixed $delimiter + * @param mixed $delimiter * * @return string */ @@ -67,9 +74,9 @@ final public static function camelize(string $text, $delimiter = null): string * @param string $b * @param string ...N * + * @return string * @param string ...N * - * @return string */ final public static function concat(): string { @@ -81,8 +88,8 @@ final public static function concat(): string * * @param string $string * - * @param string $text * @return int + * @param string $text */ final public static function countVowels(string $text): int { @@ -94,11 +101,11 @@ final public static function countVowels(string $text): int * string intact, or set it to true to convert to uppercase. * * @param string $string - * @param bool $upperRest + * @param bool $upperRest * @param string $encoding * - * @param string $text * @return string + * @param string $text */ final public static function decapitalize(string $text, bool $upperRest = false, string $encoding = 'UTF-8'): string { @@ -187,7 +194,7 @@ final public static function dynamic(string $text, string $leftDelimiter = '{', * * @param string $text * @param string $end - * @param bool $ignoreCase + * @param bool $ignoreCase * * @return bool */ @@ -374,7 +381,7 @@ final public static function reduceSlashes(string $text): string * * @param string $text * @param string $start - * @param bool $ignoreCase + * @param bool $ignoreCase * * @return bool */ @@ -393,7 +400,7 @@ final public static function startsWith(string $text, string $start, bool $ignor * ``` * * @param string $text - * @param mixed $delimiter + * @param mixed $delimiter * * @return string */ diff --git a/src/Phalcon/html/Attributes.php b/src/Phalcon/Html/Attributes.php similarity index 67% rename from src/Phalcon/html/Attributes.php rename to src/Phalcon/Html/Attributes.php index b15686e8..d431bbcc 100644 --- a/src/Phalcon/html/Attributes.php +++ b/src/Phalcon/Html/Attributes.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Html; use Phalcon\Collection; diff --git a/src/Phalcon/html/attributes/AttributesInterface.php b/src/Phalcon/Html/Attributes/AttributesInterface.php similarity index 68% rename from src/Phalcon/html/attributes/AttributesInterface.php rename to src/Phalcon/Html/Attributes/AttributesInterface.php index 10d1db1d..8d5a50e0 100644 --- a/src/Phalcon/html/attributes/AttributesInterface.php +++ b/src/Phalcon/Html/Attributes/AttributesInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Html\Attributes; use Phalcon\Html\Attributes; @@ -15,7 +22,7 @@ interface AttributesInterface /** * Get Attributes * - * @return \Phalcon\Html\Attributes + * @return Attributes */ public function getAttributes(): Attributes; diff --git a/src/Phalcon/html/attributes/RenderInterface.php b/src/Phalcon/Html/Attributes/RenderInterface.php similarity index 57% rename from src/Phalcon/html/attributes/RenderInterface.php rename to src/Phalcon/Html/Attributes/RenderInterface.php index 1b94eb49..7fb01f6a 100644 --- a/src/Phalcon/html/attributes/RenderInterface.php +++ b/src/Phalcon/Html/Attributes/RenderInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Html\Attributes; /** diff --git a/src/Phalcon/html/Breadcrumbs.php b/src/Phalcon/Html/Breadcrumbs.php similarity index 89% rename from src/Phalcon/html/Breadcrumbs.php rename to src/Phalcon/Html/Breadcrumbs.php index be4e59a9..dae1eeb7 100644 --- a/src/Phalcon/html/Breadcrumbs.php +++ b/src/Phalcon/Html/Breadcrumbs.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Html; /** @@ -76,6 +83,8 @@ public function add(string $label, string $link = ''): Breadcrumbs * ```php * $breadcrumbs->clear() * ``` + * + * @return void */ public function clear() { @@ -92,6 +101,7 @@ public function clear() * ``` * * @param string $link + * @return void */ public function remove(string $link) { diff --git a/src/Phalcon/Html/Exception.php b/src/Phalcon/Html/Exception.php new file mode 100644 index 00000000..0faae5dc --- /dev/null +++ b/src/Phalcon/Html/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Html; + +/** + * Phalcon\Html\Tag\Exception + * + * Exceptions thrown in Phalcon\Html\Tag will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/html/helper/AbstractHelper.php b/src/Phalcon/Html/Helper/AbstractHelper.php similarity index 88% rename from src/Phalcon/html/helper/AbstractHelper.php rename to src/Phalcon/Html/Helper/AbstractHelper.php index 3e4d856f..8e02f3e8 100644 --- a/src/Phalcon/html/helper/AbstractHelper.php +++ b/src/Phalcon/Html/Helper/AbstractHelper.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Html\Helper; use Phalcon\Escaper\EscaperInterface; diff --git a/src/Phalcon/html/helper/Anchor.php b/src/Phalcon/Html/Helper/Anchor.php similarity index 58% rename from src/Phalcon/html/helper/Anchor.php rename to src/Phalcon/Html/Helper/Anchor.php index 70ad18aa..2624e59f 100644 --- a/src/Phalcon/html/helper/Anchor.php +++ b/src/Phalcon/Html/Helper/Anchor.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Html\Helper; /** @@ -7,7 +14,7 @@ * * Creates an anchor */ -class Anchor extends AbstractHelper +class Anchor extends \Phalcon\Html\Helper\AbstractHelper { /** diff --git a/src/Phalcon/html/helper/AnchorRaw.php b/src/Phalcon/Html/Helper/AnchorRaw.php similarity index 58% rename from src/Phalcon/html/helper/AnchorRaw.php rename to src/Phalcon/Html/Helper/AnchorRaw.php index 27555b04..402f7bde 100644 --- a/src/Phalcon/html/helper/AnchorRaw.php +++ b/src/Phalcon/Html/Helper/AnchorRaw.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Html\Helper; /** @@ -7,7 +14,7 @@ * * Creates a raw anchor */ -class AnchorRaw extends AbstractHelper +class AnchorRaw extends \Phalcon\Html\Helper\AbstractHelper { /** diff --git a/src/Phalcon/Html/Helper/Body.php b/src/Phalcon/Html/Helper/Body.php new file mode 100644 index 00000000..6584697d --- /dev/null +++ b/src/Phalcon/Html/Helper/Body.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Html\Helper; + +/** + * Phalcon\Html\Helper\Body + * + * Creates a body tag + */ +class Body extends \Phalcon\Html\Helper\AbstractHelper +{ + + /** + * @param array $attributes Any additional attributes + * @return string + */ + public function __invoke(array $attributes = array()): string + { + } +} diff --git a/src/Phalcon/html/helper/Button.php b/src/Phalcon/Html/Helper/Button.php similarity index 55% rename from src/Phalcon/html/helper/Button.php rename to src/Phalcon/Html/Helper/Button.php index 56b8eca9..75de0d32 100644 --- a/src/Phalcon/html/helper/Button.php +++ b/src/Phalcon/Html/Helper/Button.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Html\Helper; /** @@ -7,7 +14,7 @@ * * Creates a button tag */ -class Button extends AbstractHelper +class Button extends \Phalcon\Html\Helper\AbstractHelper { /** diff --git a/src/Phalcon/html/helper/Close.php b/src/Phalcon/Html/Helper/Close.php similarity index 57% rename from src/Phalcon/html/helper/Close.php rename to src/Phalcon/Html/Helper/Close.php index 5e4d0e78..3077a9fc 100644 --- a/src/Phalcon/html/helper/Close.php +++ b/src/Phalcon/Html/Helper/Close.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Html\Helper; /** diff --git a/src/Phalcon/html/helper/Element.php b/src/Phalcon/Html/Helper/Element.php similarity index 58% rename from src/Phalcon/html/helper/Element.php rename to src/Phalcon/Html/Helper/Element.php index 92d66641..ec33c18b 100644 --- a/src/Phalcon/html/helper/Element.php +++ b/src/Phalcon/Html/Helper/Element.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Html\Helper; /** @@ -7,7 +14,7 @@ * * Creates an element */ -class Element extends AbstractHelper +class Element extends \Phalcon\Html\Helper\AbstractHelper { /** diff --git a/src/Phalcon/Html/Helper/ElementRaw.php b/src/Phalcon/Html/Helper/ElementRaw.php new file mode 100644 index 00000000..e59e6900 --- /dev/null +++ b/src/Phalcon/Html/Helper/ElementRaw.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Html\Helper; + +use Phalcon\Html\Exception; + +/** + * Phalcon\Html\Helper\ElementRaw + * + * Creates an element raw + */ +class ElementRaw extends \Phalcon\Html\Helper\AbstractHelper +{ + + /** + * @param string $tag The tag for the anchor + * @param string $text The text for the anchor + * @param array $attributes Any additional attributes + * + * @return string + * @throws Exception + */ + public function __invoke(string $tag, string $text, array $attributes = array()): string + { + } +} diff --git a/src/Phalcon/html/helper/Form.php b/src/Phalcon/Html/Helper/Form.php similarity index 50% rename from src/Phalcon/html/helper/Form.php rename to src/Phalcon/Html/Helper/Form.php index 341db284..41e5fd76 100644 --- a/src/Phalcon/html/helper/Form.php +++ b/src/Phalcon/Html/Helper/Form.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Html\Helper; /** @@ -7,7 +14,7 @@ * * Creates a form opening tag */ -class Form extends AbstractHelper +class Form extends \Phalcon\Html\Helper\AbstractHelper { /** diff --git a/src/Phalcon/html/helper/Img.php b/src/Phalcon/Html/Helper/Img.php similarity index 56% rename from src/Phalcon/html/helper/Img.php rename to src/Phalcon/Html/Helper/Img.php index 1fa5ed79..1ae6623c 100644 --- a/src/Phalcon/html/helper/Img.php +++ b/src/Phalcon/Html/Helper/Img.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Html\Helper; use Phalcon\Html\Exception; @@ -14,7 +21,7 @@ class Img extends \Phalcon\Html\Helper\AbstractHelper /** * @param string $src - * @param array $attributes Any additional attributes + * @param array $attributes Any additional attributes * * @return string * @throws Exception diff --git a/src/Phalcon/html/helper/Label.php b/src/Phalcon/Html/Helper/Label.php similarity index 63% rename from src/Phalcon/html/helper/Label.php rename to src/Phalcon/Html/Helper/Label.php index c6b67169..cf170cb5 100644 --- a/src/Phalcon/html/helper/Label.php +++ b/src/Phalcon/Html/Helper/Label.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Html\Helper; use Phalcon\Html\Exception; diff --git a/src/Phalcon/html/helper/TextArea.php b/src/Phalcon/Html/Helper/TextArea.php similarity index 55% rename from src/Phalcon/html/helper/TextArea.php rename to src/Phalcon/Html/Helper/TextArea.php index ba570df0..63fe97a0 100644 --- a/src/Phalcon/html/helper/TextArea.php +++ b/src/Phalcon/Html/Helper/TextArea.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Html\Helper; /** @@ -7,7 +14,7 @@ * * Creates a textarea tag */ -class TextArea extends AbstractHelper +class TextArea extends \Phalcon\Html\Helper\AbstractHelper { /** diff --git a/src/Phalcon/Html/Link/EvolvableLink.php b/src/Phalcon/Html/Link/EvolvableLink.php new file mode 100644 index 00000000..36576364 --- /dev/null +++ b/src/Phalcon/Html/Link/EvolvableLink.php @@ -0,0 +1,101 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Html\Link; + +use Psr\Link\EvolvableLinkInterface; + +/** + * Class Phalcon\Http\Link\EvolvableLink + * + * @property array attributes + * @property string href + * @property array rels + * @property bool templated + */ +class EvolvableLink extends \Phalcon\Html\Link\Link implements \Psr\Link\EvolvableLinkInterface +{ + + /** + * Returns an instance with the specified attribute added. + * + * If the specified attribute is already present, it will be overwritten + * with the new value. + * + * @param string $attribute The attribute to include. + * @param string $value The value of the attribute to set. + * + * @return static + */ + public function withAttribute($attribute, $value) + { + } + + /** + * Returns an instance with the specified href. + * + * @param string $href * The href value to include. It must be one of: + * - An absolute URI, as defined by RFC 5988. + * - A relative URI, as defined by RFC 5988. The base of the relative + * link is assumed to be known based on context by the client. + * - A URI template as defined by RFC 6570. + * - An object implementing __toString() that produces one of the + * above values. + * + * An implementing library SHOULD evaluate a passed object to a string + * immediately rather than waiting for it to be returned later. + * + * @return static + */ + public function withHref($href) + { + } + + /** + * Returns an instance with the specified relationship included. + * + * If the specified rel is already present, this method MUST return + * normally without errors, but without adding the rel a second time. + * + * @param string $rel * The relationship value to add. + * + * @return static + */ + public function withRel($rel) + { + } + + /** + * Returns an instance with the specified attribute excluded. + * + * If the specified attribute is not present, this method MUST return + * normally without errors. + * + * @param string $attribute * The attribute to remove. + * + * @return static + */ + public function withoutAttribute($attribute) + { + } + + /** + * Returns an instance with the specified relationship excluded. + * + * If the specified rel is already not present, this method MUST return + * normally without errors. + * + * @param string $rel * The relationship value to exclude. + * + * @return static + */ + public function withoutRel($rel) + { + } +} diff --git a/src/Phalcon/Html/Link/EvolvableLinkProvider.php b/src/Phalcon/Html/Link/EvolvableLinkProvider.php new file mode 100644 index 00000000..46df0820 --- /dev/null +++ b/src/Phalcon/Html/Link/EvolvableLinkProvider.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Html\Link; + +use Psr\Link\EvolvableLinkProviderInterface; +use Psr\Link\LinkInterface; + +/** + * Class Phalcon\Http\Link\LinkProvider + * + * @property LinkInterface[] links + */ +class EvolvableLinkProvider extends \Phalcon\Html\Link\LinkProvider implements \Psr\Link\EvolvableLinkProviderInterface +{ + + /** + * Returns an instance with the specified link included. + * + * If the specified link is already present, this method MUST return + * normally without errors. The link is present if link is === identical + * to a link object already in the collection. + * + * @param LinkInterface $link * A link object that should be included in this collection. + * + * @return static + */ + public function withLink(\Psr\Link\LinkInterface $link) + { + } + + /** + * Returns an instance with the specified link removed. + * + * If the specified link is not present, this method MUST return normally + * without errors. The link is present if link is === identical to a link + * object already in the collection. + * + * @param LinkInterface $link * The link to remove. + * + * @return static + */ + public function withoutLink(\Psr\Link\LinkInterface $link) + { + } +} diff --git a/src/Phalcon/Html/Link/Link.php b/src/Phalcon/Html/Link/Link.php new file mode 100644 index 00000000..96a73caa --- /dev/null +++ b/src/Phalcon/Html/Link/Link.php @@ -0,0 +1,118 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Html\Link; + +use Phalcon\Collection; +use Psr\Link\LinkInterface; + +/** + * Class Phalcon\Http\Link\Link + * + * @property array attributes + * @property string href + * @property array rels + * @property bool templated + */ +class Link implements \Psr\Link\LinkInterface +{ + /** + * @var Collection + */ + protected $attributes; + + /** + * @var string + */ + protected $href = ''; + + /** + * @var Collection + */ + protected $rels; + + /** + * @var bool + */ + protected $templated = false; + + + /** + * Link constructor. + * + * @param string $rel + * @param string $href + * @param array $attributes + */ + public function __construct(string $rel = '', string $href = '', array $attributes = array()) + { + } + + /** + * Returns a list of attributes that describe the target URI. + * + * @return array + * A key-value list of attributes, where the key is a string and the value + * is either a PHP primitive or an array of PHP strings. If no values are + * found an empty array MUST be returned. + */ + public function getAttributes() + { + } + + /** + * Returns the target of the link. + * + * The target link must be one of: + * - An absolute URI, as defined by RFC 5988. + * - A relative URI, as defined by RFC 5988. The base of the relative link + * is assumed to be known based on context by the client. + * - A URI template as defined by RFC 6570. + * + * If a URI template is returned, isTemplated() MUST return True. + * + * @return string + */ + public function getHref() + { + } + + /** + * Returns the relationship type(s) of the link. + * + * This method returns 0 or more relationship types for a link, expressed + * as an array of strings. + * + * @return string[] + */ + public function getRels() + { + } + + /** + * Returns whether or not this is a templated link. + * + * @return bool True if this link object is templated, False otherwise. + */ + public function isTemplated() + { + } + + /** + * Determines if a href is a templated link or not. + * + * @see https://tools.ietf.org/html/rfc6570 + * + * @param string $href * + * @return bool + */ + protected function hrefIsTemplated(string $href): bool + { + } +} diff --git a/src/Phalcon/Html/Link/LinkProvider.php b/src/Phalcon/Html/Link/LinkProvider.php new file mode 100644 index 00000000..a7829ba5 --- /dev/null +++ b/src/Phalcon/Html/Link/LinkProvider.php @@ -0,0 +1,73 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Html\Link; + +use Psr\Link\LinkInterface; +use Psr\Link\LinkProviderInterface; + +/** + * Class Phalcon\Http\Link\LinkProvider + * + * @property LinkInterface[] links + */ +class LinkProvider implements \Psr\Link\LinkProviderInterface +{ + /** + * @var LinkInterface[] + */ + protected $links = array(); + + + /** + * LinkProvider constructor. + * + * @param array $links + */ + public function __construct(array $links = array()) + { + } + + /** + * Returns an iterable of LinkInterface objects. + * + * The iterable may be an array or any PHP \Traversable object. If no links + * are available, an empty array or \Traversable MUST be returned. + * + * @return LinkInterface[]|\Traversable + */ + public function getLinks() + { + } + + /** + * Returns an iterable of LinkInterface objects that have a specific + * relationship. + * + * The iterable may be an array or any PHP \Traversable object. If no links + * with that relationship are available, an empty array or \Traversable + * MUST be returned. + * + * @return LinkInterface[]|Traversable + * @param mixed $rel + */ + public function getLinksByRel($rel) + { + } + + /** + * Returns the object hash key + * + * @param LinkInterface $link * + * @return string + */ + protected function getKey(\Psr\Link\LinkInterface $link): string + { + } +} diff --git a/src/Phalcon/Html/Link/Serializer/Header.php b/src/Phalcon/Html/Link/Serializer/Header.php new file mode 100644 index 00000000..cd9f5957 --- /dev/null +++ b/src/Phalcon/Html/Link/Serializer/Header.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Html\Link\Serializer; + +use Psr\Link\EvolvableLinkInterface; + +/** + * Class Phalcon\Http\Link\Serializer\Header + */ +class Header implements \Phalcon\Html\Link\Serializer\SerializerInterface +{ + + /** + * Serializes all the passed links to a HTTP link header + * + * @param array $links + * @return string|null + */ + public function serialize(array $links): ?string + { + } +} diff --git a/src/Phalcon/Html/Link/Serializer/SerializerInterface.php b/src/Phalcon/Html/Link/Serializer/SerializerInterface.php new file mode 100644 index 00000000..d2804463 --- /dev/null +++ b/src/Phalcon/Html/Link/Serializer/SerializerInterface.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Html\Link\Serializer; + +/** + * Class Phalcon\Http\Link\Serializer\SerializerInterface + */ +interface SerializerInterface +{ + + /** + * Serializer method + * + * @param array $links + * @return string|null + */ + public function serialize(array $links): ?string; +} diff --git a/src/Phalcon/html/TagFactory.php b/src/Phalcon/Html/TagFactory.php similarity index 77% rename from src/Phalcon/html/TagFactory.php rename to src/Phalcon/Html/TagFactory.php index 161d4ecf..63c147f3 100644 --- a/src/Phalcon/html/TagFactory.php +++ b/src/Phalcon/Html/TagFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Html; use Phalcon\Escaper\EscaperInterface; diff --git a/src/Phalcon/http/Cookie.php b/src/Phalcon/Http/Cookie.php similarity index 95% rename from src/Phalcon/http/Cookie.php rename to src/Phalcon/Http/Cookie.php index bf5ffb55..e9159ba8 100644 --- a/src/Phalcon/http/Cookie.php +++ b/src/Phalcon/Http/Cookie.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http; use Phalcon\Di\AbstractInjectionAware; @@ -238,10 +245,10 @@ public function setSecure(bool $secure): CookieInterface * * Use NULL to disable cookie signing. * + * @see \Phalcon\Security\Random + * @throws \Phalcon\Http\Cookie\Exception * @param string $signKey * @return CookieInterface - * @throws \Phalcon\Http\Cookie\Exception - * @see \Phalcon\Security\Random */ public function setSignKey(string $signKey = null): CookieInterface { @@ -270,8 +277,9 @@ public function useEncryption(bool $useEncryption): CookieInterface /** * Assert the cookie's key is enough long. * - * @param string $signKey * @throws \Phalcon\Http\Cookie\Exception + * @param string $signKey + * @return void */ protected function assertSignKeyIsLongEnough(string $signKey) { diff --git a/src/Phalcon/Http/Cookie/Exception.php b/src/Phalcon/Http/Cookie/Exception.php new file mode 100644 index 00000000..aab99c80 --- /dev/null +++ b/src/Phalcon/Http/Cookie/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Http\Cookie; + +/** + * Phalcon\Http\Cookie\Exception + * + * Exceptions thrown in Phalcon\Http\Cookie will use this class. + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/http/CookieInterface.php b/src/Phalcon/Http/CookieInterface.php similarity index 92% rename from src/Phalcon/http/CookieInterface.php rename to src/Phalcon/Http/CookieInterface.php index 8d2386f2..39573562 100644 --- a/src/Phalcon/http/CookieInterface.php +++ b/src/Phalcon/Http/CookieInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http; /** diff --git a/src/Phalcon/http/message/AbstractCommon.php b/src/Phalcon/Http/Message/AbstractCommon.php similarity index 71% rename from src/Phalcon/http/message/AbstractCommon.php rename to src/Phalcon/Http/Message/AbstractCommon.php index 61a4e2a7..91c209e8 100644 --- a/src/Phalcon/http/message/AbstractCommon.php +++ b/src/Phalcon/Http/Message/AbstractCommon.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message; /** @@ -11,7 +18,7 @@ abstract class AbstractCommon /** * Returns a new instance having set the parameter * - * @param mixed $element + * @param mixed $element * @param string $property * * @return mixed @@ -24,6 +31,7 @@ final protected function cloneInstance($element, string $property) * Checks the element passed if it is a string * * @param mixed $element + * @return void */ final protected function checkStringParameter($element) { @@ -33,7 +41,7 @@ final protected function checkStringParameter($element) * Checks the element passed; assigns it to the property and returns a * clone of the object back * - * @param mixed $element + * @param mixed $element * @param string $property * * @return mixed diff --git a/src/Phalcon/http/message/AbstractMessage.php b/src/Phalcon/Http/Message/AbstractMessage.php similarity index 95% rename from src/Phalcon/http/message/AbstractMessage.php rename to src/Phalcon/Http/Message/AbstractMessage.php index 861c686d..8073f424 100644 --- a/src/Phalcon/http/message/AbstractMessage.php +++ b/src/Phalcon/Http/Message/AbstractMessage.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message; use Phalcon\Collection; @@ -10,7 +17,7 @@ /** * Message methods */ -abstract class AbstractMessage extends AbstractCommon +abstract class AbstractMessage extends \Phalcon\Http\Message\AbstractCommon { /** * Gets the body of the message. @@ -51,7 +58,7 @@ abstract class AbstractMessage extends AbstractCommon /** * Gets the body of the message. * - * @return StreamInterface + * @return mixed */ public function getBody() { @@ -74,7 +81,7 @@ public function getProtocolVersion(): string * * This method MUST return a UriInterface instance. * - * @return UriInterface + * @return mixed */ public function getUri() { @@ -169,13 +176,13 @@ public function hasHeader($name): bool * immutability of the message, and MUST return an instance that has the * new header and/or value. * - * @param string $name + * @param string $name * @param string|string[] $value * + * @return self * @param mixed $value * @param string|string [] $value * - * @return self */ public function withAddedHeader($name, $value) { @@ -211,15 +218,15 @@ public function withBody(\Psr\Http\Message\StreamInterface $body) * immutability of the message, and MUST return an instance that has the * new and/or updated header and value. * - * @param string $name + * @param string $name * @param string|string[] $value * - * @param mixed $value - * @param string|string [] $value - * * @return self * @throws InvalidArgumentException for invalid header names or values. * + * @param mixed $value + * @param string|string [] $value + * */ public function withHeader($name, $value) { @@ -278,6 +285,7 @@ final protected function checkHeaderHost(\Phalcon\Collection $collection): Colle * * @see http://tools.ietf.org/html/rfc7230#section-3.2 * @param mixed $name + * @return void */ final protected function checkHeaderName($name) { @@ -328,6 +336,7 @@ final protected function checkHeaderName($name) * * @see https://tools.ietf.org/html/rfc7230#section-3.2.6 * @param mixed $value + * @return void */ final protected function checkHeaderValue($value) { @@ -369,7 +378,7 @@ final protected function populateHeaderCollection(array $headers): Collection * Set a valid stream * * @param StreamInterface|resource|string $body - * @param string $mode + * @param string $mode * * @return StreamInterface */ @@ -381,7 +390,7 @@ final protected function processBody($body = 'php://memory', string $mode = 'r+b * Sets the headers * * @param mixed $headers - * @return \Phalcon\Collection + * @return Collection */ final protected function processHeaders($headers): Collection { diff --git a/src/Phalcon/http/message/AbstractRequest.php b/src/Phalcon/Http/Message/AbstractRequest.php similarity index 93% rename from src/Phalcon/http/message/AbstractRequest.php rename to src/Phalcon/Http/Message/AbstractRequest.php index cf69d995..fd605d15 100644 --- a/src/Phalcon/http/message/AbstractRequest.php +++ b/src/Phalcon/Http/Message/AbstractRequest.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message; use Phalcon\Http\Message\Exception\InvalidArgumentException; @@ -8,7 +15,7 @@ /** * Request methods */ -abstract class AbstractRequest extends AbstractMessage +abstract class AbstractRequest extends \Phalcon\Http\Message\AbstractMessage { /** * Retrieves the HTTP method of the request. @@ -50,7 +57,7 @@ public function getMethod(): string * * This method MUST return a UriInterface instance. * - * @return UriInterface + * @return mixed */ public function getUri() { @@ -146,7 +153,7 @@ public function withRequestTarget($requestTarget) * @see http://tools.ietf.org/html/rfc3986#section-4.3 * * @param UriInterface $uri - * @param bool $preserveHost + * @param bool $preserveHost * * @return object */ diff --git a/src/Phalcon/http/message/exception/InvalidArgumentException.php b/src/Phalcon/Http/Message/Exception/InvalidArgumentException.php similarity index 62% rename from src/Phalcon/http/message/exception/InvalidArgumentException.php rename to src/Phalcon/Http/Message/Exception/InvalidArgumentException.php index a2ebf36c..14de3be7 100644 --- a/src/Phalcon/http/message/exception/InvalidArgumentException.php +++ b/src/Phalcon/Http/Message/Exception/InvalidArgumentException.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message\Exception; /** diff --git a/src/Phalcon/http/message/Request.php b/src/Phalcon/Http/Message/Request.php similarity index 56% rename from src/Phalcon/http/message/Request.php rename to src/Phalcon/Http/Message/Request.php index 7033576c..802c9ceb 100644 --- a/src/Phalcon/http/message/Request.php +++ b/src/Phalcon/Http/Message/Request.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message; use Psr\Http\Message\RequestInterface; @@ -15,10 +22,10 @@ final class Request extends AbstractRequest implements \Psr\Http\Message\Request /** * Request constructor. * - * @param string $method - * @param UriInterface|string|null $uri + * @param string $method + * @param UriInterface|string|null $uri * @param StreamInterface|resource|string $body - * @param array $headers + * @param array $headers */ public function __construct(string $method = 'GET', $uri = null, $body = 'php://memory', $headers = array()) { diff --git a/src/Phalcon/http/message/RequestFactory.php b/src/Phalcon/Http/Message/RequestFactory.php similarity index 64% rename from src/Phalcon/http/message/RequestFactory.php rename to src/Phalcon/Http/Message/RequestFactory.php index f5f626f2..b7bd65e4 100644 --- a/src/Phalcon/http/message/RequestFactory.php +++ b/src/Phalcon/Http/Message/RequestFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message; use Psr\Http\Message\RequestFactoryInterface; @@ -15,7 +22,7 @@ final class RequestFactory implements \Psr\Http\Message\RequestFactoryInterface /** * Create a new request. * - * @param string $method + * @param string $method * @param UriInterface|string|null $uri * * @return RequestInterface diff --git a/src/Phalcon/http/message/Response.php b/src/Phalcon/Http/Message/Response.php similarity index 90% rename from src/Phalcon/http/message/Response.php rename to src/Phalcon/Http/Message/Response.php index c82cf0f7..cfb4ec27 100644 --- a/src/Phalcon/http/message/Response.php +++ b/src/Phalcon/Http/Message/Response.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message; use Psr\Http\Message\ResponseInterface; @@ -69,8 +76,8 @@ public function getStatusCode(): int * Response constructor. * * @param string $body - * @param int $code - * @param array $headers + * @param int $code + * @param array $headers */ public function __construct($body = 'php://memory', int $code = 200, array $headers = array()) { @@ -91,7 +98,7 @@ public function __construct($body = 'php://memory', int $code = 200, array $head * @see http://tools.ietf.org/html/rfc7231#section-6 * @see http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml * - * @param int $code + * @param int $code * @param string $reasonPhrase * * @return Response @@ -104,6 +111,7 @@ public function withStatus($code, $reasonPhrase = ''): Response * Checks if a code is integer or string * * @param mixed $code + * @return void */ private function checkCodeType($code) { @@ -113,6 +121,7 @@ private function checkCodeType($code) * Checks if a code is integer or string * * @param int $code + * @return void */ private function checkCodeValue(int $code) { @@ -132,6 +141,7 @@ private function getPhrases(): array * * @param mixed $code * @param mixed $phrase + * @return void */ private function processCode($code, $phrase = '') { diff --git a/src/Phalcon/http/message/ResponseFactory.php b/src/Phalcon/Http/Message/ResponseFactory.php similarity index 71% rename from src/Phalcon/http/message/ResponseFactory.php rename to src/Phalcon/Http/Message/ResponseFactory.php index 91b3541a..7491c31a 100644 --- a/src/Phalcon/http/message/ResponseFactory.php +++ b/src/Phalcon/Http/Message/ResponseFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message; use Psr\Http\Message\ResponseFactoryInterface; @@ -14,7 +21,7 @@ final class ResponseFactory implements \Psr\Http\Message\ResponseFactoryInterfac /** * Create a new response. * - * @param int $code The HTTP status code. Defaults to 200. + * @param int $code The HTTP status code. Defaults to 200. * @param string $reasonPhrase The reason phrase to associate with the status * code in the generated response. If none is * provided, implementations MAY use the defaults diff --git a/src/Phalcon/http/message/ServerRequest.php b/src/Phalcon/Http/Message/ServerRequest.php similarity index 92% rename from src/Phalcon/http/message/ServerRequest.php rename to src/Phalcon/Http/Message/ServerRequest.php index 5f62b6e8..e11cfb58 100644 --- a/src/Phalcon/http/message/ServerRequest.php +++ b/src/Phalcon/Http/Message/ServerRequest.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message; use Phalcon\Collection; @@ -12,7 +19,7 @@ /** * PSR-7 ServerRequest */ -final class ServerRequest extends AbstractRequest implements \Psr\Http\Message\ServerRequestInterface +final class ServerRequest extends \Phalcon\Http\Message\AbstractRequest implements \Psr\Http\Message\ServerRequestInterface { /** * @var Collection @@ -165,16 +172,16 @@ public function getUploadedFiles(): array /** * ServerRequest constructor. * - * @param string $method + * @param string $method * @param UriInterface|string|null $uri - * @param array $serverParams - * @param StreamInterface|string $body - * @param array $headers - * @param array $cookies - * @param array $queryParams - * @param array $uploadFiles - * @param null|array|object $parsedBody - * @param string $protocol + * @param array $serverParams + * @param StreamInterface|string $body + * @param array $headers + * @param array $cookies + * @param array $queryParams + * @param array $uploadFiles + * @param null|array|object $parsedBody + * @param string $protocol */ public function __construct(string $method = 'GET', $uri = null, array $serverParams = array(), $body = 'php://input', $headers = array(), array $cookies = array(), array $queryParams = array(), array $uploadFiles = array(), $parsedBody = null, string $protocol = '1.1') { @@ -190,8 +197,8 @@ public function __construct(string $method = 'GET', $uri = null, array $serverPa * This method obviates the need for a hasAttribute() method, as it allows * specifying a default value to return if the attribute is not found. * - * @param string $name - * @param mixed|null $defaultValue + * @param string $name + * @param mixed|null $defaultValue * * @return mixed */ @@ -225,7 +232,7 @@ public function getAttributes(): array * updated attribute. * * @param string $name - * @param mixed $value + * @param mixed $value * * @return ServerRequest */ @@ -352,6 +359,7 @@ public function withoutAttribute($name): ServerRequest * Checks the uploaded files * * @param array $files + * @return void */ private function checkUploadedFiles(array $files) { diff --git a/src/Phalcon/http/message/ServerRequestFactory.php b/src/Phalcon/Http/Message/ServerRequestFactory.php similarity index 89% rename from src/Phalcon/http/message/ServerRequestFactory.php rename to src/Phalcon/Http/Message/ServerRequestFactory.php index 5bc42c35..65dbc874 100644 --- a/src/Phalcon/http/message/ServerRequestFactory.php +++ b/src/Phalcon/Http/Message/ServerRequestFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message; use Phalcon\Collection; @@ -23,14 +30,14 @@ class ServerRequestFactory implements \Psr\Http\Message\ServerRequestFactoryInte * no attempt is made to determine the HTTP method or URI, which must be * provided explicitly. * - * @param string $method The HTTP method associated with + * @param string $method The HTTP method associated with * the request. - * @param UriInterface|string $uri The URI associated with the + * @param UriInterface|string $uri The URI associated with the * request. If the value is a * string, the factory MUST create * a UriInterface instance based * on it. - * @param array $serverParams Array of SAPI parameters with + * @param array $serverParams Array of SAPI parameters with * which to seed the generated * request instance. * @@ -46,11 +53,11 @@ public function createServerRequest(string $method, $uri, array $serverParams = * If any argument is not supplied, the corresponding superglobal value will * be used. * - * @param array $server $_SERVER superglobal - * @param array $get $_GET superglobal - * @param array $post $_POST superglobal + * @param array $server $_SERVER superglobal + * @param array $get $_GET superglobal + * @param array $post $_POST superglobal * @param array $cookies $_COOKIE superglobal - * @param array $files $_FILES superglobal + * @param array $files $_FILES superglobal * * @return ServerRequest * @see fromServer() @@ -155,7 +162,7 @@ private function createUploadedFile(array $file): UploadedFile * Returns a header * * @param Collection $headers - * @param string $name + * @param string $name * @param mixed|null $defaultValue * * @return mixed|string diff --git a/src/Phalcon/http/message/Stream.php b/src/Phalcon/Http/Message/Stream.php similarity index 90% rename from src/Phalcon/http/message/Stream.php rename to src/Phalcon/Http/Message/Stream.php index 2a44a4f0..d01bbcb5 100644 --- a/src/Phalcon/http/message/Stream.php +++ b/src/Phalcon/Http/Message/Stream.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message; use Psr\Http\Message\StreamInterface; @@ -23,7 +30,7 @@ class Stream implements \Psr\Http\Message\StreamInterface /** * Stream constructor. * - * @param mixed $stream + * @param mixed $stream * @param string $mode */ public function __construct($stream, string $mode = 'rb') @@ -57,6 +64,8 @@ public function __toString(): string /** * Closes the stream and any underlying resources. + * + * @return void */ public function close() { @@ -157,6 +166,8 @@ public function read($length): string * * If the stream is not seekable, this method will raise an exception; * otherwise, it will perform a seek(0). + * + * @return void */ public function rewind() { @@ -167,6 +178,7 @@ public function rewind() * * @param int $offset * @param int $whence + * @return void */ public function seek($offset, $whence = 0) { @@ -175,8 +187,9 @@ public function seek($offset, $whence = 0) /** * Sets the stream - existing instance * - * @param mixed $stream + * @param mixed $stream * @param string $mode + * @return void */ public function setStream($stream, string $mode = 'rb') { @@ -204,6 +217,8 @@ public function write($data): int /** * Checks if a handle is available and throws an exception otherwise + * + * @return void */ private function checkHandle() { @@ -211,6 +226,8 @@ private function checkHandle() /** * Checks if a handle is readable and throws an exception otherwise + * + * @return void */ private function checkReadable() { @@ -218,6 +235,8 @@ private function checkReadable() /** * Checks if a handle is seekable and throws an exception otherwise + * + * @return void */ private function checkSeekable() { @@ -225,6 +244,8 @@ private function checkSeekable() /** * Checks if a handle is writeable and throws an exception otherwise + * + * @return void */ private function checkWritable() { diff --git a/src/Phalcon/http/message/stream/Input.php b/src/Phalcon/Http/Message/Stream/Input.php similarity index 88% rename from src/Phalcon/http/message/stream/Input.php rename to src/Phalcon/Http/Message/Stream/Input.php index 88c39025..2e3f6696 100644 --- a/src/Phalcon/http/message/stream/Input.php +++ b/src/Phalcon/Http/Message/Stream/Input.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message\Stream; use Phalcon\Http\Message\Stream; @@ -52,12 +59,12 @@ public function __toString(): string /** * Returns the remaining contents in a string * - * @param int $length - * - * @return string * @throws RuntimeException if unable to read. * @throws RuntimeException if error occurs while reading. * + * @param int $length + * + * @return string */ public function getContents(int $length = -1): string { diff --git a/src/Phalcon/http/message/stream/Memory.php b/src/Phalcon/Http/Message/Stream/Memory.php similarity index 68% rename from src/Phalcon/http/message/stream/Memory.php rename to src/Phalcon/Http/Message/Stream/Memory.php index f325bf53..efa30ca4 100644 --- a/src/Phalcon/http/message/stream/Memory.php +++ b/src/Phalcon/Http/Message/Stream/Memory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message\Stream; use Phalcon\Http\Message\Stream; diff --git a/src/Phalcon/http/message/stream/Temp.php b/src/Phalcon/Http/Message/Stream/Temp.php similarity index 67% rename from src/Phalcon/http/message/stream/Temp.php rename to src/Phalcon/Http/Message/Stream/Temp.php index 8f9b6650..13dc1d8c 100644 --- a/src/Phalcon/http/message/stream/Temp.php +++ b/src/Phalcon/Http/Message/Stream/Temp.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message\Stream; use Phalcon\Http\Message\Stream; diff --git a/src/Phalcon/http/message/StreamFactory.php b/src/Phalcon/Http/Message/StreamFactory.php similarity index 81% rename from src/Phalcon/http/message/StreamFactory.php rename to src/Phalcon/Http/Message/StreamFactory.php index ee5921f9..f8401d0d 100644 --- a/src/Phalcon/http/message/StreamFactory.php +++ b/src/Phalcon/Http/Message/StreamFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message; use Psr\Http\Message\StreamFactoryInterface; @@ -34,7 +41,7 @@ public function createStream(string $content = ''): StreamInterface * * @param string $filename The filename or stream URI to use as basis of * stream. - * @param string $mode The mode with which to open the underlying + * @param string $mode The mode with which to open the underlying * filename/stream. * * @return StreamInterface @@ -49,7 +56,7 @@ public function createStreamFromFile(string $filename, string $mode = 'r+b'): St * The stream MUST be readable and may be writable. * * @param mixed $phpResource - * @return \Psr\Http\Message\StreamInterface + * @return StreamInterface */ public function createStreamFromResource($phpResource): StreamInterface { diff --git a/src/Phalcon/http/message/UploadedFile.php b/src/Phalcon/Http/Message/UploadedFile.php similarity index 92% rename from src/Phalcon/http/message/UploadedFile.php rename to src/Phalcon/Http/Message/UploadedFile.php index fa61d185..d309089f 100644 --- a/src/Phalcon/http/message/UploadedFile.php +++ b/src/Phalcon/Http/Message/UploadedFile.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message; use Phalcon\Http\Message\Exception\InvalidArgumentException; @@ -156,10 +163,10 @@ public function getSize(): ?int * UploadedFile constructor. * * @param StreamInterface|string|null $stream - * @param int|null $size - * @param int $error - * @param string|null $clientFilename - * @param string|null $clientMediaType + * @param int|null $size + * @param int $error + * @param string|null $clientFilename + * @param string|null $clientMediaType */ public function __construct($stream, int $size = null, int $error = 0, string $clientFilename = null, string $clientMediaType = null) { @@ -217,6 +224,7 @@ public function getStream() * @throws InvalidArgumentException if the $targetPath specified is invalid. * @throws RuntimeException on any error during the move operation, or on * the second or subsequent call to the method. + * @return void */ public function moveTo($targetPath) { @@ -226,6 +234,7 @@ public function moveTo($targetPath) * Checks the passed error code and if not in the range throws an exception * * @param int $error + * @return void */ private function checkError(int $error) { @@ -235,7 +244,8 @@ private function checkError(int $error) * Checks the passed error code and if not in the range throws an exception * * @param StreamInterface|resource|string $stream - * @param int $error + * @param int $error + * @return void */ private function checkStream($stream, int $error) { @@ -256,6 +266,7 @@ private function getErrorDescription(int $error): string * Store a file in the new location (stream) * * @param string $targetPath + * @return void */ private function storeFile(string $targetPath) { diff --git a/src/Phalcon/http/message/UploadedFileFactory.php b/src/Phalcon/Http/Message/UploadedFileFactory.php similarity index 58% rename from src/Phalcon/http/message/UploadedFileFactory.php rename to src/Phalcon/Http/Message/UploadedFileFactory.php index fe2c233e..e01d2ad4 100644 --- a/src/Phalcon/http/message/UploadedFileFactory.php +++ b/src/Phalcon/Http/Message/UploadedFileFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message; use Psr\Http\Message\StreamInterface; @@ -21,15 +28,15 @@ final class UploadedFileFactory implements \Psr\Http\Message\UploadedFileFactory * @link http://php.net/manual/features.file-upload.post-method.php * @link http://php.net/manual/features.file-upload.errors.php * - * @param StreamInterface $stream The underlying stream representing the + * @param StreamInterface $stream The underlying stream representing the * uploaded file content. - * @param int $size The size of the file in bytes. - * @param int $error The PHP file upload error. - * @param string $clientFilename The filename as provided by the client, if any. - * @param string $clientMediaType The media type as provided by the client, if any. + * @param int $size The size of the file in bytes. + * @param int $error The PHP file upload error. + * @param string $clientFilename The filename as provided by the client, if any. + * @param string $clientMediaType The media type as provided by the client, if any. * * @throws \InvalidArgumentException If the file resource is not readable. - * @return \Psr\Http\Message\UploadedFileInterface + * @return UploadedFileInterface */ public function createUploadedFile(\Psr\Http\Message\StreamInterface $stream, int $size = null, int $error = 0, string $clientFilename = null, string $clientMediaType = null): UploadedFileInterface { diff --git a/src/Phalcon/http/message/Uri.php b/src/Phalcon/Http/Message/Uri.php similarity index 97% rename from src/Phalcon/http/message/Uri.php rename to src/Phalcon/Http/Message/Uri.php index ab67acd2..2b20450a 100644 --- a/src/Phalcon/http/message/Uri.php +++ b/src/Phalcon/Http/Message/Uri.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message; use Phalcon\Http\Message\Exception\InvalidArgumentException; @@ -8,7 +15,7 @@ /** * PSR-7 Uri */ -final class Uri extends AbstractCommon implements \Psr\Http\Message\UriInterface +final class Uri extends \Phalcon\Http\Message\AbstractCommon implements \Psr\Http\Message\UriInterface { /** * Returns the fragment of the URL @@ -317,7 +324,7 @@ public function withScheme($scheme): Uri /** * Return an instance with the specified user information. * - * @param string $user + * @param string $user * @param string|null $password * * @return Uri diff --git a/src/Phalcon/http/message/UriFactory.php b/src/Phalcon/Http/Message/UriFactory.php similarity index 63% rename from src/Phalcon/http/message/UriFactory.php rename to src/Phalcon/Http/Message/UriFactory.php index e3ba04cf..221ceffd 100644 --- a/src/Phalcon/http/message/UriFactory.php +++ b/src/Phalcon/Http/Message/UriFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Message; use Psr\Http\Message\UriFactoryInterface; @@ -16,7 +23,7 @@ final class UriFactory implements \Psr\Http\Message\UriFactoryInterface * functions * * @param string $uri - * @return \Psr\Http\Message\UriInterface + * @return UriInterface */ public function createUri(string $uri = ''): UriInterface { diff --git a/src/Phalcon/http/Request.php b/src/Phalcon/Http/Request.php similarity index 97% rename from src/Phalcon/http/Request.php rename to src/Phalcon/Http/Request.php index a8f767ee..6d54dfb5 100644 --- a/src/Phalcon/http/Request.php +++ b/src/Phalcon/Http/Request.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http; use Phalcon\Di\AbstractInjectionAware; @@ -308,7 +315,7 @@ public function getHTTPReferer(): string * Gets decoded JSON HTTP raw request body * * @param bool $associative - * @return array|bool|\stdClass + * @return mixed */ public function getJsonRawBody(bool $associative = false) { @@ -472,7 +479,7 @@ public function getServerName(): string * * @param bool $onlySuccessful * @param bool $namedKeys - * @return array|\Phalcon\Http\Request\FileInterface[] + * @return array */ public function getUploadedFiles(bool $onlySuccessful = false, bool $namedKeys = false): array { @@ -516,14 +523,11 @@ public function has(string $name): bool } /** - * Returns the number of files available - * - * TODO: Check this + * Returns if the request has files or not * - * @param bool $onlySuccessful - * @return long + * @return bool */ - public function hasFiles(bool $onlySuccessful = false): int + public function hasFiles(): bool { } @@ -736,6 +740,16 @@ public function isValidHttpMethod(string $method): bool { } + /** + * Returns the number of files available + * + * @param bool $onlySuccessful + * @return int + */ + public function numFiles(bool $onlySuccessful = false): int + { + } + /** * Sets automatic sanitizers/filters for a particular field and for * particular methods @@ -792,7 +806,7 @@ final protected function getHelper(array $source, string $name = null, $filters * * @param mixed $data * @param bool $onlySuccessful - * @return long + * @return int */ final protected function hasFileHelper($data, bool $onlySuccessful): int { @@ -836,7 +850,7 @@ final protected function smoothFiles(array $names, array $types, array $tmp_name /** * Checks the filter service and assigns it to the class parameter * - * @return \Phalcon\Filter\FilterInterface + * @return FilterInterface */ private function getFilterService(): FilterInterface { diff --git a/src/Phalcon/Http/Request/Exception.php b/src/Phalcon/Http/Request/Exception.php new file mode 100644 index 00000000..2005b9fa --- /dev/null +++ b/src/Phalcon/Http/Request/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Http\Request; + +/** + * Phalcon\Http\Request\Exception + * + * Exceptions thrown in Phalcon\Http\Request will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/http/request/File.php b/src/Phalcon/Http/Request/File.php similarity index 92% rename from src/Phalcon/http/request/File.php rename to src/Phalcon/Http/Request/File.php index e3fc6ff0..eb3c6500 100644 --- a/src/Phalcon/http/request/File.php +++ b/src/Phalcon/Http/Request/File.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Request; /** diff --git a/src/Phalcon/http/request/FileInterface.php b/src/Phalcon/Http/Request/FileInterface.php similarity index 83% rename from src/Phalcon/http/request/FileInterface.php rename to src/Phalcon/Http/Request/FileInterface.php index 8353aca4..70ed6b22 100644 --- a/src/Phalcon/http/request/FileInterface.php +++ b/src/Phalcon/Http/Request/FileInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Request; /** diff --git a/src/Phalcon/http/RequestInterface.php b/src/Phalcon/Http/RequestInterface.php similarity index 96% rename from src/Phalcon/http/RequestInterface.php rename to src/Phalcon/Http/RequestInterface.php index d15b3a93..96b2bee0 100644 --- a/src/Phalcon/http/RequestInterface.php +++ b/src/Phalcon/Http/RequestInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http; /** @@ -177,7 +184,7 @@ public function getHTTPReferer(): string; * Gets decoded JSON HTTP raw request body * * @param bool $associative - * @return array|bool|\stdClass + * @return mixed */ public function getJsonRawBody(bool $associative = false); @@ -334,7 +341,7 @@ public function getServerName(): string; * * @param bool $onlySuccessful * @param bool $namedKeys - * @return array|\Phalcon\Http\Request\FileInterface[] + * @return array */ public function getUploadedFiles(bool $onlySuccessful = false, bool $namedKeys = false): array; @@ -355,12 +362,10 @@ public function has(string $name): bool; /** * Checks whether request include attached files - * TODO: We need to check the name. Not very intuitive * - * @param bool $onlySuccessful - * @return long + * @return bool */ - public function hasFiles(bool $onlySuccessful = false): int; + public function hasFiles(): bool; /** * Checks whether headers has certain index @@ -495,4 +500,12 @@ public function isSoap(): bool; * @return bool */ public function isTrace(): bool; + + /** + * Returns the number of files available + * + * @param bool $onlySuccessful + * @return int + */ + public function numFiles(bool $onlySuccessful = false): int; } diff --git a/src/Phalcon/http/Response.php b/src/Phalcon/Http/Response.php similarity index 96% rename from src/Phalcon/http/Response.php rename to src/Phalcon/Http/Response.php index a25698f6..bb19e53d 100644 --- a/src/Phalcon/http/Response.php +++ b/src/Phalcon/Http/Response.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http; use Phalcon\Di\DiInterface; @@ -83,7 +90,7 @@ public function getContent(): string /** * Returns cookies set by the user * - * @return \Phalcon\Http\Response\CookiesInterface + * @return CookiesInterface */ public function getCookies(): CookiesInterface { @@ -92,7 +99,7 @@ public function getCookies(): CookiesInterface /** * Returns the internal dependency injector * - * @return \Phalcon\Di\DiInterface + * @return DiInterface */ public function getDI(): DiInterface { @@ -101,7 +108,7 @@ public function getDI(): DiInterface /** * Returns the internal event manager * - * @return \Phalcon\Events\ManagerInterface + * @return ManagerInterface */ public function getEventsManager(): ManagerInterface { @@ -110,7 +117,7 @@ public function getEventsManager(): ManagerInterface /** * Returns headers set by the user * - * @return \Phalcon\Http\Response\HeadersInterface + * @return HeadersInterface */ public function getHeaders(): HeadersInterface { @@ -237,7 +244,7 @@ public function sendCookies(): ResponseInterface /** * Sends headers to the client * - * @return bool|ResponseInterface + * @return mixed */ public function sendHeaders() { @@ -315,6 +322,7 @@ public function setCookies(\Phalcon\Http\Response\CookiesInterface $cookies): Re * Sets the dependency injector * * @param \Phalcon\Di\DiInterface $container + * @return void */ public function setDI(\Phalcon\Di\DiInterface $container) { @@ -358,6 +366,7 @@ public function setExpires(\DateTime $datetime): ResponseInterface * Sets the events manager * * @param \Phalcon\Events\ManagerInterface $eventsManager + * @return void */ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager) { diff --git a/src/Phalcon/http/response/Cookies.php b/src/Phalcon/Http/Response/Cookies.php similarity index 92% rename from src/Phalcon/http/response/Cookies.php rename to src/Phalcon/Http/Response/Cookies.php index a08fb7e8..17ced24f 100644 --- a/src/Phalcon/http/response/Cookies.php +++ b/src/Phalcon/Http/Response/Cookies.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Response; use Phalcon\Di\AbstractInjectionAware; @@ -97,7 +104,7 @@ public function delete(string $name): bool * Gets a cookie from the bag * * @param string $name - * @return \Phalcon\Http\CookieInterface + * @return CookieInterface */ public function get(string $name): CookieInterface { @@ -135,7 +142,7 @@ public function isUsingEncryption(): bool /** * Reset set cookies * - * @return \Phalcon\Http\Response\CookiesInterface + * @return CookiesInterface */ public function reset(): CookiesInterface { @@ -177,7 +184,7 @@ public function send(): bool * @param bool $secure * @param string $domain * @param bool $httpOnly - * @return \Phalcon\Http\Response\CookiesInterface + * @return CookiesInterface */ public function set(string $name, $value = null, int $expire = 0, string $path = '/', bool $secure = null, string $domain = null, bool $httpOnly = null): CookiesInterface { @@ -191,9 +198,9 @@ public function set(string $name, $value = null, int $expire = 0, string $path = * * Use NULL to disable cookie signing. * - * @param string $signKey - * @return \Phalcon\Http\CookieInterface * @see \Phalcon\Security\Random + * @param string $signKey + * @return CookieInterface */ public function setSignKey(string $signKey = null): CookieInterface { @@ -203,7 +210,7 @@ public function setSignKey(string $signKey = null): CookieInterface * Set if cookies in the bag must be automatically encrypted/decrypted * * @param bool $useEncryption - * @return \Phalcon\Http\Response\CookiesInterface + * @return CookiesInterface */ public function useEncryption(bool $useEncryption): CookiesInterface { diff --git a/src/Phalcon/http/response/CookiesInterface.php b/src/Phalcon/Http/Response/CookiesInterface.php similarity index 88% rename from src/Phalcon/http/response/CookiesInterface.php rename to src/Phalcon/Http/Response/CookiesInterface.php index 63093998..917e5155 100644 --- a/src/Phalcon/http/response/CookiesInterface.php +++ b/src/Phalcon/Http/Response/CookiesInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Response; use Phalcon\Http\CookieInterface; @@ -25,7 +32,7 @@ public function delete(string $name): bool; * Gets a cookie from the bag * * @param string $name - * @return \Phalcon\Http\CookieInterface + * @return CookieInterface */ public function get(string $name): CookieInterface; diff --git a/src/Phalcon/Http/Response/Exception.php b/src/Phalcon/Http/Response/Exception.php new file mode 100644 index 00000000..22395565 --- /dev/null +++ b/src/Phalcon/Http/Response/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Http\Response; + +/** + * Phalcon\Http\Response\Exception + * + * Exceptions thrown in Phalcon\Http\Response will use this class. + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/http/response/Headers.php b/src/Phalcon/Http/Response/Headers.php similarity index 82% rename from src/Phalcon/http/response/Headers.php rename to src/Phalcon/Http/Response/Headers.php index 47b88b13..4104cfdd 100644 --- a/src/Phalcon/http/response/Headers.php +++ b/src/Phalcon/Http/Response/Headers.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Response; /** @@ -37,7 +44,7 @@ public function has(string $name): bool * Removes a header to be sent at the end of the request * * @param string $header - * @return \Phalcon\Http\Response\HeadersInterface + * @return HeadersInterface */ public function remove(string $header): HeadersInterface { @@ -64,7 +71,7 @@ public function send(): bool * * @param string $name * @param string $value - * @return \Phalcon\Http\Response\HeadersInterface + * @return HeadersInterface */ public function set(string $name, string $value): HeadersInterface { @@ -74,7 +81,7 @@ public function set(string $name, string $value): HeadersInterface * Sets a raw header to be sent at the end of the request * * @param string $header - * @return \Phalcon\Http\Response\HeadersInterface + * @return HeadersInterface */ public function setRaw(string $header): HeadersInterface { diff --git a/src/Phalcon/http/response/HeadersInterface.php b/src/Phalcon/Http/Response/HeadersInterface.php similarity index 82% rename from src/Phalcon/http/response/HeadersInterface.php rename to src/Phalcon/Http/Response/HeadersInterface.php index 0e178f64..471b9471 100644 --- a/src/Phalcon/http/response/HeadersInterface.php +++ b/src/Phalcon/Http/Response/HeadersInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Response; /** diff --git a/src/Phalcon/http/ResponseInterface.php b/src/Phalcon/Http/ResponseInterface.php similarity index 93% rename from src/Phalcon/http/ResponseInterface.php rename to src/Phalcon/Http/ResponseInterface.php index 8d6ba4e4..effb2543 100644 --- a/src/Phalcon/http/ResponseInterface.php +++ b/src/Phalcon/Http/ResponseInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http; use Phalcon\Http\Response\HeadersInterface; @@ -37,7 +44,7 @@ public function getStatusCode(): ?int; /** * Returns headers set by the user * - * @return \Phalcon\Http\Response\HeadersInterface + * @return HeadersInterface */ public function getHeaders(): HeadersInterface; @@ -181,7 +188,7 @@ public function sendCookies(): ResponseInterface; /** * Sends headers to the client * - * @return bool|ResponseInterface + * @return mixed */ public function sendHeaders(); } diff --git a/src/Phalcon/http/server/AbstractMiddleware.php b/src/Phalcon/Http/Server/AbstractMiddleware.php similarity index 81% rename from src/Phalcon/http/server/AbstractMiddleware.php rename to src/Phalcon/Http/Server/AbstractMiddleware.php index 1dd1de4b..2727615d 100644 --- a/src/Phalcon/http/server/AbstractMiddleware.php +++ b/src/Phalcon/Http/Server/AbstractMiddleware.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Server; use Psr\Http\Message\ResponseInterface; @@ -26,7 +33,7 @@ abstract class AbstractMiddleware implements \Psr\Http\Server\MiddlewareInterfac * * @param \Psr\Http\Message\ServerRequestInterface $request * @param \Psr\Http\Server\RequestHandlerInterface $handler - * @return \Psr\Http\Message\ResponseInterface + * @return ResponseInterface */ abstract public function process(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Server\RequestHandlerInterface $handler): ResponseInterface; } diff --git a/src/Phalcon/http/server/AbstractRequestHandler.php b/src/Phalcon/Http/Server/AbstractRequestHandler.php similarity index 74% rename from src/Phalcon/http/server/AbstractRequestHandler.php rename to src/Phalcon/Http/Server/AbstractRequestHandler.php index 9d08bce7..a272d8ae 100644 --- a/src/Phalcon/http/server/AbstractRequestHandler.php +++ b/src/Phalcon/Http/Server/AbstractRequestHandler.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Http\Server; use Psr\Http\Message\ResponseInterface; @@ -21,7 +28,7 @@ abstract class AbstractRequestHandler implements \Psr\Http\Server\RequestHandler * May call other collaborating code to generate the response. * * @param \Psr\Http\Message\ServerRequestInterface $request - * @return \Psr\Http\Message\ResponseInterface + * @return ResponseInterface */ abstract public function handle(\Psr\Http\Message\ServerRequestInterface $request): ResponseInterface; } diff --git a/src/Phalcon/image/adapter/AbstractAdapter.php b/src/Phalcon/Image/Adapter/AbstractAdapter.php similarity index 94% rename from src/Phalcon/image/adapter/AbstractAdapter.php rename to src/Phalcon/Image/Adapter/AbstractAdapter.php index 253757e4..24633d97 100644 --- a/src/Phalcon/image/adapter/AbstractAdapter.php +++ b/src/Phalcon/Image/Adapter/AbstractAdapter.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Image\Adapter; use Phalcon\Image\Enum; @@ -150,8 +157,8 @@ public function flip(int $direction): AdapterInterface * This method scales the images using liquid rescaling method. Only support * Imagick * - * @param int $width new width - * @param int $height new height + * @param int $width new width + * @param int $height new height * @param int $deltaX How much the seam can traverse on x-axis. Passing 0 causes the seams to be straight. * @param int $rigidity Introduces a bias for non-straight seams. This parameter is typically 0. * @return AbstractAdapter diff --git a/src/Phalcon/image/adapter/AdapterInterface.php b/src/Phalcon/Image/Adapter/AdapterInterface.php similarity index 93% rename from src/Phalcon/image/adapter/AdapterInterface.php rename to src/Phalcon/Image/Adapter/AdapterInterface.php index d6c1dd93..a2bff6a5 100644 --- a/src/Phalcon/image/adapter/AdapterInterface.php +++ b/src/Phalcon/Image/Adapter/AdapterInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Image\Adapter; use Phalcon\Image\Enum; diff --git a/src/Phalcon/image/adapter/Gd.php b/src/Phalcon/Image/Adapter/Gd.php similarity index 92% rename from src/Phalcon/image/adapter/Gd.php rename to src/Phalcon/Image/Adapter/Gd.php index 01ed1339..719b860b 100644 --- a/src/Phalcon/image/adapter/Gd.php +++ b/src/Phalcon/Image/Adapter/Gd.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Image\Adapter; /** @@ -10,7 +17,7 @@ * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ -class Gd extends AbstractAdapter +class Gd extends \Phalcon\Image\Adapter\AbstractAdapter { protected static $checked = false; diff --git a/src/Phalcon/image/adapter/Imagick.php b/src/Phalcon/Image/Adapter/Imagick.php similarity index 92% rename from src/Phalcon/image/adapter/Imagick.php rename to src/Phalcon/Image/Adapter/Imagick.php index 41cf51c9..8991ffb6 100644 --- a/src/Phalcon/image/adapter/Imagick.php +++ b/src/Phalcon/Image/Adapter/Imagick.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Image\Adapter; /** @@ -18,7 +25,7 @@ * } * ``` */ -class Imagick extends AbstractAdapter +class Imagick extends \Phalcon\Image\Adapter\AbstractAdapter { protected static $checked = false; @@ -120,8 +127,8 @@ protected function processFlip(int $direction) * This method scales the images using liquid rescaling method. Only support * Imagick * - * @param int $width new width - * @param int $height new height + * @param int $width new width + * @param int $height new height * @param int $deltaX How much the seam can traverse on x-axis. Passing 0 causes the seams to be straight. * @param int $rigidity Introduces a bias for non-straight seams. This parameter is typically 0. */ diff --git a/src/Phalcon/image/Enum.php b/src/Phalcon/Image/Enum.php similarity index 68% rename from src/Phalcon/image/Enum.php rename to src/Phalcon/Image/Enum.php index 2a1a2ca5..f3c5503d 100644 --- a/src/Phalcon/image/Enum.php +++ b/src/Phalcon/Image/Enum.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Image; /** diff --git a/src/Phalcon/Image/Exception.php b/src/Phalcon/Image/Exception.php new file mode 100644 index 00000000..a0223ee0 --- /dev/null +++ b/src/Phalcon/Image/Exception.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Image; + +/** + * This file is part of the Phalcon Framework. + * + * (c) Phalcon Team + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/image/ImageFactory.php b/src/Phalcon/Image/ImageFactory.php similarity index 75% rename from src/Phalcon/image/ImageFactory.php rename to src/Phalcon/Image/ImageFactory.php index a1c1fb96..a7389cfa 100644 --- a/src/Phalcon/image/ImageFactory.php +++ b/src/Phalcon/Image/ImageFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Image; use Phalcon\Factory\AbstractFactory; @@ -24,7 +31,7 @@ public function __construct(array $services = array()) * Factory to create an instace from a Config object * * @param mixed $config - * @return \Phalcon\Image\Adapter\AdapterInterface + * @return AdapterInterface */ public function load($config): AdapterInterface { @@ -37,7 +44,7 @@ public function load($config): AdapterInterface * @param string $file * @param int $width * @param int $height - * @return \Phalcon\Image\Adapter\AdapterInterface + * @return AdapterInterface */ public function newInstance(string $name, string $file, int $width = null, int $height = null): AdapterInterface { diff --git a/src/Phalcon/Kernel.php b/src/Phalcon/Kernel.php index dbca3b84..6450c1fc 100644 --- a/src/Phalcon/Kernel.php +++ b/src/Phalcon/Kernel.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; /** @@ -12,8 +19,8 @@ class Kernel * Produces a pre-computed hash key based on a string. This function * produces different numbers in 32bit/64bit processors * - * @param string $key * @return string + * @param string $key */ public static function preComputeHashKey(string $key) { diff --git a/src/Phalcon/Loader.php b/src/Phalcon/Loader.php index 62055867..3ae299da 100644 --- a/src/Phalcon/Loader.php +++ b/src/Phalcon/Loader.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; use Phalcon\Events\ManagerInterface; @@ -117,7 +124,7 @@ public function getDirs(): array /** * Returns the internal event manager * - * @return \Phalcon\Events\ManagerInterface + * @return ManagerInterface */ public function getEventsManager(): ManagerInterface { @@ -161,6 +168,8 @@ public function getNamespaces(): array /** * Checks if a file exists and then adds the file by doing virtual require + * + * @return void */ public function loadFiles() { @@ -225,6 +234,7 @@ public function registerNamespaces(array $namespaces, bool $merge = false): Load * Sets the events manager * * @param \Phalcon\Events\ManagerInterface $eventsManager + * @return void */ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager) { diff --git a/src/Phalcon/Loader/Exception.php b/src/Phalcon/Loader/Exception.php new file mode 100644 index 00000000..6e7018dc --- /dev/null +++ b/src/Phalcon/Loader/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Loader; + +/** + * Phalcon\Loader\Exception + * + * Exceptions thrown in Phalcon\Loader will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/Logger.php b/src/Phalcon/Logger.php index 85dda5f1..d19cf7ba 100644 --- a/src/Phalcon/Logger.php +++ b/src/Phalcon/Logger.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; use Phalcon\Logger\Adapter\AdapterInterface; @@ -132,6 +139,7 @@ public function addAdapter(string $name, \Phalcon\Logger\Adapter\AdapterInterfac * * @param string $message * @param array $context + * @return void */ public function alert($message, array $context = array()) { @@ -144,6 +152,7 @@ public function alert($message, array $context = array()) * * @param string $message * @param array $context + * @return void */ public function critical($message, array $context = array()) { @@ -154,6 +163,7 @@ public function critical($message, array $context = array()) * * @param string $message * @param array $context + * @return void */ public function debug($message, array $context = array()) { @@ -165,6 +175,7 @@ public function debug($message, array $context = array()) * * @param string $message * @param array $context + * @return void */ public function error($message, array $context = array()) { @@ -175,6 +186,7 @@ public function error($message, array $context = array()) * * @param string $message * @param array $context + * @return void */ public function emergency($message, array $context = array()) { @@ -195,8 +207,8 @@ public function excludeAdapters(array $adapters = array()): Logger * * @param string $name The name of the adapter * - * @return \Phalcon\Logger\Adapter\AdapterInterface * @throws Exception + * @return AdapterInterface */ public function getAdapter(string $name): AdapterInterface { @@ -227,6 +239,7 @@ public function getName(): string * * @param string $message * @param array $context + * @return void */ public function info($message, array $context = array()) { @@ -238,6 +251,7 @@ public function info($message, array $context = array()) * @param mixed $level * @param string $message * @param array $context + * @return void */ public function log($level, $message, array $context = array()) { @@ -248,6 +262,7 @@ public function log($level, $message, array $context = array()) * * @param string $message * @param array $context + * @return void */ public function notice($message, array $context = array()) { @@ -258,8 +273,8 @@ public function notice($message, array $context = array()) * * @param string $name The name of the adapter * - * @return Logger * @throws Logger\Exception + * @return Logger */ public function removeAdapter(string $name): Logger { @@ -293,6 +308,7 @@ public function setLogLevel(int $level): Logger * * @param string $message * @param array $context + * @return void */ public function warning($message, array $context = array()) { @@ -303,9 +319,9 @@ public function warning($message, array $context = array()) * * @param int $level * @param string $message * + * @throws Logger\Exception * @param array $context * @return bool - * @throws Logger\Exception */ protected function addMessage(int $level, string $message, array $context = array()): bool { diff --git a/src/Phalcon/logger/adapter/AbstractAdapter.php b/src/Phalcon/Logger/Adapter/AbstractAdapter.php similarity index 83% rename from src/Phalcon/logger/adapter/AbstractAdapter.php rename to src/Phalcon/Logger/Adapter/AbstractAdapter.php index 3fe967ae..325b51a8 100644 --- a/src/Phalcon/logger/adapter/AbstractAdapter.php +++ b/src/Phalcon/Logger/Adapter/AbstractAdapter.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Logger\Adapter; use Phalcon\Logger\Formatter\FormatterInterface; @@ -54,7 +61,7 @@ public function __destruct() * Adds a message to the queue * * @param \Phalcon\Logger\Item $item - * @return \Phalcon\Logger\Adapter\AdapterInterface + * @return AdapterInterface */ public function add(\Phalcon\Logger\Item $item): AdapterInterface { @@ -63,7 +70,7 @@ public function add(\Phalcon\Logger\Item $item): AdapterInterface /** * Starts a transaction * - * @return \Phalcon\Logger\Adapter\AdapterInterface + * @return AdapterInterface */ public function begin(): AdapterInterface { @@ -72,14 +79,14 @@ public function begin(): AdapterInterface /** * Commits the internal transaction * - * @return \Phalcon\Logger\Adapter\AdapterInterface + * @return AdapterInterface */ public function commit(): AdapterInterface { } /** - * @return \Phalcon\Logger\Formatter\FormatterInterface + * @return FormatterInterface */ public function getFormatter(): FormatterInterface { @@ -98,13 +105,14 @@ public function inTransaction(): bool * Processes the message in the adapter * * @param \Phalcon\Logger\Item $item + * @return void */ abstract public function process(\Phalcon\Logger\Item $item); /** * Rollbacks the internal transaction * - * @return \Phalcon\Logger\Adapter\AdapterInterface + * @return AdapterInterface */ public function rollback(): AdapterInterface { @@ -114,7 +122,7 @@ public function rollback(): AdapterInterface * Sets the message formatter * * @param \Phalcon\Logger\Formatter\FormatterInterface $formatter - * @return \Phalcon\Logger\Adapter\AdapterInterface + * @return AdapterInterface */ public function setFormatter(\Phalcon\Logger\Formatter\FormatterInterface $formatter): AdapterInterface { diff --git a/src/Phalcon/logger/adapter/AdapterInterface.php b/src/Phalcon/Logger/Adapter/AdapterInterface.php similarity index 84% rename from src/Phalcon/logger/adapter/AdapterInterface.php rename to src/Phalcon/Logger/Adapter/AdapterInterface.php index b93635a8..89f69ed2 100644 --- a/src/Phalcon/logger/adapter/AdapterInterface.php +++ b/src/Phalcon/Logger/Adapter/AdapterInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Logger\Adapter; use Phalcon\Logger\Formatter\FormatterInterface; @@ -44,7 +51,7 @@ public function commit(): AdapterInterface; /** * Returns the internal formatter * - * @return \Phalcon\Logger\Formatter\FormatterInterface + * @return FormatterInterface */ public function getFormatter(): FormatterInterface; @@ -52,6 +59,7 @@ public function getFormatter(): FormatterInterface; * Processes the message in the adapter * * @param \Phalcon\Logger\Item $item + * @return void */ public function process(\Phalcon\Logger\Item $item); diff --git a/src/Phalcon/logger/adapter/Noop.php b/src/Phalcon/Logger/Adapter/Noop.php similarity index 73% rename from src/Phalcon/logger/adapter/Noop.php rename to src/Phalcon/Logger/Adapter/Noop.php index bf2b4978..0565cbf0 100644 --- a/src/Phalcon/logger/adapter/Noop.php +++ b/src/Phalcon/Logger/Adapter/Noop.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Logger\Adapter; /** @@ -32,6 +39,7 @@ public function close(): bool * Processes the message i.e. writes it to the file * * @param \Phalcon\Logger\Item $item + * @return void */ public function process(\Phalcon\Logger\Item $item) { diff --git a/src/Phalcon/logger/adapter/Stream.php b/src/Phalcon/Logger/Adapter/Stream.php similarity index 85% rename from src/Phalcon/logger/adapter/Stream.php rename to src/Phalcon/Logger/Adapter/Stream.php index c61052d7..95a5c387 100644 --- a/src/Phalcon/logger/adapter/Stream.php +++ b/src/Phalcon/Logger/Adapter/Stream.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Logger\Adapter; /** @@ -80,6 +87,7 @@ public function close(): bool * Processes the message i.e. writes it to the file * * @param \Phalcon\Logger\Item $item + * @return void */ public function process(\Phalcon\Logger\Item $item) { diff --git a/src/Phalcon/logger/adapter/Syslog.php b/src/Phalcon/Logger/Adapter/Syslog.php similarity index 85% rename from src/Phalcon/logger/adapter/Syslog.php rename to src/Phalcon/Logger/Adapter/Syslog.php index 382cf89e..4b440bc3 100644 --- a/src/Phalcon/logger/adapter/Syslog.php +++ b/src/Phalcon/Logger/Adapter/Syslog.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Logger\Adapter; /** @@ -32,7 +39,7 @@ class Syslog extends \Phalcon\Logger\Adapter\AbstractAdapter * * @var string */ - protected $defaultFormatter = 'Syslog'; + protected $defaultFormatter = 'Line'; /** * @var int @@ -78,6 +85,7 @@ public function close(): bool * Processes the message i.e. writes it to the syslog * * @param \Phalcon\Logger\Item $item + * @return void */ public function process(\Phalcon\Logger\Item $item) { diff --git a/src/Phalcon/logger/AdapterFactory.php b/src/Phalcon/Logger/AdapterFactory.php similarity index 78% rename from src/Phalcon/logger/AdapterFactory.php rename to src/Phalcon/Logger/AdapterFactory.php index 690af95f..b2cb8c05 100644 --- a/src/Phalcon/logger/AdapterFactory.php +++ b/src/Phalcon/Logger/AdapterFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Logger; use Phalcon\Factory\AbstractFactory; @@ -31,7 +38,7 @@ public function __construct(array $services = array()) * @param string $name * @param string $fileName * @param array $options - * @return \Phalcon\Logger\Adapter\AdapterInterface + * @return AdapterInterface */ public function newInstance(string $name, string $fileName, array $options = array()): AdapterInterface { diff --git a/src/Phalcon/Logger/Exception.php b/src/Phalcon/Logger/Exception.php new file mode 100644 index 00000000..81003e63 --- /dev/null +++ b/src/Phalcon/Logger/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Logger; + +/** + * Phalcon\Logger\Exception + * + * Exceptions thrown in Phalcon\Logger will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/logger/formatter/AbstractFormatter.php b/src/Phalcon/Logger/Formatter/AbstractFormatter.php similarity index 74% rename from src/Phalcon/logger/formatter/AbstractFormatter.php rename to src/Phalcon/Logger/Formatter/AbstractFormatter.php index 5b00a527..6e3f5195 100644 --- a/src/Phalcon/logger/formatter/AbstractFormatter.php +++ b/src/Phalcon/Logger/Formatter/AbstractFormatter.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Logger\Formatter; /** diff --git a/src/Phalcon/logger/formatter/FormatterInterface.php b/src/Phalcon/Logger/Formatter/FormatterInterface.php similarity index 62% rename from src/Phalcon/logger/formatter/FormatterInterface.php rename to src/Phalcon/Logger/Formatter/FormatterInterface.php index bf4239f3..e51a353d 100644 --- a/src/Phalcon/logger/formatter/FormatterInterface.php +++ b/src/Phalcon/Logger/Formatter/FormatterInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Logger\Formatter; /** diff --git a/src/Phalcon/logger/formatter/Json.php b/src/Phalcon/Logger/Formatter/Json.php similarity index 76% rename from src/Phalcon/logger/formatter/Json.php rename to src/Phalcon/Logger/Formatter/Json.php index 18029e00..9e4157be 100644 --- a/src/Phalcon/logger/formatter/Json.php +++ b/src/Phalcon/Logger/Formatter/Json.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Logger\Formatter; /** @@ -7,7 +14,7 @@ * * Formats messages using JSON encoding */ -class Json extends AbstractFormatter +class Json extends \Phalcon\Logger\Formatter\AbstractFormatter { /** * Default date format diff --git a/src/Phalcon/logger/formatter/Line.php b/src/Phalcon/Logger/Formatter/Line.php similarity index 86% rename from src/Phalcon/logger/formatter/Line.php rename to src/Phalcon/Logger/Formatter/Line.php index 9f516272..d8e1bbbe 100644 --- a/src/Phalcon/logger/formatter/Line.php +++ b/src/Phalcon/Logger/Formatter/Line.php @@ -1,9 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Logger\Formatter; -use Phalcon\Logger\Formatter\Formatter; - /** * Phalcon\Logger\Formatter\Line * diff --git a/src/Phalcon/logger/Item.php b/src/Phalcon/Logger/Item.php similarity index 82% rename from src/Phalcon/logger/Item.php rename to src/Phalcon/Logger/Item.php index 0b66a8ff..015de099 100644 --- a/src/Phalcon/logger/Item.php +++ b/src/Phalcon/Logger/Item.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Logger; /** @@ -41,6 +48,7 @@ class Item protected $type; + public function getContext() { } @@ -66,7 +74,7 @@ public function getName(): string /** * Log timestamp * - * @return integer + * @return mixed */ public function getTime() { @@ -75,7 +83,7 @@ public function getTime() /** * Log type * - * @return integer + * @return mixed */ public function getType() { diff --git a/src/Phalcon/logger/LoggerFactory.php b/src/Phalcon/Logger/LoggerFactory.php similarity index 57% rename from src/Phalcon/logger/LoggerFactory.php rename to src/Phalcon/Logger/LoggerFactory.php index 99c61357..50a4cab5 100644 --- a/src/Phalcon/logger/LoggerFactory.php +++ b/src/Phalcon/Logger/LoggerFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Logger; use Phalcon\Logger; @@ -18,9 +25,9 @@ class LoggerFactory /** - * @param \Phalcon\Logger\AdapterFactory $factory + * @param AdapterFactory $factory */ - public function __construct(\Phalcon\Logger\AdapterFactory $factory) + public function __construct(AdapterFactory $factory) { } @@ -28,9 +35,9 @@ public function __construct(\Phalcon\Logger\AdapterFactory $factory) * Factory to create an instace from a Config object * * @param mixed $config - * @return mixed + * @return Logger */ - public function load($config) + public function load($config): Logger { } @@ -38,7 +45,7 @@ public function load($config) * Returns a Logger object * * @param string $name - * @param array $adapters + * @param array $adapters * * @return Logger */ diff --git a/src/Phalcon/Messages/Exception.php b/src/Phalcon/Messages/Exception.php new file mode 100644 index 00000000..763aced5 --- /dev/null +++ b/src/Phalcon/Messages/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Messages; + +/** + * Phalcon\Validation\Exception + * + * Exceptions thrown in Phalcon\Messages\ classes will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/messages/Message.php b/src/Phalcon/Messages/Message.php similarity index 85% rename from src/Phalcon/messages/Message.php rename to src/Phalcon/Messages/Message.php index 7f1ac8b6..e0da5621 100644 --- a/src/Phalcon/messages/Message.php +++ b/src/Phalcon/Messages/Message.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Messages; /** @@ -105,7 +112,7 @@ public function jsonSerialize(): array * Sets code for the message * * @param int $code - * @return \Phalcon\Messages\MessageInterface + * @return MessageInterface */ public function setCode(int $code): MessageInterface { @@ -115,7 +122,7 @@ public function setCode(int $code): MessageInterface * Sets field name related to message * * @param mixed $field - * @return \Phalcon\Messages\MessageInterface + * @return MessageInterface */ public function setField($field): MessageInterface { @@ -125,7 +132,7 @@ public function setField($field): MessageInterface * Sets verbose message * * @param string $message - * @return \Phalcon\Messages\MessageInterface + * @return MessageInterface */ public function setMessage(string $message): MessageInterface { @@ -135,7 +142,7 @@ public function setMessage(string $message): MessageInterface * Sets message metadata * * @param array $metaData - * @return \Phalcon\Messages\MessageInterface + * @return MessageInterface */ public function setMetaData(array $metaData): MessageInterface { @@ -145,7 +152,7 @@ public function setMetaData(array $metaData): MessageInterface * Sets message type * * @param string $type - * @return \Phalcon\Messages\MessageInterface + * @return MessageInterface */ public function setType(string $type): MessageInterface { diff --git a/src/Phalcon/messages/MessageInterface.php b/src/Phalcon/Messages/MessageInterface.php similarity index 88% rename from src/Phalcon/messages/MessageInterface.php rename to src/Phalcon/Messages/MessageInterface.php index 4eb1cdba..3f964f8f 100644 --- a/src/Phalcon/messages/MessageInterface.php +++ b/src/Phalcon/Messages/MessageInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Messages; /** diff --git a/src/Phalcon/messages/Messages.php b/src/Phalcon/Messages/Messages.php similarity index 88% rename from src/Phalcon/messages/Messages.php rename to src/Phalcon/Messages/Messages.php index 230bc5af..9340fb2b 100644 --- a/src/Phalcon/messages/Messages.php +++ b/src/Phalcon/Messages/Messages.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Messages; /** @@ -36,9 +43,9 @@ public function __construct(array $messages = array()) * ); * ``` * - * @param \Phalcon\Messages\MessageInterface $message + * @param MessageInterface $message */ - public function appendMessage(\Phalcon\Messages\MessageInterface $message) + public function appendMessage(MessageInterface $message) { } @@ -69,7 +76,7 @@ public function count(): int /** * Returns the current message in the iterator * - * @return \Phalcon\Messages\MessageInterface + * @return MessageInterface */ public function current(): MessageInterface { @@ -111,6 +118,8 @@ public function key(): int /** * Moves the internal iteration pointer to the next position + * + * @return void */ public function next() { @@ -157,6 +166,7 @@ public function offsetGet($index) * * @param \Phalcon\Messages\Message $message * @param mixed $index + * @return void */ public function offsetSet($index, $message) { @@ -170,6 +180,7 @@ public function offsetSet($index, $message) * ``` * * @param mixed $index + * @return void */ public function offsetUnset($index) { @@ -177,6 +188,8 @@ public function offsetUnset($index) /** * Rewinds the internal iterator + * + * @return void */ public function rewind() { diff --git a/src/Phalcon/mvc/Application.php b/src/Phalcon/Mvc/Application.php similarity index 90% rename from src/Phalcon/mvc/Application.php rename to src/Phalcon/Mvc/Application.php index a0bb0045..ec4e78c0 100644 --- a/src/Phalcon/mvc/Application.php +++ b/src/Phalcon/Mvc/Application.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc; use Phalcon\Application\AbstractApplication; @@ -66,7 +73,7 @@ class Application extends AbstractApplication * Handles a MVC request * * @param string $uri - * @return bool|\Phalcon\Http\ResponseInterface + * @return mixed */ public function handle(string $uri) { diff --git a/src/Phalcon/Mvc/Application/Exception.php b/src/Phalcon/Mvc/Application/Exception.php new file mode 100644 index 00000000..fc30b094 --- /dev/null +++ b/src/Phalcon/Mvc/Application/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Mvc\Application; + +/** + * Phalcon\Mvc\Application\Exception + * + * Exceptions thrown in Phalcon\Mvc\Application class will use this class + */ +class Exception extends \Phalcon\Application\Exception +{ + +} diff --git a/src/Phalcon/mvc/Controller.php b/src/Phalcon/Mvc/Controller.php similarity index 84% rename from src/Phalcon/mvc/Controller.php rename to src/Phalcon/Mvc/Controller.php index bf38986f..c5bfda01 100644 --- a/src/Phalcon/mvc/Controller.php +++ b/src/Phalcon/Mvc/Controller.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc; use Phalcon\Di\Injectable; diff --git a/src/Phalcon/mvc/controller/BindModelInterface.php b/src/Phalcon/Mvc/Controller/BindModelInterface.php similarity index 59% rename from src/Phalcon/mvc/controller/BindModelInterface.php rename to src/Phalcon/Mvc/Controller/BindModelInterface.php index 7df463ff..e53bf305 100644 --- a/src/Phalcon/mvc/controller/BindModelInterface.php +++ b/src/Phalcon/Mvc/Controller/BindModelInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Controller; /** diff --git a/src/Phalcon/Mvc/ControllerInterface.php b/src/Phalcon/Mvc/ControllerInterface.php new file mode 100644 index 00000000..92854264 --- /dev/null +++ b/src/Phalcon/Mvc/ControllerInterface.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Mvc; + +/** + * Phalcon\Mvc\ControllerInterface + * + * Interface for controller handlers + */ +interface ControllerInterface +{ + +} diff --git a/src/Phalcon/mvc/Dispatcher.php b/src/Phalcon/Mvc/Dispatcher.php similarity index 93% rename from src/Phalcon/mvc/Dispatcher.php rename to src/Phalcon/Mvc/Dispatcher.php index 3d851dec..af0a7413 100644 --- a/src/Phalcon/mvc/Dispatcher.php +++ b/src/Phalcon/Mvc/Dispatcher.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc; /** @@ -92,6 +99,7 @@ class Dispatcher extends \Phalcon\Dispatcher\AbstractDispatcher implements \Phal * ``` * * @param array $forward + * @return void */ public function forward(array $forward) { @@ -100,7 +108,7 @@ public function forward(array $forward) /** * Returns the active controller in the dispatcher * - * @return \Phalcon\Mvc\ControllerInterface + * @return ControllerInterface */ public function getActiveController(): ControllerInterface { @@ -128,7 +136,7 @@ public function getControllerName(): string /** * Returns the latest dispatched controller * - * @return \Phalcon\Mvc\ControllerInterface + * @return ControllerInterface */ public function getLastController(): ControllerInterface { diff --git a/src/Phalcon/Mvc/Dispatcher/Exception.php b/src/Phalcon/Mvc/Dispatcher/Exception.php new file mode 100644 index 00000000..413795b2 --- /dev/null +++ b/src/Phalcon/Mvc/Dispatcher/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Mvc\Dispatcher; + +/** + * Phalcon\Mvc\Dispatcher\Exception + * + * Exceptions thrown in Phalcon\Mvc\Dispatcher will use this class + */ +class Exception extends \Phalcon\Dispatcher\Exception +{ + +} diff --git a/src/Phalcon/mvc/DispatcherInterface.php b/src/Phalcon/Mvc/DispatcherInterface.php similarity index 70% rename from src/Phalcon/mvc/DispatcherInterface.php rename to src/Phalcon/Mvc/DispatcherInterface.php index 61c4366e..b3c8103c 100644 --- a/src/Phalcon/mvc/DispatcherInterface.php +++ b/src/Phalcon/Mvc/DispatcherInterface.php @@ -1,19 +1,28 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc; +use Phalcon\Dispatcher\DispatcherInterface as DispatcherInterfaceBase; + /** * Phalcon\Mvc\DispatcherInterface * * Interface for Phalcon\Mvc\Dispatcher */ -interface DispatcherInterface extends \Phalcon\Dispatcher\DispatcherInterface +interface DispatcherInterface extends DispatcherInterfaceBase { /** * Returns the active controller in the dispatcher * - * @return \Phalcon\Mvc\ControllerInterface + * @return ControllerInterface */ public function getActiveController(): ControllerInterface; @@ -27,7 +36,7 @@ public function getControllerName(): string; /** * Returns the latest dispatched controller * - * @return \Phalcon\Mvc\ControllerInterface + * @return ControllerInterface */ public function getLastController(): ControllerInterface; diff --git a/src/Phalcon/mvc/EntityInterface.php b/src/Phalcon/Mvc/EntityInterface.php similarity index 70% rename from src/Phalcon/mvc/EntityInterface.php rename to src/Phalcon/Mvc/EntityInterface.php index 1d14a5df..6056f3a6 100644 --- a/src/Phalcon/mvc/EntityInterface.php +++ b/src/Phalcon/Mvc/EntityInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc; /** diff --git a/src/Phalcon/mvc/Micro.php b/src/Phalcon/Mvc/Micro.php similarity index 93% rename from src/Phalcon/mvc/Micro.php rename to src/Phalcon/Mvc/Micro.php index fe66be93..012171b3 100644 --- a/src/Phalcon/mvc/Micro.php +++ b/src/Phalcon/Mvc/Micro.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc; use Phalcon\Di\Injectable; @@ -121,7 +128,7 @@ public function before($handler): Micro * * @param callable $handler * @param string $routePattern - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function delete(string $routePattern, $handler): RouteInterface { @@ -153,7 +160,7 @@ public function finish($handler): Micro * * @param callable $handler * @param string $routePattern - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function get(string $routePattern, $handler): RouteInterface { @@ -180,7 +187,7 @@ public function getBoundModels(): array /** * Returns the internal event manager * - * @return null|\Phalcon\Events\ManagerInterface + * @return mixed */ public function getEventsManager(): ?ManagerInterface { @@ -190,6 +197,7 @@ public function getEventsManager(): ?ManagerInterface * Sets the events manager * * @param \Phalcon\Events\ManagerInterface $eventsManager + * @return void */ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager) { @@ -207,7 +215,7 @@ public function getHandlers(): array /** * Gets model binder * - * @return null|\Phalcon\Mvc\Model\BinderInterface + * @return mixed */ public function getModelBinder(): ?BinderInterface { @@ -234,8 +242,8 @@ public function getRouter(): RouterInterface /** * Obtains a service from the DI * - * @param string $serviceName * @return object + * @param string $serviceName */ public function getService(string $serviceName) { @@ -244,8 +252,8 @@ public function getService(string $serviceName) /** * Obtains a shared service from the DI * - * @param string $serviceName * @return mixed + * @param string $serviceName */ public function getSharedService(string $serviceName) { @@ -276,7 +284,7 @@ public function hasService(string $serviceName): bool * * @param callable $handler * @param string $routePattern - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function head(string $routePattern, $handler): RouteInterface { @@ -287,7 +295,7 @@ public function head(string $routePattern, $handler): RouteInterface * * @param callable $handler * @param string $routePattern - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function map(string $routePattern, $handler): RouteInterface { @@ -352,6 +360,7 @@ public function offsetGet($alias) * * @param mixed $alias * @param mixed $definition + * @return void */ public function offsetSet($alias, $definition) { @@ -362,6 +371,7 @@ public function offsetSet($alias, $definition) * syntax * * @param mixed $alias + * @return void */ public function offsetUnset($alias) { @@ -372,7 +382,7 @@ public function offsetUnset($alias) * * @param callable $handler * @param string $routePattern - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function options(string $routePattern, $handler): RouteInterface { @@ -383,7 +393,7 @@ public function options(string $routePattern, $handler): RouteInterface * * @param callable $handler * @param string $routePattern - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function patch(string $routePattern, $handler): RouteInterface { @@ -394,7 +404,7 @@ public function patch(string $routePattern, $handler): RouteInterface * * @param callable $handler * @param string $routePattern - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function post(string $routePattern, $handler): RouteInterface { @@ -405,7 +415,7 @@ public function post(string $routePattern, $handler): RouteInterface * * @param callable $handler * @param string $routePattern - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function put(string $routePattern, $handler): RouteInterface { @@ -424,6 +434,7 @@ public function setActiveHandler($activeHandler) * Sets the DependencyInjector container * * @param \Phalcon\Di\DiInterface $container + * @return void */ public function setDI(\Phalcon\Di\DiInterface $container) { @@ -466,7 +477,7 @@ public function setResponseHandler($handler): Micro * @param string $serviceName * @param mixed $definition * @param bool $shared - * @return \Phalcon\Di\ServiceInterface + * @return ServiceInterface */ public function setService(string $serviceName, $definition, bool $shared = false): ServiceInterface { diff --git a/src/Phalcon/mvc/micro/Collection.php b/src/Phalcon/Mvc/Micro/Collection.php similarity index 95% rename from src/Phalcon/mvc/micro/Collection.php rename to src/Phalcon/Mvc/Micro/Collection.php index ff9801d6..8479ed72 100644 --- a/src/Phalcon/mvc/micro/Collection.php +++ b/src/Phalcon/Mvc/Micro/Collection.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Micro; /** diff --git a/src/Phalcon/mvc/micro/CollectionInterface.php b/src/Phalcon/Mvc/Micro/CollectionInterface.php similarity index 94% rename from src/Phalcon/mvc/micro/CollectionInterface.php rename to src/Phalcon/Mvc/Micro/CollectionInterface.php index 878f6c72..a0b3d42a 100644 --- a/src/Phalcon/mvc/micro/CollectionInterface.php +++ b/src/Phalcon/Mvc/Micro/CollectionInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Micro; /** diff --git a/src/Phalcon/Mvc/Micro/Exception.php b/src/Phalcon/Mvc/Micro/Exception.php new file mode 100644 index 00000000..4c2e82e0 --- /dev/null +++ b/src/Phalcon/Mvc/Micro/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Mvc\Micro; + +/** + * Exceptions thrown in Phalcon\Mvc\Micro will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/mvc/micro/LazyLoader.php b/src/Phalcon/Mvc/Micro/LazyLoader.php similarity index 76% rename from src/Phalcon/mvc/micro/LazyLoader.php rename to src/Phalcon/Mvc/Micro/LazyLoader.php index ab704b4f..1713ab44 100644 --- a/src/Phalcon/mvc/micro/LazyLoader.php +++ b/src/Phalcon/Mvc/Micro/LazyLoader.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Micro; /** @@ -16,6 +23,7 @@ class LazyLoader protected $definition; + public function getDefinition() { } @@ -33,9 +41,9 @@ public function __construct(string $definition) * Calling __call method * * @param array $arguments + * @return mixed * @param string $method * @param \Phalcon\Mvc\Model\BinderInterface $modelBinder - * @return mixed */ public function callMethod(string $method, $arguments, \Phalcon\Mvc\Model\BinderInterface $modelBinder = null) { diff --git a/src/Phalcon/mvc/micro/MiddlewareInterface.php b/src/Phalcon/Mvc/Micro/MiddlewareInterface.php similarity index 56% rename from src/Phalcon/mvc/micro/MiddlewareInterface.php rename to src/Phalcon/Mvc/Micro/MiddlewareInterface.php index e3fe446c..ab24356d 100644 --- a/src/Phalcon/mvc/micro/MiddlewareInterface.php +++ b/src/Phalcon/Mvc/Micro/MiddlewareInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Micro; /** diff --git a/src/Phalcon/mvc/Model.php b/src/Phalcon/Mvc/Model.php similarity index 95% rename from src/Phalcon/mvc/Model.php rename to src/Phalcon/Mvc/Model.php index 130ed03a..d51e101a 100644 --- a/src/Phalcon/mvc/Model.php +++ b/src/Phalcon/Mvc/Model.php @@ -1,9 +1,17 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc; use Phalcon\Db\Adapter\AdapterInterface; use Phalcon\Di\AbstractInjectionAware; +use Phalcon\Events\ManagerInterface as EventsManagerInterface; use Phalcon\Mvc\Model\CriteriaInterface; use Phalcon\Mvc\Model\ManagerInterface; use Phalcon\Mvc\Model\MetaDataInterface; @@ -117,6 +125,7 @@ abstract class Model extends AbstractInjectionAware implements \Phalcon\Mvc\Enti protected $uniqueTypes; + public function getTransaction() { } @@ -135,10 +144,10 @@ final public function __construct($data = null, \Phalcon\Di\DiInterface $contain /** * Handles method calls when a method is not implemented * - * @param string $method - * @param array $arguments * @return mixed * @throws \Phalcon\Mvc\Model\Exception If the method doesn't exist + * @param string $method + * @param array $arguments */ public function __call(string $method, array $arguments) { @@ -147,10 +156,10 @@ public function __call(string $method, array $arguments) /** * Handles method calls when a static method is not implemented * - * @param string $method - * @param array $arguments * @return mixed * @throws \Phalcon\Mvc\Model\Exception If the method doesn't exist + * @param string $method + * @param array $arguments */ public static function __callStatic(string $method, array $arguments) { @@ -160,8 +169,8 @@ public static function __callStatic(string $method, array $arguments) * Magic method to get related records using the relation alias as a * property * - * @param string $property * @return mixed + * @param string $property */ public function __get(string $property) { @@ -213,6 +222,7 @@ public function __set(string $property, $value) * ``` * * @param \Phalcon\Mvc\Model\BehaviorInterface $behavior + * @return void */ public function addBehavior(\Phalcon\Mvc\Model\BehaviorInterface $behavior) { @@ -241,7 +251,7 @@ public function addBehavior(\Phalcon\Mvc\Model\BehaviorInterface $behavior) * ``` * * @param \Phalcon\Messages\MessageInterface $message - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ public function appendMessage(\Phalcon\Messages\MessageInterface $message): ModelInterface { @@ -294,7 +304,7 @@ public function appendMessage(\Phalcon\Messages\MessageInterface $message): Mode * @param array $dataColumnMap array to transform keys of data to another * @param array $whiteList * @param array $data - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ public function assign(array $data, $whiteList = null, $dataColumnMap = null): ModelInterface { @@ -349,7 +359,7 @@ public static function average($parameters = null): float * @param \Phalcon\Mvc\ModelInterface $base * @param array $data * @param int $dirtyState - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ public static function cloneResult(\Phalcon\Mvc\ModelInterface $base, array $data, int $dirtyState = 0): ModelInterface { @@ -374,7 +384,7 @@ public static function cloneResult(\Phalcon\Mvc\ModelInterface $base, array $dat * @param array $data * @param int $dirtyState * @param bool $keepSnapshots - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ public static function cloneResultMap($base, array $data, $columnMap, int $dirtyState = 0, bool $keepSnapshots = null): ModelInterface { @@ -384,9 +394,9 @@ public static function cloneResultMap($base, array $data, $columnMap, int $dirty * Returns an hydrated result based on the data and the column map * * @param array $columnMap + * @return mixed * @param array $data * @param int $hydrationMode - * @return mixed */ public static function cloneResultMapHydrate(array $data, $columnMap, int $hydrationMode) { @@ -646,7 +656,7 @@ public function dump(): array * ``` * * @param mixed $parameters - * @return \Phalcon\Mvc\Model\ResultsetInterface + * @return ResultsetInterface */ public static function find($parameters = null): ResultsetInterface { @@ -719,7 +729,7 @@ public static function find($parameters = null): ResultsetInterface * ``` * * @param string|array $parameters - * @return bool|\Phalcon\Mvc\ModelInterface + * @return mixed */ public static function findFirst($parameters = null) { @@ -780,7 +790,7 @@ public function getDirtyState(): int /** * Returns the custom events manager * - * @return \Phalcon\Events\ManagerInterface + * @return EventsManagerInterface */ public function getEventsManager(): EventsManagerInterface { @@ -810,7 +820,7 @@ public function getEventsManager(): EventsManagerInterface * ``` * * @param mixed $filter - * @return array|\Phalcon\Messages\MessageInterface[] + * @return array */ public function getMessages($filter = null): array { @@ -819,7 +829,7 @@ public function getMessages($filter = null): array /** * Returns the models manager related to the entity instance * - * @return \Phalcon\Mvc\Model\ManagerInterface + * @return ManagerInterface */ public function getModelsManager(): ManagerInterface { @@ -828,7 +838,7 @@ public function getModelsManager(): ManagerInterface /** * {@inheritdoc} * - * @return \Phalcon\Mvc\Model\MetaDataInterface + * @return MetaDataInterface */ public function getModelsMetaData(): MetaDataInterface { @@ -856,7 +866,7 @@ public function getOldSnapshotData(): array /** * Gets the connection used to read data for the model * - * @return \Phalcon\Db\Adapter\AdapterInterface + * @return AdapterInterface */ final public function getReadConnection(): AdapterInterface { @@ -876,8 +886,8 @@ final public function getReadConnectionService(): string * Returns related records based on defined relations * * @param array $arguments - * @param string $alias * @return \Phalcon\Mvc\Model\Resultset\Simple|Phalcon\Mvc\Model\Resultset\Simple|false + * @param string $alias */ public function getRelated(string $alias, $arguments = null) { @@ -962,7 +972,7 @@ public function getUpdatedFields(): array /** * Gets the connection used to write data to the model * - * @return \Phalcon\Db\Adapter\AdapterInterface + * @return AdapterInterface */ final public function getWriteConnection(): AdapterInterface { @@ -1108,7 +1118,7 @@ public static function minimum($parameters = null) * Create a criteria for a specific model * * @param \Phalcon\Di\DiInterface $container - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public static function query(\Phalcon\Di\DiInterface $container = null): CriteriaInterface { @@ -1131,7 +1141,7 @@ public function readAttribute(string $attribute) /** * Refreshes the model attributes re-querying the record from the database * - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ public function refresh(): ModelInterface { @@ -1188,6 +1198,7 @@ public function unserialize($data) * Sets the DependencyInjection connection service name * * @param string $connectionService + * @return void */ final public function setConnectionService(string $connectionService) { @@ -1197,7 +1208,7 @@ final public function setConnectionService(string $connectionService) * Sets the dirty state of the object using one of the DIRTY_STATE_ constants * * @param int $dirtyState - * @return bool|\Phalcon\Mvc\ModelInterface + * @return mixed */ public function setDirtyState(int $dirtyState) { @@ -1216,6 +1227,7 @@ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager * Sets the DependencyInjection connection service name used to read data * * @param string $connectionService + * @return void */ final public function setReadConnectionService(string $connectionService) { @@ -1240,6 +1252,7 @@ public function setOldSnapshotData(array $data, $columnMap = null) * * @param array $columnMap * @param array $data + * @return void */ public function setSnapshotData(array $data, $columnMap = null) { @@ -1285,7 +1298,7 @@ public function setSnapshotData(array $data, $columnMap = null) * ``` * * @param \Phalcon\Mvc\Model\TransactionInterface $transaction - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ public function setTransaction(\Phalcon\Mvc\Model\TransactionInterface $transaction): ModelInterface { @@ -1295,6 +1308,7 @@ public function setTransaction(\Phalcon\Mvc\Model\TransactionInterface $transact * Enables/disables options in the ORM * * @param array $options + * @return void */ public static function setup(array $options) { @@ -1304,6 +1318,7 @@ public static function setup(array $options) * Sets the DependencyInjection connection service name used to write data * * @param string $connectionService + * @return void */ final public function setWriteConnectionService(string $connectionService) { @@ -1313,6 +1328,7 @@ final public function setWriteConnectionService(string $connectionService) * Skips the current operation forcing a success state * * @param bool $skip + * @return void */ public function skipOperation(bool $skip) { @@ -1395,6 +1411,7 @@ public function update(): bool * * @param string $attribute * @param mixed $value + * @return void */ public function writeAttribute(string $attribute, $value) { @@ -1486,7 +1503,7 @@ protected function _getRelatedRecords(string $modelName, string $method, array $ * @param array $parameters * @param string $functionName * @param string $alias - * @return \Phalcon\Mvc\Model\ResultsetInterface + * @return ResultsetInterface */ protected static function _groupResult(string $functionName, string $alias, $parameters): ResultsetInterface { @@ -1495,9 +1512,9 @@ protected static function _groupResult(string $functionName, string $alias, $par /** * Try to check if the query must invoke a finder * + * @return \Phalcon\Mvc\ModelInterface[]|\Phalcon\Mvc\ModelInterface|bool * @param string $method * @param array $arguments - * @return \Phalcon\Mvc\ModelInterface[]|\Phalcon\Mvc\ModelInterface|bool */ final protected static function _invokeFinder(string $method, array $arguments) { @@ -1553,7 +1570,7 @@ protected function _postSave(bool $success, bool $exists): bool /** * Save the related records assigned in the has-one/has-many relations * - * @param Phalcon\Mvc\ModelInterface[] related + * @param Phalcon\Mvc\ModelInterface[] related * @param \Phalcon\Db\Adapter\AdapterInterface $connection * @param mixed $related * @param Phalcon\Mvc\ModelInterface [] related @@ -1582,6 +1599,7 @@ protected function _postSaveRelatedRecords(\Phalcon\Db\Adapter\AdapterInterface * ``` * * @param array $attributes + * @return void */ protected function allowEmptyStringValues(array $attributes) { @@ -1615,7 +1633,7 @@ protected function _cancelOperation() * @param string $referenceModel * @param mixed $referencedFields * @param mixed $options - * @return \Phalcon\Mvc\Model\Relation + * @return Relation */ protected function belongsTo($fields, string $referenceModel, $referencedFields, $options = null): Relation { @@ -1626,7 +1644,7 @@ protected function belongsTo($fields, string $referenceModel, $referencedFields, * * @param mixed $params * @param mixed $limit - * @return \Phalcon\Mvc\Model\Query + * @return Query */ private static function getPreparedQuery($params, $limit = null): Query { @@ -1653,7 +1671,7 @@ private static function getPreparedQuery($params, $limit = null): Query * @param string $referenceModel * @param mixed $referencedFields * @param mixed $options - * @return \Phalcon\Mvc\Model\Relation + * @return Relation */ protected function hasMany($fields, string $referenceModel, $referencedFields, $options = null): Relation { @@ -1688,7 +1706,7 @@ protected function hasMany($fields, string $referenceModel, $referencedFields, $ * @param array $options * @param string $intermediateModel * @param string $referenceModel - * @return \Phalcon\Mvc\Model\Relation + * @return Relation */ protected function hasManyToMany($fields, string $intermediateModel, $intermediateFields, $intermediateReferencedFields, string $referenceModel, $referencedFields, $options = null): Relation { @@ -1715,12 +1733,47 @@ protected function hasManyToMany($fields, string $intermediateModel, $intermedia * @param string $referenceModel * @param mixed $referencedFields * @param mixed $options - * @return \Phalcon\Mvc\Model\Relation + * @return Relation */ protected function hasOne($fields, string $referenceModel, $referencedFields, $options = null): Relation { } + /** + * Setup a 1-1 relation between two models, through an intermediate + * relation + * + * ```php + * class Robots extends \Phalcon\Mvc\Model + * { + * public function initialize() + * { + * // Setup a 1-1 relation to one item from Parts through RobotsParts + * $this->hasOneThrough( + * "id", + * RobotsParts::class, + * "robots_id", + * "parts_id", + * Parts::class, + * "id", + * ); + * } + * } + * ``` + * + * @param string|array $fields + * @param string|array $intermediateFields + * @param string|array $intermediateReferencedFields + * @param string|array $referencedFields + * @param array $options + * @param string $intermediateModel + * @param string $referenceModel + * @return Relation + */ + protected function hasOneThrough($fields, string $intermediateModel, $intermediateFields, $intermediateReferencedFields, string $referenceModel, $referencedFields, $options = null): Relation + { + } + /** * Sets if the model must keep the original record snapshot in memory * @@ -1737,6 +1790,7 @@ protected function hasOne($fields, string $referenceModel, $referencedFields, $o * ``` * * @param bool $keepSnapshot + * @return void */ protected function keepSnapshots(bool $keepSnapshot) { @@ -1746,7 +1800,7 @@ protected function keepSnapshots(bool $keepSnapshot) * Sets schema name where the mapped table is located * * @param string $schema - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ final protected function setSchema(string $schema): ModelInterface { @@ -1756,7 +1810,7 @@ final protected function setSchema(string $schema): ModelInterface * Sets the table name to which model should be mapped * * @param string $source - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ final protected function setSource(string $source): ModelInterface { @@ -1805,6 +1859,7 @@ protected function skipAttributes(array $attributes) * ``` * * @param array $attributes + * @return void */ protected function skipAttributesOnCreate(array $attributes) { @@ -1829,6 +1884,7 @@ protected function skipAttributesOnCreate(array $attributes) * ``` * * @param array $attributes + * @return void */ protected function skipAttributesOnUpdate(array $attributes) { @@ -1850,6 +1906,7 @@ protected function skipAttributesOnUpdate(array $attributes) * ``` * * @param bool $dynamicUpdate + * @return void */ protected function useDynamicUpdate(bool $dynamicUpdate) { diff --git a/src/Phalcon/mvc/model/Behavior.php b/src/Phalcon/Mvc/Model/Behavior.php similarity index 86% rename from src/Phalcon/mvc/model/Behavior.php rename to src/Phalcon/Mvc/Model/Behavior.php index a22c6289..25bf961e 100644 --- a/src/Phalcon/mvc/model/Behavior.php +++ b/src/Phalcon/Mvc/Model/Behavior.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; /** @@ -27,8 +34,8 @@ public function __construct(array $options = array()) /** * Returns the behavior options related to an event * - * @param string $eventName * @return array + * @param string $eventName */ protected function getOptions(string $eventName = null) { diff --git a/src/Phalcon/mvc/model/behavior/SoftDelete.php b/src/Phalcon/Mvc/Model/Behavior/SoftDelete.php similarity index 69% rename from src/Phalcon/mvc/model/behavior/SoftDelete.php rename to src/Phalcon/Mvc/Model/Behavior/SoftDelete.php index 53c93099..85b47a4d 100644 --- a/src/Phalcon/mvc/model/behavior/SoftDelete.php +++ b/src/Phalcon/Mvc/Model/Behavior/SoftDelete.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\Behavior; use Phalcon\Mvc\Model\Behavior; diff --git a/src/Phalcon/mvc/model/behavior/Timestampable.php b/src/Phalcon/Mvc/Model/Behavior/Timestampable.php similarity index 74% rename from src/Phalcon/mvc/model/behavior/Timestampable.php rename to src/Phalcon/Mvc/Model/Behavior/Timestampable.php index e6eb4f72..0863099b 100644 --- a/src/Phalcon/mvc/model/behavior/Timestampable.php +++ b/src/Phalcon/Mvc/Model/Behavior/Timestampable.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\Behavior; use Phalcon\Mvc\Model\Behavior; diff --git a/src/Phalcon/mvc/model/BehaviorInterface.php b/src/Phalcon/Mvc/Model/BehaviorInterface.php similarity index 75% rename from src/Phalcon/mvc/model/BehaviorInterface.php rename to src/Phalcon/Mvc/Model/BehaviorInterface.php index a6a61047..8d42f024 100644 --- a/src/Phalcon/mvc/model/BehaviorInterface.php +++ b/src/Phalcon/Mvc/Model/BehaviorInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; /** diff --git a/src/Phalcon/mvc/model/Binder.php b/src/Phalcon/Mvc/Model/Binder.php similarity index 91% rename from src/Phalcon/mvc/model/Binder.php rename to src/Phalcon/Mvc/Model/Binder.php index 243ee36a..980c7340 100644 --- a/src/Phalcon/mvc/model/Binder.php +++ b/src/Phalcon/Mvc/Model/Binder.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; use Phalcon\Cache\Adapter\AdapterInterface; @@ -86,7 +93,7 @@ protected function findBoundModel($paramValue, string $className): bool /** * Sets cache instance * - * @return \Phalcon\Cache\Adapter\AdapterInterface + * @return AdapterInterface */ public function getCache(): AdapterInterface { diff --git a/src/Phalcon/mvc/model/binder/BindableInterface.php b/src/Phalcon/Mvc/Model/Binder/BindableInterface.php similarity index 61% rename from src/Phalcon/mvc/model/binder/BindableInterface.php rename to src/Phalcon/Mvc/Model/Binder/BindableInterface.php index d0b643e6..f37da24c 100644 --- a/src/Phalcon/mvc/model/binder/BindableInterface.php +++ b/src/Phalcon/Mvc/Model/Binder/BindableInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\Binder; /** diff --git a/src/Phalcon/mvc/model/BinderInterface.php b/src/Phalcon/Mvc/Model/BinderInterface.php similarity index 79% rename from src/Phalcon/mvc/model/BinderInterface.php rename to src/Phalcon/Mvc/Model/BinderInterface.php index 8ce5d24a..8963d43c 100644 --- a/src/Phalcon/mvc/model/BinderInterface.php +++ b/src/Phalcon/Mvc/Model/BinderInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; use Phalcon\Cache\Adapter\AdapterInterface; @@ -33,7 +40,7 @@ public function getBoundModels(): array; /** * Gets cache instance * - * @return \Phalcon\Cache\Adapter\AdapterInterface + * @return AdapterInterface */ public function getCache(): AdapterInterface; diff --git a/src/Phalcon/mvc/model/Criteria.php b/src/Phalcon/Mvc/Model/Criteria.php similarity index 88% rename from src/Phalcon/mvc/model/Criteria.php rename to src/Phalcon/Mvc/Model/Criteria.php index 0eebabeb..532ce0b7 100644 --- a/src/Phalcon/mvc/model/Criteria.php +++ b/src/Phalcon/Mvc/Model/Criteria.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; use Phalcon\Di\DiInterface; @@ -44,6 +51,7 @@ class Criteria implements \Phalcon\Mvc\Model\CriteriaInterface, \Phalcon\Di\Inje * Sets the DependencyInjector container * * @param \Phalcon\Di\DiInterface $container + * @return void */ public function setDI(\Phalcon\Di\DiInterface $container) { @@ -52,7 +60,7 @@ public function setDI(\Phalcon\Di\DiInterface $container) /** * Returns the DependencyInjector container * - * @return \Phalcon\Di\DiInterface + * @return DiInterface */ public function getDI(): DiInterface { @@ -62,7 +70,7 @@ public function getDI(): DiInterface * Set a model on which the query will be executed * * @param string $modelName - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function setModelName(string $modelName): CriteriaInterface { @@ -83,7 +91,7 @@ public function getModelName(): string * * @param array $bindParams * @param bool $merge - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function bind(array $bindParams, bool $merge = false): CriteriaInterface { @@ -94,7 +102,7 @@ public function bind(array $bindParams, bool $merge = false): CriteriaInterface * This method replaces all previously set bound parameters * * @param array $bindTypes - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function bindTypes(array $bindTypes): CriteriaInterface { @@ -104,7 +112,7 @@ public function bindTypes(array $bindTypes): CriteriaInterface * Sets SELECT DISTINCT / SELECT ALL flag * * @param mixed $distinct - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function distinct($distinct): CriteriaInterface { @@ -123,7 +131,7 @@ public function distinct($distinct): CriteriaInterface * ``` * * @param string|array $columns - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function columns($columns): CriteriaInterface { @@ -160,7 +168,7 @@ public function columns($columns): CriteriaInterface * @param mixed $conditions * @param mixed $alias * @param mixed $type - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function join(string $model, $conditions = null, $alias = null, $type = null): CriteriaInterface { @@ -189,7 +197,7 @@ public function join(string $model, $conditions = null, $alias = null, $type = n * @param string $model * @param mixed $conditions * @param mixed $alias - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function innerJoin(string $model, $conditions = null, $alias = null): CriteriaInterface { @@ -209,7 +217,7 @@ public function innerJoin(string $model, $conditions = null, $alias = null): Cri * @param string $model * @param mixed $conditions * @param mixed $alias - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function leftJoin(string $model, $conditions = null, $alias = null): CriteriaInterface { @@ -229,7 +237,7 @@ public function leftJoin(string $model, $conditions = null, $alias = null): Crit * @param string $model * @param mixed $conditions * @param mixed $alias - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function rightJoin(string $model, $conditions = null, $alias = null): CriteriaInterface { @@ -241,7 +249,7 @@ public function rightJoin(string $model, $conditions = null, $alias = null): Cri * @param string $conditions * @param mixed $bindParams * @param mixed $bindTypes - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function where(string $conditions, $bindParams = null, $bindTypes = null): CriteriaInterface { @@ -253,7 +261,7 @@ public function where(string $conditions, $bindParams = null, $bindTypes = null) * @param string $conditions * @param mixed $bindParams * @param mixed $bindTypes - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function andWhere(string $conditions, $bindParams = null, $bindTypes = null): CriteriaInterface { @@ -265,7 +273,7 @@ public function andWhere(string $conditions, $bindParams = null, $bindTypes = nu * @param string $conditions * @param mixed $bindParams * @param mixed $bindTypes - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function orWhere(string $conditions, $bindParams = null, $bindTypes = null): CriteriaInterface { @@ -281,7 +289,7 @@ public function orWhere(string $conditions, $bindParams = null, $bindTypes = nul * @param string $expr * @param mixed $minimum * @param mixed $maximum - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function betweenWhere(string $expr, $minimum, $maximum): CriteriaInterface { @@ -297,7 +305,7 @@ public function betweenWhere(string $expr, $minimum, $maximum): CriteriaInterfac * @param string $expr * @param mixed $minimum * @param mixed $maximum - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function notBetweenWhere(string $expr, $minimum, $maximum): CriteriaInterface { @@ -312,7 +320,7 @@ public function notBetweenWhere(string $expr, $minimum, $maximum): CriteriaInter * * @param string $expr * @param array $values - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function inWhere(string $expr, array $values): CriteriaInterface { @@ -327,7 +335,7 @@ public function inWhere(string $expr, array $values): CriteriaInterface * * @param string $expr * @param array $values - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function notInWhere(string $expr, array $values): CriteriaInterface { @@ -337,7 +345,7 @@ public function notInWhere(string $expr, array $values): CriteriaInterface * Adds the conditions parameter to the criteria * * @param string $conditions - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function conditions(string $conditions): CriteriaInterface { @@ -347,7 +355,7 @@ public function conditions(string $conditions): CriteriaInterface * Adds the order-by clause to the criteria * * @param string $orderColumns - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function orderBy(string $orderColumns): CriteriaInterface { @@ -357,7 +365,7 @@ public function orderBy(string $orderColumns): CriteriaInterface * Adds the group-by clause to the criteria * * @param mixed $group - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function groupBy($group): CriteriaInterface { @@ -367,7 +375,7 @@ public function groupBy($group): CriteriaInterface * Adds the having clause to the criteria * * @param mixed $having - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function having($having): CriteriaInterface { @@ -384,7 +392,7 @@ public function having($having): CriteriaInterface * * @param int $limit * @param int $offset - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function limit(int $limit, int $offset = 0): CriteriaInterface { @@ -394,7 +402,7 @@ public function limit(int $limit, int $offset = 0): CriteriaInterface * Adds the "for_update" parameter to the criteria * * @param bool $forUpdate - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function forUpdate(bool $forUpdate = true): CriteriaInterface { @@ -404,7 +412,7 @@ public function forUpdate(bool $forUpdate = true): CriteriaInterface * Adds the "shared_lock" parameter to the criteria * * @param bool $sharedLock - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function sharedLock(bool $sharedLock = true): CriteriaInterface { @@ -415,7 +423,7 @@ public function sharedLock(bool $sharedLock = true): CriteriaInterface * This method replaces all previously set cache options * * @param array $cache - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public function cache(array $cache): CriteriaInterface { @@ -498,7 +506,7 @@ public function getParams(): array * @param string $modelName * @param array $data * @param string $operator - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public static function fromInput(\Phalcon\Di\DiInterface $container, string $modelName, array $data, string $operator = 'AND'): CriteriaInterface { @@ -514,7 +522,7 @@ public static function fromInput(\Phalcon\Di\DiInterface $container, string $mod * ->createBuilder(); * ``` * - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function createBuilder(): BuilderInterface { @@ -523,7 +531,7 @@ public function createBuilder(): BuilderInterface /** * Executes a find using the parameters built with the criteria * - * @return \Phalcon\Mvc\Model\ResultsetInterface + * @return ResultsetInterface */ public function execute(): ResultsetInterface { diff --git a/src/Phalcon/mvc/model/CriteriaInterface.php b/src/Phalcon/Mvc/Model/CriteriaInterface.php similarity index 97% rename from src/Phalcon/mvc/model/CriteriaInterface.php rename to src/Phalcon/Mvc/Model/CriteriaInterface.php index 09adbbdb..419e17a5 100644 --- a/src/Phalcon/mvc/model/CriteriaInterface.php +++ b/src/Phalcon/Mvc/Model/CriteriaInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; /** diff --git a/src/Phalcon/Mvc/Model/Exception.php b/src/Phalcon/Mvc/Model/Exception.php new file mode 100644 index 00000000..376877b4 --- /dev/null +++ b/src/Phalcon/Mvc/Model/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Mvc\Model; + +/** + * Phalcon\Mvc\Model\Exception + * + * Exceptions thrown in Phalcon\Mvc\Model\ classes will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/mvc/model/Manager.php b/src/Phalcon/Mvc/Model/Manager.php similarity index 87% rename from src/Phalcon/mvc/model/Manager.php rename to src/Phalcon/Mvc/Model/Manager.php index 99d4af9e..777815c2 100644 --- a/src/Phalcon/mvc/model/Manager.php +++ b/src/Phalcon/Mvc/Model/Manager.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; use Phalcon\Db\Adapter\AdapterInterface; @@ -97,6 +104,16 @@ class Manager implements \Phalcon\Mvc\Model\ManagerInterface, \Phalcon\Di\Inject */ protected $hasOneSingle = array(); + /** + * Has one through relations + */ + protected $hasOneThrough = array(); + + /** + * Has one through relations by model + */ + protected $hasOneThroughSingle = array(); + /** * Mark initialized models */ @@ -143,6 +160,7 @@ class Manager implements \Phalcon\Mvc\Model\ManagerInterface, \Phalcon\Di\Inject * Sets the DependencyInjector container * * @param \Phalcon\Di\DiInterface $container + * @return void */ public function setDI(\Phalcon\Di\DiInterface $container) { @@ -151,7 +169,7 @@ public function setDI(\Phalcon\Di\DiInterface $container) /** * Returns the DependencyInjector container * - * @return \Phalcon\Di\DiInterface + * @return DiInterface */ public function getDI(): DiInterface { @@ -161,6 +179,7 @@ public function getDI(): DiInterface * Sets a global events manager * * @param \Phalcon\Events\ManagerInterface $eventsManager + * @return void */ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager) { @@ -169,7 +188,7 @@ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager /** * Returns the internal event manager * - * @return \Phalcon\Events\ManagerInterface + * @return EventsManagerInterface */ public function getEventsManager(): EventsManagerInterface { @@ -180,6 +199,7 @@ public function getEventsManager(): EventsManagerInterface * * @param \Phalcon\Mvc\ModelInterface $model * @param \Phalcon\Events\ManagerInterface $eventsManager + * @return void */ public function setCustomEventsManager(\Phalcon\Mvc\ModelInterface $model, \Phalcon\Events\ManagerInterface $eventsManager) { @@ -189,7 +209,7 @@ public function setCustomEventsManager(\Phalcon\Mvc\ModelInterface $model, \Phal * Returns a custom events manager related to a model * * @param \Phalcon\Mvc\ModelInterface $model - * @return bool|\Phalcon\Events\ManagerInterface + * @return mixed */ public function getCustomEventsManager(\Phalcon\Mvc\ModelInterface $model) { @@ -218,7 +238,7 @@ public function isInitialized(string $className): bool /** * Get last initialized model * - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ public function getLastInitialized(): ModelInterface { @@ -228,7 +248,7 @@ public function getLastInitialized(): ModelInterface * Loads a model throwing an exception if it doesn't exist * * @param string $modelName - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ public function load(string $modelName): ModelInterface { @@ -257,6 +277,7 @@ public function load(string $modelName): ModelInterface * ``` * * @param string $prefix + * @return void */ public function setModelPrefix(string $prefix) { @@ -276,6 +297,7 @@ public function getModelPrefix(): string * * @param \Phalcon\Mvc\ModelInterface $model * @param string $source + * @return void */ public function setModelSource(\Phalcon\Mvc\ModelInterface $model, string $source) { @@ -314,6 +336,7 @@ public function getModelSource(\Phalcon\Mvc\ModelInterface $model): string * * @param \Phalcon\Mvc\ModelInterface $model * @param string $schema + * @return void */ public function setModelSchema(\Phalcon\Mvc\ModelInterface $model, string $schema) { @@ -334,6 +357,7 @@ public function getModelSchema(\Phalcon\Mvc\ModelInterface $model): string * * @param \Phalcon\Mvc\ModelInterface $model * @param string $connectionService + * @return void */ public function setConnectionService(\Phalcon\Mvc\ModelInterface $model, string $connectionService) { @@ -344,6 +368,7 @@ public function setConnectionService(\Phalcon\Mvc\ModelInterface $model, string * * @param \Phalcon\Mvc\ModelInterface $model * @param string $connectionService + * @return void */ public function setWriteConnectionService(\Phalcon\Mvc\ModelInterface $model, string $connectionService) { @@ -354,6 +379,7 @@ public function setWriteConnectionService(\Phalcon\Mvc\ModelInterface $model, st * * @param \Phalcon\Mvc\ModelInterface $model * @param string $connectionService + * @return void */ public function setReadConnectionService(\Phalcon\Mvc\ModelInterface $model, string $connectionService) { @@ -363,7 +389,7 @@ public function setReadConnectionService(\Phalcon\Mvc\ModelInterface $model, str * Returns the connection to read data related to a model * * @param \Phalcon\Mvc\ModelInterface $model - * @return \Phalcon\Db\Adapter\AdapterInterface + * @return AdapterInterface */ public function getReadConnection(\Phalcon\Mvc\ModelInterface $model): AdapterInterface { @@ -373,7 +399,7 @@ public function getReadConnection(\Phalcon\Mvc\ModelInterface $model): AdapterIn * Returns the connection to write data related to a model * * @param \Phalcon\Mvc\ModelInterface $model - * @return \Phalcon\Db\Adapter\AdapterInterface + * @return AdapterInterface */ public function getWriteConnection(\Phalcon\Mvc\ModelInterface $model): AdapterInterface { @@ -384,7 +410,7 @@ public function getWriteConnection(\Phalcon\Mvc\ModelInterface $model): AdapterI * * @param \Phalcon\Mvc\ModelInterface $model * @param mixed $connectionServices - * @return \Phalcon\Db\Adapter\AdapterInterface + * @return AdapterInterface */ protected function _getConnection(\Phalcon\Mvc\ModelInterface $model, $connectionServices): AdapterInterface { @@ -452,6 +478,7 @@ public function missingMethod(\Phalcon\Mvc\ModelInterface $model, string $eventN * * @param \Phalcon\Mvc\ModelInterface $model * @param \Phalcon\Mvc\Model\BehaviorInterface $behavior + * @return void */ public function addBehavior(\Phalcon\Mvc\ModelInterface $model, \Phalcon\Mvc\Model\BehaviorInterface $behavior) { @@ -462,6 +489,7 @@ public function addBehavior(\Phalcon\Mvc\ModelInterface $model, \Phalcon\Mvc\Mod * * @param \Phalcon\Mvc\ModelInterface $model * @param bool $keepSnapshots + * @return void */ public function keepSnapshots(\Phalcon\Mvc\ModelInterface $model, bool $keepSnapshots) { @@ -482,6 +510,7 @@ public function isKeepingSnapshots(\Phalcon\Mvc\ModelInterface $model): bool * * @param \Phalcon\Mvc\ModelInterface $model * @param bool $dynamicUpdate + * @return void */ public function useDynamicUpdate(\Phalcon\Mvc\ModelInterface $model, bool $dynamicUpdate) { @@ -505,12 +534,29 @@ public function isUsingDynamicUpdate(\Phalcon\Mvc\ModelInterface $model): bool * @param mixed $fields * @param string $referencedModel * @param mixed $referencedFields - * @return \Phalcon\Mvc\Model\RelationInterface + * @return RelationInterface */ public function addHasOne(\Phalcon\Mvc\ModelInterface $model, $fields, string $referencedModel, $referencedFields, $options = null): RelationInterface { } + /** + * Setups a relation 1-1 between two models using an intermediate model + * + * @param string $fields + * @param string $intermediateFields + * @param string $intermediateReferencedFields + * @param string $referencedFields + * @param array $options + * @param \Phalcon\Mvc\ModelInterface $model + * @param string $intermediateModel + * @param string $referencedModel + * @return RelationInterface + */ + public function addHasOneThrough(\Phalcon\Mvc\ModelInterface $model, $fields, string $intermediateModel, $intermediateFields, $intermediateReferencedFields, string $referencedModel, $referencedFields, $options = null): RelationInterface + { + } + /** * Setup a relation reverse many to one between two models * @@ -519,7 +565,7 @@ public function addHasOne(\Phalcon\Mvc\ModelInterface $model, $fields, string $r * @param mixed $fields * @param string $referencedModel * @param mixed $referencedFields - * @return \Phalcon\Mvc\Model\RelationInterface + * @return RelationInterface */ public function addBelongsTo(\Phalcon\Mvc\ModelInterface $model, $fields, string $referencedModel, $referencedFields, $options = null): RelationInterface { @@ -533,7 +579,7 @@ public function addBelongsTo(\Phalcon\Mvc\ModelInterface $model, $fields, string * @param \Phalcon\Mvc\ModelInterface $model * @param mixed $fields * @param string $referencedModel - * @return \Phalcon\Mvc\Model\RelationInterface + * @return RelationInterface */ public function addHasMany(\Phalcon\Mvc\ModelInterface $model, $fields, string $referencedModel, $referencedFields, $options = null): RelationInterface { @@ -550,7 +596,7 @@ public function addHasMany(\Phalcon\Mvc\ModelInterface $model, $fields, string $ * @param \Phalcon\Mvc\ModelInterface $model * @param string $intermediateModel * @param string $referencedModel - * @return \Phalcon\Mvc\Model\RelationInterface + * @return RelationInterface */ public function addHasManyToMany(\Phalcon\Mvc\ModelInterface $model, $fields, string $intermediateModel, $intermediateFields, $intermediateReferencedFields, string $referencedModel, $referencedFields, $options = null): RelationInterface { @@ -589,6 +635,17 @@ public function existsHasOne(string $modelName, string $modelRelation): bool { } + /** + * Checks whether a model has a hasOneThrough relation with another model + * + * @param string $modelName + * @param string $modelRelation + * @return bool + */ + public function existsHasOneThrough(string $modelName, string $modelRelation): bool + { + } + /** * Checks whether a model has a hasManyToMany relation with another model * @@ -605,7 +662,7 @@ public function existsHasManyToMany(string $modelName, string $modelRelation): b * * @param string $modelName * @param string $alias - * @return bool|\Phalcon\Mvc\Model\RelationInterface + * @return mixed */ public function getRelationByAlias(string $modelName, string $alias) { @@ -625,13 +682,13 @@ final protected function _mergeFindParameters($findParamsOne, $findParamsTwo): a /** * Helper method to query records based on a relation definition * - * @param \Phalcon\Mvc\Model\RelationInterface $relation + * @return \Phalcon\Mvc\Model\Resultset\Simple|Phalcon\Mvc\Model\Resultset\Simple|int|false + * @param RelationInterface $relation * @param \Phalcon\Mvc\ModelInterface $record * @param mixed $parameters * @param string $method - * @return \Phalcon\Mvc\Model\Resultset\Simple|Phalcon\Mvc\Model\Resultset\Simple|int|false */ - public function getRelationRecords(\Phalcon\Mvc\Model\RelationInterface $relation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null) + public function getRelationRecords(RelationInterface $relation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null) { } @@ -651,6 +708,7 @@ public function getReusableRecords(string $modelName, string $key) * @param string $modelName * @param string $key * @param mixed $records + * @return void */ public function setReusableRecords(string $modelName, string $key, $records) { @@ -658,6 +716,8 @@ public function setReusableRecords(string $modelName, string $key, $records) /** * Clears the internal reusable list + * + * @return void */ public function clearReusableObjects() { @@ -671,7 +731,7 @@ public function clearReusableObjects() * @param \Phalcon\Mvc\ModelInterface $record * @param mixed $parameters * @param string $method - * @return bool|\Phalcon\Mvc\Model\ResultsetInterface + * @return mixed */ public function getBelongsToRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null) { @@ -685,7 +745,7 @@ public function getBelongsToRecords(string $modelName, string $modelRelation, \P * @param \Phalcon\Mvc\ModelInterface $record * @param mixed $parameters * @param string $method - * @return bool|\Phalcon\Mvc\Model\ResultsetInterface + * @return mixed */ public function getHasManyRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null) { @@ -699,7 +759,7 @@ public function getHasManyRecords(string $modelName, string $modelRelation, \Pha * @param \Phalcon\Mvc\ModelInterface $record * @param mixed $parameters * @param string $method - * @return bool|\Phalcon\Mvc\ModelInterface + * @return mixed */ public function getHasOneRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null) { @@ -715,7 +775,7 @@ public function getHasOneRecords(string $modelName, string $modelRelation, \Phal * ``` * * @param \Phalcon\Mvc\ModelInterface $model - * @return array|\Phalcon\Mvc\Model\RelationInterface[] + * @return array */ public function getBelongsTo(\Phalcon\Mvc\ModelInterface $model): array { @@ -725,7 +785,7 @@ public function getBelongsTo(\Phalcon\Mvc\ModelInterface $model): array * Gets hasMany relations defined on a model * * @param \Phalcon\Mvc\ModelInterface $model - * @return array|\Phalcon\Mvc\Model\RelationInterface[] + * @return array */ public function getHasMany(\Phalcon\Mvc\ModelInterface $model): array { @@ -741,11 +801,21 @@ public function getHasOne(\Phalcon\Mvc\ModelInterface $model): array { } + /** + * Gets hasOneThrough relations defined on a model + * + * @param \Phalcon\Mvc\ModelInterface $model + * @return array + */ + public function getHasOneThrough(\Phalcon\Mvc\ModelInterface $model): array + { + } + /** * Gets hasManyToMany relations defined on a model * * @param \Phalcon\Mvc\ModelInterface $model - * @return array|\Phalcon\Mvc\Model\RelationInterface[] + * @return array */ public function getHasManyToMany(\Phalcon\Mvc\ModelInterface $model): array { @@ -755,7 +825,7 @@ public function getHasManyToMany(\Phalcon\Mvc\ModelInterface $model): array * Gets hasOne relations defined on a model * * @param \Phalcon\Mvc\ModelInterface $model - * @return array|\Phalcon\Mvc\Model\RelationInterface[] + * @return array */ public function getHasOneAndHasMany(\Phalcon\Mvc\ModelInterface $model): array { @@ -765,7 +835,7 @@ public function getHasOneAndHasMany(\Phalcon\Mvc\ModelInterface $model): array * Query all the relationships defined on a model * * @param string $modelName - * @return array|\Phalcon\Mvc\Model\RelationInterface[] + * @return array */ public function getRelations(string $modelName): array { @@ -776,7 +846,7 @@ public function getRelations(string $modelName): array * * @param string $first * @param string $second - * @return array|bool|\Phalcon\Mvc\Model\RelationInterface[] + * @return array|bool */ public function getRelationsBetween(string $first, string $second) { @@ -786,7 +856,7 @@ public function getRelationsBetween(string $first, string $second) * Creates a Phalcon\Mvc\Model\Query without execute it * * @param string $phql - * @return \Phalcon\Mvc\Model\QueryInterface + * @return QueryInterface */ public function createQuery(string $phql): QueryInterface { @@ -798,7 +868,7 @@ public function createQuery(string $phql): QueryInterface * @param string $phql * @param mixed $placeholders * @param mixed $types - * @return \Phalcon\Mvc\Model\QueryInterface + * @return QueryInterface */ public function executeQuery(string $phql, $placeholders = null, $types = null): QueryInterface { @@ -808,7 +878,7 @@ public function executeQuery(string $phql, $placeholders = null, $types = null): * Creates a Phalcon\Mvc\Model\Query\Builder * * @param mixed $params - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function createBuilder($params = null): BuilderInterface { @@ -817,7 +887,7 @@ public function createBuilder($params = null): BuilderInterface /** * Returns the last query created or executed in the models manager * - * @return \Phalcon\Mvc\Model\QueryInterface + * @return QueryInterface */ public function getLastQuery(): QueryInterface { diff --git a/src/Phalcon/mvc/model/ManagerInterface.php b/src/Phalcon/Mvc/Model/ManagerInterface.php similarity index 80% rename from src/Phalcon/mvc/model/ManagerInterface.php rename to src/Phalcon/Mvc/Model/ManagerInterface.php index 04b666e8..c7d7b345 100644 --- a/src/Phalcon/mvc/model/ManagerInterface.php +++ b/src/Phalcon/Mvc/Model/ManagerInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; use Phalcon\Db\Adapter\AdapterInterface; @@ -18,9 +25,10 @@ interface ManagerInterface * Binds a behavior to a model * * @param \Phalcon\Mvc\ModelInterface $model - * @param \Phalcon\Mvc\Model\BehaviorInterface $behavior + * @param BehaviorInterface $behavior + * @return void */ - public function addBehavior(\Phalcon\Mvc\ModelInterface $model, \Phalcon\Mvc\Model\BehaviorInterface $behavior); + public function addBehavior(\Phalcon\Mvc\ModelInterface $model, BehaviorInterface $behavior); /** * Setup a relation reverse 1-1 between two models @@ -30,7 +38,7 @@ public function addBehavior(\Phalcon\Mvc\ModelInterface $model, \Phalcon\Mvc\Mod * @param array $options * @param \Phalcon\Mvc\ModelInterface $model * @param string $referencedModel - * @return \Phalcon\Mvc\Model\RelationInterface + * @return RelationInterface */ public function addBelongsTo(\Phalcon\Mvc\ModelInterface $model, $fields, string $referencedModel, $referencedFields, $options = null): RelationInterface; @@ -42,7 +50,7 @@ public function addBelongsTo(\Phalcon\Mvc\ModelInterface $model, $fields, string * @param array $options * @param \Phalcon\Mvc\ModelInterface $model * @param string $referencedModel - * @return \Phalcon\Mvc\Model\RelationInterface + * @return RelationInterface */ public function addHasMany(\Phalcon\Mvc\ModelInterface $model, $fields, string $referencedModel, $referencedFields, $options = null): RelationInterface; @@ -54,10 +62,25 @@ public function addHasMany(\Phalcon\Mvc\ModelInterface $model, $fields, string $ * @param array $options * @param \Phalcon\Mvc\ModelInterface $model * @param string $referencedModel - * @return \Phalcon\Mvc\Model\RelationInterface + * @return RelationInterface */ public function addHasOne(\Phalcon\Mvc\ModelInterface $model, $fields, string $referencedModel, $referencedFields, $options = null): RelationInterface; + /** + * Setups a 1-1 relation between two models using an intermediate table + * + * @param string $fields + * @param string $intermediateFields + * @param string $intermediateReferencedFields + * @param string $referencedFields + * @param array $options + * @param \Phalcon\Mvc\ModelInterface $model + * @param string $intermediateModel + * @param string $referencedModel + * @return RelationInterface + */ + public function addHasOneThrough(\Phalcon\Mvc\ModelInterface $model, $fields, string $intermediateModel, $intermediateFields, $intermediateReferencedFields, string $referencedModel, $referencedFields, $options = null): RelationInterface; + /** * Setups a relation n-m between two models * @@ -69,7 +92,7 @@ public function addHasOne(\Phalcon\Mvc\ModelInterface $model, $fields, string $r * @param \Phalcon\Mvc\ModelInterface $model * @param string $intermediateModel * @param string $referencedModel - * @return \Phalcon\Mvc\Model\RelationInterface + * @return RelationInterface */ public function addHasManyToMany(\Phalcon\Mvc\ModelInterface $model, $fields, string $intermediateModel, $intermediateFields, $intermediateReferencedFields, string $referencedModel, $referencedFields, $options = null): RelationInterface; @@ -77,7 +100,7 @@ public function addHasManyToMany(\Phalcon\Mvc\ModelInterface $model, $fields, st * Creates a Phalcon\Mvc\Model\Query\Builder * * @param string $params - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function createBuilder($params = null): BuilderInterface; @@ -85,7 +108,7 @@ public function createBuilder($params = null): BuilderInterface; * Creates a Phalcon\Mvc\Model\Query without execute it * * @param string $phql - * @return \Phalcon\Mvc\Model\QueryInterface + * @return QueryInterface */ public function createQuery(string $phql): QueryInterface; @@ -94,7 +117,7 @@ public function createQuery(string $phql): QueryInterface; * * @param array $placeholders * @param string $phql - * @return \Phalcon\Mvc\Model\QueryInterface + * @return QueryInterface */ public function executeQuery(string $phql, $placeholders = null): QueryInterface; @@ -125,6 +148,15 @@ public function existsHasMany(string $modelName, string $modelRelation): bool; */ public function existsHasOne(string $modelName, string $modelRelation): bool; + /** + * Checks whether a model has a hasOneThrough relation with another model + * + * @param string $modelName + * @param string $modelRelation + * @return bool + */ + public function existsHasOneThrough(string $modelName, string $modelRelation): bool; + /** * Checks whether a model has a hasManyToMany relation with another model * @@ -138,19 +170,19 @@ public function existsHasManyToMany(string $modelName, string $modelRelation): b * Gets belongsTo relations defined on a model * * @param \Phalcon\Mvc\ModelInterface $model - * @return array|\Phalcon\Mvc\Model\RelationInterface[] + * @return array */ public function getBelongsTo(\Phalcon\Mvc\ModelInterface $model): array; /** * Gets belongsTo related records from a model * - * @param string $modelName - * @param string $modelRelation + * @param string $modelName + * @param string $modelRelation * @param array|string|null $parameters - * @param ModelInterface $record - * @param string|null $method - * @return bool|ResultsetInterface + * @param ModelInterface $record + * @param string|null $method + * @return mixed */ public function getBelongsToRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null); @@ -158,19 +190,19 @@ public function getBelongsToRecords(string $modelName, string $modelRelation, \P * Gets hasMany relations defined on a model * * @param \Phalcon\Mvc\ModelInterface $model - * @return array|\Phalcon\Mvc\Model\RelationInterface[] + * @return array */ public function getHasMany(\Phalcon\Mvc\ModelInterface $model): array; /** * Gets hasMany related records from a model * - * @param string $modelName - * @param string $modelRelation + * @param string $modelName + * @param string $modelRelation * @param array|string|null $parameters - * @param ModelInterface $record - * @param string|null $method - * @return bool|ResultsetInterface + * @param ModelInterface $record + * @param string|null $method + * @return mixed */ public function getHasManyRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null); @@ -178,7 +210,7 @@ public function getHasManyRecords(string $modelName, string $modelRelation, \Pha * Gets hasManyToMany relations defined on a model * * @param \Phalcon\Mvc\ModelInterface $model - * @return array|\Phalcon\Mvc\Model\RelationInterface[] + * @return array */ public function getHasManyToMany(\Phalcon\Mvc\ModelInterface $model): array; @@ -186,41 +218,49 @@ public function getHasManyToMany(\Phalcon\Mvc\ModelInterface $model): array; * Gets hasOne relations defined on a model * * @param \Phalcon\Mvc\ModelInterface $model - * @return array|\Phalcon\Mvc\Model\RelationInterface[] + * @return array */ public function getHasOne(\Phalcon\Mvc\ModelInterface $model): array; + /** + * Gets hasOneThrough relations defined on a model + * + * @param \Phalcon\Mvc\ModelInterface $model + * @return array + */ + public function getHasOneThrough(\Phalcon\Mvc\ModelInterface $model): array; + /** * Gets hasOne relations defined on a model * * @param \Phalcon\Mvc\ModelInterface $model - * @return array|\Phalcon\Mvc\Model\RelationInterface[] + * @return array */ public function getHasOneAndHasMany(\Phalcon\Mvc\ModelInterface $model): array; /** - * Gets belongsTo related records from a model + * Gets hasOne related records from a model * - * @param string $modelName - * @param string $modelRelation + * @param string $modelName + * @param string $modelRelation * @param array|string|null $parameters - * @param ModelInterface $record - * @param string|null $method - * @return bool|\Phalcon\Mvc\ModelInterface + * @param ModelInterface $record + * @param string|null $method + * @return mixed */ public function getHasOneRecords(string $modelName, string $modelRelation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null); /** * Get last initialized model * - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ public function getLastInitialized(): ModelInterface; /** * Returns the last query created or executed in the models manager * - * @return \Phalcon\Mvc\Model\QueryInterface + * @return QueryInterface */ public function getLastQuery(): QueryInterface; @@ -244,7 +284,7 @@ public function getModelSource(\Phalcon\Mvc\ModelInterface $model): string; * Returns the connection to read data related to a model * * @param \Phalcon\Mvc\ModelInterface $model - * @return \Phalcon\Db\Adapter\AdapterInterface + * @return AdapterInterface */ public function getReadConnection(\Phalcon\Mvc\ModelInterface $model): AdapterInterface; @@ -261,26 +301,26 @@ public function getReadConnectionService(\Phalcon\Mvc\ModelInterface $model): st * * @param string $modelName * @param string $alias - * @return bool|Relation + * @return mixed */ public function getRelationByAlias(string $modelName, string $alias); /** * Helper method to query records based on a relation definition * - * @param \Phalcon\Mvc\Model\RelationInterface $relation + * @return \Phalcon\Mvc\Model\Resultset\Simple|Phalcon\Mvc\Model\Resultset\Simple|int|false + * @param RelationInterface $relation * @param \Phalcon\Mvc\ModelInterface $record * @param mixed $parameters * @param string $method - * @return \Phalcon\Mvc\Model\Resultset\Simple|Phalcon\Mvc\Model\Resultset\Simple|int|false */ - public function getRelationRecords(\Phalcon\Mvc\Model\RelationInterface $relation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null); + public function getRelationRecords(RelationInterface $relation, \Phalcon\Mvc\ModelInterface $record, $parameters = null, string $method = null); /** * Query all the relationships defined on a model * * @param string $modelName - * @return array|\Phalcon\Mvc\Model\RelationInterface[] + * @return array */ public function getRelations(string $modelName): array; @@ -289,7 +329,7 @@ public function getRelations(string $modelName): array; * * @param string $first * @param string $second - * @return array|bool|\Phalcon\Mvc\Model\RelationInterface[] + * @return array|bool */ public function getRelationsBetween(string $first, string $second); @@ -297,7 +337,7 @@ public function getRelationsBetween(string $first, string $second); * Returns the connection to write data related to a model * * @param \Phalcon\Mvc\ModelInterface $model - * @return \Phalcon\Db\Adapter\AdapterInterface + * @return AdapterInterface */ public function getWriteConnection(\Phalcon\Mvc\ModelInterface $model): AdapterInterface; @@ -313,7 +353,7 @@ public function getWriteConnectionService(\Phalcon\Mvc\ModelInterface $model): s * Loads a model throwing an exception if it doesn't exist * * @param string $modelName - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ public function load(string $modelName): ModelInterface; @@ -369,6 +409,7 @@ public function isVisibleModelProperty(\Phalcon\Mvc\ModelInterface $model, strin * * @param \Phalcon\Mvc\ModelInterface $model * @param bool $keepSnapshots + * @return void */ public function keepSnapshots(\Phalcon\Mvc\ModelInterface $model, bool $keepSnapshots); @@ -378,9 +419,9 @@ public function keepSnapshots(\Phalcon\Mvc\ModelInterface $model, bool $keepSnap * meaning that a least one is implemented * * @param array $data + * @return bool * @param \Phalcon\Mvc\ModelInterface $model * @param string $eventName - * @return bool */ public function missingMethod(\Phalcon\Mvc\ModelInterface $model, string $eventName, $data); @@ -398,6 +439,7 @@ public function notifyEvent(string $eventName, \Phalcon\Mvc\ModelInterface $mode * * @param \Phalcon\Mvc\ModelInterface $model * @param string $connectionService + * @return void */ public function setConnectionService(\Phalcon\Mvc\ModelInterface $model, string $connectionService); @@ -406,6 +448,7 @@ public function setConnectionService(\Phalcon\Mvc\ModelInterface $model, string * * @param \Phalcon\Mvc\ModelInterface $model * @param string $connectionService + * @return void */ public function setReadConnectionService(\Phalcon\Mvc\ModelInterface $model, string $connectionService); @@ -414,6 +457,7 @@ public function setReadConnectionService(\Phalcon\Mvc\ModelInterface $model, str * * @param \Phalcon\Mvc\ModelInterface $model * @param string $schema + * @return void */ public function setModelSchema(\Phalcon\Mvc\ModelInterface $model, string $schema); @@ -422,6 +466,7 @@ public function setModelSchema(\Phalcon\Mvc\ModelInterface $model, string $schem * * @param \Phalcon\Mvc\ModelInterface $model * @param string $source + * @return void */ public function setModelSource(\Phalcon\Mvc\ModelInterface $model, string $source); @@ -438,6 +483,7 @@ public function setWriteConnectionService(\Phalcon\Mvc\ModelInterface $model, st * * @param \Phalcon\Mvc\ModelInterface $model * @param bool $dynamicUpdate + * @return void */ public function useDynamicUpdate(\Phalcon\Mvc\ModelInterface $model, bool $dynamicUpdate); } diff --git a/src/Phalcon/mvc/model/MetaData.php b/src/Phalcon/Mvc/Model/MetaData.php similarity index 95% rename from src/Phalcon/mvc/model/MetaData.php rename to src/Phalcon/Mvc/Model/MetaData.php index 60d9f426..e6e6309b 100644 --- a/src/Phalcon/mvc/model/MetaData.php +++ b/src/Phalcon/Mvc/Model/MetaData.php @@ -1,7 +1,15 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; +use Phalcon\Cache\Adapter\AdapterInterface as CacheAdapterInterface; use Phalcon\Di\DiInterface; use Phalcon\Mvc\Model\MetaData\Strategy\StrategyInterface; @@ -240,7 +248,7 @@ public function getDataTypesNumeric(\Phalcon\Mvc\ModelInterface $model): array /** * Returns the DependencyInjector container * - * @return \Phalcon\Di\DiInterface + * @return DiInterface */ public function getDI(): DiInterface { @@ -276,9 +284,9 @@ public function getEmptyStringAttributes(\Phalcon\Mvc\ModelInterface $model): ar * ``` * * @param \Phalcon\Mvc\ModelInterface $model - * @return string + * @return string|null */ - public function getIdentityField(\Phalcon\Mvc\ModelInterface $model): string + public function getIdentityField(\Phalcon\Mvc\ModelInterface $model): ?string { } @@ -357,7 +365,7 @@ public function getReverseColumnMap(\Phalcon\Mvc\ModelInterface $model): array /** * Return the strategy to obtain the meta-data * - * @return \Phalcon\Mvc\Model\MetaData\Strategy\StrategyInterface + * @return StrategyInterface */ public function getStrategy(): StrategyInterface { @@ -488,6 +496,8 @@ final public function readMetaDataIndex(\Phalcon\Mvc\ModelInterface $model, int * ```php * $metaData->reset(); * ``` + * + * @return void */ public function reset() { @@ -507,6 +517,7 @@ public function reset() * * @param \Phalcon\Mvc\ModelInterface $model * @param array $attributes + * @return void */ public function setAutomaticCreateAttributes(\Phalcon\Mvc\ModelInterface $model, array $attributes) { @@ -526,6 +537,7 @@ public function setAutomaticCreateAttributes(\Phalcon\Mvc\ModelInterface $model, * * @param \Phalcon\Mvc\ModelInterface $model * @param array $attributes + * @return void */ public function setAutomaticUpdateAttributes(\Phalcon\Mvc\ModelInterface $model, array $attributes) { @@ -545,6 +557,7 @@ public function setAutomaticUpdateAttributes(\Phalcon\Mvc\ModelInterface $model, * * @param \Phalcon\Mvc\ModelInterface $model * @param array $attributes + * @return void */ public function setEmptyStringAttributes(\Phalcon\Mvc\ModelInterface $model, array $attributes) { @@ -554,6 +567,7 @@ public function setEmptyStringAttributes(\Phalcon\Mvc\ModelInterface $model, arr * Sets the DependencyInjector container * * @param \Phalcon\Di\DiInterface $container + * @return void */ public function setDI(\Phalcon\Di\DiInterface $container) { @@ -563,6 +577,7 @@ public function setDI(\Phalcon\Di\DiInterface $container) * Set the meta-data extraction strategy * * @param \Phalcon\Mvc\Model\MetaData\Strategy\StrategyInterface $strategy + * @return void */ public function setStrategy(\Phalcon\Mvc\Model\MetaData\Strategy\StrategyInterface $strategy) { @@ -573,6 +588,7 @@ public function setStrategy(\Phalcon\Mvc\Model\MetaData\Strategy\StrategyInterfa * * @param string $key * @param array $data + * @return void */ public function write(string $key, array $data) { @@ -596,6 +612,7 @@ public function write(string $key, array $data) * @param \Phalcon\Mvc\ModelInterface $model * @param int $index * @param mixed $data + * @return void */ final public function writeMetaDataIndex(\Phalcon\Mvc\ModelInterface $model, int $index, $data) { @@ -617,6 +634,7 @@ final protected function initialize(\Phalcon\Mvc\ModelInterface $model, $key, $t * Throws an exception when the metadata cannot be written * * @param mixed $option + * @return void */ private function throwWriteException($option) { diff --git a/src/Phalcon/mvc/model/metadata/Apcu.php b/src/Phalcon/Mvc/Model/MetaData/Apcu.php similarity index 78% rename from src/Phalcon/mvc/model/metadata/Apcu.php rename to src/Phalcon/Mvc/Model/MetaData/Apcu.php index 612da494..0280a7f7 100644 --- a/src/Phalcon/mvc/model/metadata/Apcu.php +++ b/src/Phalcon/Mvc/Model/MetaData/Apcu.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\MetaData; use Phalcon\Mvc\Model\MetaData; diff --git a/src/Phalcon/mvc/model/metadata/Libmemcached.php b/src/Phalcon/Mvc/Model/MetaData/Libmemcached.php similarity index 73% rename from src/Phalcon/mvc/model/metadata/Libmemcached.php rename to src/Phalcon/Mvc/Model/MetaData/Libmemcached.php index fcd40dc2..0598634e 100644 --- a/src/Phalcon/mvc/model/metadata/Libmemcached.php +++ b/src/Phalcon/Mvc/Model/MetaData/Libmemcached.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\MetaData; use Phalcon\Mvc\Model\MetaData; @@ -26,6 +33,8 @@ public function __construct(\Phalcon\Cache\AdapterFactory $factory, array $optio /** * Flush Memcache data and resets internal meta-data in order to regenerate it + * + * @return void */ public function reset() { diff --git a/src/Phalcon/mvc/model/metadata/Memory.php b/src/Phalcon/Mvc/Model/MetaData/Memory.php similarity index 76% rename from src/Phalcon/mvc/model/metadata/Memory.php rename to src/Phalcon/Mvc/Model/MetaData/Memory.php index 456302dd..7b6ef87a 100644 --- a/src/Phalcon/mvc/model/metadata/Memory.php +++ b/src/Phalcon/Mvc/Model/MetaData/Memory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\MetaData; use Phalcon\Mvc\Model\MetaData; @@ -36,6 +43,7 @@ public function read(string $key): ?array * * @param string $key * @param array $data + * @return void */ public function write(string $key, array $data) { diff --git a/src/Phalcon/mvc/model/metadata/Redis.php b/src/Phalcon/Mvc/Model/MetaData/Redis.php similarity index 79% rename from src/Phalcon/mvc/model/metadata/Redis.php rename to src/Phalcon/Mvc/Model/MetaData/Redis.php index 0a72aa37..d320f49a 100644 --- a/src/Phalcon/mvc/model/metadata/Redis.php +++ b/src/Phalcon/Mvc/Model/MetaData/Redis.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\MetaData; use Phalcon\Mvc\Model\MetaData; @@ -40,6 +47,8 @@ public function __construct(\Phalcon\Cache\AdapterFactory $factory, array $optio /** * Flush Redis data and resets internal meta-data in order to regenerate it + * + * @return void */ public function reset() { diff --git a/src/Phalcon/mvc/model/metadata/strategy/Annotations.php b/src/Phalcon/Mvc/Model/MetaData/Strategy/Annotations.php similarity index 82% rename from src/Phalcon/mvc/model/metadata/strategy/Annotations.php rename to src/Phalcon/Mvc/Model/MetaData/Strategy/Annotations.php index 8b941252..9fdd2e38 100644 --- a/src/Phalcon/mvc/model/metadata/strategy/Annotations.php +++ b/src/Phalcon/Mvc/Model/MetaData/Strategy/Annotations.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\MetaData\Strategy; /** diff --git a/src/Phalcon/mvc/model/metadata/strategy/Introspection.php b/src/Phalcon/Mvc/Model/MetaData/Strategy/Introspection.php similarity index 81% rename from src/Phalcon/mvc/model/metadata/strategy/Introspection.php rename to src/Phalcon/Mvc/Model/MetaData/Strategy/Introspection.php index d1974e36..0e875ac1 100644 --- a/src/Phalcon/mvc/model/metadata/strategy/Introspection.php +++ b/src/Phalcon/Mvc/Model/MetaData/Strategy/Introspection.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\MetaData\Strategy; /** diff --git a/src/Phalcon/mvc/model/metadata/strategy/StrategyInterface.php b/src/Phalcon/Mvc/Model/MetaData/Strategy/StrategyInterface.php similarity index 81% rename from src/Phalcon/mvc/model/metadata/strategy/StrategyInterface.php rename to src/Phalcon/Mvc/Model/MetaData/Strategy/StrategyInterface.php index 57a22db3..f2cf8b19 100644 --- a/src/Phalcon/mvc/model/metadata/strategy/StrategyInterface.php +++ b/src/Phalcon/Mvc/Model/MetaData/Strategy/StrategyInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\MetaData\Strategy; /** @@ -16,10 +23,10 @@ interface StrategyInterface /** * Read the model's column map, this can't be inferred * + * @todo Not implemented * @param \Phalcon\Mvc\ModelInterface $model * @param \Phalcon\Di\DiInterface $container * @return array - * @todo Not implemented */ public function getColumnMaps(\Phalcon\Mvc\ModelInterface $model, \Phalcon\Di\DiInterface $container): array; diff --git a/src/Phalcon/mvc/model/metadata/Stream.php b/src/Phalcon/Mvc/Model/MetaData/Stream.php similarity index 80% rename from src/Phalcon/mvc/model/metadata/Stream.php rename to src/Phalcon/Mvc/Model/MetaData/Stream.php index 97092b45..a9c7d71d 100644 --- a/src/Phalcon/mvc/model/metadata/Stream.php +++ b/src/Phalcon/Mvc/Model/MetaData/Stream.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\MetaData; use Phalcon\Mvc\Model\MetaData; @@ -47,6 +54,7 @@ public function read(string $key): ?array * * @param string $key * @param array $data + * @return void */ public function write(string $key, array $data) { @@ -56,6 +64,7 @@ public function write(string $key, array $data) * Throws an exception when the metadata cannot be written * * @param mixed $option + * @return void */ private function throwWriteException($option) { diff --git a/src/Phalcon/mvc/model/MetaDataInterface.php b/src/Phalcon/Mvc/Model/MetaDataInterface.php similarity index 95% rename from src/Phalcon/mvc/model/MetaDataInterface.php rename to src/Phalcon/Mvc/Model/MetaDataInterface.php index 3818ede4..40abad22 100644 --- a/src/Phalcon/mvc/model/MetaDataInterface.php +++ b/src/Phalcon/Mvc/Model/MetaDataInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; use Phalcon\Mvc\Model\MetaData\Strategy\StrategyInterface; @@ -88,9 +95,9 @@ public function getEmptyStringAttributes(\Phalcon\Mvc\ModelInterface $model): ar * Returns the name of identity field (if one is present) * * @param \Phalcon\Mvc\ModelInterface $model - * @return string + * @return string|null */ - public function getIdentityField(\Phalcon\Mvc\ModelInterface $model): string; + public function getIdentityField(\Phalcon\Mvc\ModelInterface $model): ?string; /** * Returns an array of fields which are not part of the primary key @@ -127,7 +134,7 @@ public function getReverseColumnMap(\Phalcon\Mvc\ModelInterface $model): array; /** * Return the strategy to obtain the meta-data * - * @return \Phalcon\Mvc\Model\MetaData\Strategy\StrategyInterface + * @return StrategyInterface */ public function getStrategy(): StrategyInterface; @@ -214,6 +221,7 @@ public function setAutomaticUpdateAttributes(\Phalcon\Mvc\ModelInterface $model, * * @param \Phalcon\Mvc\ModelInterface $model * @param array $attributes + * @return void */ public function setEmptyStringAttributes(\Phalcon\Mvc\ModelInterface $model, array $attributes); @@ -238,6 +246,7 @@ public function setStrategy(\Phalcon\Mvc\Model\MetaData\Strategy\StrategyInterfa * * @param string $key * @param array $data + * @return void */ public function write(string $key, array $data); } diff --git a/src/Phalcon/mvc/model/Query.php b/src/Phalcon/Mvc/Model/Query.php similarity index 89% rename from src/Phalcon/mvc/model/Query.php rename to src/Phalcon/Mvc/Model/Query.php index bb8ffd26..31d41240 100644 --- a/src/Phalcon/mvc/model/Query.php +++ b/src/Phalcon/Mvc/Model/Query.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; use Phalcon\Db\Adapter\AdapterInterface; @@ -175,6 +182,7 @@ public function __construct(string $phql = null, \Phalcon\Di\DiInterface $contai * Sets the dependency injection container * * @param \Phalcon\Di\DiInterface $container + * @return void */ public function setDI(\Phalcon\Di\DiInterface $container) { @@ -183,7 +191,7 @@ public function setDI(\Phalcon\Di\DiInterface $container) /** * Returns the dependency injection container * - * @return \Phalcon\Di\DiInterface + * @return DiInterface */ public function getDI(): DiInterface { @@ -194,7 +202,7 @@ public function getDI(): DiInterface * returned * * @param bool $uniqueRow - * @return \Phalcon\Mvc\Model\QueryInterface + * @return QueryInterface */ public function setUniqueRow(bool $uniqueRow): QueryInterface { @@ -276,22 +284,22 @@ final protected function _getSelectColumn(array $column): array /** * Resolves a table in a SELECT statement checking if the model exists * - * @param \Phalcon\Mvc\Model\ManagerInterface $manager - * @param array $qualifiedName * @return string + * @param ManagerInterface $manager + * @param array $qualifiedName */ - final protected function _getTable(\Phalcon\Mvc\Model\ManagerInterface $manager, array $qualifiedName) + final protected function _getTable(ManagerInterface $manager, array $qualifiedName) { } /** * Resolves a JOIN clause checking if the associated models exist * - * @param \Phalcon\Mvc\Model\ManagerInterface $manager + * @param ManagerInterface $manager * @param array $join * @return array */ - final protected function _getJoin(\Phalcon\Mvc\Model\ManagerInterface $manager, array $join): array + final protected function _getJoin(ManagerInterface $manager, array $join): array { } @@ -312,10 +320,10 @@ final protected function _getJoinType(array $join): string * @param string $joinType * @param string $modelAlias * @param string $joinAlias - * @param \Phalcon\Mvc\Model\RelationInterface $relation + * @param RelationInterface $relation * @return array */ - final protected function _getSingleJoin(string $joinType, $joinSource, string $modelAlias, string $joinAlias, \Phalcon\Mvc\Model\RelationInterface $relation): array + final protected function _getSingleJoin(string $joinType, $joinSource, string $modelAlias, string $joinAlias, RelationInterface $relation): array { } @@ -326,10 +334,10 @@ final protected function _getSingleJoin(string $joinType, $joinSource, string $m * @param string $joinType * @param string $modelAlias * @param string $joinAlias - * @param \Phalcon\Mvc\Model\RelationInterface $relation + * @param RelationInterface $relation * @return array */ - final protected function _getMultiJoin(string $joinType, $joinSource, string $modelAlias, string $joinAlias, \Phalcon\Mvc\Model\RelationInterface $relation): array + final protected function _getMultiJoin(string $joinType, $joinSource, string $modelAlias, string $joinAlias, RelationInterface $relation): array { } @@ -429,7 +437,7 @@ public function parse(): array /** * Returns the current cache backend instance * - * @return \Phalcon\Db\Adapter\AdapterInterface + * @return AdapterInterface */ public function getCache(): AdapterInterface { @@ -443,7 +451,7 @@ public function getCache(): AdapterInterface * @param array $bindParams * @param array $bindTypes * @param bool $simulate - * @return array|\Phalcon\Mvc\Model\ResultsetInterface + * @return mixed */ final protected function _executeSelect(array $intermediate, array $bindParams, array $bindTypes, bool $simulate = false) { @@ -456,7 +464,7 @@ final protected function _executeSelect(array $intermediate, array $bindParams, * @param array $intermediate * @param array $bindParams * @param array $bindTypes - * @return \Phalcon\Mvc\Model\Query\StatusInterface + * @return StatusInterface */ final protected function _executeInsert(array $intermediate, array $bindParams, array $bindTypes): StatusInterface { @@ -469,7 +477,7 @@ final protected function _executeInsert(array $intermediate, array $bindParams, * @param array $intermediate * @param array $bindParams * @param array $bindTypes - * @return \Phalcon\Mvc\Model\Query\StatusInterface + * @return StatusInterface */ final protected function _executeUpdate(array $intermediate, array $bindParams, array $bindTypes): StatusInterface { @@ -482,7 +490,7 @@ final protected function _executeUpdate(array $intermediate, array $bindParams, * @param array $intermediate * @param array $bindParams * @param array $bindTypes - * @return \Phalcon\Mvc\Model\Query\StatusInterface + * @return StatusInterface */ final protected function _executeDelete(array $intermediate, array $bindParams, array $bindTypes): StatusInterface { @@ -495,7 +503,7 @@ final protected function _executeDelete(array $intermediate, array $bindParams, * @param array $intermediate * @param array $bindParams * @param array $bindTypes - * @return \Phalcon\Mvc\Model\ResultsetInterface + * @return ResultsetInterface */ final protected function _getRelatedRecords(\Phalcon\Mvc\ModelInterface $model, array $intermediate, array $bindParams, array $bindTypes): ResultsetInterface { @@ -504,9 +512,9 @@ final protected function _getRelatedRecords(\Phalcon\Mvc\ModelInterface $model, /** * Executes a parsed PHQL statement * + * @return mixed * @param array $bindParams * @param array $bindTypes - * @return mixed */ public function execute(array $bindParams = array(), array $bindTypes = array()) { @@ -517,7 +525,7 @@ public function execute(array $bindParams = array(), array $bindTypes = array()) * * @param array $bindParams * @param array $bindTypes - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ public function getSingleResult(array $bindParams = array(), array $bindTypes = array()): ModelInterface { @@ -527,7 +535,7 @@ public function getSingleResult(array $bindParams = array(), array $bindTypes = * Sets the type of PHQL statement to be executed * * @param int $type - * @return \Phalcon\Mvc\Model\QueryInterface + * @return QueryInterface */ public function setType(int $type): QueryInterface { @@ -547,7 +555,7 @@ public function getType(): int * * @param array $bindParams * @param bool $merge - * @return \Phalcon\Mvc\Model\QueryInterface + * @return QueryInterface */ public function setBindParams(array $bindParams, bool $merge = false): QueryInterface { @@ -567,7 +575,7 @@ public function getBindParams(): array * * @param array $bindTypes * @param bool $merge - * @return \Phalcon\Mvc\Model\QueryInterface + * @return QueryInterface */ public function setBindTypes(array $bindTypes, bool $merge = false): QueryInterface { @@ -577,7 +585,7 @@ public function setBindTypes(array $bindTypes, bool $merge = false): QueryInterf * Set SHARED LOCK clause * * @param bool $sharedLock - * @return \Phalcon\Mvc\Model\QueryInterface + * @return QueryInterface */ public function setSharedLock(bool $sharedLock = false): QueryInterface { @@ -596,7 +604,7 @@ public function getBindTypes(): array * Allows to set the IR to be executed * * @param array $intermediate - * @return \Phalcon\Mvc\Model\QueryInterface + * @return QueryInterface */ public function setIntermediate(array $intermediate): QueryInterface { @@ -615,7 +623,7 @@ public function getIntermediate(): array * Sets the cache parameters of the query * * @param array $cacheOptions - * @return \Phalcon\Mvc\Model\QueryInterface + * @return QueryInterface */ public function cache(array $cacheOptions): QueryInterface { @@ -642,6 +650,8 @@ public function getSql(): array /** * Destroys the internal PHQL cache + * + * @return void */ public static function clean() { @@ -655,7 +665,7 @@ public static function clean() * @param array $intermediate * @param array $bindParams * @param array $bindTypes - * @return \Phalcon\Db\Adapter\AdapterInterface + * @return AdapterInterface */ protected function getReadConnection(\Phalcon\Mvc\ModelInterface $model, array $intermediate = null, array $bindParams = array(), array $bindTypes = array()): AdapterInterface { @@ -669,7 +679,7 @@ protected function getReadConnection(\Phalcon\Mvc\ModelInterface $model, array $ * @param array $intermediate * @param array $bindParams * @param array $bindTypes - * @return \Phalcon\Db\Adapter\AdapterInterface + * @return AdapterInterface */ protected function getWriteConnection(\Phalcon\Mvc\ModelInterface $model, array $intermediate = null, array $bindParams = array(), array $bindTypes = array()): AdapterInterface { @@ -678,10 +688,10 @@ protected function getWriteConnection(\Phalcon\Mvc\ModelInterface $model, array /** * allows to wrap a transaction around all queries * - * @param \Phalcon\Mvc\Model\TransactionInterface $transaction - * @return \Phalcon\Mvc\Model\QueryInterface + * @param TransactionInterface $transaction + * @return QueryInterface */ - public function setTransaction(\Phalcon\Mvc\Model\TransactionInterface $transaction): QueryInterface + public function setTransaction(TransactionInterface $transaction): QueryInterface { } } diff --git a/src/Phalcon/mvc/model/query/Builder.php b/src/Phalcon/Mvc/Model/Query/Builder.php similarity index 90% rename from src/Phalcon/mvc/model/query/Builder.php rename to src/Phalcon/Mvc/Model/Query/Builder.php index 6fec223c..6c919f58 100644 --- a/src/Phalcon/mvc/model/query/Builder.php +++ b/src/Phalcon/Mvc/Model/Query/Builder.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\Query; use Phalcon\Di\DiInterface; @@ -122,7 +129,7 @@ public function __construct($params = null, \Phalcon\Di\DiInterface $container = * * @param string $model * @param string $alias - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function addFrom(string $model, string $alias = null): BuilderInterface { @@ -145,7 +152,7 @@ public function addFrom(string $model, string $alias = null): BuilderInterface * @param string $conditions * @param array $bindParams * @param array $bindTypes - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function andHaving(string $conditions, array $bindParams = array(), array $bindTypes = array()): BuilderInterface { @@ -169,7 +176,7 @@ public function andHaving(string $conditions, array $bindParams = array(), array * @param string $conditions * @param array $bindParams * @param array $bindTypes - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function andWhere(string $conditions, array $bindParams = array(), array $bindTypes = array()): BuilderInterface { @@ -196,7 +203,7 @@ final public function autoescape(string $identifier): string * @param mixed $minimum * @param mixed $maximum * @param string $operator - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function betweenHaving(string $expr, $minimum, $maximum, string $operator = BuilderInterface::OPERATOR_AND): BuilderInterface { @@ -213,7 +220,7 @@ public function betweenHaving(string $expr, $minimum, $maximum, string $operator * @param mixed $minimum * @param mixed $maximum * @param string $operator - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function betweenWhere(string $expr, $minimum, $maximum, string $operator = BuilderInterface::OPERATOR_AND): BuilderInterface { @@ -241,7 +248,7 @@ public function betweenWhere(string $expr, $minimum, $maximum, string $operator * ``` * * @param mixed $columns - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function columns($columns): BuilderInterface { @@ -256,7 +263,7 @@ public function columns($columns): BuilderInterface * ``` * * @param mixed $distinct - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function distinct($distinct): BuilderInterface { @@ -270,7 +277,7 @@ public function distinct($distinct): BuilderInterface * ``` * * @param bool $forUpdate - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function forUpdate(bool $forUpdate): BuilderInterface { @@ -300,7 +307,7 @@ public function forUpdate(bool $forUpdate): BuilderInterface * ``` * * @param mixed $models - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function from($models): BuilderInterface { @@ -336,7 +343,7 @@ public function getColumns() /** * Returns the DependencyInjector container * - * @return \Phalcon\Di\DiInterface + * @return DiInterface */ public function getDI(): DiInterface { @@ -435,7 +442,7 @@ final public function getPhql(): string /** * Returns the query built * - * @return \Phalcon\Mvc\Model\QueryInterface + * @return QueryInterface */ public function getQuery(): QueryInterface { @@ -462,7 +469,7 @@ public function getWhere() * ``` * * @param string|array $group - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function groupBy($group): BuilderInterface { @@ -485,7 +492,7 @@ public function groupBy($group): BuilderInterface * @param mixed $conditions * @param array $bindParams * @param array $bindTypes - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function having($conditions, array $bindParams = array(), array $bindTypes = array()): BuilderInterface { @@ -501,7 +508,7 @@ public function having($conditions, array $bindParams = array(), array $bindType * @param string $expr * @param array $values * @param string $operator - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function inHaving(string $expr, array $values, string $operator = BuilderInterface::OPERATOR_AND): BuilderInterface { @@ -533,7 +540,7 @@ public function inHaving(string $expr, array $values, string $operator = Builder * @param string $model * @param string $conditions * @param string $alias - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function innerJoin(string $model, string $conditions = null, string $alias = null): BuilderInterface { @@ -552,7 +559,7 @@ public function innerJoin(string $model, string $conditions = null, string $alia * @param string $expr * @param array $values * @param string $operator - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function inWhere(string $expr, array $values, string $operator = BuilderInterface::OPERATOR_AND): BuilderInterface { @@ -593,7 +600,7 @@ public function inWhere(string $expr, array $values, string $operator = BuilderI * @param string $conditions * @param string $alias * @param string $type - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function join(string $model, string $conditions = null, string $alias = null, string $type = null): BuilderInterface { @@ -613,7 +620,7 @@ public function join(string $model, string $conditions = null, string $alias = n * @param string $model * @param string $conditions * @param string $alias - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function leftJoin(string $model, string $conditions = null, string $alias = null): BuilderInterface { @@ -630,7 +637,7 @@ public function leftJoin(string $model, string $conditions = null, string $alias * * @param int $limit * @param mixed $offset - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function limit(int $limit, $offset = null): BuilderInterface { @@ -647,7 +654,7 @@ public function limit(int $limit, $offset = null): BuilderInterface * @param mixed $minimum * @param mixed $maximum * @param string $operator - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function notBetweenHaving(string $expr, $minimum, $maximum, string $operator = BuilderInterface::OPERATOR_AND): BuilderInterface { @@ -664,7 +671,7 @@ public function notBetweenHaving(string $expr, $minimum, $maximum, string $opera * @param mixed $minimum * @param mixed $maximum * @param string $operator - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function notBetweenWhere(string $expr, $minimum, $maximum, string $operator = BuilderInterface::OPERATOR_AND): BuilderInterface { @@ -680,7 +687,7 @@ public function notBetweenWhere(string $expr, $minimum, $maximum, string $operat * @param string $expr * @param array $values * @param string $operator - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function notInHaving(string $expr, array $values, string $operator = BuilderInterface::OPERATOR_AND): BuilderInterface { @@ -696,7 +703,7 @@ public function notInHaving(string $expr, array $values, string $operator = Buil * @param string $expr * @param array $values * @param string $operator - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function notInWhere(string $expr, array $values, string $operator = BuilderInterface::OPERATOR_AND): BuilderInterface { @@ -710,7 +717,7 @@ public function notInWhere(string $expr, array $values, string $operator = Build * ``` * * @param int $offset - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function offset(int $offset): BuilderInterface { @@ -726,7 +733,7 @@ public function offset(int $offset): BuilderInterface * ``` * * @param string|array $orderBy - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function orderBy($orderBy): BuilderInterface { @@ -749,7 +756,7 @@ public function orderBy($orderBy): BuilderInterface * @param string $conditions * @param array $bindParams * @param array $bindTypes - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function orHaving(string $conditions, array $bindParams = array(), array $bindTypes = array()): BuilderInterface { @@ -773,7 +780,7 @@ public function orHaving(string $conditions, array $bindParams = array(), array * @param string $conditions * @param array $bindParams * @param array $bindTypes - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function orWhere(string $conditions, array $bindParams = array(), array $bindTypes = array()): BuilderInterface { @@ -793,7 +800,7 @@ public function orWhere(string $conditions, array $bindParams = array(), array $ * @param string $model * @param string $conditions * @param string $alias - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function rightJoin(string $model, string $conditions = null, string $alias = null): BuilderInterface { @@ -804,7 +811,7 @@ public function rightJoin(string $model, string $conditions = null, string $alia * * @param array $bindParams * @param bool $merge - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function setBindParams(array $bindParams, bool $merge = false): BuilderInterface { @@ -815,7 +822,7 @@ public function setBindParams(array $bindParams, bool $merge = false): BuilderIn * * @param array $bindTypes * @param bool $merge - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function setBindTypes(array $bindTypes, bool $merge = false): BuilderInterface { @@ -825,6 +832,7 @@ public function setBindTypes(array $bindTypes, bool $merge = false): BuilderInte * Sets the DependencyInjector container * * @param \Phalcon\Di\DiInterface $container + * @return void */ public function setDI(\Phalcon\Di\DiInterface $container) { @@ -850,7 +858,7 @@ public function setDI(\Phalcon\Di\DiInterface $container) * @param string $conditions * @param array $bindParams * @param array $bindTypes - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ public function where(string $conditions, array $bindParams = array(), array $bindTypes = array()): BuilderInterface { @@ -864,7 +872,7 @@ public function where(string $conditions, array $bindParams = array(), array $bi * @param string $expr * @param mixed $minimum * @param mixed $maximum - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ protected function conditionBetween(string $clause, string $operator, string $expr, $minimum, $maximum): BuilderInterface { @@ -877,7 +885,7 @@ protected function conditionBetween(string $clause, string $operator, string $ex * @param string $operator * @param string $expr * @param array $values - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ protected function conditionIn(string $clause, string $operator, string $expr, array $values): BuilderInterface { @@ -891,7 +899,7 @@ protected function conditionIn(string $clause, string $operator, string $expr, a * @param string $expr * @param mixed $minimum * @param mixed $maximum - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ protected function conditionNotBetween(string $clause, string $operator, string $expr, $minimum, $maximum): BuilderInterface { @@ -904,7 +912,7 @@ protected function conditionNotBetween(string $clause, string $operator, string * @param string $operator * @param string $expr * @param array $values - * @return \Phalcon\Mvc\Model\Query\BuilderInterface + * @return BuilderInterface */ protected function conditionNotIn(string $clause, string $operator, string $expr, array $values): BuilderInterface { diff --git a/src/Phalcon/mvc/model/query/BuilderInterface.php b/src/Phalcon/Mvc/Model/Query/BuilderInterface.php similarity index 97% rename from src/Phalcon/mvc/model/query/BuilderInterface.php rename to src/Phalcon/Mvc/Model/Query/BuilderInterface.php index 1b77025f..d9b86f9b 100644 --- a/src/Phalcon/mvc/model/query/BuilderInterface.php +++ b/src/Phalcon/Mvc/Model/Query/BuilderInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\Query; use Phalcon\Mvc\Model\QueryInterface; @@ -176,7 +183,7 @@ public function getPhql(): string; /** * Returns the query built * - * @return \Phalcon\Mvc\Model\QueryInterface + * @return QueryInterface */ public function getQuery(): QueryInterface; diff --git a/src/Phalcon/mvc/model/query/Lang.php b/src/Phalcon/Mvc/Model/Query/Lang.php similarity index 82% rename from src/Phalcon/mvc/model/query/Lang.php rename to src/Phalcon/Mvc/Model/Query/Lang.php index 4f574562..1877eef5 100644 --- a/src/Phalcon/mvc/model/query/Lang.php +++ b/src/Phalcon/Mvc/Model/Query/Lang.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\Query; /** diff --git a/src/Phalcon/mvc/model/query/Status.php b/src/Phalcon/Mvc/Model/Query/Status.php similarity index 84% rename from src/Phalcon/mvc/model/query/Status.php rename to src/Phalcon/Mvc/Model/Query/Status.php index 027decdf..9c6f5668 100644 --- a/src/Phalcon/mvc/model/query/Status.php +++ b/src/Phalcon/Mvc/Model/Query/Status.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\Query; use Phalcon\Mvc\ModelInterface; @@ -53,7 +60,7 @@ public function __construct(bool $success, \Phalcon\Mvc\ModelInterface $model = /** * Returns the messages produced because of a failed operation * - * @return array|\Phalcon\Messages\MessageInterface[] + * @return array */ public function getMessages(): array { @@ -62,7 +69,7 @@ public function getMessages(): array /** * Returns the model that executed the action * - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ public function getModel(): ModelInterface { diff --git a/src/Phalcon/mvc/model/query/StatusInterface.php b/src/Phalcon/Mvc/Model/Query/StatusInterface.php similarity index 68% rename from src/Phalcon/mvc/model/query/StatusInterface.php rename to src/Phalcon/Mvc/Model/Query/StatusInterface.php index a333a915..c63f95dc 100644 --- a/src/Phalcon/mvc/model/query/StatusInterface.php +++ b/src/Phalcon/Mvc/Model/Query/StatusInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\Query; use Phalcon\Mvc\ModelInterface; @@ -15,14 +22,14 @@ interface StatusInterface /** * Returns the messages produced by an operation failed * - * @return array|\Phalcon\Messages\MessageInterface[] + * @return array */ public function getMessages(): array; /** * Returns the model which executed the action * - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ public function getModel(): ModelInterface; diff --git a/src/Phalcon/mvc/model/QueryInterface.php b/src/Phalcon/Mvc/Model/QueryInterface.php similarity index 91% rename from src/Phalcon/mvc/model/QueryInterface.php rename to src/Phalcon/Mvc/Model/QueryInterface.php index 83e2d6a6..23e22e87 100644 --- a/src/Phalcon/mvc/model/QueryInterface.php +++ b/src/Phalcon/Mvc/Model/QueryInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; use Phalcon\Mvc\ModelInterface; @@ -23,9 +30,9 @@ public function cache(array $cacheOptions): QueryInterface; /** * Executes a parsed PHQL statement * + * @return mixed * @param array $bindParams * @param array $bindTypes - * @return mixed */ public function execute(array $bindParams = array(), array $bindTypes = array()); @@ -62,7 +69,7 @@ public function getSql(): array; * * @param array $bindParams * @param array $bindTypes - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ public function getSingleResult(array $bindParams = array(), array $bindTypes = array()): ModelInterface; diff --git a/src/Phalcon/mvc/model/Relation.php b/src/Phalcon/Mvc/Model/Relation.php similarity index 94% rename from src/Phalcon/mvc/model/Relation.php rename to src/Phalcon/Mvc/Model/Relation.php index 655e4598..5b0487aa 100644 --- a/src/Phalcon/mvc/model/Relation.php +++ b/src/Phalcon/Mvc/Model/Relation.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; /** diff --git a/src/Phalcon/mvc/model/RelationInterface.php b/src/Phalcon/Mvc/Model/RelationInterface.php similarity index 92% rename from src/Phalcon/mvc/model/RelationInterface.php rename to src/Phalcon/Mvc/Model/RelationInterface.php index f8c565d0..ed33aa25 100644 --- a/src/Phalcon/mvc/model/RelationInterface.php +++ b/src/Phalcon/Mvc/Model/RelationInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; /** diff --git a/src/Phalcon/mvc/model/ResultInterface.php b/src/Phalcon/Mvc/Model/ResultInterface.php similarity index 57% rename from src/Phalcon/mvc/model/ResultInterface.php rename to src/Phalcon/Mvc/Model/ResultInterface.php index 58bdb6d5..3f71406f 100644 --- a/src/Phalcon/mvc/model/ResultInterface.php +++ b/src/Phalcon/Mvc/Model/ResultInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; /** @@ -14,7 +21,7 @@ interface ResultInterface * Sets the object's state * * @param int $dirtyState - * @return bool|\Phalcon\Mvc\ModelInterface + * @return mixed */ public function setDirtyState(int $dirtyState); } diff --git a/src/Phalcon/mvc/model/Resultset.php b/src/Phalcon/Mvc/Model/Resultset.php similarity index 92% rename from src/Phalcon/mvc/model/Resultset.php rename to src/Phalcon/Mvc/Model/Resultset.php index b4e6fbc3..0cb616a9 100644 --- a/src/Phalcon/mvc/model/Resultset.php +++ b/src/Phalcon/Mvc/Model/Resultset.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; use Phalcon\Cache\Adapter\AdapterInterface; @@ -139,7 +146,7 @@ public function delete(\Closure $conditionCallback = null): bool * ``` * * @param callable $filter - * @return array|\Phalcon\Mvc\ModelInterface[] + * @return array */ public function filter($filter): array { @@ -148,7 +155,7 @@ public function filter($filter): array /** * Returns the associated cache for the resultset * - * @return \Phalcon\Cache\Adapter\AdapterInterface + * @return AdapterInterface */ public function getCache(): AdapterInterface { @@ -157,7 +164,7 @@ public function getCache(): AdapterInterface /** * Get first row in the resultset * - * @return null|\Phalcon\Mvc\ModelInterface + * @return mixed */ public function getFirst(): ?ModelInterface { @@ -175,7 +182,7 @@ public function getHydrateMode(): int /** * Get last row in the resultset * - * @return null|\Phalcon\Mvc\ModelInterface + * @return mixed */ public function getLast(): ?ModelInterface { @@ -184,7 +191,7 @@ public function getLast(): ?ModelInterface /** * Returns the error messages produced by a batch operation * - * @return array|\Phalcon\Messages\MessageInterface[] + * @return array */ public function getMessages(): array { @@ -235,6 +242,8 @@ public function key(): ?int /** * Moves cursor to next row in the resultset + * + * @return void */ public function next() { @@ -244,7 +253,7 @@ public function next() * Gets row in a specific position of the resultset * * @param mixed $index - * @return bool|\Phalcon\Mvc\ModelInterface + * @return mixed */ public function offsetGet($index) { @@ -265,6 +274,7 @@ public function offsetExists($index): bool * * @param int $index * @param \Phalcon\Mvc\ModelInterface $value + * @return void */ public function offsetSet($index, $value) { @@ -274,6 +284,7 @@ public function offsetSet($index, $value) * Resultsets cannot be changed. It has only been implemented to meet the definition of the ArrayAccess interface * * @param mixed $offset + * @return void */ public function offsetUnset($offset) { @@ -281,6 +292,8 @@ public function offsetUnset($offset) /** * Rewinds resultset to its beginning + * + * @return void */ final public function rewind() { @@ -291,6 +304,7 @@ final public function rewind() * Set the new position if required, and then set this->row * * @param mixed $position + * @return void */ final public function seek($position) { @@ -300,7 +314,7 @@ final public function seek($position) * Sets the hydration mode in the resultset * * @param int $hydrateMode - * @return \Phalcon\Mvc\Model\ResultsetInterface + * @return ResultsetInterface */ public function setHydrateMode(int $hydrateMode): ResultsetInterface { @@ -310,7 +324,7 @@ public function setHydrateMode(int $hydrateMode): ResultsetInterface * Set if the resultset is fresh or an old one cached * * @param bool $isFresh - * @return \Phalcon\Mvc\Model\ResultsetInterface + * @return ResultsetInterface */ public function setIsFresh(bool $isFresh): ResultsetInterface { diff --git a/src/Phalcon/mvc/model/resultset/Complex.php b/src/Phalcon/Mvc/Model/Resultset/Complex.php similarity index 86% rename from src/Phalcon/mvc/model/resultset/Complex.php rename to src/Phalcon/Mvc/Model/Resultset/Complex.php index cc90a156..4f3240f2 100644 --- a/src/Phalcon/mvc/model/resultset/Complex.php +++ b/src/Phalcon/Mvc/Model/Resultset/Complex.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\Resultset; use Phalcon\Mvc\Model\Resultset; @@ -36,7 +43,7 @@ public function __construct($columnTypes, \Phalcon\Db\ResultInterface $result = /** * Returns current row in the resultset * - * @return bool|\Phalcon\Mvc\ModelInterface + * @return mixed */ final public function current() { @@ -65,6 +72,7 @@ public function serialize(): string * Unserializing a resultset will allow to only works on the rows present in the saved state * * @param mixed $data + * @return void */ public function unserialize($data) { diff --git a/src/Phalcon/mvc/model/resultset/Simple.php b/src/Phalcon/Mvc/Model/Resultset/Simple.php similarity index 87% rename from src/Phalcon/mvc/model/resultset/Simple.php rename to src/Phalcon/Mvc/Model/Resultset/Simple.php index 1cd3e083..0d428d2b 100644 --- a/src/Phalcon/mvc/model/resultset/Simple.php +++ b/src/Phalcon/Mvc/Model/Resultset/Simple.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\Resultset; use Phalcon\Mvc\Model\Resultset; @@ -41,7 +48,7 @@ public function __construct($columnMap, $model, $result, \Phalcon\Cache\Adapter\ /** * Returns current row in the resultset * - * @return null|\Phalcon\Mvc\ModelInterface + * @return mixed */ final public function current(): ?ModelInterface { @@ -74,6 +81,7 @@ public function serialize(): string * the saved state * * @param mixed $data + * @return void */ public function unserialize($data) { diff --git a/src/Phalcon/mvc/model/ResultsetInterface.php b/src/Phalcon/Mvc/Model/ResultsetInterface.php similarity index 88% rename from src/Phalcon/mvc/model/ResultsetInterface.php rename to src/Phalcon/Mvc/Model/ResultsetInterface.php index f95ac27c..7109e39a 100644 --- a/src/Phalcon/mvc/model/ResultsetInterface.php +++ b/src/Phalcon/Mvc/Model/ResultsetInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; use Phalcon\Cache\Adapter\AdapterInterface; @@ -35,21 +42,21 @@ public function delete(\Closure $conditionCallback = null): bool; * ``` * * @param callable $filter - * @return array|\Phalcon\Mvc\ModelInterface[] + * @return array */ public function filter($filter): array; /** * Returns the associated cache for the resultset * - * @return \Phalcon\Cache\Adapter\AdapterInterface + * @return AdapterInterface */ public function getCache(): AdapterInterface; /** * Get first row in the resultset * - * @return null|\Phalcon\Mvc\ModelInterface + * @return mixed */ public function getFirst(): ?ModelInterface; @@ -63,14 +70,14 @@ public function getHydrateMode(): int; /** * Get last row in the resultset * - * @return null|\Phalcon\Mvc\ModelInterface + * @return mixed */ public function getLast(): ?ModelInterface; /** * Returns the error messages produced by a batch operation * - * @return array|\Phalcon\Messages\MessageInterface[] + * @return array */ public function getMessages(): array; diff --git a/src/Phalcon/mvc/model/Row.php b/src/Phalcon/Mvc/Model/Row.php similarity index 88% rename from src/Phalcon/mvc/model/Row.php rename to src/Phalcon/Mvc/Model/Row.php index 6c8eae16..5ad81337 100644 --- a/src/Phalcon/mvc/model/Row.php +++ b/src/Phalcon/Mvc/Model/Row.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; /** @@ -45,6 +52,7 @@ public function offsetExists($index): bool * * @param string|int $index * @param \Phalcon\Mvc\ModelInterface $value + * @return void */ public function offsetSet($index, $value) { @@ -54,6 +62,7 @@ public function offsetSet($index, $value) * Rows cannot be changed. It has only been implemented to meet the definition of the ArrayAccess interface * * @param string|int $offset + * @return void */ public function offsetUnset($offset) { @@ -66,8 +75,8 @@ public function offsetUnset($offset) * echo $robot->readAttribute("name"); * ``` * - * @param string $attribute * @return mixed + * @param string $attribute */ public function readAttribute(string $attribute) { @@ -77,7 +86,7 @@ public function readAttribute(string $attribute) * Set the current object's state * * @param int $dirtyState - * @return bool|\Phalcon\Mvc\ModelInterface + * @return mixed */ public function setDirtyState(int $dirtyState) { @@ -101,6 +110,7 @@ public function toArray(): array * * @param mixed $value * @param string $attribute + * @return void */ public function writeAttribute(string $attribute, $value) { diff --git a/src/Phalcon/mvc/model/Transaction.php b/src/Phalcon/Mvc/Model/Transaction.php similarity index 92% rename from src/Phalcon/mvc/model/Transaction.php rename to src/Phalcon/Mvc/Model/Transaction.php index 4ab0dc7d..9f8d9866 100644 --- a/src/Phalcon/mvc/model/Transaction.php +++ b/src/Phalcon/Mvc/Model/Transaction.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; /** @@ -153,6 +160,7 @@ public function rollback(string $rollbackMessage = null, \Phalcon\Mvc\ModelInter * Sets if is a reused transaction or new once * * @param bool $isNew + * @return void */ public function setIsNewTransaction(bool $isNew) { @@ -162,6 +170,7 @@ public function setIsNewTransaction(bool $isNew) * Sets flag to rollback on abort the HTTP connection * * @param bool $rollbackOnAbort + * @return void */ public function setRollbackOnAbort(bool $rollbackOnAbort) { @@ -171,6 +180,7 @@ public function setRollbackOnAbort(bool $rollbackOnAbort) * Sets object which generates rollback action * * @param \Phalcon\Mvc\ModelInterface $record + * @return void */ public function setRollbackedRecord(\Phalcon\Mvc\ModelInterface $record) { @@ -180,6 +190,7 @@ public function setRollbackedRecord(\Phalcon\Mvc\ModelInterface $record) * Sets transaction manager related to the transaction * * @param \Phalcon\Mvc\Model\Transaction\ManagerInterface $manager + * @return void */ public function setTransactionManager(\Phalcon\Mvc\Model\Transaction\ManagerInterface $manager) { @@ -189,7 +200,7 @@ public function setTransactionManager(\Phalcon\Mvc\Model\Transaction\ManagerInte * Enables throwing exception * * @param bool $status - * @return \Phalcon\Mvc\Model\TransactionInterface + * @return TransactionInterface */ public function throwRollbackException(bool $status): TransactionInterface { diff --git a/src/Phalcon/mvc/model/transaction/Exception.php b/src/Phalcon/Mvc/Model/Transaction/Exception.php similarity index 50% rename from src/Phalcon/mvc/model/transaction/Exception.php rename to src/Phalcon/Mvc/Model/Transaction/Exception.php index 51ec8b7d..466a2b52 100644 --- a/src/Phalcon/mvc/model/transaction/Exception.php +++ b/src/Phalcon/Mvc/Model/Transaction/Exception.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\Transaction; /** diff --git a/src/Phalcon/mvc/model/transaction/Failed.php b/src/Phalcon/Mvc/Model/Transaction/Failed.php similarity index 70% rename from src/Phalcon/mvc/model/transaction/Failed.php rename to src/Phalcon/Mvc/Model/Transaction/Failed.php index 21c32947..b6555617 100644 --- a/src/Phalcon/mvc/model/transaction/Failed.php +++ b/src/Phalcon/Mvc/Model/Transaction/Failed.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\Transaction; use Phalcon\Mvc\ModelInterface; @@ -9,7 +16,7 @@ * * This class will be thrown to exit a try/catch block for isolated transactions */ -class Failed extends Exception +class Failed extends \Phalcon\Mvc\Model\Transaction\Exception { protected $record = null; @@ -28,7 +35,7 @@ public function __construct(string $message, \Phalcon\Mvc\ModelInterface $record /** * Returns validation record messages which stop the transaction * - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ public function getRecord(): ModelInterface { @@ -37,7 +44,7 @@ public function getRecord(): ModelInterface /** * Returns validation record messages which stop the transaction * - * @return array|\Phalcon\Messages\MessageInterface[] + * @return array */ public function getRecordMessages(): array { diff --git a/src/Phalcon/mvc/model/transaction/Manager.php b/src/Phalcon/Mvc/Model/Transaction/Manager.php similarity index 90% rename from src/Phalcon/mvc/model/transaction/Manager.php rename to src/Phalcon/Mvc/Model/Transaction/Manager.php index 70953823..28fd6173 100644 --- a/src/Phalcon/mvc/model/transaction/Manager.php +++ b/src/Phalcon/Mvc/Model/Transaction/Manager.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\Transaction; use Phalcon\Di\DiInterface; @@ -86,6 +93,8 @@ public function __construct(\Phalcon\Di\DiInterface $container = null) /** * Remove all the transactions from the manager + * + * @return void */ public function collectTransactions() { @@ -103,7 +112,7 @@ public function commit() * This method registers a shutdown function to rollback active connections * * @param bool $autoBegin - * @return \Phalcon\Mvc\Model\TransactionInterface + * @return TransactionInterface */ public function get(bool $autoBegin = true): TransactionInterface { @@ -121,7 +130,7 @@ public function getDbService(): string /** * Returns the dependency injection container * - * @return \Phalcon\Di\DiInterface + * @return DiInterface */ public function getDI(): DiInterface { @@ -131,7 +140,7 @@ public function getDI(): DiInterface * Create/Returns a new transaction or an existing one * * @param bool $autoBegin - * @return \Phalcon\Mvc\Model\TransactionInterface + * @return TransactionInterface */ public function getOrCreateTransaction(bool $autoBegin = true): TransactionInterface { @@ -160,6 +169,7 @@ public function has(): bool * Notifies the manager about a committed transaction * * @param \Phalcon\Mvc\Model\TransactionInterface $transaction + * @return void */ public function notifyCommit(\Phalcon\Mvc\Model\TransactionInterface $transaction) { @@ -169,6 +179,7 @@ public function notifyCommit(\Phalcon\Mvc\Model\TransactionInterface $transactio * Notifies the manager about a rollbacked transaction * * @param \Phalcon\Mvc\Model\TransactionInterface $transaction + * @return void */ public function notifyRollback(\Phalcon\Mvc\Model\TransactionInterface $transaction) { @@ -179,6 +190,7 @@ public function notifyRollback(\Phalcon\Mvc\Model\TransactionInterface $transact * Collect will remove the transaction from the manager * * @param bool $collect + * @return void */ public function rollback(bool $collect = true) { @@ -186,6 +198,8 @@ public function rollback(bool $collect = true) /** * Rollbacks active transactions within the manager + * + * @return void */ public function rollbackPendent() { @@ -195,7 +209,7 @@ public function rollbackPendent() * Sets the database service used to run the isolated transactions * * @param string $service - * @return \Phalcon\Mvc\Model\Transaction\ManagerInterface + * @return ManagerInterface */ public function setDbService(string $service): ManagerInterface { @@ -205,6 +219,7 @@ public function setDbService(string $service): ManagerInterface * Sets the dependency injection container * * @param \Phalcon\Di\DiInterface $container + * @return void */ public function setDI(\Phalcon\Di\DiInterface $container) { @@ -215,7 +230,7 @@ public function setDI(\Phalcon\Di\DiInterface $container) * up pendent transactions * * @param bool $rollbackPendent - * @return \Phalcon\Mvc\Model\Transaction\ManagerInterface + * @return ManagerInterface */ public function setRollbackPendent(bool $rollbackPendent): ManagerInterface { @@ -225,6 +240,7 @@ public function setRollbackPendent(bool $rollbackPendent): ManagerInterface * Removes transactions from the TransactionManager * * @param \Phalcon\Mvc\Model\TransactionInterface $transaction + * @return void */ protected function collectTransaction(\Phalcon\Mvc\Model\TransactionInterface $transaction) { diff --git a/src/Phalcon/mvc/model/transaction/ManagerInterface.php b/src/Phalcon/Mvc/Model/Transaction/ManagerInterface.php similarity index 86% rename from src/Phalcon/mvc/model/transaction/ManagerInterface.php rename to src/Phalcon/Mvc/Model/Transaction/ManagerInterface.php index fc07bdbc..d2acfa22 100644 --- a/src/Phalcon/mvc/model/transaction/ManagerInterface.php +++ b/src/Phalcon/Mvc/Model/Transaction/ManagerInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model\Transaction; use Phalcon\Mvc\Model\TransactionInterface; @@ -14,6 +21,8 @@ interface ManagerInterface /** * Remove all the transactions from the manager + * + * @return void */ public function collectTransactions(); @@ -26,7 +35,7 @@ public function commit(); * Returns a new \Phalcon\Mvc\Model\Transaction or an already created once * * @param bool $autoBegin - * @return \Phalcon\Mvc\Model\TransactionInterface + * @return TransactionInterface */ public function get(bool $autoBegin = true): TransactionInterface; @@ -55,6 +64,7 @@ public function has(): bool; * Notifies the manager about a committed transaction * * @param \Phalcon\Mvc\Model\TransactionInterface $transaction + * @return void */ public function notifyCommit(\Phalcon\Mvc\Model\TransactionInterface $transaction); @@ -62,6 +72,7 @@ public function notifyCommit(\Phalcon\Mvc\Model\TransactionInterface $transactio * Notifies the manager about a rollbacked transaction * * @param \Phalcon\Mvc\Model\TransactionInterface $transaction + * @return void */ public function notifyRollback(\Phalcon\Mvc\Model\TransactionInterface $transaction); @@ -70,11 +81,14 @@ public function notifyRollback(\Phalcon\Mvc\Model\TransactionInterface $transact * Collect will remove transaction from the manager * * @param bool $collect + * @return void */ public function rollback(bool $collect = false); /** * Rollbacks active transactions within the manager + * + * @return void */ public function rollbackPendent(); diff --git a/src/Phalcon/mvc/model/TransactionInterface.php b/src/Phalcon/Mvc/Model/TransactionInterface.php similarity index 88% rename from src/Phalcon/mvc/model/TransactionInterface.php rename to src/Phalcon/Mvc/Model/TransactionInterface.php index 2499aebe..99dba3e3 100644 --- a/src/Phalcon/mvc/model/TransactionInterface.php +++ b/src/Phalcon/Mvc/Model/TransactionInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; /** @@ -65,6 +72,7 @@ public function rollback(string $rollbackMessage = null, \Phalcon\Mvc\ModelInter * Sets if is a reused transaction or new once * * @param bool $isNew + * @return void */ public function setIsNewTransaction(bool $isNew); @@ -72,6 +80,7 @@ public function setIsNewTransaction(bool $isNew); * Sets flag to rollback on abort the HTTP connection * * @param bool $rollbackOnAbort + * @return void */ public function setRollbackOnAbort(bool $rollbackOnAbort); @@ -79,6 +88,7 @@ public function setRollbackOnAbort(bool $rollbackOnAbort); * Sets object which generates rollback action * * @param \Phalcon\Mvc\ModelInterface $record + * @return void */ public function setRollbackedRecord(\Phalcon\Mvc\ModelInterface $record); @@ -86,6 +96,7 @@ public function setRollbackedRecord(\Phalcon\Mvc\ModelInterface $record); * Sets transaction manager related to the transaction * * @param \Phalcon\Mvc\Model\Transaction\ManagerInterface $manager + * @return void */ public function setTransactionManager(\Phalcon\Mvc\Model\Transaction\ManagerInterface $manager); diff --git a/src/Phalcon/mvc/model/ValidationFailed.php b/src/Phalcon/Mvc/Model/ValidationFailed.php similarity index 78% rename from src/Phalcon/mvc/model/ValidationFailed.php rename to src/Phalcon/Mvc/Model/ValidationFailed.php index 200baf2c..098cc9d4 100644 --- a/src/Phalcon/mvc/model/ValidationFailed.php +++ b/src/Phalcon/Mvc/Model/ValidationFailed.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Model; use Phalcon\Mvc\ModelInterface; @@ -34,7 +41,7 @@ public function __construct(\Phalcon\Mvc\ModelInterface $model, array $validatio /** * Returns the complete group of messages produced in the validation * - * @return array|Message[] + * @return array */ public function getMessages(): array { @@ -43,7 +50,7 @@ public function getMessages(): array /** * Returns the model that generated the messages * - * @return \Phalcon\Mvc\ModelInterface + * @return ModelInterface */ public function getModel(): ModelInterface { diff --git a/src/Phalcon/mvc/ModelInterface.php b/src/Phalcon/Mvc/ModelInterface.php similarity index 94% rename from src/Phalcon/mvc/ModelInterface.php rename to src/Phalcon/Mvc/ModelInterface.php index 91ccf067..ed66717c 100644 --- a/src/Phalcon/mvc/ModelInterface.php +++ b/src/Phalcon/Mvc/ModelInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc; use Phalcon\Db\Adapter\AdapterInterface; @@ -58,10 +65,10 @@ public static function cloneResult(ModelInterface $base, array $data, int $dirty * * @param \Phalcon\Mvc\Model $base * @param array $columnMap + * @return \Phalcon\Mvc\Model result * @param array $data * @param int $dirtyState * @param bool $keepSnapshots - * @return \Phalcon\Mvc\Model result */ public static function cloneResultMap($base, array $data, $columnMap, int $dirtyState = 0, bool $keepSnapshots = null): ModelInterface; @@ -102,7 +109,7 @@ public function delete(): bool; * Allows to query a set of records that match the specified conditions * * @param mixed $parameters - * @return \Phalcon\Mvc\Model\ResultsetInterface + * @return ResultsetInterface */ public static function find($parameters = null): ResultsetInterface; @@ -110,7 +117,7 @@ public static function find($parameters = null): ResultsetInterface; * Allows to query the first record that match the specified conditions * * @param array $parameters - * @return bool|ModelInterface + * @return mixed */ public static function findFirst($parameters = null); @@ -144,14 +151,14 @@ public function getDirtyState(): int; /** * Returns array of validation messages * - * @return array|\Phalcon\Messages\MessageInterface[] + * @return array */ public function getMessages(): array; /** * Returns the models meta-data service related to the entity instance. * - * @return \Phalcon\Mvc\Model\MetaDataInterface + * @return MetaDataInterface */ public function getModelsMetaData(): MetaDataInterface; @@ -166,7 +173,7 @@ public function getOperationMade(): int; /** * Gets internal database connection * - * @return \Phalcon\Db\Adapter\AdapterInterface + * @return AdapterInterface */ public function getReadConnection(): AdapterInterface; @@ -181,8 +188,8 @@ public function getReadConnectionService(): string; * Returns related records based on defined relations * * @param array $arguments - * @param string $alias * @return \Phalcon\Mvc\Model\Resultset\Simple|Phalcon\Mvc\Model\Resultset\Simple|false + * @param string $alias */ public function getRelated(string $alias, $arguments = null); @@ -203,7 +210,7 @@ public function getSource(): string; /** * Gets internal database connection * - * @return \Phalcon\Db\Adapter\AdapterInterface + * @return AdapterInterface */ public function getWriteConnection(): AdapterInterface; @@ -236,7 +243,7 @@ public static function minimum($parameters = null); * Create a criteria for a specific model * * @param \Phalcon\Di\DiInterface $container - * @return \Phalcon\Mvc\Model\CriteriaInterface + * @return CriteriaInterface */ public static function query(\Phalcon\Di\DiInterface $container = null): CriteriaInterface; @@ -259,6 +266,7 @@ public function save(): bool; * Sets both read/write connection services * * @param string $connectionService + * @return void */ public function setConnectionService(string $connectionService); @@ -267,7 +275,7 @@ public function setConnectionService(string $connectionService); * constants * * @param int $dirtyState - * @return bool|ModelInterface + * @return mixed */ public function setDirtyState(int $dirtyState); @@ -275,6 +283,7 @@ public function setDirtyState(int $dirtyState); * Sets the DependencyInjection connection service used to read data * * @param string $connectionService + * @return void */ public function setReadConnectionService(string $connectionService); @@ -284,6 +293,7 @@ public function setReadConnectionService(string $connectionService); * * @param array $columnMap * @param array $data + * @return void */ public function setSnapshotData(array $data, $columnMap = null); @@ -299,6 +309,7 @@ public function setTransaction(\Phalcon\Mvc\Model\TransactionInterface $transact * Sets the DependencyInjection connection service used to write data * * @param string $connectionService + * @return void */ public function setWriteConnectionService(string $connectionService); @@ -306,6 +317,7 @@ public function setWriteConnectionService(string $connectionService); * Skips the current operation forcing a success state * * @param bool $skip + * @return void */ public function skipOperation(bool $skip); diff --git a/src/Phalcon/mvc/ModuleDefinitionInterface.php b/src/Phalcon/Mvc/ModuleDefinitionInterface.php similarity index 72% rename from src/Phalcon/mvc/ModuleDefinitionInterface.php rename to src/Phalcon/Mvc/ModuleDefinitionInterface.php index 04605ce1..ac195410 100644 --- a/src/Phalcon/mvc/ModuleDefinitionInterface.php +++ b/src/Phalcon/Mvc/ModuleDefinitionInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc; /** diff --git a/src/Phalcon/mvc/Router.php b/src/Phalcon/Mvc/Router.php similarity index 93% rename from src/Phalcon/mvc/Router.php rename to src/Phalcon/Mvc/Router.php index 6054ff5c..02751581 100644 --- a/src/Phalcon/mvc/Router.php +++ b/src/Phalcon/Mvc/Router.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc; use Phalcon\Di\AbstractInjectionAware; @@ -103,6 +110,7 @@ class Router extends AbstractInjectionAware implements \Phalcon\Mvc\RouterInterf protected $wasMatched = false; + public function getKeyRouteNames() { } @@ -161,7 +169,7 @@ public function __construct(bool $defaultRoutes = true) * @param mixed $paths * @param mixed $httpMethods * @param mixed $position - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function add(string $pattern, $paths = null, $httpMethods = null, $position = Router::POSITION_LAST): RouteInterface { @@ -173,7 +181,7 @@ public function add(string $pattern, $paths = null, $httpMethods = null, $positi * @param string $pattern * @param mixed $paths * @param mixed $position - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addConnect(string $pattern, $paths = null, $position = Router::POSITION_LAST): RouteInterface { @@ -185,7 +193,7 @@ public function addConnect(string $pattern, $paths = null, $position = Router::P * @param string $pattern * @param mixed $paths * @param mixed $position - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addDelete(string $pattern, $paths = null, $position = Router::POSITION_LAST): RouteInterface { @@ -197,7 +205,7 @@ public function addDelete(string $pattern, $paths = null, $position = Router::PO * @param string $pattern * @param mixed $paths * @param mixed $position - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addGet(string $pattern, $paths = null, $position = Router::POSITION_LAST): RouteInterface { @@ -209,7 +217,7 @@ public function addGet(string $pattern, $paths = null, $position = Router::POSIT * @param string $pattern * @param mixed $paths * @param mixed $position - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addHead(string $pattern, $paths = null, $position = Router::POSITION_LAST): RouteInterface { @@ -221,7 +229,7 @@ public function addHead(string $pattern, $paths = null, $position = Router::POSI * @param string $pattern * @param mixed $paths * @param mixed $position - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addOptions(string $pattern, $paths = null, $position = Router::POSITION_LAST): RouteInterface { @@ -233,7 +241,7 @@ public function addOptions(string $pattern, $paths = null, $position = Router::P * @param string $pattern * @param mixed $paths * @param mixed $position - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addPatch(string $pattern, $paths = null, $position = Router::POSITION_LAST): RouteInterface { @@ -245,7 +253,7 @@ public function addPatch(string $pattern, $paths = null, $position = Router::POS * @param string $pattern * @param mixed $paths * @param mixed $position - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addPost(string $pattern, $paths = null, $position = Router::POSITION_LAST): RouteInterface { @@ -258,7 +266,7 @@ public function addPost(string $pattern, $paths = null, $position = Router::POSI * @param string $pattern * @param mixed $paths * @param mixed $position - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addPurge(string $pattern, $paths = null, $position = Router::POSITION_LAST): RouteInterface { @@ -270,7 +278,7 @@ public function addPurge(string $pattern, $paths = null, $position = Router::POS * @param string $pattern * @param mixed $paths * @param mixed $position - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addPut(string $pattern, $paths = null, $position = Router::POSITION_LAST): RouteInterface { @@ -282,7 +290,7 @@ public function addPut(string $pattern, $paths = null, $position = Router::POSIT * @param string $pattern * @param mixed $paths * @param mixed $position - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addTrace(string $pattern, $paths = null, $position = Router::POSITION_LAST): RouteInterface { @@ -317,6 +325,8 @@ public function attach(\Phalcon\Mvc\Router\RouteInterface $route, $position = Ro /** * Removes all the pre-defined routes + * + * @return void */ public function clear() { @@ -325,7 +335,7 @@ public function clear() /** * Returns the internal event manager * - * @return \Phalcon\Events\ManagerInterface + * @return ManagerInterface */ public function getEventsManager(): ManagerInterface { @@ -352,7 +362,7 @@ public function getControllerName(): string /** * Returns the route that matches the handled URI * - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function getMatchedRoute(): RouteInterface { @@ -398,7 +408,7 @@ public function getParams(): array * Returns a route object by its id * * @param mixed $id - * @return bool|\Phalcon\Mvc\Router\RouteInterface + * @return mixed */ public function getRouteById($id) { @@ -408,7 +418,7 @@ public function getRouteById($id) * Returns a route object by its name * * @param string $name - * @return bool|\Phalcon\Mvc\Router\RouteInterface + * @return mixed */ public function getRouteByName(string $name) { @@ -417,7 +427,7 @@ public function getRouteByName(string $name) /** * Returns all the routes defined in the router * - * @return array|\Phalcon\Mvc\Router\RouteInterface[] + * @return array */ public function getRoutes(): array { @@ -432,6 +442,7 @@ public function getRoutes(): array * ``` * * @param string $uri + * @return void */ public function handle(string $uri) { @@ -551,6 +562,7 @@ public function getDefaults(): array * Sets the events manager * * @param \Phalcon\Events\ManagerInterface $eventsManager + * @return void */ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager) { diff --git a/src/Phalcon/mvc/router/Annotations.php b/src/Phalcon/Mvc/Router/Annotations.php similarity index 92% rename from src/Phalcon/mvc/router/Annotations.php rename to src/Phalcon/Mvc/Router/Annotations.php index 565a5564..4fd2e415 100644 --- a/src/Phalcon/mvc/router/Annotations.php +++ b/src/Phalcon/Mvc/Router/Annotations.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Router; use Phalcon\Mvc\Router; @@ -80,6 +87,7 @@ public function getResources(): array * Produce the routing parameters from the rewrite information * * @param string $uri + * @return void */ public function handle(string $uri) { diff --git a/src/Phalcon/Mvc/Router/Exception.php b/src/Phalcon/Mvc/Router/Exception.php new file mode 100644 index 00000000..f60ebd75 --- /dev/null +++ b/src/Phalcon/Mvc/Router/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Mvc\Router; + +/** + * Phalcon\Mvc\Router\Exception + * + * Exceptions thrown in Phalcon\Mvc\Router will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/mvc/router/Group.php b/src/Phalcon/Mvc/Router/Group.php similarity index 95% rename from src/Phalcon/mvc/router/Group.php rename to src/Phalcon/Mvc/Router/Group.php index b1a49f19..084af716 100644 --- a/src/Phalcon/mvc/router/Group.php +++ b/src/Phalcon/Mvc/Router/Group.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Router; /** @@ -217,6 +224,8 @@ public function beforeMatch($beforeMatch): GroupInterface /** * Removes all the pre-defined routes + * + * @return void */ public function clear() { @@ -225,7 +234,7 @@ public function clear() /** * Returns the 'before match' callback if any * - * @return callable + * @return mixed */ public function getBeforeMatch() { @@ -261,7 +270,7 @@ public function getPrefix(): string /** * Returns the routes added to the group * - * @return array|RouteInterface[] + * @return array */ public function getRoutes(): array { diff --git a/src/Phalcon/mvc/router/GroupInterface.php b/src/Phalcon/Mvc/Router/GroupInterface.php similarity index 89% rename from src/Phalcon/mvc/router/GroupInterface.php rename to src/Phalcon/Mvc/Router/GroupInterface.php index c504e20c..d68a50db 100644 --- a/src/Phalcon/mvc/router/GroupInterface.php +++ b/src/Phalcon/Mvc/Router/GroupInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Router; /** @@ -61,7 +68,7 @@ interface GroupInterface * @param string $pattern * @param mixed $paths * @param mixed $httpMethods - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function add(string $pattern, $paths = null, $httpMethods = null): RouteInterface; @@ -70,7 +77,7 @@ public function add(string $pattern, $paths = null, $httpMethods = null): RouteI * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addConnect(string $pattern, $paths = null): RouteInterface; @@ -79,7 +86,7 @@ public function addConnect(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addDelete(string $pattern, $paths = null): RouteInterface; @@ -88,7 +95,7 @@ public function addDelete(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addGet(string $pattern, $paths = null): RouteInterface; @@ -97,7 +104,7 @@ public function addGet(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addHead(string $pattern, $paths = null): RouteInterface; @@ -106,7 +113,7 @@ public function addHead(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addOptions(string $pattern, $paths = null): RouteInterface; @@ -115,7 +122,7 @@ public function addOptions(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addPatch(string $pattern, $paths = null): RouteInterface; @@ -124,7 +131,7 @@ public function addPatch(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addPost(string $pattern, $paths = null): RouteInterface; @@ -133,7 +140,7 @@ public function addPost(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addPurge(string $pattern, $paths = null): RouteInterface; @@ -142,7 +149,7 @@ public function addPurge(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addPut(string $pattern, $paths = null): RouteInterface; @@ -151,7 +158,7 @@ public function addPut(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addTrace(string $pattern, $paths = null): RouteInterface; @@ -167,13 +174,15 @@ public function beforeMatch($beforeMatch): GroupInterface; /** * Removes all the pre-defined routes + * + * @return void */ public function clear(); /** * Returns the 'before match' callback if any * - * @return callable + * @return mixed */ public function getBeforeMatch(); @@ -201,7 +210,7 @@ public function getPrefix(): string; /** * Returns the routes added to the group * - * @return array|\Phalcon\Mvc\Router\RouteInterface[] + * @return array */ public function getRoutes(): array; diff --git a/src/Phalcon/mvc/router/Route.php b/src/Phalcon/Mvc/Router/Route.php similarity index 95% rename from src/Phalcon/mvc/router/Route.php rename to src/Phalcon/Mvc/Router/Route.php index 7eb8bf76..bb9ea158 100644 --- a/src/Phalcon/mvc/router/Route.php +++ b/src/Phalcon/Mvc/Router/Route.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Router; /** @@ -46,6 +53,7 @@ class Route implements \Phalcon\Mvc\Router\RouteInterface protected static $uniqueId = 0; + public function getId() { } @@ -126,7 +134,7 @@ public function extractNamedParams(string $pattern) /** * Returns the 'before match' callback if any * - * @return callable + * @return mixed */ public function getBeforeMatch() { @@ -153,7 +161,7 @@ public function getConverters(): array /** * Returns the group associated with the route * - * @return null|GroupInterface + * @return mixed */ public function getGroup(): ?GroupInterface { @@ -180,7 +188,7 @@ public function getHostname(): string /** * Returns the 'match' callback if any * - * @return callable + * @return mixed */ public function getMatch() { @@ -267,6 +275,7 @@ public function match($callback): RouteInterface * * @param string $pattern * @param mixed $paths + * @return void */ public function reConfigure(string $pattern, $paths = null) { @@ -274,6 +283,8 @@ public function reConfigure(string $pattern, $paths = null) /** * Resets the internal route id generator + * + * @return void */ public static function reset() { diff --git a/src/Phalcon/mvc/router/RouteInterface.php b/src/Phalcon/Mvc/Router/RouteInterface.php similarity index 91% rename from src/Phalcon/mvc/router/RouteInterface.php rename to src/Phalcon/Mvc/Router/RouteInterface.php index 39e2d5cf..830cf72e 100644 --- a/src/Phalcon/mvc/router/RouteInterface.php +++ b/src/Phalcon/Mvc/Router/RouteInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\Router; /** @@ -112,11 +119,14 @@ public function setName(string $name): RouteInterface; * * @param string $pattern * @param mixed $paths + * @return void */ public function reConfigure(string $pattern, $paths = null); /** * Resets the internal route id generator + * + * @return void */ public static function reset(); diff --git a/src/Phalcon/mvc/RouterInterface.php b/src/Phalcon/Mvc/RouterInterface.php similarity index 88% rename from src/Phalcon/mvc/RouterInterface.php rename to src/Phalcon/Mvc/RouterInterface.php index 7ab02262..eca288fe 100644 --- a/src/Phalcon/mvc/RouterInterface.php +++ b/src/Phalcon/Mvc/RouterInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc; use Phalcon\Mvc\Router\RouteInterface; @@ -16,7 +23,7 @@ interface RouterInterface * @param string $pattern * @param mixed $paths * @param mixed $httpMethods - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function add(string $pattern, $paths = null, $httpMethods = null): RouteInterface; @@ -34,7 +41,7 @@ public function attach(\Phalcon\Mvc\Router\RouteInterface $route, $position = Ro * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addConnect(string $pattern, $paths = null): RouteInterface; @@ -43,7 +50,7 @@ public function addConnect(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addDelete(string $pattern, $paths = null): RouteInterface; @@ -52,7 +59,7 @@ public function addDelete(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addHead(string $pattern, $paths = null): RouteInterface; @@ -61,7 +68,7 @@ public function addHead(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addGet(string $pattern, $paths = null): RouteInterface; @@ -70,7 +77,7 @@ public function addGet(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addOptions(string $pattern, $paths = null): RouteInterface; @@ -79,7 +86,7 @@ public function addOptions(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addPatch(string $pattern, $paths = null): RouteInterface; @@ -88,7 +95,7 @@ public function addPatch(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addPost(string $pattern, $paths = null): RouteInterface; @@ -98,7 +105,7 @@ public function addPost(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addPurge(string $pattern, $paths = null): RouteInterface; @@ -107,7 +114,7 @@ public function addPurge(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addPut(string $pattern, $paths = null): RouteInterface; @@ -116,12 +123,14 @@ public function addPut(string $pattern, $paths = null): RouteInterface; * * @param string $pattern * @param mixed $paths - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function addTrace(string $pattern, $paths = null): RouteInterface; /** * Removes all the defined routes + * + * @return void */ public function clear(); @@ -142,7 +151,7 @@ public function getControllerName(): string; /** * Returns the route that matches the handled URI * - * @return \Phalcon\Mvc\Router\RouteInterface + * @return RouteInterface */ public function getMatchedRoute(): RouteInterface; @@ -177,7 +186,7 @@ public function getParams(): array; /** * Return all the routes defined in the router * - * @return array|\Phalcon\Mvc\Router\RouteInterface[] + * @return array */ public function getRoutes(): array; @@ -185,7 +194,7 @@ public function getRoutes(): array; * Returns a route object by its id * * @param mixed $id - * @return bool|\Phalcon\Mvc\Router\RouteInterface + * @return mixed */ public function getRouteById($id); @@ -193,7 +202,7 @@ public function getRouteById($id); * Returns a route object by its name * * @param string $name - * @return bool|\Phalcon\Mvc\Router\RouteInterface + * @return mixed */ public function getRouteByName(string $name); @@ -201,6 +210,7 @@ public function getRouteByName(string $name); * Handles routing information received from the rewrite engine * * @param string $uri + * @return void */ public function handle(string $uri); diff --git a/src/Phalcon/mvc/View.php b/src/Phalcon/Mvc/View.php similarity index 97% rename from src/Phalcon/mvc/View.php rename to src/Phalcon/Mvc/View.php index ea069d7d..29bd0da4 100644 --- a/src/Phalcon/mvc/View.php +++ b/src/Phalcon/Mvc/View.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc; use Phalcon\Di\Injectable; @@ -133,6 +140,7 @@ class View extends Injectable implements \Phalcon\Mvc\ViewInterface, \Phalcon\Ev protected $viewParams = array(); + public function getCurrentRenderLevel() { } @@ -227,7 +235,7 @@ public function cleanTemplateBefore(): View * ``` * * @param mixed $level - * @return \Phalcon\Mvc\ViewInterface + * @return ViewInterface */ public function disableLevel($level): ViewInterface { @@ -318,7 +326,7 @@ public function getControllerName(): string /** * Returns the internal event manager * - * @return null|\Phalcon\Events\ManagerInterface + * @return mixed */ public function getEventsManager(): ?ManagerInterface { @@ -535,7 +543,7 @@ public function registerEngines(array $engines): View * @param string $controllerName * @param string $actionName * @param array $params - * @return bool|View + * @return mixed */ public function render(string $controllerName, string $actionName, array $params = array()) { @@ -583,6 +591,7 @@ public function setContent(string $content): View * Sets the events manager * * @param \Phalcon\Events\ManagerInterface $eventsManager + * @return void */ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager) { @@ -677,7 +686,7 @@ public function setParamToView(string $key, $value): View * ``` * * @param int $level - * @return \Phalcon\Mvc\ViewInterface + * @return ViewInterface */ public function setRenderLevel(int $level): ViewInterface { diff --git a/src/Phalcon/mvc/view/engine/AbstractEngine.php b/src/Phalcon/Mvc/View/Engine/AbstractEngine.php similarity index 80% rename from src/Phalcon/mvc/view/engine/AbstractEngine.php rename to src/Phalcon/Mvc/View/Engine/AbstractEngine.php index b67caa74..007c9c85 100644 --- a/src/Phalcon/mvc/view/engine/AbstractEngine.php +++ b/src/Phalcon/Mvc/View/Engine/AbstractEngine.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\View\Engine; use Phalcon\Di\Injectable; @@ -37,7 +44,7 @@ public function getContent(): string /** * Returns the view component related to the adapter * - * @return \Phalcon\Mvc\ViewBaseInterface + * @return ViewBaseInterface */ public function getView(): ViewBaseInterface { @@ -48,6 +55,7 @@ public function getView(): ViewBaseInterface * * @param array $params * @param string $partialPath + * @return void */ public function partial(string $partialPath, $params = null) { diff --git a/src/Phalcon/mvc/view/engine/EngineInterface.php b/src/Phalcon/Mvc/View/Engine/EngineInterface.php similarity index 73% rename from src/Phalcon/mvc/view/engine/EngineInterface.php rename to src/Phalcon/Mvc/View/Engine/EngineInterface.php index 7f0d981f..78012e02 100644 --- a/src/Phalcon/mvc/view/engine/EngineInterface.php +++ b/src/Phalcon/Mvc/View/Engine/EngineInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\View\Engine; /** @@ -20,6 +27,7 @@ public function getContent(): string; * * @param string $partialPath * @param mixed $params + * @return void */ public function partial(string $partialPath, $params = null); diff --git a/src/Phalcon/mvc/view/engine/Php.php b/src/Phalcon/Mvc/View/Engine/Php.php similarity index 55% rename from src/Phalcon/mvc/view/engine/Php.php rename to src/Phalcon/Mvc/View/Engine/Php.php index 0e6d1a5a..35138e3f 100644 --- a/src/Phalcon/mvc/view/engine/Php.php +++ b/src/Phalcon/Mvc/View/Engine/Php.php @@ -1,11 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\View\Engine; /** * Adapter to use PHP itself as templating engine */ -class Php extends AbstractEngine +class Php extends \Phalcon\Mvc\View\Engine\AbstractEngine { /** diff --git a/src/Phalcon/mvc/view/engine/Volt.php b/src/Phalcon/Mvc/View/Engine/Volt.php similarity index 86% rename from src/Phalcon/mvc/view/engine/Volt.php rename to src/Phalcon/Mvc/View/Engine/Volt.php index d4e83800..6192db65 100644 --- a/src/Phalcon/mvc/view/engine/Volt.php +++ b/src/Phalcon/Mvc/View/Engine/Volt.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\View\Engine; use Phalcon\Events\ManagerInterface; @@ -8,7 +15,7 @@ /** * Designer friendly and fast template engine for PHP written in Zephir/C */ -class Volt extends AbstractEngine implements \Phalcon\Events\EventsAwareInterface +class Volt extends \Phalcon\Mvc\View\Engine\AbstractEngine implements \Phalcon\Events\EventsAwareInterface { protected $compiler; @@ -49,7 +56,7 @@ public function convertEncoding(string $text, string $from, string $to): string /** * Returns the Volt's compiler * - * @return \Phalcon\Mvc\View\Engine\Volt\Compiler + * @return Compiler */ public function getCompiler(): Compiler { @@ -58,7 +65,7 @@ public function getCompiler(): Compiler /** * Returns the internal event manager * - * @return null|\Phalcon\Events\ManagerInterface + * @return mixed */ public function getEventsManager(): ?ManagerInterface { @@ -109,6 +116,7 @@ public function render(string $templatePath, $params, bool $mustClean = false) * Sets the events manager * * @param \Phalcon\Events\ManagerInterface $eventsManager + * @return void */ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager) { diff --git a/src/Phalcon/mvc/view/engine/volt/Compiler.php b/src/Phalcon/Mvc/View/Engine/Volt/Compiler.php similarity index 97% rename from src/Phalcon/mvc/view/engine/volt/Compiler.php rename to src/Phalcon/Mvc/View/Engine/Volt/Compiler.php index 8c89fc49..9fe907a5 100644 --- a/src/Phalcon/mvc/view/engine/volt/Compiler.php +++ b/src/Phalcon/Mvc/View/Engine/Volt/Compiler.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\View\Engine\Volt; use Phalcon\Di\DiInterface; @@ -232,10 +239,10 @@ public function compileElseIf(array $statement): string * ); * ``` * + * @return string|array * @param string $path * @param string $compiledPath * @param bool $extendsMode - * @return string|array */ public function compileFile(string $path, string $compiledPath, bool $extendsMode = false) { @@ -353,8 +360,8 @@ final public function expression(array $expr): string * Fires an event to registered extensions * * @param array $arguments - * @param string $name * @return mixed + * @param string $name */ final public function fireExtensionEvent(string $name, $arguments = null) { @@ -382,7 +389,7 @@ public function getCompiledTemplatePath(): string /** * Returns the internal dependency injector * - * @return \Phalcon\Di\DiInterface + * @return DiInterface */ public function getDI(): DiInterface { @@ -418,8 +425,8 @@ public function getFunctions(): array /** * Returns a compiler's option * - * @param string $option * @return string + * @param string $option */ public function getOption(string $option) { @@ -462,8 +469,8 @@ public function getUniquePrefix(): string * ); * ``` * - * @param string $viewCode * @return array + * @param string $viewCode */ public function parse(string $viewCode) { @@ -484,6 +491,7 @@ public function resolveTest(array $test, string $left): string * Sets the dependency injector * * @param \Phalcon\Di\DiInterface $container + * @return void */ public function setDI(\Phalcon\Di\DiInterface $container) { diff --git a/src/Phalcon/mvc/view/engine/volt/Exception.php b/src/Phalcon/Mvc/View/Engine/Volt/Exception.php similarity index 66% rename from src/Phalcon/mvc/view/engine/volt/Exception.php rename to src/Phalcon/Mvc/View/Engine/Volt/Exception.php index 915f73b0..08a2dad3 100644 --- a/src/Phalcon/mvc/view/engine/volt/Exception.php +++ b/src/Phalcon/Mvc/View/Engine/Volt/Exception.php @@ -1,13 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\View\Engine\Volt; -use Phalcon\Mvc\View\Exception as BaseException; - /** * Class for exceptions thrown by Phalcon\Mvc\View */ -class Exception extends BaseException +class Exception extends \Phalcon\Mvc\View\Exception { protected $statement; diff --git a/src/Phalcon/Mvc/View/Exception.php b/src/Phalcon/Mvc/View/Exception.php new file mode 100644 index 00000000..92c5704b --- /dev/null +++ b/src/Phalcon/Mvc/View/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Mvc\View; + +/** + * Phalcon\Mvc\View\Exception + * + * Class for exceptions thrown by Phalcon\Mvc\View + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/mvc/view/Simple.php b/src/Phalcon/Mvc/View/Simple.php similarity index 95% rename from src/Phalcon/mvc/view/Simple.php rename to src/Phalcon/Mvc/View/Simple.php index 9a93d03b..7b4e6dd3 100644 --- a/src/Phalcon/mvc/view/Simple.php +++ b/src/Phalcon/Mvc/View/Simple.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc\View; use Phalcon\Di\Injectable; @@ -131,7 +138,7 @@ public function getContent(): string /** * Returns the internal event manager * - * @return null|\Phalcon\Events\ManagerInterface + * @return mixed */ public function getEventsManager(): ?ManagerInterface { @@ -238,6 +245,7 @@ public function setContent(string $content): Simple * Sets the events manager * * @param \Phalcon\Events\ManagerInterface $eventsManager + * @return void */ public function setEventsManager(\Phalcon\Events\ManagerInterface $eventsManager) { diff --git a/src/Phalcon/mvc/ViewBaseInterface.php b/src/Phalcon/Mvc/ViewBaseInterface.php similarity index 86% rename from src/Phalcon/mvc/ViewBaseInterface.php rename to src/Phalcon/Mvc/ViewBaseInterface.php index 0495848b..494f184a 100644 --- a/src/Phalcon/mvc/ViewBaseInterface.php +++ b/src/Phalcon/Mvc/ViewBaseInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc; /** diff --git a/src/Phalcon/mvc/ViewInterface.php b/src/Phalcon/Mvc/ViewInterface.php similarity index 94% rename from src/Phalcon/mvc/ViewInterface.php rename to src/Phalcon/Mvc/ViewInterface.php index 94305bb5..c791f141 100644 --- a/src/Phalcon/mvc/ViewInterface.php +++ b/src/Phalcon/Mvc/ViewInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Mvc; /** @@ -118,7 +125,7 @@ public function registerEngines(array $engines); * @param string $controllerName * @param string $actionName * @param array $params - * @return bool|ViewInterface + * @return mixed */ public function render(string $controllerName, string $actionName, array $params = array()); diff --git a/src/Phalcon/paginator/adapter/AbstractAdapter.php b/src/Phalcon/Paginator/Adapter/AbstractAdapter.php similarity index 82% rename from src/Phalcon/paginator/adapter/AbstractAdapter.php rename to src/Phalcon/Paginator/Adapter/AbstractAdapter.php index 6dfb374e..4a919273 100644 --- a/src/Phalcon/paginator/adapter/AbstractAdapter.php +++ b/src/Phalcon/Paginator/Adapter/AbstractAdapter.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Paginator\Adapter; use Phalcon\Paginator\RepositoryInterface; @@ -54,7 +61,7 @@ public function getLimit(): int * Set the current page number * * @param int $page - * @return \Phalcon\Paginator\Adapter\AdapterInterface + * @return AdapterInterface */ public function setCurrentPage(int $page): AdapterInterface { @@ -64,7 +71,7 @@ public function setCurrentPage(int $page): AdapterInterface * Set current rows limit * * @param int $limitRows - * @return \Phalcon\Paginator\Adapter\AdapterInterface + * @return AdapterInterface */ public function setLimit(int $limitRows): AdapterInterface { @@ -74,7 +81,7 @@ public function setLimit(int $limitRows): AdapterInterface * Sets current repository for pagination * * @param \Phalcon\Paginator\RepositoryInterface $repository - * @return \Phalcon\Paginator\Adapter\AdapterInterface + * @return AdapterInterface */ public function setRepository(\Phalcon\Paginator\RepositoryInterface $repository): AdapterInterface { @@ -84,7 +91,7 @@ public function setRepository(\Phalcon\Paginator\RepositoryInterface $repository * Gets current repository for pagination * * @param array $properties - * @return \Phalcon\Paginator\RepositoryInterface + * @return RepositoryInterface */ protected function getRepository(array $properties = null): RepositoryInterface { diff --git a/src/Phalcon/paginator/adapter/AdapterInterface.php b/src/Phalcon/Paginator/Adapter/AdapterInterface.php similarity index 73% rename from src/Phalcon/paginator/adapter/AdapterInterface.php rename to src/Phalcon/Paginator/Adapter/AdapterInterface.php index b577dc1e..b39e5b27 100644 --- a/src/Phalcon/paginator/adapter/AdapterInterface.php +++ b/src/Phalcon/Paginator/Adapter/AdapterInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Paginator\Adapter; use Phalcon\Paginator\RepositoryInterface; @@ -22,7 +29,7 @@ public function getLimit(): int; /** * Returns a slice of the resultset to show in the pagination * - * @return \Phalcon\Paginator\RepositoryInterface + * @return RepositoryInterface */ public function paginate(): RepositoryInterface; diff --git a/src/Phalcon/Paginator/Adapter/Model.php b/src/Phalcon/Paginator/Adapter/Model.php new file mode 100644 index 00000000..cca3b9d3 --- /dev/null +++ b/src/Phalcon/Paginator/Adapter/Model.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Paginator\Adapter; + +use Phalcon\Paginator\RepositoryInterface; + +/** + * Phalcon\Paginator\Adapter\Model + * + * This adapter allows to paginate data using a Phalcon\Mvc\Model resultset as a + * base. + * + * ```php + * use Phalcon\Paginator\Adapter\Model; + * + * $paginator = new Model( + * [ + * "model" => Robots::class, + * "limit" => 25, + * "page" => $currentPage, + * ] + * ); + * + * $paginator = new Model( + * [ + * "model" => Robots::class, + * "parameters" => [ + * "columns" => "id, name" + * ], + * "limit" => 12, + * "page" => $currentPage, + * ] + * ); + * + * $paginator = new Model( + * [ + * "model" => Robots::class, + * "parameters" => [ + * "type = :type:", + * "bind" => [ + * "type" => "mechanical" + * ], + * "order" => "name" + * ], + * "limit" => 16, + * "page" => $currentPage, + * ] + * ); + * + * $paginator = new Model( + * [ + * "model" => Robots::class, + * "parameters" => "(id % 2) = 0", + * "limit" => 8, + * "page" => $currentPage, + * ] + * ); + * + * $paginator = new Model( + * [ + * "model" => Robots::class, + * "parameters" => [ "(id % 2) = 0" ], + * "limit" => 8, + * "page" => $currentPage, + * ] + * ); + * + * $paginate = $paginator->paginate(); + * ``` + */ +class Model extends \Phalcon\Paginator\Adapter\AbstractAdapter +{ + + /** + * Returns a slice of the resultset to show in the pagination + * + * @return RepositoryInterface + */ + public function paginate(): RepositoryInterface + { + } +} diff --git a/src/Phalcon/paginator/adapter/NativeArray.php b/src/Phalcon/Paginator/Adapter/NativeArray.php similarity index 71% rename from src/Phalcon/paginator/adapter/NativeArray.php rename to src/Phalcon/Paginator/Adapter/NativeArray.php index b3e7fe96..a6bae499 100644 --- a/src/Phalcon/paginator/adapter/NativeArray.php +++ b/src/Phalcon/Paginator/Adapter/NativeArray.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Paginator\Adapter; use Phalcon\Paginator\RepositoryInterface; @@ -27,13 +34,13 @@ * ); * ``` */ -class NativeArray extends AbstractAdapter +class NativeArray extends \Phalcon\Paginator\Adapter\AbstractAdapter { /** * Returns a slice of the resultset to show in the pagination * - * @return \Phalcon\Paginator\RepositoryInterface + * @return RepositoryInterface */ public function paginate(): RepositoryInterface { diff --git a/src/Phalcon/paginator/adapter/QueryBuilder.php b/src/Phalcon/Paginator/Adapter/QueryBuilder.php similarity index 81% rename from src/Phalcon/paginator/adapter/QueryBuilder.php rename to src/Phalcon/Paginator/Adapter/QueryBuilder.php index 9d95c134..45925fcd 100644 --- a/src/Phalcon/paginator/adapter/QueryBuilder.php +++ b/src/Phalcon/Paginator/Adapter/QueryBuilder.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Paginator\Adapter; use Phalcon\Mvc\Model\Query\Builder; @@ -27,7 +34,7 @@ * ); * ``` */ -class QueryBuilder extends AbstractAdapter +class QueryBuilder extends \Phalcon\Paginator\Adapter\AbstractAdapter { /** * Paginator's data @@ -61,7 +68,7 @@ public function getCurrentPage(): int /** * Get query builder object * - * @return \Phalcon\Mvc\Model\Query\Builder + * @return Builder */ public function getQueryBuilder(): Builder { @@ -70,7 +77,7 @@ public function getQueryBuilder(): Builder /** * Returns a slice of the resultset to show in the pagination * - * @return \Phalcon\Paginator\RepositoryInterface + * @return RepositoryInterface */ public function paginate(): RepositoryInterface { diff --git a/src/Phalcon/Paginator/Exception.php b/src/Phalcon/Paginator/Exception.php new file mode 100644 index 00000000..4939c43b --- /dev/null +++ b/src/Phalcon/Paginator/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Paginator; + +/** + * Phalcon\Paginator\Exception + * + * Exceptions thrown in Phalcon\Paginator will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/paginator/PaginatorFactory.php b/src/Phalcon/Paginator/PaginatorFactory.php similarity index 84% rename from src/Phalcon/paginator/PaginatorFactory.php rename to src/Phalcon/Paginator/PaginatorFactory.php index 598bfcd6..ebe00abd 100644 --- a/src/Phalcon/paginator/PaginatorFactory.php +++ b/src/Phalcon/Paginator/PaginatorFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Paginator; use Phalcon\Factory\AbstractFactory; @@ -49,7 +56,7 @@ public function __construct(array $services = array()) * ``` * * @param mixed $config - * @return \Phalcon\Paginator\Adapter\AdapterInterface + * @return AdapterInterface */ public function load($config): AdapterInterface { @@ -60,7 +67,7 @@ public function load($config): AdapterInterface * * @param string $name * @param array $options - * @return \Phalcon\Paginator\Adapter\AdapterInterface + * @return AdapterInterface */ public function newInstance(string $name, array $options = array()): AdapterInterface { diff --git a/src/Phalcon/paginator/Repository.php b/src/Phalcon/Paginator/Repository.php similarity index 91% rename from src/Phalcon/paginator/Repository.php rename to src/Phalcon/Paginator/Repository.php index 14a0eadf..798df280 100644 --- a/src/Phalcon/paginator/Repository.php +++ b/src/Phalcon/Paginator/Repository.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Paginator; /** diff --git a/src/Phalcon/paginator/RepositoryInterface.php b/src/Phalcon/Paginator/RepositoryInterface.php similarity index 90% rename from src/Phalcon/paginator/RepositoryInterface.php rename to src/Phalcon/Paginator/RepositoryInterface.php index 7eeac3db..921f0c17 100644 --- a/src/Phalcon/paginator/RepositoryInterface.php +++ b/src/Phalcon/Paginator/RepositoryInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Paginator; /** diff --git a/src/Phalcon/Registry.php b/src/Phalcon/Registry.php index e5234f64..59f90e2e 100644 --- a/src/Phalcon/Registry.php +++ b/src/Phalcon/Registry.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; use Traversable; @@ -54,7 +61,7 @@ * are implemented using object handlers or similar techniques: this allows to * bypass relatively slow method calls. */ -final class Registry extends Collection +final class Registry extends \Phalcon\Collection { /** @@ -91,6 +98,7 @@ final public function __isset(string $element): bool * * @param string $element * @param mixed $value + * @return void */ final public function __set(string $element, $value) { @@ -100,6 +108,7 @@ final public function __set(string $element, $value) * Magic unset to remove an element from the collection * * @param string $element + * @return void */ final public function __unset(string $element) { @@ -107,6 +116,8 @@ final public function __unset(string $element) /** * Clears the internal collection + * + * @return void */ final public function clear() { @@ -137,7 +148,7 @@ final public function get(string $element, $defaultValue = null, string $cast = /** * Returns the iterator of the class * - * @return \Traversable + * @return Traversable */ final public function getIterator(): Traversable { @@ -157,6 +168,7 @@ final public function has(string $element): bool * Initialize internal array * * @param array $data + * @return void */ final public function init(array $data = array()) { @@ -200,6 +212,7 @@ final public function offsetGet($element) * @link https://php.net/manual/en/arrayaccess.offsetset.php * @param mixed $element * @param mixed $value + * @return void */ final public function offsetSet($element, $value) { @@ -210,6 +223,7 @@ final public function offsetSet($element, $value) * * @link https://php.net/manual/en/arrayaccess.offsetunset.php * @param mixed $element + * @return void */ final public function offsetUnset($element) { @@ -219,6 +233,7 @@ final public function offsetUnset($element) * Delete the element from the collection * * @param string $element + * @return void */ final public function remove(string $element) { @@ -239,6 +254,7 @@ final public function serialize(): string * * @param string $element * @param mixed $value + * @return void */ final public function set(string $element, $value) { @@ -273,6 +289,7 @@ final public function toJson(int $options = 79): string * * @link https://php.net/manual/en/serializable.unserialize.php * @param mixed $serialized + * @return void */ final public function unserialize($serialized) { diff --git a/src/Phalcon/Security.php b/src/Phalcon/Security.php index eb791bf6..07809558 100644 --- a/src/Phalcon/Security.php +++ b/src/Phalcon/Security.php @@ -1,10 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; use Phalcon\Di\AbstractInjectionAware; use Phalcon\Http\RequestInterface; use Phalcon\Security\Random; +use Phalcon\Session\ManagerInterface as SessionInterface; /** * This component provides a set of functions to improve the security in Phalcon @@ -171,7 +179,7 @@ public function getDefaultHash(): ?int /** * Returns a secure random number generator instance * - * @return \Phalcon\Security\Random + * @return Random */ public function getRandom(): Random { @@ -279,14 +287,14 @@ public function setRandomBytes(int $randomBytes): Security } /** - * @return null|\Phalcon\Http\RequestInterface + * @return mixed */ private function getLocalRequest(): ?RequestInterface { } /** - * @return null|\Phalcon\Session\ManagerInterface + * @return mixed */ private function getLocalSession(): ?SessionInterface { diff --git a/src/Phalcon/Security/Exception.php b/src/Phalcon/Security/Exception.php new file mode 100644 index 00000000..d382be1a --- /dev/null +++ b/src/Phalcon/Security/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Security; + +/** + * Phalcon\Security\Exception + * + * Exceptions thrown in Phalcon\Security will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/security/Random.php b/src/Phalcon/Security/Random.php similarity index 97% rename from src/Phalcon/security/Random.php rename to src/Phalcon/Security/Random.php index 08449196..0c309003 100644 --- a/src/Phalcon/security/Random.php +++ b/src/Phalcon/Security/Random.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Security; /** @@ -86,11 +93,11 @@ class Random * echo $random->base58(); // 4kUgL2pdQMSCQtjE * ``` * + * @see \Phalcon\Security\Random:base64 + * @link https://en.wikipedia.org/wiki/Base58 + * @throws Exception If secure random number generator is not available or unexpected partial read * @param int $len * @return string - * @throws Exception If secure random number generator is not available or unexpected partial read - * @link https://en.wikipedia.org/wiki/Base58 - * @see \Phalcon\Security\Random:base64 */ public function base58(int $len = null): string { @@ -112,10 +119,10 @@ public function base58(int $len = null): string * echo $random->base62(); // z0RkwHfh8ErDM1xw * ``` * + * @see \Phalcon\Security\Random:base58 + * @throws Exception If secure random number generator is not available or unexpected partial read * @param int $len * @return string - * @throws Exception If secure random number generator is not available or unexpected partial read - * @see \Phalcon\Security\Random:base58 */ public function base62(int $len = null): string { @@ -134,9 +141,9 @@ public function base62(int $len = null): string * echo $random->base64(12); // 3rcq39QzGK9fUqh8 * ``` * + * @throws Exception If secure random number generator is not available or unexpected partial read * @param int $len * @return string - * @throws Exception If secure random number generator is not available or unexpected partial read */ public function base64(int $len = null): string { @@ -186,9 +193,9 @@ public function base64Safe(int $len = null, bool $padding = false): string * // Possible output: string(32) "00f6c04b144b41fad6a59111c126e1ee" * ``` * + * @throws Exception If secure random number generator is not available or unexpected partial read * @param int $len * @return string - * @throws Exception If secure random number generator is not available or unexpected partial read */ public function bytes(int $len = 16): string { @@ -206,9 +213,9 @@ public function bytes(int $len = 16): string * echo $random->hex(10); // a29f470508d5ccb8e289 * ``` * + * @throws Exception If secure random number generator is not available or unexpected partial read * @param int $len * @return string - * @throws Exception If secure random number generator is not available or unexpected partial read */ public function hex(int $len = null): string { @@ -225,9 +232,9 @@ public function hex(int $len = null): string * echo $random->number(16); // 8 * ``` * + * @throws Exception If secure random number generator is not available, unexpected partial read or $len <= 0 * @param int $len * @return int - * @throws Exception If secure random number generator is not available, unexpected partial read or $len <= 0 */ public function number(int $len): int { @@ -266,11 +273,11 @@ public function uuid(): string * * If $n is not specified, 16 is assumed. It may be larger in future. * + * @throws Exception If secure random number generator is not available or unexpected partial read * @param string $alphabet * @param int $base * @param mixed $n * @return string - * @throws Exception If secure random number generator is not available or unexpected partial read */ protected function base(string $alphabet, int $base, $n = null): string { diff --git a/src/Phalcon/session/adapter/AbstractAdapter.php b/src/Phalcon/Session/Adapter/AbstractAdapter.php similarity index 85% rename from src/Phalcon/session/adapter/AbstractAdapter.php rename to src/Phalcon/Session/Adapter/AbstractAdapter.php index 7b73851e..e0d4fc6e 100644 --- a/src/Phalcon/session/adapter/AbstractAdapter.php +++ b/src/Phalcon/Session/Adapter/AbstractAdapter.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Session\Adapter; use Phalcon\Storage\Adapter\AdapterInterface; diff --git a/src/Phalcon/session/adapter/Libmemcached.php b/src/Phalcon/Session/Adapter/Libmemcached.php similarity index 53% rename from src/Phalcon/session/adapter/Libmemcached.php rename to src/Phalcon/Session/Adapter/Libmemcached.php index 7ebded2f..248cb73d 100644 --- a/src/Phalcon/session/adapter/Libmemcached.php +++ b/src/Phalcon/Session/Adapter/Libmemcached.php @@ -1,11 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Session\Adapter; /** * Phalcon\Session\Adapter\Libmemcached */ -class Libmemcached extends AbstractAdapter +class Libmemcached extends \Phalcon\Session\Adapter\AbstractAdapter { /** diff --git a/src/Phalcon/session/adapter/Noop.php b/src/Phalcon/Session/Adapter/Noop.php similarity index 89% rename from src/Phalcon/session/adapter/Noop.php rename to src/Phalcon/Session/Adapter/Noop.php index d324e104..ffd12844 100644 --- a/src/Phalcon/session/adapter/Noop.php +++ b/src/Phalcon/Session/Adapter/Noop.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Session\Adapter; /** diff --git a/src/Phalcon/session/adapter/Redis.php b/src/Phalcon/Session/Adapter/Redis.php similarity index 53% rename from src/Phalcon/session/adapter/Redis.php rename to src/Phalcon/Session/Adapter/Redis.php index 12df0d78..9a013a2d 100644 --- a/src/Phalcon/session/adapter/Redis.php +++ b/src/Phalcon/Session/Adapter/Redis.php @@ -1,11 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Session\Adapter; /** * Phalcon\Session\Adapter\Redis */ -class Redis extends AbstractAdapter +class Redis extends \Phalcon\Session\Adapter\AbstractAdapter { /** diff --git a/src/Phalcon/session/adapter/Stream.php b/src/Phalcon/Session/Adapter/Stream.php similarity index 85% rename from src/Phalcon/session/adapter/Stream.php rename to src/Phalcon/Session/Adapter/Stream.php index 8ab1e0bf..d1f9cebd 100644 --- a/src/Phalcon/session/adapter/Stream.php +++ b/src/Phalcon/Session/Adapter/Stream.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Session\Adapter; /** @@ -56,9 +63,9 @@ public function gc($maxlifetime): bool /** * Ignore the savePath and use local defined path * + * @return bool * @param mixed $savePath * @param mixed $sessionName - * @return bool */ public function open($savePath, $sessionName): bool { diff --git a/src/Phalcon/session/Bag.php b/src/Phalcon/Session/Bag.php similarity index 81% rename from src/Phalcon/session/Bag.php rename to src/Phalcon/Session/Bag.php index 14ae6175..5e2d1468 100644 --- a/src/Phalcon/session/Bag.php +++ b/src/Phalcon/Session/Bag.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Session; use Phalcon\Collection; @@ -42,6 +49,8 @@ public function __construct(string $name) /** * Destroys the session bag + * + * @return void */ public function clear() { @@ -50,7 +59,7 @@ public function clear() /** * Returns the DependencyInjector container * - * @return \Phalcon\Di\DiInterface + * @return DiInterface */ public function getDI(): DiInterface { @@ -60,6 +69,7 @@ public function getDI(): DiInterface * Removes a property from the internal bag * * @param array $data + * @return void */ public function init(array $data = array()) { @@ -69,6 +79,7 @@ public function init(array $data = array()) * Removes a property from the internal bag * * @param string $element + * @return void */ public function remove(string $element) { @@ -79,6 +90,7 @@ public function remove(string $element) * * @param string $element * @param mixed $value + * @return void */ public function set(string $element, $value) { @@ -88,6 +100,7 @@ public function set(string $element, $value) * Sets the DependencyInjector container * * @param \Phalcon\Di\DiInterface $container + * @return void */ public function setDI(\Phalcon\Di\DiInterface $container) { diff --git a/src/Phalcon/Session/Exception.php b/src/Phalcon/Session/Exception.php new file mode 100644 index 00000000..5a48add9 --- /dev/null +++ b/src/Phalcon/Session/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Session; + +/** + * Phalcon\Session\Exception + * + * Exceptions thrown in Phalcon\Session will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/session/Manager.php b/src/Phalcon/Session/Manager.php similarity index 90% rename from src/Phalcon/session/Manager.php rename to src/Phalcon/Session/Manager.php index 83df12cc..bb3c27dd 100644 --- a/src/Phalcon/session/Manager.php +++ b/src/Phalcon/Session/Manager.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Session; use InvalidArgumentException; @@ -68,6 +75,7 @@ public function __isset(string $key): bool * * @param string $key * @param mixed $value + * @return void */ public function __set(string $key, $value) { @@ -77,6 +85,7 @@ public function __set(string $key, $value) * Alias: Removes a session variable from an application context * * @param string $key + * @return void */ public function __unset(string $key) { @@ -84,6 +93,8 @@ public function __unset(string $key) /** * Destroy/end a session + * + * @return void */ public function destroy() { @@ -113,7 +124,7 @@ public function get(string $key, $defaultValue = null, bool $remove = false) /** * Returns the stored session adapter * - * @return \SessionHandlerInterface + * @return SessionHandlerInterface */ public function getAdapter(): SessionHandlerInterface { @@ -160,7 +171,7 @@ public function getOptions(): array * Regenerates the session id using the adapter. * * @param mixed $deleteOldSession - * @return \Phalcon\Session\ManagerInterface + * @return ManagerInterface */ public function regenerateId($deleteOldSession = true): ManagerInterface { @@ -170,6 +181,7 @@ public function regenerateId($deleteOldSession = true): ManagerInterface * Removes a session variable from an application context * * @param string $key + * @return void */ public function remove(string $key) { @@ -180,6 +192,7 @@ public function remove(string $key) * * @param string $key * @param mixed $value + * @return void */ public function set(string $key, $value) { @@ -189,7 +202,7 @@ public function set(string $key, $value) * Set the adapter for the session * * @param \SessionHandlerInterface $adapter - * @return \Phalcon\Session\ManagerInterface + * @return ManagerInterface */ public function setAdapter(\SessionHandlerInterface $adapter): ManagerInterface { @@ -199,7 +212,7 @@ public function setAdapter(\SessionHandlerInterface $adapter): ManagerInterface * Set session Id * * @param string $id - * @return \Phalcon\Session\ManagerInterface + * @return ManagerInterface */ public function setId(string $id): ManagerInterface { @@ -210,9 +223,9 @@ public function setId(string $id): ManagerInterface * and do not allow poop names * * @param string $name * - * @return Manager * @throws InvalidArgumentException * + * @return Manager */ public function setName(string $name): ManagerInterface { @@ -222,6 +235,7 @@ public function setName(string $name): ManagerInterface * Sets session's options * * @param array $options + * @return void */ public function setOptions(array $options) { diff --git a/src/Phalcon/session/ManagerInterface.php b/src/Phalcon/Session/ManagerInterface.php similarity index 90% rename from src/Phalcon/session/ManagerInterface.php rename to src/Phalcon/Session/ManagerInterface.php index 2d0e35b5..8be38a03 100644 --- a/src/Phalcon/session/ManagerInterface.php +++ b/src/Phalcon/Session/ManagerInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Session; use InvalidArgumentException; @@ -43,6 +50,7 @@ public function __isset(string $key): bool; * * @param string $key * @param mixed $value + * @return void */ public function __set(string $key, $value); @@ -50,6 +58,7 @@ public function __set(string $key, $value); * Alias: Removes a session variable from an application context * * @param string $key + * @return void */ public function __unset(string $key); @@ -62,6 +71,8 @@ public function exists(): bool; /** * Destroy/end a session + * + * @return void */ public function destroy(); @@ -85,7 +96,7 @@ public function getId(): string; /** * Returns the stored session adapter * - * @return \SessionHandlerInterface + * @return SessionHandlerInterface */ public function getAdapter(): SessionHandlerInterface; @@ -115,6 +126,7 @@ public function has(string $key): bool; * Removes a session variable from an application context * * @param string $key + * @return void */ public function remove(string $key); @@ -123,6 +135,7 @@ public function remove(string $key); * * @param string $key * @param mixed $value + * @return void */ public function set(string $key, $value); @@ -146,9 +159,9 @@ public function setId(string $id): ManagerInterface; * Set the session name. Throw exception if the session has started * and do not allow poop names * + * @throws InvalidArgumentException * @param string $name * @return ManagerInterface - * @throws InvalidArgumentException */ public function setName(string $name): ManagerInterface; @@ -156,6 +169,7 @@ public function setName(string $name): ManagerInterface; * Sets session's options * * @param array $options + * @return void */ public function setOptions(array $options); diff --git a/src/Phalcon/storage/adapter/AbstractAdapter.php b/src/Phalcon/Storage/Adapter/AbstractAdapter.php similarity index 94% rename from src/Phalcon/storage/adapter/AbstractAdapter.php rename to src/Phalcon/Storage/Adapter/AbstractAdapter.php index 94256425..acf1b438 100644 --- a/src/Phalcon/storage/adapter/AbstractAdapter.php +++ b/src/Phalcon/Storage/Adapter/AbstractAdapter.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage\Adapter; use DateInterval; @@ -209,6 +216,8 @@ protected function getUnserializedData($content, $defaultValue = null) /** * Initializes the serializer + * + * @return void */ protected function initSerializer() { diff --git a/src/Phalcon/storage/adapter/AdapterInterface.php b/src/Phalcon/Storage/Adapter/AdapterInterface.php similarity index 88% rename from src/Phalcon/storage/adapter/AdapterInterface.php rename to src/Phalcon/Storage/Adapter/AdapterInterface.php index 5e182da4..5c3bc3f0 100644 --- a/src/Phalcon/storage/adapter/AdapterInterface.php +++ b/src/Phalcon/Storage/Adapter/AdapterInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage\Adapter; /** diff --git a/src/Phalcon/storage/adapter/Apcu.php b/src/Phalcon/Storage/Adapter/Apcu.php similarity index 79% rename from src/Phalcon/storage/adapter/Apcu.php rename to src/Phalcon/Storage/Adapter/Apcu.php index 48c4b88b..b7b68ef1 100644 --- a/src/Phalcon/storage/adapter/Apcu.php +++ b/src/Phalcon/Storage/Adapter/Apcu.php @@ -1,11 +1,18 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage\Adapter; /** * Apcu adapter */ -class Apcu extends AbstractAdapter +class Apcu extends \Phalcon\Storage\Adapter\AbstractAdapter { /** * @var array @@ -36,7 +43,7 @@ public function clear(): bool * Decrements a stored number * * @param string $key - * @param int $value + * @param int $value * * @return bool|int */ @@ -59,7 +66,7 @@ public function delete(string $key): bool * Reads data from the adapter * * @param string $key - * @param null $defaultValue + * @param null $defaultValue * * @return mixed */ @@ -68,10 +75,9 @@ public function get(string $key, $defaultValue = null) } /** - * Returns the already connected adapter or connects to the Memcached - * server(s) + * Always returns null * - * @return mixed + * @return null */ public function getAdapter() { @@ -101,7 +107,7 @@ public function has(string $key): bool * Increments a stored number * * @param string $key - * @param int $value + * @param int $value * * @return bool|int */ @@ -113,8 +119,8 @@ public function increment(string $key, int $value = 1) * Stores data in the adapter * * @param string $key - * @param mixed $value - * @param null $ttl + * @param mixed $value + * @param null $ttl * * @return bool * @throws \Exception diff --git a/src/Phalcon/storage/adapter/Libmemcached.php b/src/Phalcon/Storage/Adapter/Libmemcached.php similarity index 85% rename from src/Phalcon/storage/adapter/Libmemcached.php rename to src/Phalcon/Storage/Adapter/Libmemcached.php index 0ea8caee..9977a0ec 100644 --- a/src/Phalcon/storage/adapter/Libmemcached.php +++ b/src/Phalcon/Storage/Adapter/Libmemcached.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage\Adapter; use Phalcon\Storage\Exception; @@ -7,7 +14,7 @@ /** * Libmemcached adapter */ -class Libmemcached extends AbstractAdapter +class Libmemcached extends \Phalcon\Storage\Adapter\AbstractAdapter { /** * @var array @@ -62,7 +69,7 @@ public function delete(string $key): bool * Reads data from the adapter * * @param string $key - * @param null $defaultValue + * @param null $defaultValue * * @return mixed * @throws Exception @@ -108,7 +115,7 @@ public function has(string $key): bool * Increments a stored number * * @param string $key - * @param int $value + * @param int $value * * @return bool|int * @throws Exception @@ -121,8 +128,8 @@ public function increment(string $key, int $value = 1) * Stores data in the adapter * * @param string $key - * @param mixed $value - * @param null $ttl + * @param mixed $value + * @param null $ttl * * @return bool * @throws Exception diff --git a/src/Phalcon/storage/adapter/Memory.php b/src/Phalcon/Storage/Adapter/Memory.php similarity index 80% rename from src/Phalcon/storage/adapter/Memory.php rename to src/Phalcon/Storage/Adapter/Memory.php index 10c77db9..91db861e 100644 --- a/src/Phalcon/storage/adapter/Memory.php +++ b/src/Phalcon/Storage/Adapter/Memory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage\Adapter; use Phalcon\Collection; @@ -7,7 +14,7 @@ /** * Memory adapter */ -class Memory extends AbstractAdapter +class Memory extends \Phalcon\Storage\Adapter\AbstractAdapter { /** * @var Collection @@ -43,7 +50,7 @@ public function clear(): bool * Decrements a stored number * * @param string $key - * @param int $value + * @param int $value * * @return bool|int */ @@ -65,7 +72,7 @@ public function delete(string $key): bool /** * Reads data from the adapter * - * @param string $key + * @param string $key * @param mixed|null $defaultValue * * @return mixed @@ -75,10 +82,9 @@ public function get(string $key, $defaultValue = null) } /** - * Returns the already connected adapter or connects to the Memcached - * server(s) + * Always returns null * - * @return mixed + * @return null */ public function getAdapter() { @@ -108,7 +114,7 @@ public function has(string $key): bool * Increments a stored number * * @param string $key - * @param int $value + * @param int $value * * @return bool|int */ @@ -120,8 +126,8 @@ public function increment(string $key, int $value = 1) * Stores data in the adapter * * @param string $key - * @param mixed $value - * @param null $ttl + * @param mixed $value + * @param null $ttl * * @return bool */ diff --git a/src/Phalcon/storage/adapter/Redis.php b/src/Phalcon/Storage/Adapter/Redis.php similarity index 84% rename from src/Phalcon/storage/adapter/Redis.php rename to src/Phalcon/Storage/Adapter/Redis.php index e110d1a2..b6baaec3 100644 --- a/src/Phalcon/storage/adapter/Redis.php +++ b/src/Phalcon/Storage/Adapter/Redis.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage\Adapter; use Phalcon\Storage\Exception; @@ -7,7 +14,7 @@ /** * Redis adapter */ -class Redis extends AbstractAdapter +class Redis extends \Phalcon\Storage\Adapter\AbstractAdapter { /** * @var array @@ -39,7 +46,7 @@ public function clear(): bool * Decrements a stored number * * @param string $key - * @param int $value + * @param int $value * * @return bool|int * @throws Exception @@ -64,7 +71,7 @@ public function delete(string $key): bool * Reads data from the adapter * * @param string $key - * @param null $defaultValue + * @param null $defaultValue * * @return mixed * @throws Exception @@ -74,7 +81,7 @@ public function get(string $key, $defaultValue = null) } /** - * Returns the already connected adapter or connects to the Memcached + * Returns the already connected adapter or connects to the Redis * server(s) * * @return mixed|\Redis @@ -110,7 +117,7 @@ public function has(string $key): bool * Increments a stored number * * @param string $key - * @param int $value + * @param int $value * * @return bool|int * @throws Exception @@ -123,8 +130,8 @@ public function increment(string $key, int $value = 1) * Stores data in the adapter * * @param string $key - * @param mixed $value - * @param null $ttl + * @param mixed $value + * @param null $ttl * * @return bool * @throws Exception diff --git a/src/Phalcon/storage/adapter/Stream.php b/src/Phalcon/Storage/Adapter/Stream.php similarity index 86% rename from src/Phalcon/storage/adapter/Stream.php rename to src/Phalcon/Storage/Adapter/Stream.php index 6279bd5e..61222306 100644 --- a/src/Phalcon/storage/adapter/Stream.php +++ b/src/Phalcon/Storage/Adapter/Stream.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage\Adapter; use Iterator; @@ -8,7 +15,7 @@ /** * Stream adapter */ -class Stream extends AbstractAdapter +class Stream extends \Phalcon\Storage\Adapter\AbstractAdapter { /** * @var string @@ -31,8 +38,8 @@ class Stream extends AbstractAdapter * * @param array $options * - * @param \Phalcon\Storage\SerializerFactory $factory * @throws Exception + * @param \Phalcon\Storage\SerializerFactory $factory */ public function __construct(\Phalcon\Storage\SerializerFactory $factory = null, array $options = array()) { @@ -51,7 +58,7 @@ public function clear(): bool * Decrements a stored number * * @param string $key - * @param int $value + * @param int $value * * @return bool|int * @throws \Exception @@ -75,7 +82,7 @@ public function delete(string $key): bool * Reads data from the adapter * * @param string $key - * @param null $defaultValue + * @param null $defaultValue * * @return mixed|null */ @@ -84,10 +91,9 @@ public function get(string $key, $defaultValue = null) } /** - * Returns the already connected adapter or connects to the Memcached - * server(s) + * Always returns null * - * @return mixed + * @return null */ public function getAdapter() { @@ -117,7 +123,7 @@ public function has(string $key): bool * Increments a stored number * * @param string $key - * @param int $value + * @param int $value * * @return bool|int * @throws \Exception @@ -130,8 +136,8 @@ public function increment(string $key, int $value = 1) * Stores data in the adapter * * @param string $key - * @param mixed $value - * @param null $ttl + * @param mixed $value + * @param null $ttl * * @return bool * @throws \Exception @@ -165,7 +171,7 @@ private function getFilepath(string $key): string * Returns an iterator for the directory contents * * @param string $dir - * @return \Iterator + * @return Iterator */ private function getIterator(string $dir): Iterator { diff --git a/src/Phalcon/storage/AdapterFactory.php b/src/Phalcon/Storage/AdapterFactory.php similarity index 69% rename from src/Phalcon/storage/AdapterFactory.php rename to src/Phalcon/Storage/AdapterFactory.php index dd7887d1..099c16b5 100644 --- a/src/Phalcon/storage/AdapterFactory.php +++ b/src/Phalcon/Storage/AdapterFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage; use Phalcon\Factory\AbstractFactory; @@ -24,10 +31,10 @@ class AdapterFactory extends AbstractFactory /** * AdapterFactory constructor. * - * @param \Phalcon\Storage\SerializerFactory $factory + * @param SerializerFactory $factory * @param array $services */ - public function __construct(\Phalcon\Storage\SerializerFactory $factory = null, array $services = array()) + public function __construct(SerializerFactory $factory = null, array $services = array()) { } @@ -36,7 +43,7 @@ public function __construct(\Phalcon\Storage\SerializerFactory $factory = null, * * @param string $name * @param array $options - * @return \Phalcon\Storage\Adapter\AdapterInterface + * @return AdapterInterface */ public function newInstance(string $name, array $options = array()): AdapterInterface { diff --git a/src/Phalcon/Storage/Exception.php b/src/Phalcon/Storage/Exception.php new file mode 100644 index 00000000..8026ddee --- /dev/null +++ b/src/Phalcon/Storage/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Storage; + +/** + * Phalcon\Storage\Exception + * + * Exceptions thrown in Phalcon\Storage will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/storage/serializer/AbstractSerializer.php b/src/Phalcon/Storage/Serializer/AbstractSerializer.php similarity index 79% rename from src/Phalcon/storage/serializer/AbstractSerializer.php rename to src/Phalcon/Storage/Serializer/AbstractSerializer.php index 205118eb..7dbe671d 100644 --- a/src/Phalcon/storage/serializer/AbstractSerializer.php +++ b/src/Phalcon/Storage/Serializer/AbstractSerializer.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage\Serializer; /** @@ -46,6 +53,7 @@ public function getData() /** * @param mixed $data + * @return void */ public function setData($data) { diff --git a/src/Phalcon/storage/serializer/Base64.php b/src/Phalcon/Storage/Serializer/Base64.php similarity index 62% rename from src/Phalcon/storage/serializer/Base64.php rename to src/Phalcon/Storage/Serializer/Base64.php index ac8ebb63..45363d98 100644 --- a/src/Phalcon/storage/serializer/Base64.php +++ b/src/Phalcon/Storage/Serializer/Base64.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage\Serializer; /** @@ -10,7 +17,7 @@ * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ -class Base64 extends AbstractSerializer +class Base64 extends \Phalcon\Storage\Serializer\AbstractSerializer { /** @@ -26,6 +33,7 @@ public function serialize(): string * Unserializes data * * @param mixed $data + * @return void */ public function unserialize($data) { diff --git a/src/Phalcon/storage/serializer/Igbinary.php b/src/Phalcon/Storage/Serializer/Igbinary.php similarity index 62% rename from src/Phalcon/storage/serializer/Igbinary.php rename to src/Phalcon/Storage/Serializer/Igbinary.php index 5ae29919..c3db0cbe 100644 --- a/src/Phalcon/storage/serializer/Igbinary.php +++ b/src/Phalcon/Storage/Serializer/Igbinary.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage\Serializer; /** @@ -10,7 +17,7 @@ * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ -class Igbinary extends AbstractSerializer +class Igbinary extends \Phalcon\Storage\Serializer\AbstractSerializer { /** @@ -26,6 +33,7 @@ public function serialize(): string * Unserializes data * * @param mixed $data + * @return void */ public function unserialize($data) { diff --git a/src/Phalcon/storage/serializer/Json.php b/src/Phalcon/Storage/Serializer/Json.php similarity index 62% rename from src/Phalcon/storage/serializer/Json.php rename to src/Phalcon/Storage/Serializer/Json.php index 98601157..6695c299 100644 --- a/src/Phalcon/storage/serializer/Json.php +++ b/src/Phalcon/Storage/Serializer/Json.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage\Serializer; /** @@ -10,7 +17,7 @@ * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ -class Json extends AbstractSerializer +class Json extends \Phalcon\Storage\Serializer\AbstractSerializer { /** @@ -26,6 +33,7 @@ public function serialize(): string * Unserializes data * * @param mixed $data + * @return void */ public function unserialize($data) { diff --git a/src/Phalcon/storage/serializer/Msgpack.php b/src/Phalcon/Storage/Serializer/Msgpack.php similarity index 62% rename from src/Phalcon/storage/serializer/Msgpack.php rename to src/Phalcon/Storage/Serializer/Msgpack.php index 7b5cc9f0..44c730ea 100644 --- a/src/Phalcon/storage/serializer/Msgpack.php +++ b/src/Phalcon/Storage/Serializer/Msgpack.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage\Serializer; /** @@ -10,7 +17,7 @@ * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ -class Msgpack extends AbstractSerializer +class Msgpack extends \Phalcon\Storage\Serializer\AbstractSerializer { /** @@ -26,6 +33,7 @@ public function serialize(): ?string * Unserializes data * * @param mixed $data + * @return void */ public function unserialize($data) { diff --git a/src/Phalcon/storage/serializer/None.php b/src/Phalcon/Storage/Serializer/None.php similarity index 62% rename from src/Phalcon/storage/serializer/None.php rename to src/Phalcon/Storage/Serializer/None.php index 4887eb92..141510a0 100644 --- a/src/Phalcon/storage/serializer/None.php +++ b/src/Phalcon/Storage/Serializer/None.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage\Serializer; /** @@ -10,7 +17,7 @@ * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ -class None extends AbstractSerializer +class None extends \Phalcon\Storage\Serializer\AbstractSerializer { /** @@ -26,6 +33,7 @@ public function serialize(): string * Unserializes data * * @param mixed $data + * @return void */ public function unserialize($data) { diff --git a/src/Phalcon/storage/serializer/Php.php b/src/Phalcon/Storage/Serializer/Php.php similarity index 62% rename from src/Phalcon/storage/serializer/Php.php rename to src/Phalcon/Storage/Serializer/Php.php index 07a289c5..40355084 100644 --- a/src/Phalcon/storage/serializer/Php.php +++ b/src/Phalcon/Storage/Serializer/Php.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage\Serializer; /** @@ -10,7 +17,7 @@ * For the full copyright and license information, please view the LICENSE.txt * file that was distributed with this source code. */ -class Php extends AbstractSerializer +class Php extends \Phalcon\Storage\Serializer\AbstractSerializer { /** @@ -26,6 +33,7 @@ public function serialize(): string * Unserializes data * * @param mixed $data + * @return void */ public function unserialize($data) { diff --git a/src/Phalcon/storage/serializer/SerializerInterface.php b/src/Phalcon/Storage/Serializer/SerializerInterface.php similarity index 66% rename from src/Phalcon/storage/serializer/SerializerInterface.php rename to src/Phalcon/Storage/Serializer/SerializerInterface.php index e70bde5d..50a28a44 100644 --- a/src/Phalcon/storage/serializer/SerializerInterface.php +++ b/src/Phalcon/Storage/Serializer/SerializerInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage\Serializer; /** @@ -20,6 +27,7 @@ public function getData(); /** * @param mixed $data + * @return void */ public function setData($data); } diff --git a/src/Phalcon/storage/SerializerFactory.php b/src/Phalcon/Storage/SerializerFactory.php similarity index 78% rename from src/Phalcon/storage/SerializerFactory.php rename to src/Phalcon/Storage/SerializerFactory.php index a2d1ccd9..0ae0be18 100644 --- a/src/Phalcon/storage/SerializerFactory.php +++ b/src/Phalcon/Storage/SerializerFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Storage; use Phalcon\Factory\AbstractFactory; diff --git a/src/Phalcon/Tag.php b/src/Phalcon/Tag.php index c4b1e65b..bced6d14 100644 --- a/src/Phalcon/Tag.php +++ b/src/Phalcon/Tag.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; use Phalcon\Di\DiInterface; @@ -87,6 +94,7 @@ class Tag * Appends a text to current document title * * @param mixed $title + * @return void */ public static function appendTitle($title) { @@ -147,6 +155,7 @@ public static function dateTimeLocalField($parameters): string * * @param string $id * @param mixed $value + * @return void */ public static function displayTo(string $id, $value) { @@ -217,7 +226,7 @@ public static function getDocType(): string * Obtains the 'escaper' service if required * * @param array $params - * @return null|\Phalcon\Escaper\EscaperInterface + * @return mixed */ public static function getEscaper(array $params): ?EscaperInterface { @@ -226,7 +235,7 @@ public static function getEscaper(array $params): ?EscaperInterface /** * Internally gets the request dispatcher * - * @return \Phalcon\Di\DiInterface + * @return DiInterface */ public static function getDI(): DiInterface { @@ -235,7 +244,7 @@ public static function getDI(): DiInterface /** * Returns an Escaper service from the default DI * - * @return \Phalcon\Escaper\EscaperInterface + * @return EscaperInterface */ public static function getEscaperService(): EscaperInterface { @@ -264,7 +273,7 @@ public static function getTitleSeparator(): string /** * Returns a URL service from the default DI * - * @return \Phalcon\Url\UrlInterface + * @return UrlInterface */ public static function getUrlService(): UrlInterface { @@ -380,6 +389,7 @@ public static function passwordField($parameters): string * Prepends a text to current document title * * @param mixed $title + * @return void */ public static function prependTitle($title) { @@ -433,6 +443,7 @@ public static function renderTitle(bool $prepend = true, bool $append = true): s * * @deprecated Will be removed in 4.0.0 * @deprecated + * @return void */ public static function resetInput() { @@ -474,6 +485,7 @@ public static function selectStatic($parameters, $data = null): string * Set autoescape mode in generated html * * @param bool $autoescape + * @return void */ public static function setAutoescape(bool $autoescape) { @@ -484,6 +496,7 @@ public static function setAutoescape(bool $autoescape) * * @param string $id * @param mixed $value + * @return void */ public static function setDefault(string $id, $value) { @@ -494,6 +507,7 @@ public static function setDefault(string $id, $value) * * @param array $values * @param bool $merge + * @return void */ public static function setDefaults(array $values, bool $merge = false) { @@ -503,6 +517,7 @@ public static function setDefaults(array $values, bool $merge = false) * Sets the dependency injector container. * * @param \Phalcon\Di\DiInterface $container + * @return void */ public static function setDI(\Phalcon\Di\DiInterface $container) { @@ -512,6 +527,7 @@ public static function setDI(\Phalcon\Di\DiInterface $container) * Set the document type of content * * @param int $doctype + * @return void */ public static function setDocType(int $doctype) { @@ -521,6 +537,7 @@ public static function setDocType(int $doctype) * Set the title of view content * * @param string $title + * @return void */ public static function setTitle(string $title) { @@ -530,6 +547,7 @@ public static function setTitle(string $title) * Set the title separator of view content * * @param string $titleSeparator + * @return void */ public static function setTitleSeparator(string $titleSeparator) { diff --git a/src/Phalcon/Tag/Exception.php b/src/Phalcon/Tag/Exception.php new file mode 100644 index 00000000..2a322cc7 --- /dev/null +++ b/src/Phalcon/Tag/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Tag; + +/** + * Phalcon\Tag\Exception + * + * Exceptions thrown in Phalcon\Tag will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/tag/Select.php b/src/Phalcon/Tag/Select.php similarity index 83% rename from src/Phalcon/tag/Select.php rename to src/Phalcon/Tag/Select.php index 4d7fbcef..687c9fa7 100644 --- a/src/Phalcon/tag/Select.php +++ b/src/Phalcon/Tag/Select.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Tag; /** diff --git a/src/Phalcon/Text.php b/src/Phalcon/Text.php index e5971794..38a3a944 100644 --- a/src/Phalcon/Text.php +++ b/src/Phalcon/Text.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; /** diff --git a/src/Phalcon/translate/adapter/AbstractAdapter.php b/src/Phalcon/Translate/Adapter/AbstractAdapter.php similarity index 89% rename from src/Phalcon/translate/adapter/AbstractAdapter.php rename to src/Phalcon/Translate/Adapter/AbstractAdapter.php index 61eb811a..5c2cb5c4 100644 --- a/src/Phalcon/translate/adapter/AbstractAdapter.php +++ b/src/Phalcon/Translate/Adapter/AbstractAdapter.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Translate\Adapter; use Phalcon\Translate\InterpolatorFactory; @@ -66,6 +73,7 @@ public function offsetGet($translateKey) * * @param string $value * @param mixed $offset + * @return void */ public function offsetSet($offset, $value) { @@ -75,6 +83,7 @@ public function offsetSet($offset, $value) * Unsets a translation from the dictionary * * @param mixed $offset + * @return void */ public function offsetUnset($offset) { diff --git a/src/Phalcon/translate/adapter/AdapterInterface.php b/src/Phalcon/Translate/Adapter/AdapterInterface.php similarity index 79% rename from src/Phalcon/translate/adapter/AdapterInterface.php rename to src/Phalcon/Translate/Adapter/AdapterInterface.php index d3e246e6..c1de0bfc 100644 --- a/src/Phalcon/translate/adapter/AdapterInterface.php +++ b/src/Phalcon/Translate/Adapter/AdapterInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Translate\Adapter; /** diff --git a/src/Phalcon/translate/adapter/Csv.php b/src/Phalcon/Translate/Adapter/Csv.php similarity index 78% rename from src/Phalcon/translate/adapter/Csv.php rename to src/Phalcon/Translate/Adapter/Csv.php index 42cf4523..5410eead 100644 --- a/src/Phalcon/translate/adapter/Csv.php +++ b/src/Phalcon/Translate/Adapter/Csv.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Translate\Adapter; /** @@ -7,7 +14,7 @@ * * Allows to define translation lists using CSV file */ -class Csv extends AbstractAdapter implements \ArrayAccess +class Csv extends \Phalcon\Translate\Adapter\AbstractAdapter implements \ArrayAccess { /** * @var array @@ -53,6 +60,7 @@ public function query(string $index, array $placeholders = array()): string * @param int $length * @param string $delimiter * @param string $enclosure + * @return void */ private function load(string $file, int $length, string $delimiter, string $enclosure) { diff --git a/src/Phalcon/translate/adapter/Gettext.php b/src/Phalcon/Translate/Adapter/Gettext.php similarity index 91% rename from src/Phalcon/translate/adapter/Gettext.php rename to src/Phalcon/Translate/Adapter/Gettext.php index 9c4cfd96..c6f706e3 100644 --- a/src/Phalcon/translate/adapter/Gettext.php +++ b/src/Phalcon/Translate/Adapter/Gettext.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Translate\Adapter; /** @@ -20,7 +27,7 @@ * * Allows translate using gettext */ -class Gettext extends AbstractAdapter implements \ArrayAccess +class Gettext extends \Phalcon\Translate\Adapter\AbstractAdapter implements \ArrayAccess { /** * @var int @@ -135,6 +142,7 @@ public function resetDomain(): string * Sets the domain default to search within when calls are made to gettext() * * @param string $domain + * @return void */ public function setDefaultDomain(string $domain) { @@ -157,6 +165,7 @@ public function setDefaultDomain(string $domain) * ``` * * @param string|array $directory The directory path or an array of directories and domains + * @return void */ public function setDirectory($directory) { @@ -204,6 +213,7 @@ protected function getOptionsDefault(): array * Validator for constructor * * @param array $options + * @return void */ protected function prepareOptions(array $options) { diff --git a/src/Phalcon/translate/adapter/NativeArray.php b/src/Phalcon/Translate/Adapter/NativeArray.php similarity index 79% rename from src/Phalcon/translate/adapter/NativeArray.php rename to src/Phalcon/Translate/Adapter/NativeArray.php index b61536af..09ff3e20 100644 --- a/src/Phalcon/translate/adapter/NativeArray.php +++ b/src/Phalcon/Translate/Adapter/NativeArray.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Translate\Adapter; /** @@ -7,7 +14,7 @@ * * Allows to define translation lists using PHP arrays */ -class NativeArray extends AbstractAdapter implements \ArrayAccess +class NativeArray extends \Phalcon\Translate\Adapter\AbstractAdapter implements \ArrayAccess { /** * @var array diff --git a/src/Phalcon/Translate/Exception.php b/src/Phalcon/Translate/Exception.php new file mode 100644 index 00000000..2c13440f --- /dev/null +++ b/src/Phalcon/Translate/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Translate; + +/** + * Phalcon\Translate\Exception + * + * Class for exceptions thrown by Phalcon\Translate + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/translate/interpolator/AssociativeArray.php b/src/Phalcon/Translate/Interpolator/AssociativeArray.php similarity index 74% rename from src/Phalcon/translate/interpolator/AssociativeArray.php rename to src/Phalcon/Translate/Interpolator/AssociativeArray.php index f38fa2ff..ea3aad8e 100644 --- a/src/Phalcon/translate/interpolator/AssociativeArray.php +++ b/src/Phalcon/Translate/Interpolator/AssociativeArray.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Translate\Interpolator; /** diff --git a/src/Phalcon/translate/interpolator/IndexedArray.php b/src/Phalcon/Translate/Interpolator/IndexedArray.php similarity index 74% rename from src/Phalcon/translate/interpolator/IndexedArray.php rename to src/Phalcon/Translate/Interpolator/IndexedArray.php index d1bf80ab..d363ba26 100644 --- a/src/Phalcon/translate/interpolator/IndexedArray.php +++ b/src/Phalcon/Translate/Interpolator/IndexedArray.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Translate\Interpolator; /** diff --git a/src/Phalcon/translate/interpolator/InterpolatorInterface.php b/src/Phalcon/Translate/Interpolator/InterpolatorInterface.php similarity index 66% rename from src/Phalcon/translate/interpolator/InterpolatorInterface.php rename to src/Phalcon/Translate/Interpolator/InterpolatorInterface.php index 81c5972a..e3ab9ade 100644 --- a/src/Phalcon/translate/interpolator/InterpolatorInterface.php +++ b/src/Phalcon/Translate/Interpolator/InterpolatorInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Translate\Interpolator; /** diff --git a/src/Phalcon/translate/InterpolatorFactory.php b/src/Phalcon/Translate/InterpolatorFactory.php similarity index 78% rename from src/Phalcon/translate/InterpolatorFactory.php rename to src/Phalcon/Translate/InterpolatorFactory.php index 2b8f0d68..1a2657ba 100644 --- a/src/Phalcon/translate/InterpolatorFactory.php +++ b/src/Phalcon/Translate/InterpolatorFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Translate; use Phalcon\Factory\AbstractFactory; @@ -39,7 +46,7 @@ public function __construct(array $services = array()) * Create a new instance of the adapter * * @param string $name - * @return \Phalcon\Translate\Adapter\AdapterInterface + * @return AdapterInterface */ public function newInstance(string $name): AdapterInterface { diff --git a/src/Phalcon/translate/TranslateFactory.php b/src/Phalcon/Translate/TranslateFactory.php similarity index 72% rename from src/Phalcon/translate/TranslateFactory.php rename to src/Phalcon/Translate/TranslateFactory.php index bb89fff5..fbdb6200 100644 --- a/src/Phalcon/translate/TranslateFactory.php +++ b/src/Phalcon/Translate/TranslateFactory.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Translate; use Phalcon\Factory\AbstractFactory; @@ -24,10 +31,10 @@ class TranslateFactory extends AbstractFactory /** * AdapterFactory constructor. * - * @param \Phalcon\Translate\InterpolatorFactory $interpolator + * @param InterpolatorFactory $interpolator * @param array $services */ - public function __construct(\Phalcon\Translate\InterpolatorFactory $interpolator, array $services = array()) + public function __construct(InterpolatorFactory $interpolator, array $services = array()) { } @@ -46,7 +53,7 @@ public function load($config) * * @param string $name * @param array $options - * @return \Phalcon\Translate\Adapter\AdapterInterface + * @return AdapterInterface */ public function newInstance(string $name, array $options = array()): AdapterInterface { diff --git a/src/Phalcon/Url.php b/src/Phalcon/Url.php index b5786583..60223859 100644 --- a/src/Phalcon/Url.php +++ b/src/Phalcon/Url.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; use Phalcon\Di\AbstractInjectionAware; @@ -153,7 +160,7 @@ public function getStaticBaseUri(): string * ``` * * @param string $basePath - * @return \Phalcon\Url\UrlInterface + * @return UrlInterface */ public function setBasePath(string $basePath): UrlInterface { @@ -169,7 +176,7 @@ public function setBasePath(string $basePath): UrlInterface * ``` * * @param string $baseUri - * @return \Phalcon\Url\UrlInterface + * @return UrlInterface */ public function setBaseUri(string $baseUri): UrlInterface { @@ -183,7 +190,7 @@ public function setBaseUri(string $baseUri): UrlInterface * ``` * * @param string $staticBaseUri - * @return \Phalcon\Url\UrlInterface + * @return UrlInterface */ public function setStaticBaseUri(string $staticBaseUri): UrlInterface { diff --git a/src/Phalcon/Url/Exception.php b/src/Phalcon/Url/Exception.php new file mode 100644 index 00000000..6e425288 --- /dev/null +++ b/src/Phalcon/Url/Exception.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Url; + +/** + * Phalcon\Url\Exception + * + * Exceptions thrown in Phalcon\Url will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/url/UrlInterface.php b/src/Phalcon/Url/UrlInterface.php similarity index 84% rename from src/Phalcon/url/UrlInterface.php rename to src/Phalcon/Url/UrlInterface.php index c7d6b3a6..3a25a9f8 100644 --- a/src/Phalcon/url/UrlInterface.php +++ b/src/Phalcon/Url/UrlInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Url; /** diff --git a/src/Phalcon/Validation.php b/src/Phalcon/Validation.php index 99644012..ed18b42d 100644 --- a/src/Phalcon/Validation.php +++ b/src/Phalcon/Validation.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; use Phalcon\Di\Injectable; @@ -36,6 +43,7 @@ class Validation extends Injectable implements \Phalcon\Validation\ValidationInt protected $values; + public function getData() { } @@ -61,7 +69,7 @@ public function __construct(array $validators = array()) * * @param mixed $field * @param \Phalcon\Validation\ValidatorInterface $validator - * @return \Phalcon\Validation\ValidationInterface + * @return ValidationInterface */ public function add($field, \Phalcon\Validation\ValidatorInterface $validator): ValidationInterface { @@ -71,7 +79,7 @@ public function add($field, \Phalcon\Validation\ValidatorInterface $validator): * Appends a message to the messages list * * @param \Phalcon\Messages\MessageInterface $message - * @return \Phalcon\Validation\ValidationInterface + * @return ValidationInterface */ public function appendMessage(\Phalcon\Messages\MessageInterface $message): ValidationInterface { @@ -83,7 +91,7 @@ public function appendMessage(\Phalcon\Messages\MessageInterface $message): Vali * * @param object $entity * @param array|object $data - * @return \Phalcon\Validation\ValidationInterface + * @return ValidationInterface */ public function bind($entity, $data): ValidationInterface { @@ -121,7 +129,7 @@ public function getLabel($field): string /** * Returns the registered validators * - * @return \Phalcon\Messages\Messages + * @return Messages */ public function getMessages(): Messages { @@ -151,7 +159,7 @@ public function getValue(string $field) * * @param mixed $field * @param \Phalcon\Validation\ValidatorInterface $validator - * @return \Phalcon\Validation\ValidationInterface + * @return ValidationInterface */ public function rule($field, \Phalcon\Validation\ValidatorInterface $validator): ValidationInterface { @@ -162,7 +170,7 @@ public function rule($field, \Phalcon\Validation\ValidatorInterface $validator): * * @param mixed $field * @param array $validators - * @return \Phalcon\Validation\ValidationInterface + * @return ValidationInterface */ public function rules($field, array $validators): ValidationInterface { @@ -172,6 +180,7 @@ public function rules($field, array $validators): ValidationInterface * Sets the bound entity * * @param object $entity + * @return void */ public function setEntity($entity) { @@ -182,7 +191,7 @@ public function setEntity($entity) * * @param string $field * @param array|string $filters - * @return \Phalcon\Validation\ValidationInterface + * @return ValidationInterface */ public function setFilters($field, $filters): ValidationInterface { @@ -192,6 +201,7 @@ public function setFilters($field, $filters): ValidationInterface * Adds labels for fields * * @param array $labels + * @return void */ public function setLabels(array $labels) { @@ -202,7 +212,7 @@ public function setLabels(array $labels) * * @param array|object $data * @param object $entity - * @return \Phalcon\Messages\Messages + * @return Messages */ public function validate($data = null, $entity = null): Messages { diff --git a/src/Phalcon/Validation/AbstractCombinedFieldsValidator.php b/src/Phalcon/Validation/AbstractCombinedFieldsValidator.php new file mode 100644 index 00000000..f75e0a48 --- /dev/null +++ b/src/Phalcon/Validation/AbstractCombinedFieldsValidator.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Validation; + +/** + * This is a base class for combined fields validators + */ +abstract class AbstractCombinedFieldsValidator extends \Phalcon\Validation\AbstractValidator +{ + +} diff --git a/src/Phalcon/validation/AbstractValidator.php b/src/Phalcon/Validation/AbstractValidator.php similarity index 92% rename from src/Phalcon/validation/AbstractValidator.php rename to src/Phalcon/Validation/AbstractValidator.php index 1a0bc25b..92f00e49 100644 --- a/src/Phalcon/validation/AbstractValidator.php +++ b/src/Phalcon/Validation/AbstractValidator.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation; use Phalcon\Messages\Message; @@ -39,9 +46,9 @@ public function __construct(array $options = array()) /** * Get the template message * - * @param string $field * @return string * @throw InvalidArgumentException When the field does not exists + * @param string $field */ public function getTemplate(string $field = null): string { @@ -59,8 +66,8 @@ public function getTemplates(): array /** * Clear current templates and set new from an array, * - * @param array $templates * @return ValidatorInterface + * @param array $templates */ public function setTemplates(array $templates): ValidatorInterface { @@ -69,8 +76,8 @@ public function setTemplates(array $templates): ValidatorInterface /** * Set a new template message * - * @param string $template * @return ValidatorInterface + * @param string $template */ public function setTemplate(string $template): ValidatorInterface { @@ -103,6 +110,7 @@ public function hasOption(string $key): bool * * @param string $key * @param mixed $value + * @return void */ public function setOption(string $key, $value) { @@ -141,12 +149,12 @@ protected function prepareLabel(\Phalcon\Validation $validation, string $field) /** * Create a default message by factory * - * @param \Phalcon\Validation $validation - * @param mixed $field - * @param array $replacements * @return Message * * @throw Exception + * @param \Phalcon\Validation $validation + * @param mixed $field + * @param array $replacements */ public function messageFactory(\Phalcon\Validation $validation, $field, array $replacements = array()): Message { diff --git a/src/Phalcon/validation/AbstractValidatorComposite.php b/src/Phalcon/Validation/AbstractValidatorComposite.php similarity index 74% rename from src/Phalcon/validation/AbstractValidatorComposite.php rename to src/Phalcon/Validation/AbstractValidatorComposite.php index 842ec995..b1180f8d 100644 --- a/src/Phalcon/validation/AbstractValidatorComposite.php +++ b/src/Phalcon/Validation/AbstractValidatorComposite.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation; /** diff --git a/src/Phalcon/Validation/Exception.php b/src/Phalcon/Validation/Exception.php new file mode 100644 index 00000000..44c0dce8 --- /dev/null +++ b/src/Phalcon/Validation/Exception.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Validation; + +/** + * Exceptions thrown in Phalcon\Validation\ classes will use this class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/validation/ValidationInterface.php b/src/Phalcon/Validation/ValidationInterface.php similarity index 82% rename from src/Phalcon/validation/ValidationInterface.php rename to src/Phalcon/Validation/ValidationInterface.php index 260f0862..d8a7caf5 100644 --- a/src/Phalcon/validation/ValidationInterface.php +++ b/src/Phalcon/Validation/ValidationInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation; use Phalcon\Messages\Messages; @@ -14,10 +21,10 @@ interface ValidationInterface * Adds a validator to a field * * @param string $field - * @param \Phalcon\Validation\ValidatorInterface $validator + * @param ValidatorInterface $validator * @return ValidationInterface */ - public function add(string $field, \Phalcon\Validation\ValidatorInterface $validator): ValidationInterface; + public function add(string $field, ValidatorInterface $validator): ValidationInterface; /** * Appends a message to the messages list @@ -63,7 +70,7 @@ public function getLabel(string $field): string; /** * Returns the registered validators * - * @return \Phalcon\Messages\Messages + * @return Messages */ public function getMessages(): Messages; @@ -86,10 +93,10 @@ public function getValue(string $field); * Alias of `add` method * * @param string $field - * @param \Phalcon\Validation\ValidatorInterface $validator + * @param ValidatorInterface $validator * @return ValidationInterface */ - public function rule(string $field, \Phalcon\Validation\ValidatorInterface $validator): ValidationInterface; + public function rule(string $field, ValidatorInterface $validator): ValidationInterface; /** * Adds the validators to a field @@ -113,6 +120,7 @@ public function setFilters(string $field, $filters): ValidationInterface; * Adds labels for fields * * @param array $labels + * @return void */ public function setLabels(array $labels); @@ -121,7 +129,7 @@ public function setLabels(array $labels); * * @param array|object $data * @param object $entity - * @return \Phalcon\Messages\Messages + * @return Messages */ public function validate($data = null, $entity = null): Messages; } diff --git a/src/Phalcon/validation/validator/Alnum.php b/src/Phalcon/Validation/Validator/Alnum.php similarity index 84% rename from src/Phalcon/validation/validator/Alnum.php rename to src/Phalcon/Validation/Validator/Alnum.php index c42de8bd..bdd79a8b 100644 --- a/src/Phalcon/validation/validator/Alnum.php +++ b/src/Phalcon/Validation/Validator/Alnum.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/Alpha.php b/src/Phalcon/Validation/Validator/Alpha.php similarity index 83% rename from src/Phalcon/validation/validator/Alpha.php rename to src/Phalcon/Validation/Validator/Alpha.php index 890bd985..64b374fd 100644 --- a/src/Phalcon/validation/validator/Alpha.php +++ b/src/Phalcon/Validation/Validator/Alpha.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/Between.php b/src/Phalcon/Validation/Validator/Between.php similarity index 87% rename from src/Phalcon/validation/validator/Between.php rename to src/Phalcon/Validation/Validator/Between.php index 8c59ea02..40ecc261 100644 --- a/src/Phalcon/validation/validator/Between.php +++ b/src/Phalcon/Validation/Validator/Between.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/Callback.php b/src/Phalcon/Validation/Validator/Callback.php similarity index 87% rename from src/Phalcon/validation/validator/Callback.php rename to src/Phalcon/Validation/Validator/Callback.php index d9ed74af..3187fafb 100644 --- a/src/Phalcon/validation/validator/Callback.php +++ b/src/Phalcon/Validation/Validator/Callback.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/Confirmation.php b/src/Phalcon/Validation/Validator/Confirmation.php similarity index 87% rename from src/Phalcon/validation/validator/Confirmation.php rename to src/Phalcon/Validation/Validator/Confirmation.php index 294f6d93..da86e02f 100644 --- a/src/Phalcon/validation/validator/Confirmation.php +++ b/src/Phalcon/Validation/Validator/Confirmation.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/CreditCard.php b/src/Phalcon/Validation/Validator/CreditCard.php similarity index 86% rename from src/Phalcon/validation/validator/CreditCard.php rename to src/Phalcon/Validation/Validator/CreditCard.php index bfc588b7..be542d77 100644 --- a/src/Phalcon/validation/validator/CreditCard.php +++ b/src/Phalcon/Validation/Validator/CreditCard.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/Date.php b/src/Phalcon/Validation/Validator/Date.php similarity index 86% rename from src/Phalcon/validation/validator/Date.php rename to src/Phalcon/Validation/Validator/Date.php index 538b51c1..7f73687e 100644 --- a/src/Phalcon/validation/validator/Date.php +++ b/src/Phalcon/Validation/Validator/Date.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/Digit.php b/src/Phalcon/Validation/Validator/Digit.php similarity index 82% rename from src/Phalcon/validation/validator/Digit.php rename to src/Phalcon/Validation/Validator/Digit.php index c09dc3cc..c98a06d5 100644 --- a/src/Phalcon/validation/validator/Digit.php +++ b/src/Phalcon/Validation/Validator/Digit.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/Email.php b/src/Phalcon/Validation/Validator/Email.php similarity index 83% rename from src/Phalcon/validation/validator/Email.php rename to src/Phalcon/Validation/Validator/Email.php index 1b537ecb..9d783851 100644 --- a/src/Phalcon/validation/validator/Email.php +++ b/src/Phalcon/Validation/Validator/Email.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/Validation/Validator/Exception.php b/src/Phalcon/Validation/Validator/Exception.php new file mode 100644 index 00000000..d6afa040 --- /dev/null +++ b/src/Phalcon/Validation/Validator/Exception.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ +namespace Phalcon\Validation\Validator; + +/** + * Exceptions thrown in Phalcon\Validation\Validator\ classes will use this + * class + */ +class Exception extends \Phalcon\Exception +{ + +} diff --git a/src/Phalcon/validation/validator/ExclusionIn.php b/src/Phalcon/Validation/Validator/ExclusionIn.php similarity index 86% rename from src/Phalcon/validation/validator/ExclusionIn.php rename to src/Phalcon/Validation/Validator/ExclusionIn.php index 4933c82a..48552430 100644 --- a/src/Phalcon/validation/validator/ExclusionIn.php +++ b/src/Phalcon/Validation/Validator/ExclusionIn.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/File.php b/src/Phalcon/Validation/Validator/File.php similarity index 91% rename from src/Phalcon/validation/validator/File.php rename to src/Phalcon/Validation/Validator/File.php index 9aef43c4..8e036ab0 100644 --- a/src/Phalcon/validation/validator/File.php +++ b/src/Phalcon/Validation/Validator/File.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidatorComposite; diff --git a/src/Phalcon/validation/validator/file/AbstractFile.php b/src/Phalcon/Validation/Validator/File/AbstractFile.php similarity index 94% rename from src/Phalcon/validation/validator/file/AbstractFile.php rename to src/Phalcon/Validation/Validator/File/AbstractFile.php index a787dddc..849cd591 100644 --- a/src/Phalcon/validation/validator/file/AbstractFile.php +++ b/src/Phalcon/Validation/Validator/File/AbstractFile.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator\File; use Phalcon\Validation; diff --git a/src/Phalcon/validation/validator/file/MimeType.php b/src/Phalcon/Validation/Validator/File/MimeType.php similarity index 83% rename from src/Phalcon/validation/validator/file/MimeType.php rename to src/Phalcon/Validation/Validator/File/MimeType.php index 777c08be..443c35bd 100644 --- a/src/Phalcon/validation/validator/file/MimeType.php +++ b/src/Phalcon/Validation/Validator/File/MimeType.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator\File; use Phalcon\Validation; @@ -52,7 +59,7 @@ * ); * ``` */ -class MimeType extends AbstractFile +class MimeType extends \Phalcon\Validation\Validator\File\AbstractFile { protected $template = 'File :field must be of type: :types'; diff --git a/src/Phalcon/validation/validator/file/resolution/Equal.php b/src/Phalcon/Validation/Validator/File/Resolution/Equal.php similarity index 86% rename from src/Phalcon/validation/validator/file/resolution/Equal.php rename to src/Phalcon/Validation/Validator/File/Resolution/Equal.php index 8c266d16..a12f6db2 100644 --- a/src/Phalcon/validation/validator/file/resolution/Equal.php +++ b/src/Phalcon/Validation/Validator/File/Resolution/Equal.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator\File\Resolution; use Phalcon\Validation\Validator\File\AbstractFile; diff --git a/src/Phalcon/validation/validator/file/resolution/Max.php b/src/Phalcon/Validation/Validator/File/Resolution/Max.php similarity index 87% rename from src/Phalcon/validation/validator/file/resolution/Max.php rename to src/Phalcon/Validation/Validator/File/Resolution/Max.php index af9715d6..24db0706 100644 --- a/src/Phalcon/validation/validator/file/resolution/Max.php +++ b/src/Phalcon/Validation/Validator/File/Resolution/Max.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator\File\Resolution; use Phalcon\Validation\Validator\File\AbstractFile; diff --git a/src/Phalcon/validation/validator/file/resolution/Min.php b/src/Phalcon/Validation/Validator/File/Resolution/Min.php similarity index 87% rename from src/Phalcon/validation/validator/file/resolution/Min.php rename to src/Phalcon/Validation/Validator/File/Resolution/Min.php index 75e48df5..35a093c6 100644 --- a/src/Phalcon/validation/validator/file/resolution/Min.php +++ b/src/Phalcon/Validation/Validator/File/Resolution/Min.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator\File\Resolution; use Phalcon\Validation\Validator\File\AbstractFile; diff --git a/src/Phalcon/validation/validator/file/size/Equal.php b/src/Phalcon/Validation/Validator/File/Size/Equal.php similarity index 86% rename from src/Phalcon/validation/validator/file/size/Equal.php rename to src/Phalcon/Validation/Validator/File/Size/Equal.php index 852b0144..1974832e 100644 --- a/src/Phalcon/validation/validator/file/size/Equal.php +++ b/src/Phalcon/Validation/Validator/File/Size/Equal.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator\File\Size; use Phalcon\Validation\Validator\File\AbstractFile; diff --git a/src/Phalcon/validation/validator/file/size/Max.php b/src/Phalcon/Validation/Validator/File/Size/Max.php similarity index 86% rename from src/Phalcon/validation/validator/file/size/Max.php rename to src/Phalcon/Validation/Validator/File/Size/Max.php index 7465186a..48d4aebf 100644 --- a/src/Phalcon/validation/validator/file/size/Max.php +++ b/src/Phalcon/Validation/Validator/File/Size/Max.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator\File\Size; use Phalcon\Validation\Validator\File\AbstractFile; diff --git a/src/Phalcon/validation/validator/file/size/Min.php b/src/Phalcon/Validation/Validator/File/Size/Min.php similarity index 86% rename from src/Phalcon/validation/validator/file/size/Min.php rename to src/Phalcon/Validation/Validator/File/Size/Min.php index 01383b3b..621a0439 100644 --- a/src/Phalcon/validation/validator/file/size/Min.php +++ b/src/Phalcon/Validation/Validator/File/Size/Min.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator\File\Size; use Phalcon\Validation\Validator\File\AbstractFile; diff --git a/src/Phalcon/validation/validator/Identical.php b/src/Phalcon/Validation/Validator/Identical.php similarity index 85% rename from src/Phalcon/validation/validator/Identical.php rename to src/Phalcon/Validation/Validator/Identical.php index b3299ff1..4091901f 100644 --- a/src/Phalcon/validation/validator/Identical.php +++ b/src/Phalcon/Validation/Validator/Identical.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/InclusionIn.php b/src/Phalcon/Validation/Validator/InclusionIn.php similarity index 85% rename from src/Phalcon/validation/validator/InclusionIn.php rename to src/Phalcon/Validation/Validator/InclusionIn.php index 05a1c725..68e790e9 100644 --- a/src/Phalcon/validation/validator/InclusionIn.php +++ b/src/Phalcon/Validation/Validator/InclusionIn.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/Ip.php b/src/Phalcon/Validation/Validator/Ip.php similarity index 90% rename from src/Phalcon/validation/validator/Ip.php rename to src/Phalcon/Validation/Validator/Ip.php index ccfddd67..1ed667e6 100644 --- a/src/Phalcon/validation/validator/Ip.php +++ b/src/Phalcon/Validation/Validator/Ip.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/Numericality.php b/src/Phalcon/Validation/Validator/Numericality.php similarity index 82% rename from src/Phalcon/validation/validator/Numericality.php rename to src/Phalcon/Validation/Validator/Numericality.php index d991fcb4..e7443a15 100644 --- a/src/Phalcon/validation/validator/Numericality.php +++ b/src/Phalcon/Validation/Validator/Numericality.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/PresenceOf.php b/src/Phalcon/Validation/Validator/PresenceOf.php similarity index 82% rename from src/Phalcon/validation/validator/PresenceOf.php rename to src/Phalcon/Validation/Validator/PresenceOf.php index c0002357..9b7e57a4 100644 --- a/src/Phalcon/validation/validator/PresenceOf.php +++ b/src/Phalcon/Validation/Validator/PresenceOf.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/Regex.php b/src/Phalcon/Validation/Validator/Regex.php similarity index 86% rename from src/Phalcon/validation/validator/Regex.php rename to src/Phalcon/Validation/Validator/Regex.php index c25b6ecf..03fbc77d 100644 --- a/src/Phalcon/validation/validator/Regex.php +++ b/src/Phalcon/Validation/Validator/Regex.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/StringLength.php b/src/Phalcon/Validation/Validator/StringLength.php similarity index 90% rename from src/Phalcon/validation/validator/StringLength.php rename to src/Phalcon/Validation/Validator/StringLength.php index b3b7a984..1e332e06 100644 --- a/src/Phalcon/validation/validator/StringLength.php +++ b/src/Phalcon/Validation/Validator/StringLength.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidatorComposite; diff --git a/src/Phalcon/validation/validator/stringlength/Max.php b/src/Phalcon/Validation/Validator/StringLength/Max.php similarity index 87% rename from src/Phalcon/validation/validator/stringlength/Max.php rename to src/Phalcon/Validation/Validator/StringLength/Max.php index 6dfb16a1..d7a6e675 100644 --- a/src/Phalcon/validation/validator/stringlength/Max.php +++ b/src/Phalcon/Validation/Validator/StringLength/Max.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator\StringLength; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/stringlength/Min.php b/src/Phalcon/Validation/Validator/StringLength/Min.php similarity index 87% rename from src/Phalcon/validation/validator/stringlength/Min.php rename to src/Phalcon/Validation/Validator/StringLength/Min.php index 5c77a755..93a22fa2 100644 --- a/src/Phalcon/validation/validator/stringlength/Min.php +++ b/src/Phalcon/Validation/Validator/StringLength/Min.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator\StringLength; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/validator/Uniqueness.php b/src/Phalcon/Validation/Validator/Uniqueness.php similarity index 92% rename from src/Phalcon/validation/validator/Uniqueness.php rename to src/Phalcon/Validation/Validator/Uniqueness.php index dd3b39cf..4ded9900 100644 --- a/src/Phalcon/validation/validator/Uniqueness.php +++ b/src/Phalcon/Validation/Validator/Uniqueness.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractCombinedFieldsValidator; diff --git a/src/Phalcon/validation/validator/Url.php b/src/Phalcon/Validation/Validator/Url.php similarity index 82% rename from src/Phalcon/validation/validator/Url.php rename to src/Phalcon/Validation/Validator/Url.php index 3872318a..19f47564 100644 --- a/src/Phalcon/validation/validator/Url.php +++ b/src/Phalcon/Validation/Validator/Url.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation\Validator; use Phalcon\Validation\AbstractValidator; diff --git a/src/Phalcon/validation/ValidatorCompositeInterface.php b/src/Phalcon/Validation/ValidatorCompositeInterface.php similarity index 68% rename from src/Phalcon/validation/ValidatorCompositeInterface.php rename to src/Phalcon/Validation/ValidatorCompositeInterface.php index 602bef4d..cb532dfc 100644 --- a/src/Phalcon/validation/ValidatorCompositeInterface.php +++ b/src/Phalcon/Validation/ValidatorCompositeInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation; /** diff --git a/src/Phalcon/validation/ValidatorFactory.php b/src/Phalcon/Validation/ValidatorFactory.php similarity index 65% rename from src/Phalcon/validation/ValidatorFactory.php rename to src/Phalcon/Validation/ValidatorFactory.php index 955bd259..d1253674 100644 --- a/src/Phalcon/validation/ValidatorFactory.php +++ b/src/Phalcon/Validation/ValidatorFactory.php @@ -1,8 +1,16 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation; use Phalcon\Factory\AbstractFactory; +use Phalcon\Factory\ValidatorInterface; /** * This file is part of the Phalcon Framework. @@ -28,9 +36,9 @@ public function __construct(array $services = array()) * Creates a new instance * * @param string $name - * @return mixed + * @return ValidatorInterface */ - public function newInstance(string $name) + public function newInstance(string $name): ValidatorInterface { } diff --git a/src/Phalcon/validation/ValidatorInterface.php b/src/Phalcon/Validation/ValidatorInterface.php similarity index 87% rename from src/Phalcon/validation/ValidatorInterface.php rename to src/Phalcon/Validation/ValidatorInterface.php index f1848f02..2019197f 100644 --- a/src/Phalcon/validation/ValidatorInterface.php +++ b/src/Phalcon/Validation/ValidatorInterface.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon\Validation; /** @@ -12,35 +19,35 @@ interface ValidatorInterface * Returns an option in the validator's options * Returns null if the option hasn't set * + * @return mixed * @param string $key * @param mixed $defaultValue - * @return mixed */ public function getOption(string $key, $defaultValue = null); /** * Checks if an option is defined * - * @param string $key * @return boolean + * @param string $key */ public function hasOption(string $key): bool; /** * Executes the validation * + * @return boolean * @param \Phalcon\Validation $validation * @param mixed $field - * @return boolean */ public function validate(\Phalcon\Validation $validation, $field): bool; /** * Get the template message * - * @param string $field * @return string * @throw InvalidArgumentException When the field does not exists + * @param string $field */ public function getTemplate(string $field): string; @@ -54,16 +61,16 @@ public function getTemplates(): array; /** * Clear current template and set new from an array, * - * @param array $templates * @return ValidatorInterface + * @param array $templates */ public function setTemplates(array $templates): ValidatorInterface; /** * Set a new temlate message * - * @param string $template * @return ValidatorInterface + * @param string $template */ public function setTemplate(string $template): ValidatorInterface; } diff --git a/src/Phalcon/Version.php b/src/Phalcon/Version.php index 237ed367..f9904425 100644 --- a/src/Phalcon/Version.php +++ b/src/Phalcon/Version.php @@ -1,5 +1,12 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ namespace Phalcon; /** diff --git a/src/Phalcon/acl/Enum.php b/src/Phalcon/acl/Enum.php deleted file mode 100644 index a81e1a28..00000000 --- a/src/Phalcon/acl/Enum.php +++ /dev/null @@ -1,15 +0,0 @@ - Robots::find(), - * "limit" => 25, - * "page" => $currentPage, - * ] - * ); - * - * $paginate = $paginator->paginate(); - * ``` - */ -class Model extends AbstractAdapter -{ - - /** - * Returns a slice of the resultset to show in the pagination - * - * @return \Phalcon\Paginator\RepositoryInterface - */ - public function paginate(): RepositoryInterface - { - } -} diff --git a/src/Phalcon/security/Exception.php b/src/Phalcon/security/Exception.php deleted file mode 100644 index c13eabd7..00000000 --- a/src/Phalcon/security/Exception.php +++ /dev/null @@ -1,13 +0,0 @@ -