Skip to content

Commit c04ea15

Browse files
committed
Method: removed space after reference &
1 parent 3568624 commit c04ea15

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

src/PhpGenerator/Helpers.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static function dump($var)
3232
}
3333

3434

35-
private static function _dump(& $var, $level = 0)
35+
private static function _dump(&$var, $level = 0)
3636
{
3737
if ($var instanceof PhpLiteral) {
3838
return (string) $var;
@@ -83,7 +83,7 @@ private static function _dump(& $var, $level = 0)
8383
$outAlt = "\n$space";
8484
$var[$marker] = TRUE;
8585
$counter = 0;
86-
foreach ($var as $k => & $v) {
86+
foreach ($var as $k => &$v) {
8787
if ($k !== $marker) {
8888
$item = ($k === $counter ? '' : self::_dump($k, $level + 1) . ' => ') . self::_dump($v, $level + 1);
8989
$counter = is_int($k) ? max($k + 1, $counter) : $counter;
@@ -126,7 +126,7 @@ private static function _dump(& $var, $level = 0)
126126
$props[$v] = $props["\x00*\x00$v"] = $props["\x00$class\x00$v"] = TRUE;
127127
}
128128
}
129-
foreach ($arr as $k => & $v) {
129+
foreach ($arr as $k => &$v) {
130130
if (!isset($props) || isset($props[$k])) {
131131
$out .= "$space\t" . self::_dump($k, $level + 1) . ' => ' . self::_dump($v, $level + 1) . ",\n";
132132
}

src/PhpGenerator/Method.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ public function __toString()
131131
. ($this->final ? 'final ' : '')
132132
. ($this->visibility ? $this->visibility . ' ' : '')
133133
. ($this->static ? 'static ' : '')
134-
. 'function'
135-
. ($this->returnReference ? ' &' : '')
136-
. ' ' . $this->name
134+
. 'function '
135+
. ($this->returnReference ? '&' : '')
136+
. $this->name
137137
. '(' . implode(', ', $parameters) . ')'
138138
. ($this->uses ? ' use (' . implode(', ', $uses) . ')' : '')
139139
. ($this->returnType ? ': ' . ($this->returnNullable ? '?' : '')

tests/PhpGenerator/ClassType.expect

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

3131

32-
protected static function & getSections($mode = self::ORDER)
32+
protected static function &getSections($mode = self::ORDER)
3333
{
3434
$mode = 123;
3535
return self::$sections;

tests/PhpGenerator/ClassType.from.expect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class Class2 extends Class1 implements Interface2
4848
* Func3
4949
* @return Class1
5050
*/
51-
private function & func3(array $a%a?%, Class2 $b = NULL, Unknown $c, \Xyz\Unknown $d, callable $e, $f)
51+
private function &func3(array $a%a?%, Class2 $b = NULL, Unknown $c, \Xyz\Unknown $d, callable $e, $f)
5252
{
5353
}
5454

tests/PhpGenerator/ClassType.from.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Class2 extends Class1 implements Interface2
5454
* Func3
5555
* @return Class1
5656
*/
57-
private function & func3(array $a = [], Class2 $b = NULL, \Abc\Unknown $c, \Xyz\Unknown $d, callable $e, $f)
57+
private function &func3(array $a = [], Class2 $b = NULL, \Abc\Unknown $c, \Xyz\Unknown $d, callable $e, $f)
5858
{}
5959

6060
final function func2()

tests/PhpGenerator/Method.function.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $function->addUse('vars')
2323
->setReference(TRUE);
2424

2525
Assert::match(
26-
'function & ($a, $b) use ($this, &$vars) {
26+
'function &($a, $b) use ($this, &$vars) {
2727
return $a + $b;
2828
}', (string) $function);
2929

0 commit comments

Comments
 (0)