Skip to content

Commit 6442fd5

Browse files
committed
removed magic properties usage
1 parent 384b95a commit 6442fd5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/PhpGenerator/Method.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,19 +140,19 @@ public function __toString()
140140
$parameters = array();
141141
foreach ($this->parameters as $param) {
142142
$variadic = $this->variadic && $param === end($this->parameters);
143-
$hint = in_array($param->typeHint, array('array', ''))
144-
? $param->typeHint
145-
: ($this->namespace ? $this->namespace->unresolveName($param->typeHint) : $param->typeHint);
143+
$hint = in_array($param->getTypeHint(), array('array', ''))
144+
? $param->getTypeHint()
145+
: ($this->namespace ? $this->namespace->unresolveName($param->getTypeHint()) : $param->getTypeHint());
146146

147147
$parameters[] = ($hint ? $hint . ' ' : '')
148-
. ($param->reference ? '&' : '')
148+
. ($param->isReference() ? '&' : '')
149149
. ($variadic ? '...' : '')
150-
. '$' . $param->name
151-
. ($param->optional && !$variadic ? ' = ' . Helpers::dump($param->defaultValue) : '');
150+
. '$' . $param->getName()
151+
. ($param->isOptional() && !$variadic ? ' = ' . Helpers::dump($param->defaultValue) : '');
152152
}
153153
$uses = array();
154154
foreach ($this->uses as $param) {
155-
$uses[] = ($param->reference ? '&' : '') . '$' . $param->name;
155+
$uses[] = ($param->isReference() ? '&' : '') . '$' . $param->getName();
156156
}
157157
return ($this->documents ? str_replace("\n", "\n * ", "/**\n" . implode("\n", (array) $this->documents)) . "\n */\n" : '')
158158
. ($this->abstract ? 'abstract ' : '')

src/PhpGenerator/Property.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static function from(\ReflectionProperty $from)
5151
$prop = new static;
5252
$prop->name = $from->getName();
5353
$defaults = $from->getDeclaringClass()->getDefaultProperties();
54-
$prop->value = isset($defaults[$from->name]) ? $defaults[$from->name] : NULL;
54+
$prop->value = isset($defaults[$prop->name]) ? $defaults[$prop->name] : NULL;
5555
$prop->static = $from->isStatic();
5656
$prop->visibility = $from->isPrivate() ? 'private' : ($from->isProtected() ? 'protected' : 'public');
5757
$prop->documents = preg_replace('#^\s*\* ?#m', '', trim($from->getDocComment(), "/* \r\n\t"));

0 commit comments

Comments
 (0)