Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style fixes (code quality) #14407

Merged
merged 15 commits into from
Sep 24, 2019
1 change: 0 additions & 1 deletion phalcon/Acl/Adapter/Memory.zep
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion phalcon/Annotations/Annotation.zep
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Phalcon\Annotations;

use Phalcon\Annotations\Annotation;
use Phalcon\Annotations\Exception;

/**
Expand Down
4 changes: 2 additions & 2 deletions phalcon/Application/AbstractApplication.zep
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* (c) Phalcon Team <team@phalcon.io>
*
* 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;
Expand Down Expand Up @@ -94,7 +94,7 @@ abstract class AbstractApplication extends Injectable implements EventsAwareInte
/**
* Handles a request
*/
abstract public function handle();
abstract public function handle(var! uri);
sergeyklay marked this conversation as resolved.
Show resolved Hide resolved

/**
* Register an array of modules present in the application
Expand Down
6 changes: 5 additions & 1 deletion phalcon/Cli/Console.zep
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@ class Console extends AbstractApplication
/**
* Handle the whole command-line tasks
*/
public function handle(array arguments = null)
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");
sergeyklay marked this conversation as resolved.
Show resolved Hide resolved
}

if unlikely typeof container != "object" {
throw new Exception(
Exception::containerServiceNotFound("internal services")
Expand Down
2 changes: 1 addition & 1 deletion phalcon/Factory/AbstractFactory.zep
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Phalcon\Factory;
use Phalcon\Config;
use Phalcon\Factory\Exception;

class AbstractFactory
abstract class AbstractFactory
{
/**
* @var array
Expand Down
4 changes: 2 additions & 2 deletions phalcon/Forms/Element/Select.zep
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
);
Expand Down
1 change: 0 additions & 1 deletion phalcon/Forms/Form.zep
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ 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;
Expand Down
7 changes: 4 additions & 3 deletions phalcon/Helper/Fs.zep
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion phalcon/Html/Attributes/RenderInterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ namespace Phalcon\Html\Attributes;
*
* Interface Phalcon\Html\Attributes\RenderInterface
*/
interface RenderInterface {
interface RenderInterface
{
/**
* Generate a string represetation
*/
Expand Down
2 changes: 1 addition & 1 deletion phalcon/Http/RequestInterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions phalcon/Image/Adapter/Imagick.zep
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Phalcon\Image\Adapter;

use Imagick;
use Imagick as ImagicNative;
use ImagickDraw;
use ImagickPixel;
use Phalcon\Image\Enum;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -105,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();
}
Expand Down Expand Up @@ -138,7 +138,7 @@ class Imagick extends AbstractAdapter
/**
* Get instance
*/
public function getInternalImInstance() -> <\Imagick>
public function getInternalImInstance() -> <ImagicNative>
{
return this->image;
}
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -324,7 +324,7 @@ class Imagick extends AbstractAdapter
{
var mask, ret;

let mask = new Imagick();
let mask = new ImagicNative();

mask->readImageBlob(
image->render()
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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()
Expand Down
6 changes: 5 additions & 1 deletion phalcon/Mvc/Application.zep
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,17 @@ class Application extends AbstractApplication
/**
* Handles a MVC request
*/
public function handle(string! uri) -> <ResponseInterface> | bool
public function handle(var! uri)
sergeyklay marked this conversation as resolved.
Show resolved Hide resolved
{
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");
sergeyklay marked this conversation as resolved.
Show resolved Hide resolved
}

let container = this->container;

if unlikely typeof container != "object" {
Expand Down
1 change: 0 additions & 1 deletion phalcon/Mvc/Model.zep
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
2 changes: 1 addition & 1 deletion phalcon/Mvc/Model/ManagerInterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ interface ManagerInterface
* );
* ```
*/
final public function isVisibleModelProperty(<ModelInterface> model, string property) -> bool;
public function isVisibleModelProperty(<ModelInterface> model, string property) -> bool;

/**
* Sets if a model must keep snapshots
Expand Down
1 change: 0 additions & 1 deletion phalcon/Mvc/Model/Query.zep
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions phalcon/Mvc/ModelInterface.zep
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion phalcon/Validation/Validator/File/Size/Equal.zep
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
1 change: 0 additions & 1 deletion phalcon/Validation/Validator/File/Size/Max.zep
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
1 change: 0 additions & 1 deletion phalcon/Validation/Validator/File/Size/Min.zep
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down