From 582e5ffacfa24e9a5500c5191258a8f44a0263a3 Mon Sep 17 00:00:00 2001 From: Ruud Boon Date: Sat, 21 Sep 2019 20:28:40 +0200 Subject: [PATCH 01/12] Styling fix changelog --- CHANGELOG-4.0.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG-4.0.md b/CHANGELOG-4.0.md index 79aff5d8dcd..1b063c2f2f0 100644 --- a/CHANGELOG-4.0.md +++ b/CHANGELOG-4.0.md @@ -33,8 +33,8 @@ - Fixed `Phalcon\Flash\*` interfaces for `message()` to return `string/null` [#14349](https://github.com/phalcon/cphalcon/issues/14349) - Fixed `Phalcon\Paginator\Adapter\AbstractAdapter` throw exception if `limit <= 0` [#14303](https://github.com/phalcon/cphalcon/issues/14303) - Fixed `Phalcon\Mvc\Model\Query\Builder` Empty table alias in query [#14366](https://github.com/phalcon/cphalcon/issues/14366) -- Fixed `Phalcon/Db/Adapter/PdoFactory` to reference the correct interface [#14381](https://github.com/phalcon/cphalcon/pull/14381) -- Fixed `Phalcon/Db/Dialect/Mysql` Fixed missing schema in constraint for create table [#14378](https://github.com/phalcon/cphalcon/issues/14378) +- Fixed `Phalcon\Db\Adapter\PdoFactory` to reference the correct interface [#14381](https://github.com/phalcon/cphalcon/pull/14381) +- Fixed `Phalcon\Db\Dialect\Mysql` Fixed missing schema in constraint for create table [#14378](https://github.com/phalcon/cphalcon/issues/14378) - Fixed `Phalcon\Mvc\Model::hasChanged()` and `getChangedFields()` returning false values when `castOnHydrate` option is on. [#14376](https://github.com/phalcon/cphalcon/issues/14376) ## Removed From cf2a47b7139f8ad56366b5cfa7c89023f7b382b8 Mon Sep 17 00:00:00 2001 From: Ruud Boon Date: Mon, 23 Sep 2019 13:15:52 +0200 Subject: [PATCH 02/12] EventsManagerInterface declared twice --- phalcon/Mvc/Model.zep | 1 - 1 file changed, 1 deletion(-) diff --git a/phalcon/Mvc/Model.zep b/phalcon/Mvc/Model.zep index 143de0729d1..307a92b0dc3 100644 --- a/phalcon/Mvc/Model.zep +++ b/phalcon/Mvc/Model.zep @@ -41,7 +41,6 @@ use Phalcon\Mvc\Model\TransactionInterface; use Phalcon\Mvc\Model\ValidationFailed; use Phalcon\Mvc\ModelInterface; use Phalcon\Validation\ValidationInterface; -use Phalcon\Events\ManagerInterface as EventsManagerInterface; use Serializable; /** From cd7d74e9fbd90e929a2cfa590b27245c55d5b1dd Mon Sep 17 00:00:00 2001 From: Ruud Boon Date: Mon, 23 Sep 2019 14:56:21 +0200 Subject: [PATCH 03/12] - Interfaces cannot have final - Typo in inline class - Interface corrections for handle() - Styling fix --- phalcon/Application/AbstractApplication.zep | 2 +- phalcon/Assets/Inline.zep | 2 +- phalcon/Cli/Console.zep | 2 +- phalcon/Factory/AbstractFactory.zep | 2 +- phalcon/Helper/Fs.zep | 7 ++++--- phalcon/Http/RequestInterface.zep | 2 +- phalcon/Mvc/Model/ManagerInterface.zep | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/phalcon/Application/AbstractApplication.zep b/phalcon/Application/AbstractApplication.zep index 3eac802c1e5..344e732f914 100644 --- a/phalcon/Application/AbstractApplication.zep +++ b/phalcon/Application/AbstractApplication.zep @@ -94,7 +94,7 @@ abstract class AbstractApplication extends Injectable implements EventsAwareInte /** * Handles a request */ - abstract public function handle(); + abstract public function handle(string! uri) -> | bool; /** * Register an array of modules present in the application diff --git a/phalcon/Assets/Inline.zep b/phalcon/Assets/Inline.zep index 5bdc918fd87..6f973ba178d 100644 --- a/phalcon/Assets/Inline.zep +++ b/phalcon/Assets/Inline.zep @@ -17,7 +17,7 @@ namespace Phalcon\Assets; * $inline = new \Phalcon\Assets\Inline("js", "alert('hello world');"); *``` */ -class $Inline implements AssetInterface +class Inline implements AssetInterface { /** * @var array | null diff --git a/phalcon/Cli/Console.zep b/phalcon/Cli/Console.zep index 3b27e0d7b8b..bb966642a2a 100644 --- a/phalcon/Cli/Console.zep +++ b/phalcon/Cli/Console.zep @@ -34,7 +34,7 @@ class Console extends AbstractApplication /** * Handle the whole command-line tasks */ - public function handle(array arguments = null) + public function handle(string! arguments) -> | bool { var className, container, dispatcher, eventsManager, module, moduleName, moduleObject, modules, path, router, task; diff --git a/phalcon/Factory/AbstractFactory.zep b/phalcon/Factory/AbstractFactory.zep index 591c6db122a..a4cb4a14b20 100644 --- a/phalcon/Factory/AbstractFactory.zep +++ b/phalcon/Factory/AbstractFactory.zep @@ -13,7 +13,7 @@ namespace Phalcon\Factory; use Phalcon\Config; use Phalcon\Factory\Exception; -class AbstractFactory +abstract class AbstractFactory { /** * @var array diff --git a/phalcon/Helper/Fs.zep b/phalcon/Helper/Fs.zep index 1b098739219..b5a29599dc5 100644 --- a/phalcon/Helper/Fs.zep +++ b/phalcon/Helper/Fs.zep @@ -13,7 +13,8 @@ namespace Phalcon\Helper; /** * This class offers file operation helper */ -class Fs { +class Fs +{ /** * Gets the filename from a given path, Same as PHP's basename() but has non-ASCII support. @@ -30,8 +31,8 @@ class Fs { var filename, matches; let uri = rtrim(uri, DIRECTORY_SEPARATOR); let filename = preg_match( - "@[^" . preg_quote(DIRECTORY_SEPARATOR, "@") . "]+$@", - uri, + "@[^" . preg_quote(DIRECTORY_SEPARATOR, "@") . "]+$@", + uri, matches ) ? matches[0] : ""; if suffix { diff --git a/phalcon/Http/RequestInterface.zep b/phalcon/Http/RequestInterface.zep index 93c974a1e56..7d255a1dec7 100644 --- a/phalcon/Http/RequestInterface.zep +++ b/phalcon/Http/RequestInterface.zep @@ -191,7 +191,7 @@ interface RequestInterface * @param bool onlyPath If true, query part will be omitted * @return string */ - final public function getURI(bool onlyPath = false) -> string; + public function getURI(bool onlyPath = false) -> string; /** * Gets a variable from the $_POST superglobal applying filters if needed diff --git a/phalcon/Mvc/Model/ManagerInterface.zep b/phalcon/Mvc/Model/ManagerInterface.zep index 146d6c8cf61..9b78ed3644f 100644 --- a/phalcon/Mvc/Model/ManagerInterface.zep +++ b/phalcon/Mvc/Model/ManagerInterface.zep @@ -262,7 +262,7 @@ interface ManagerInterface * ); * ``` */ - final public function isVisibleModelProperty( model, string property) -> bool; + public function isVisibleModelProperty( model, string property) -> bool; /** * Sets if a model must keep snapshots From 8dd30b50e13c363725985e023806204a15323459 Mon Sep 17 00:00:00 2001 From: Ruud Boon Date: Mon, 23 Sep 2019 15:07:08 +0200 Subject: [PATCH 04/12] - Looks like $Inline was intentional --- phalcon/Assets/Inline.zep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phalcon/Assets/Inline.zep b/phalcon/Assets/Inline.zep index 6f973ba178d..5bdc918fd87 100644 --- a/phalcon/Assets/Inline.zep +++ b/phalcon/Assets/Inline.zep @@ -17,7 +17,7 @@ namespace Phalcon\Assets; * $inline = new \Phalcon\Assets\Inline("js", "alert('hello world');"); *``` */ -class Inline implements AssetInterface +class $Inline implements AssetInterface { /** * @var array | null From 18365c56090fb5d1aee7636a549793ce53df5919 Mon Sep 17 00:00:00 2001 From: Ruud Boon Date: Mon, 23 Sep 2019 15:32:59 +0200 Subject: [PATCH 05/12] - Cleanup Imports --- phalcon/Acl/Adapter/Memory.zep | 1 - phalcon/Annotations/Annotation.zep | 1 - phalcon/Forms/Element/Select.zep | 4 ++-- phalcon/Forms/Form.zep | 1 - phalcon/Image/Adapter/Imagick.zep | 1 - phalcon/Mvc/Model/Query.zep | 1 - phalcon/Mvc/ModelInterface.zep | 2 -- phalcon/Validation/Validator/File/Size/Equal.zep | 1 - phalcon/Validation/Validator/File/Size/Max.zep | 1 - phalcon/Validation/Validator/File/Size/Min.zep | 1 - 10 files changed, 2 insertions(+), 12 deletions(-) diff --git a/phalcon/Acl/Adapter/Memory.zep b/phalcon/Acl/Adapter/Memory.zep index 48a96573209..a808339ee6d 100644 --- a/phalcon/Acl/Adapter/Memory.zep +++ b/phalcon/Acl/Adapter/Memory.zep @@ -19,7 +19,6 @@ use Phalcon\Acl\Exception; use Phalcon\Events\Manager as EventsManager; use Phalcon\Acl\RoleAware; use Phalcon\Acl\ComponentAware; -use Phalcon\Acl\RoleInterface; use Phalcon\Acl\ComponentInterface; use ReflectionFunction; diff --git a/phalcon/Annotations/Annotation.zep b/phalcon/Annotations/Annotation.zep index 4425cf8ddad..739b80a69a0 100644 --- a/phalcon/Annotations/Annotation.zep +++ b/phalcon/Annotations/Annotation.zep @@ -10,7 +10,6 @@ namespace Phalcon\Annotations; -use Phalcon\Annotations\Annotation; use Phalcon\Annotations\Exception; /** diff --git a/phalcon/Forms/Element/Select.zep b/phalcon/Forms/Element/Select.zep index 534dda10c48..a928ef3a045 100644 --- a/phalcon/Forms/Element/Select.zep +++ b/phalcon/Forms/Element/Select.zep @@ -11,7 +11,7 @@ namespace Phalcon\Forms\Element; use Phalcon\Forms\Element\AbstractElement; -use Phalcon\Tag\Select; +use Phalcon\Tag\Select as SelectTag; /** * Phalcon\Forms\Element\Select @@ -73,7 +73,7 @@ class Select extends AbstractElement /** * Merged passed attributes with previously defined ones */ - return Select::selectField( + return SelectTag::selectField( this->prepareAttributes(attributes), this->optionsValues ); diff --git a/phalcon/Forms/Form.zep b/phalcon/Forms/Form.zep index 6bc74c54513..4677c65e49b 100644 --- a/phalcon/Forms/Form.zep +++ b/phalcon/Forms/Form.zep @@ -15,7 +15,6 @@ use Iterator; use Phalcon\Di\Injectable; use Phalcon\Di\DiInterface; use Phalcon\FilterInterface; -use Phalcon\Filter\FilterInterface; use Phalcon\Forms\Exception; use Phalcon\Forms\Element\ElementInterface; use Phalcon\Html\Attributes; diff --git a/phalcon/Image/Adapter/Imagick.zep b/phalcon/Image/Adapter/Imagick.zep index ac54337477c..14c36a6e0b4 100644 --- a/phalcon/Image/Adapter/Imagick.zep +++ b/phalcon/Image/Adapter/Imagick.zep @@ -10,7 +10,6 @@ namespace Phalcon\Image\Adapter; -use Imagick; use ImagickDraw; use ImagickPixel; use Phalcon\Image\Enum; diff --git a/phalcon/Mvc/Model/Query.zep b/phalcon/Mvc/Model/Query.zep index a6d18f009ec..a096dc72d13 100644 --- a/phalcon/Mvc/Model/Query.zep +++ b/phalcon/Mvc/Model/Query.zep @@ -30,7 +30,6 @@ use Phalcon\Di\InjectionAwareInterface; use Phalcon\Mvc\Model\RelationInterface; use Phalcon\Mvc\Model\TransactionInterface; use Phalcon\Db\DialectInterface; -use Phalcon\Cache\Adapter\AdapterInterface; /** * Phalcon\Mvc\Model\Query diff --git a/phalcon/Mvc/ModelInterface.zep b/phalcon/Mvc/ModelInterface.zep index 84d895f1f70..8bc6ec65264 100644 --- a/phalcon/Mvc/ModelInterface.zep +++ b/phalcon/Mvc/ModelInterface.zep @@ -13,11 +13,9 @@ use Phalcon\Db\Adapter\AdapterInterface; use Phalcon\Di\DiInterface; use Phalcon\Messages\MessageInterface; use Phalcon\Mvc\Model\CriteriaInterface; -use Phalcon\Mvc\Model\ModelInterface; use Phalcon\Mvc\Model\MetaDataInterface; use Phalcon\Mvc\Model\ResultsetInterface; use Phalcon\Mvc\Model\TransactionInterface; -use Phalcon\Mvc\ModelInterface; /** * Phalcon\Mvc\ModelInterface diff --git a/phalcon/Validation/Validator/File/Size/Equal.zep b/phalcon/Validation/Validator/File/Size/Equal.zep index e8ea0f3cf79..1b50357a259 100644 --- a/phalcon/Validation/Validator/File/Size/Equal.zep +++ b/phalcon/Validation/Validator/File/Size/Equal.zep @@ -12,7 +12,6 @@ namespace Phalcon\Validation\Validator\File\Size; use Phalcon\Messages\Message; use Phalcon\Validation; -use Phalcon\Validation\Validator\File\Size\Equal; use Phalcon\Validation\Validator\File\AbstractFile; /** diff --git a/phalcon/Validation/Validator/File/Size/Max.zep b/phalcon/Validation/Validator/File/Size/Max.zep index fdb8769ae42..7e3ca751fad 100644 --- a/phalcon/Validation/Validator/File/Size/Max.zep +++ b/phalcon/Validation/Validator/File/Size/Max.zep @@ -12,7 +12,6 @@ namespace Phalcon\Validation\Validator\File\Size; use Phalcon\Messages\Message; use Phalcon\Validation; -use Phalcon\Validation\Validator\File\Size\Max; use Phalcon\Validation\Validator\File\AbstractFile; /** diff --git a/phalcon/Validation/Validator/File/Size/Min.zep b/phalcon/Validation/Validator/File/Size/Min.zep index 94b88690429..6c7ac3ef099 100644 --- a/phalcon/Validation/Validator/File/Size/Min.zep +++ b/phalcon/Validation/Validator/File/Size/Min.zep @@ -12,7 +12,6 @@ namespace Phalcon\Validation\Validator\File\Size; use Phalcon\Messages\Message; use Phalcon\Validation; -use Phalcon\Validation\Validator\File\Size\Min; use Phalcon\Validation\Validator\File\AbstractFile; /** From 8f9e0eb8b04e62a8fc804beddadc6774fcbb8f6b Mon Sep 17 00:00:00 2001 From: Ruud Boon Date: Mon, 23 Sep 2019 15:42:56 +0200 Subject: [PATCH 06/12] Styling issue fix --- phalcon/Html/Attributes/RenderInterface.zep | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phalcon/Html/Attributes/RenderInterface.zep b/phalcon/Html/Attributes/RenderInterface.zep index 272acee8f25..dc769c5fd2c 100644 --- a/phalcon/Html/Attributes/RenderInterface.zep +++ b/phalcon/Html/Attributes/RenderInterface.zep @@ -14,7 +14,8 @@ namespace Phalcon\Html\Attributes; * * Interface Phalcon\Html\Attributes\RenderInterface */ -interface RenderInterface { +interface RenderInterface +{ /** * Generate a string represetation */ From 27ba1dcaea3ecbd23005cf5a9d433b3cc75cb223 Mon Sep 17 00:00:00 2001 From: Ruud Boon Date: Mon, 23 Sep 2019 15:48:18 +0200 Subject: [PATCH 07/12] - Fix Imagic use --- phalcon/Image/Adapter/Imagick.zep | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phalcon/Image/Adapter/Imagick.zep b/phalcon/Image/Adapter/Imagick.zep index 14c36a6e0b4..56c942fbae7 100644 --- a/phalcon/Image/Adapter/Imagick.zep +++ b/phalcon/Image/Adapter/Imagick.zep @@ -10,6 +10,7 @@ namespace Phalcon\Image\Adapter; +use Imagick as ImagicNative; use ImagickDraw; use ImagickPixel; use Phalcon\Image\Enum; @@ -104,7 +105,7 @@ class Imagick extends AbstractAdapter */ public function __destruct() { - if this->image instanceof \Imagick { + if this->image instanceof ImagicNative { this->image->clear(); this->image->destroy(); } From 0b0b9a24599ee52daebf0fc5854130b5325b5cc9 Mon Sep 17 00:00:00 2001 From: Ruud Boon Date: Mon, 23 Sep 2019 15:55:32 +0200 Subject: [PATCH 08/12] - Use ImagicNative alias - Fixed form --- phalcon/Forms/Form.zep | 2 +- phalcon/Image/Adapter/Imagick.zep | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/phalcon/Forms/Form.zep b/phalcon/Forms/Form.zep index 4677c65e49b..c7c246bf9bd 100644 --- a/phalcon/Forms/Form.zep +++ b/phalcon/Forms/Form.zep @@ -14,7 +14,7 @@ use Countable; use Iterator; use Phalcon\Di\Injectable; use Phalcon\Di\DiInterface; -use Phalcon\FilterInterface; +use Phalcon\Filter\FilterInterface; use Phalcon\Forms\Exception; use Phalcon\Forms\Element\ElementInterface; use Phalcon\Html\Attributes; diff --git a/phalcon/Image/Adapter/Imagick.zep b/phalcon/Image/Adapter/Imagick.zep index 56c942fbae7..2f9eb5680fa 100644 --- a/phalcon/Image/Adapter/Imagick.zep +++ b/phalcon/Image/Adapter/Imagick.zep @@ -50,7 +50,7 @@ class Imagick extends AbstractAdapter let this->file = file; - let this->image = new Imagick(); + let this->image = new ImagicNative(); if file_exists(this->file) { let this->realpath = realpath(this->file); @@ -138,7 +138,7 @@ class Imagick extends AbstractAdapter /** * Get instance */ - public function getInternalImInstance() -> <\Imagick> + public function getInternalImInstance() -> { return this->image; } @@ -166,7 +166,7 @@ class Imagick extends AbstractAdapter let pixel2 = new ImagickPixel("transparent"); - let background = new Imagick(); + let background = new ImagicNative(); this->image->setIteratorIndex(0); @@ -324,7 +324,7 @@ class Imagick extends AbstractAdapter { var mask, ret; - let mask = new Imagick(); + let mask = new ImagicNative(); mask->readImageBlob( image->render() @@ -417,7 +417,7 @@ class Imagick extends AbstractAdapter } let pseudo = fadeIn ? "gradient:black-transparent" : "gradient:transparent-black", - fade = new Imagick(); + fade = new ImagicNative(); fade->newPseudoImage( reflection->getImageWidth(), @@ -454,7 +454,7 @@ class Imagick extends AbstractAdapter fade->destroy(); - let image = new Imagick(), + let image = new ImagicNative(), pixel = new ImagickPixel(), height = this->image->getImageHeight() + height; @@ -808,7 +808,7 @@ class Imagick extends AbstractAdapter var watermark, ret; let opacity = opacity / 100, - watermark = new Imagick(); + watermark = new ImagicNative(); watermark->readImageBlob( image->render() From bfce6ef5db981e85ef046ea8431393c615454189 Mon Sep 17 00:00:00 2001 From: Ruud Boon Date: Mon, 23 Sep 2019 17:45:40 +0200 Subject: [PATCH 09/12] Fixed application interface --- phalcon/Application/AbstractApplication.zep | 4 ++-- phalcon/Cli/Console.zep | 6 +++++- phalcon/Mvc/Application.zep | 6 +++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/phalcon/Application/AbstractApplication.zep b/phalcon/Application/AbstractApplication.zep index 344e732f914..8940408453e 100644 --- a/phalcon/Application/AbstractApplication.zep +++ b/phalcon/Application/AbstractApplication.zep @@ -5,7 +5,7 @@ * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE.txt - * file that was distributed with this source code. + * file that was disĀ§tributed with this source code. */ namespace Phalcon\Application; @@ -94,7 +94,7 @@ abstract class AbstractApplication extends Injectable implements EventsAwareInte /** * Handles a request */ - abstract public function handle(string! uri) -> | bool; + abstract public function handle(var! uri); /** * Register an array of modules present in the application diff --git a/phalcon/Cli/Console.zep b/phalcon/Cli/Console.zep index bb966642a2a..25c7bfd4f52 100644 --- a/phalcon/Cli/Console.zep +++ b/phalcon/Cli/Console.zep @@ -34,13 +34,17 @@ class Console extends AbstractApplication /** * Handle the whole command-line tasks */ - public function handle(string! arguments) -> | bool + public function handle(var! arguments) { var className, container, dispatcher, eventsManager, module, moduleName, moduleObject, modules, path, router, task; let container = this->container; + if unlikely typeof arguments != "array" { + throw new Exception("Argument should be an array"); + } + if unlikely typeof container != "object" { throw new Exception( Exception::containerServiceNotFound("internal services") diff --git a/phalcon/Mvc/Application.zep b/phalcon/Mvc/Application.zep index b9189a2aaf6..a532ef788b7 100644 --- a/phalcon/Mvc/Application.zep +++ b/phalcon/Mvc/Application.zep @@ -79,13 +79,17 @@ class Application extends AbstractApplication /** * Handles a MVC request */ - public function handle(string! uri) -> | bool + public function handle(var! uri) { var container, eventsManager, router, dispatcher, response, view, module, moduleObject, moduleName, className, path, implicitView, returnedResponse, controller, possibleResponse, renderStatus, matchedRoute, match; + if unlikely typeof uri != "string" { + throw new Exception("Argument should be a string"); + } + let container = this->container; if unlikely typeof container != "object" { From d95b1eb545d9a4c0070dce8fd3e302436adf83f5 Mon Sep 17 00:00:00 2001 From: Ruud Boon Date: Mon, 23 Sep 2019 17:58:08 +0200 Subject: [PATCH 10/12] Fixed comment typo --- phalcon/Application/AbstractApplication.zep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phalcon/Application/AbstractApplication.zep b/phalcon/Application/AbstractApplication.zep index 8940408453e..792c6152941 100644 --- a/phalcon/Application/AbstractApplication.zep +++ b/phalcon/Application/AbstractApplication.zep @@ -5,7 +5,7 @@ * (c) Phalcon Team * * For the full copyright and license information, please view the LICENSE.txt - * file that was disĀ§tributed with this source code. + * file that was distributed with this source code. */ namespace Phalcon\Application; From 4d6b0a8716ef7001f391c9dee0982af3490b286f Mon Sep 17 00:00:00 2001 From: Ruud Boon Date: Tue, 24 Sep 2019 09:59:41 +0200 Subject: [PATCH 11/12] - Removed handle from AbstractApplication - Reverted changes on Phalcon\Cli\Console & Phalcon\Mvc\Application:handle() --- phalcon/Application/AbstractApplication.zep | 5 ----- phalcon/Cli/Console.zep | 6 +----- phalcon/Mvc/Application.zep | 6 +----- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/phalcon/Application/AbstractApplication.zep b/phalcon/Application/AbstractApplication.zep index 792c6152941..12f6c4cc459 100644 --- a/phalcon/Application/AbstractApplication.zep +++ b/phalcon/Application/AbstractApplication.zep @@ -91,11 +91,6 @@ abstract class AbstractApplication extends Injectable implements EventsAwareInte return this->modules; } - /** - * Handles a request - */ - abstract public function handle(var! uri); - /** * Register an array of modules present in the application * diff --git a/phalcon/Cli/Console.zep b/phalcon/Cli/Console.zep index 25c7bfd4f52..3b27e0d7b8b 100644 --- a/phalcon/Cli/Console.zep +++ b/phalcon/Cli/Console.zep @@ -34,17 +34,13 @@ class Console extends AbstractApplication /** * Handle the whole command-line tasks */ - public function handle(var! arguments) + public function handle(array arguments = null) { var className, container, dispatcher, eventsManager, module, moduleName, moduleObject, modules, path, router, task; let container = this->container; - if unlikely typeof arguments != "array" { - throw new Exception("Argument should be an array"); - } - if unlikely typeof container != "object" { throw new Exception( Exception::containerServiceNotFound("internal services") diff --git a/phalcon/Mvc/Application.zep b/phalcon/Mvc/Application.zep index a532ef788b7..b9189a2aaf6 100644 --- a/phalcon/Mvc/Application.zep +++ b/phalcon/Mvc/Application.zep @@ -79,17 +79,13 @@ class Application extends AbstractApplication /** * Handles a MVC request */ - public function handle(var! uri) + public function handle(string! uri) -> | bool { var container, eventsManager, router, dispatcher, response, view, module, moduleObject, moduleName, className, path, implicitView, returnedResponse, controller, possibleResponse, renderStatus, matchedRoute, match; - if unlikely typeof uri != "string" { - throw new Exception("Argument should be a string"); - } - let container = this->container; if unlikely typeof container != "object" { From ea8cdced6d5b9f34c56225b09d61f24b2ffa6382 Mon Sep 17 00:00:00 2001 From: Ruud Boon Date: Tue, 24 Sep 2019 11:37:27 +0200 Subject: [PATCH 12/12] Updated change log to reflect changes --- CHANGELOG-4.0.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG-4.0.md b/CHANGELOG-4.0.md index 61693ff56e1..e395199a7ab 100644 --- a/CHANGELOG-4.0.md +++ b/CHANGELOG-4.0.md @@ -3,6 +3,9 @@ - Fixed `Phalcon\Mvc\View\Engine\Volt\Compiler::parse()` Corrected syntax recognize for "set" keyword. [#14288](https://github.com/phalcon/cphalcon/issues/14288) - Fixed `Phalcon\Mvc\View\Engine\Volt\Compiler::parse()` Corrected syntax recognize for "is" keyword. [#11683](https://github.com/phalcon/cphalcon/issues/11683) +## Removed +- Removed `Phalcon\Application\AbstractApplication::handle()` as it does not serve any purpose and causing issues with type hinting. + # [4.0.0-rc.1](https://github.com/phalcon/cphalcon/releases/tag/v4.0.0-rc.1) (2019-09-23) ## Added