Skip to content

Commit 901d3bf

Browse files
committed
Property::$value & Parameter::$defaultValue are private
1 parent 47bf50d commit 901d3bf

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

src/PhpGenerator/ClassType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function __toString()
109109
foreach ($this->properties as $property) {
110110
$properties[] = Helpers::formatDocComment((string) $property->getComment())
111111
. ($property->getVisibility() ?: 'public') . ($property->isStatic() ? ' static' : '') . ' $' . $property->getName()
112-
. ($property->value === NULL ? '' : ' = ' . Helpers::dump($property->value))
112+
. ($property->getValue() === NULL ? '' : ' = ' . Helpers::dump($property->getValue()))
113113
. ';';
114114
}
115115

src/PhpGenerator/Parameter.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
/**
1616
* Method parameter description.
17+
*
18+
* @property mixed $defaultValue
1719
*/
1820
class Parameter
1921
{
@@ -33,7 +35,7 @@ class Parameter
3335
private $hasDefaultValue = FALSE;
3436

3537
/** @var mixed */
36-
public $defaultValue;
38+
private $defaultValue;
3739

3840

3941
/**

src/PhpGenerator/Property.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
/**
1616
* Class property description.
17+
*
18+
* @property mixed $value
1719
*/
1820
class Property
1921
{
@@ -23,7 +25,7 @@ class Property
2325
use Traits\CommentAware;
2426

2527
/** @var mixed */
26-
public $value;
28+
private $value;
2729

2830
/** @var bool */
2931
private $static = FALSE;
@@ -42,7 +44,7 @@ public function setValue($val)
4244
/**
4345
* @return mixed
4446
*/
45-
public function getValue()
47+
public function &getValue()
4648
{
4749
return $this->value;
4850
}

src/PhpGenerator/Traits/FunctionLike.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ protected function parametersToString()
216216
. ($param->isReference() ? '&' : '')
217217
. ($variadic ? '...' : '')
218218
. '$' . $param->getName()
219-
. ($param->hasDefaultValue() && !$variadic ? ' = ' . Helpers::dump($param->defaultValue) : '');
219+
. ($param->hasDefaultValue() && !$variadic ? ' = ' . Helpers::dump($param->getDefaultValue()) : '');
220220
}
221221
return '(' . implode(', ', $params) . ')';
222222
}

0 commit comments

Comments
 (0)