Skip to content

Commit

Permalink
[#13915] - Work on the property names
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed Mar 22, 2019
1 parent ee5751c commit 59fc394
Show file tree
Hide file tree
Showing 11 changed files with 186 additions and 186 deletions.
16 changes: 8 additions & 8 deletions phalcon/annotations/adapter.zep
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@ use Phalcon\Annotations\ReaderInterface;
abstract class Adapter implements AdapterInterface
{

protected _reader;
protected reader;

protected _annotations;
protected annotations;

/**
* Sets the annotations parser
*/
public function setReader(<ReaderInterface> reader)
{
let this->_reader = reader;
let this->reader = reader;
}

/**
* Returns the annotation reader
*/
public function getReader() -> <ReaderInterface>
{
if typeof this->_reader != "object" {
let this->_reader = new Reader();
if typeof this->reader != "object" {
let this->reader = new Reader();
}
return this->_reader;
return this->reader;
}

/**
Expand All @@ -66,7 +66,7 @@ abstract class Adapter implements AdapterInterface
let realClassName = className;
}

let annotations = this->_annotations;
let annotations = this->annotations;
if typeof annotations == "array" {
if isset annotations[realClassName] {
return annotations[realClassName];
Expand All @@ -90,7 +90,7 @@ abstract class Adapter implements AdapterInterface
*/
if typeof parsedAnnotations == "array" {
let classAnnotations = new Reflection(parsedAnnotations),
this->_annotations[realClassName] = classAnnotations;
this->annotations[realClassName] = classAnnotations;
this->{"write"}(realClassName, classAnnotations);
}
}
Expand Down
12 changes: 6 additions & 6 deletions phalcon/annotations/adapter/apcu.zep
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ use Phalcon\Annotations\Reflection;
class Apcu extends Adapter
{

protected _prefix = "";
protected prefix = "";

protected _ttl = 172800;
protected ttl = 172800;

/**
* Phalcon\Annotations\Adapter\Apcu constructor
Expand All @@ -42,10 +42,10 @@ class Apcu extends Adapter

if typeof options == "array" {
if fetch prefix, options["prefix"] {
let this->_prefix = prefix;
let this->prefix = prefix;
}
if fetch ttl, options["lifetime"] {
let this->_ttl = ttl;
let this->ttl = ttl;
}
}
}
Expand All @@ -55,14 +55,14 @@ class Apcu extends Adapter
*/
public function read(string! key) -> <Reflection> | bool
{
return apcu_fetch(strtolower("_PHAN" . this->_prefix . key));
return apcu_fetch(strtolower("_PHAN" . this->prefix . key));
}

/**
* Writes parsed annotations to APCu
*/
public function write(string! key, <Reflection> data)
{
return apcu_store(strtolower("_PHAN" . this->_prefix . key), data, this->_ttl);
return apcu_store(strtolower("_PHAN" . this->prefix . key), data, this->ttl);
}
}
8 changes: 4 additions & 4 deletions phalcon/annotations/adapter/files.zep
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use Phalcon\Annotations\Exception;
*/
class Files extends Adapter
{
protected _annotationsDir = "./";
protected annotationsDir = "./";

/**
* Phalcon\Annotations\Adapter\Files constructor
Expand All @@ -41,7 +41,7 @@ class Files extends Adapter
var annotationsDir;

if fetch annotationsDir, options["annotationsDir"] {
let this->_annotationsDir = annotationsDir;
let this->annotationsDir = annotationsDir;
}
}

Expand All @@ -55,7 +55,7 @@ class Files extends Adapter
/**
* Paths must be normalized before be used as keys
*/
let path = this->_annotationsDir . prepare_virtual_path(key, "_") . ".php";
let path = this->annotationsDir . prepare_virtual_path(key, "_") . ".php";

if file_exists(path) {
return require path;
Expand All @@ -74,7 +74,7 @@ class Files extends Adapter
/**
* Paths must be normalized before be used as keys
*/
let path = this->_annotationsDir . prepare_virtual_path(key, "_") . ".php";
let path = this->annotationsDir . prepare_virtual_path(key, "_") . ".php";

if (file_put_contents(path, "<?php return " . var_export(data, true) . "; ") === false) {
throw new Exception("Annotations directory cannot be written");
Expand Down
6 changes: 3 additions & 3 deletions phalcon/annotations/adapter/memory.zep
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Memory extends Adapter
* Data
* @var mixed
*/
protected _data;
protected data;

/**
* Reads parsed annotations from memory
Expand All @@ -33,7 +33,7 @@ class Memory extends Adapter
{
var data;

if fetch data, this->_data[strtolower(key)] {
if fetch data, this->data[strtolower(key)] {
return data;
}

Expand All @@ -48,6 +48,6 @@ class Memory extends Adapter
var lowercasedKey;

let lowercasedKey = strtolower(key);
let this->_data[lowercasedKey] = data;
let this->data[lowercasedKey] = data;
}
}
26 changes: 13 additions & 13 deletions phalcon/annotations/annotation.zep
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ class Annotation
* Annotation Name
* @var string
*/
protected _name;
protected name;

/**
* Annotation Arguments
* @var string
*/
protected _arguments;
protected arguments;

/**
* Annotation ExprArguments
* @var string
*/
protected _exprArguments;
protected exprArguments;

/**
* Phalcon\Annotations\Annotation constructor
Expand All @@ -46,7 +46,7 @@ class Annotation
{
var name, exprArguments, argument, resolvedArgument, arguments;

let this->_name = reflectionData["name"];
let this->name = reflectionData["name"];

/**
* Process annotation arguments
Expand All @@ -61,8 +61,8 @@ class Annotation
let arguments[] = resolvedArgument;
}
}
let this->_arguments = arguments;
let this->_exprArguments = exprArguments;
let this->arguments = arguments;
let this->exprArguments = exprArguments;
}
}

Expand All @@ -71,7 +71,7 @@ class Annotation
*/
public function getName() -> string
{
return this->_name;
return this->name;
}

/**
Expand Down Expand Up @@ -134,7 +134,7 @@ class Annotation
*/
public function getExprArguments()
{
return this->_exprArguments;
return this->exprArguments;
}

/**
Expand All @@ -144,15 +144,15 @@ class Annotation
*/
public function getArguments()
{
return this->_arguments;
return this->arguments;
}

/**
* Returns the number of arguments that the annotation has
*/
public function numberArguments() -> int
{
return count(this->_arguments);
return count(this->arguments);
}

/**
Expand All @@ -164,7 +164,7 @@ class Annotation
public function getArgument(var position)
{
var argument;
if fetch argument, this->_arguments[position] {
if fetch argument, this->arguments[position] {
return argument;
}
}
Expand All @@ -176,7 +176,7 @@ class Annotation
*/
public function hasArgument(var position) -> bool
{
return isset this->_arguments[position];
return isset this->arguments[position];
}

/**
Expand All @@ -187,7 +187,7 @@ class Annotation
public function getNamedArgument(string! name)
{
var argument;
if fetch argument, this->_arguments[name] {
if fetch argument, this->arguments[name] {
return argument;
}
}
Expand Down
26 changes: 13 additions & 13 deletions phalcon/annotations/collection.zep
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ use Phalcon\Annotations\Exception;
class Collection implements \Iterator, \Countable
{

protected _position = 0;
protected position = 0;

protected _annotations;
protected annotations;

/**
* Phalcon\Annotations\Collection constructor
Expand All @@ -53,23 +53,23 @@ class Collection implements \Iterator, \Countable
let annotations[] = new Annotation(annotationData);
}

let this->_annotations = annotations;
let this->annotations = annotations;
}

/**
* Returns the number of annotations in the collection
*/
public function count() -> int
{
return count(this->_annotations);
return count(this->annotations);
}

/**
* Rewinds the internal iterator
*/
public function rewind() -> void
{
let this->_position = 0;
let this->position = 0;
}

/**
Expand All @@ -78,7 +78,7 @@ class Collection implements \Iterator, \Countable
public function current() -> <Annotation> | bool
{
var annotation;
if fetch annotation, this->_annotations[this->_position] {
if fetch annotation, this->annotations[this->position] {
return annotation;
}
return false;
Expand All @@ -89,31 +89,31 @@ class Collection implements \Iterator, \Countable
*/
public function key() -> int
{
return this->_position;
return this->position;
}

/**
* Moves the internal iteration pointer to the next position
*/
public function next() -> void
{
let this->_position++;
let this->position++;
}

/**
* Check if the current annotation in the iterator is valid
*/
public function valid() -> bool
{
return isset this->_annotations[this->_position];
return isset this->annotations[this->position];
}

/**
* Returns the internal annotations as an array
*/
public function getAnnotations() -> <Annotation[]>
{
return this->_annotations;
return this->annotations;
}

/**
Expand All @@ -122,7 +122,7 @@ class Collection implements \Iterator, \Countable
public function get(string name) -> <Annotation>
{
var annotation, annotations;
let annotations = this->_annotations;
let annotations = this->annotations;
if typeof annotations == "array" {
for annotation in annotations {
if name == annotation->getName() {
Expand All @@ -142,7 +142,7 @@ class Collection implements \Iterator, \Countable
var annotations, found, annotation;

let found = [],
annotations = this->_annotations;
annotations = this->annotations;
if typeof annotations == "array" {
for annotation in annotations {
if name == annotation->getName() {
Expand All @@ -161,7 +161,7 @@ class Collection implements \Iterator, \Countable
{
var annotations, annotation;

let annotations = this->_annotations;
let annotations = this->annotations;
if typeof annotations == "array" {
for annotation in annotations {
if name == annotation->getName() {
Expand Down
Loading

0 comments on commit 59fc394

Please sign in to comment.