@@ -49,7 +49,7 @@ $obj->static((CONST_A&CONST_B)|CONST_C | $var);
49
49
* DNF parentheses.
50
50
*/
51
51
52
- class DNFTypes {
52
+ abstract class DNFTypes {
53
53
/* testDNFTypeOOConstUnqualifiedClasses */
54
54
public const (A &B )|D UNQUALIFIED = new Foo ;
55
55
@@ -63,7 +63,7 @@ class DNFTypes {
63
63
(C &D ) | // phpcs:ignore Stnd.Cat.Sniff
64
64
/* testDNFTypeOOConstMulti3 */
65
65
(Y &D )
66
- | null MULTI_DNF = false ;
66
+ | null MULTI_DNF = null ;
67
67
68
68
/* testDNFTypeOOConstNamespaceRelative */
69
69
final protected const (namespace \Sub \NameA &namespace \Sub \NameB )|namespace \Sub \NameC NAMESPACE_RELATIVE = new namespace \Sub \NameB ;
@@ -75,10 +75,10 @@ class DNFTypes {
75
75
const (\Fully \Qualified \NameA &\Fully \Qualified \NameB )|\Fully \Qualified \NameC FULLY_QUALIFIED = new \Fully \Qualified \NameB ();
76
76
77
77
/* testDNFTypePropertyUnqualifiedClasses */
78
- public static (Foo &Bar )|object $ obj ;
78
+ public static (Foo &Bar )|array $ obj ;
79
79
80
80
/* testDNFTypePropertyReverseModifierOrder */
81
- static protected string |(A &B )|bool $ dnf /* testParensNoOwnerPropertyDefaultValue1 */ = ( E_WARNING & E_NOTICE ) | /* testParensNoOwnerPropertyDefaultValue2 */ (E_ALL & E_DEPRECATED );
81
+ static protected string |(A &B )|int $ dnf /* testParensNoOwnerPropertyDefaultValue1 */ = ( E_WARNING & E_NOTICE ) | /* testParensNoOwnerPropertyDefaultValue2 */ (E_ALL & E_DEPRECATED );
82
82
83
83
private
84
84
/* testDNFTypePropertyMultiNamespaceRelative */
@@ -96,15 +96,15 @@ class DNFTypes {
96
96
static readonly (A &B &C )|array $ staticReadonly ;
97
97
98
98
/* testDNFTypePropertyWithOnlyStaticKeyword */
99
- static (A &B &C )|true $ obj ;
99
+ static (A &B &C )|true $ onlyStaticModified ;
100
100
101
101
public function paramTypes (
102
102
/* testDNFTypeParam1WithAttribute */
103
103
#[MyAttribute]
104
104
(\Foo &Bar )|int |float $ paramA /* testParensNoOwnerParamDefaultValue */ = SOMETHING | (CONSTANT_A & CONSTANT_B ),
105
105
106
106
/* testDNFTypeParam2 */
107
- (Foo &\Bar ) /* testDNFTypeParam3 */ |(Baz &Fop ) &...$ paramB = null ,
107
+ (Foo &\Bar ) /* testDNFTypeParam3 */ |(Baz &Fop ) &...$ paramB ,
108
108
) {
109
109
/* testParensNoOwnerInReturnValue1 */
110
110
return (
@@ -148,7 +148,7 @@ function globalFunctionWithSpreadAndReference(
148
148
/* testDNFTypeWithReference */
149
149
float |(B &A ) &$ paramA ,
150
150
/* testDNFTypeWithSpreadOperator */
151
- string |(B | D ) ...$ paramB
151
+ string |(B & D ) ...$ paramB
152
152
) {}
153
153
154
154
@@ -160,7 +160,7 @@ $closureWithReturnType = function ($string = NONSENSE & FAKE) /* testDNFTypeClos
160
160
/* testParensOwnerArrowDNFUsedWithin */
161
161
$ arrowWithParamType = fn (
162
162
/* testDNFTypeArrowParam */
163
- object |(A &B &C )|array $ param ,
163
+ int |(A &B &C )|array $ param ,
164
164
/* testParensNoOwnerAmpersandInDefaultValue */ ?int $ int = (CONSTA & CONSTB )| CONST_C
165
165
)
166
166
/* testParensNoOwnerInArrowReturnExpression */
@@ -175,11 +175,11 @@ $arrowWithParamReturnByRef = fn &(
175
175
176
176
function InvalidSyntaxes (
177
177
/* testDNFTypeParamIllegalUnnecessaryParens */
178
- (A &B ) $ parensNotNeeded
178
+ (A &B ) $ parensNotNeeded,
179
179
180
180
/* testDNFTypeParamIllegalIntersectUnionReversed */
181
- A&(B|D) $ onlyIntersectAllowedWithinParensAndUnionOutside
181
+ A &(B |D) $ onlyIntersectAllowedWithinParensAndUnionOutside,
182
182
183
183
/* testDNFTypeParamIllegalNestedParens */
184
- A|(B&(D|W)|null) $ nestedParensNotAllowed
184
+ A |(B &(D |W )|null ) $ nestedParensNotAllowed,
185
185
) {}
0 commit comments