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
Merged
3 changes: 3 additions & 0 deletions CHANGELOG-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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
5 changes: 0 additions & 5 deletions phalcon/Application/AbstractApplication.zep
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@ abstract class AbstractApplication extends Injectable implements EventsAwareInte
return this->modules;
}

/**
* Handles a request
*/
abstract public function handle();

/**
* Register an array of modules present in the application
*
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
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