Skip to content

Commit ef0273a

Browse files
committed
Merge branch 'php-8.0/pear-validdefaultvalue-add-support-constr-prop-prom' of https://github.com/jrfnl/PHP_CodeSniffer
2 parents 1b4ce1a + 43feac1 commit ef0273a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.inc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,20 @@ $closure = function(array $arg2=array(), array $arg1) {}
100100

101101
$fn = fn($a = [], $b) => $a[] = $b;
102102

103+
class OnlyConstructorPropertyPromotion {
104+
public function __construct(
105+
public string $name = '',
106+
protected $bar
107+
) {}
108+
}
109+
110+
class ConstructorPropertyPromotionMixedWithNormalParams {
111+
public function __construct(
112+
public string $name = '',
113+
?int $optionalParam = 0,
114+
mixed $requiredParam,
115+
) {}
116+
}
117+
103118
// Intentional syntax error. Must be last thing in the file.
104119
function

src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public function getErrorList()
3535
91 => 1,
3636
99 => 1,
3737
101 => 1,
38+
106 => 1,
39+
114 => 1,
3840
];
3941

4042
}//end getErrorList()

0 commit comments

Comments
 (0)