Skip to content

Commit 0acad58

Browse files
frosty22dg
authored andcommitted
Fix bug of static properties in PhpGenerator - doesn't print static state.
1 parent b3908c6 commit 0acad58

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/PhpGenerator/ClassType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function __toString()
121121
$properties = array();
122122
foreach ($this->properties as $property) {
123123
$properties[] = ($property->documents ? str_replace("\n", "\n * ", "/**\n" . implode("\n", (array) $property->documents)) . "\n */\n" : '')
124-
. $property->visibility . ' $' . $property->name
124+
. $property->visibility . ($property->static ? ' static' : '') . ' $' . $property->name
125125
. ($property->value === NULL ? '' : ' = ' . Helpers::dump($property->value))
126126
. ";\n";
127127
}

tests/PhpGenerator/PhpGenerator.class.expect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ abstract final class Example extends ParentClass implements IExample, IOne
2020

2121
public $order = RecursiveIteratorIterator::SELF_FIRST;
2222

23-
public $sections = array(
23+
public static $sections = array(
2424
'first' => TRUE,
2525
);
2626

0 commit comments

Comments
 (0)