Skip to content

Commit dc59530

Browse files
committed
Merge branch 'php-8.0/generic-lowercasetype-add-tests-constr-prop-prom' of https://github.com/jrfnl/PHP_CodeSniffer
2 parents c7f7013 + 805723a commit dc59530

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,11 @@ class TypedProperties
7373
private ClassName|/*comment*/Float|STRING|False $unionTypeC;
7474
public sTRing | aRRaY | FaLSe $unionTypeD;
7575
}
76+
77+
class ConstructorPropertyPromotionWithTypes {
78+
public function __construct(protected Float|Int $x, public ?STRING &$y = 'test', private mixed $z) {}
79+
}
80+
81+
class ConstructorPropertyPromotionAndNormalParams {
82+
public function __construct(public Int $promotedProp, ?Int $normalArg) {}
83+
}

src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,11 @@ class TypedProperties
7373
private ClassName|/*comment*/float|string|false $unionTypeC;
7474
public string | array | false $unionTypeD;
7575
}
76+
77+
class ConstructorPropertyPromotionWithTypes {
78+
public function __construct(protected float|int $x, public ?string &$y = 'test', private mixed $z) {}
79+
}
80+
81+
class ConstructorPropertyPromotionAndNormalParams {
82+
public function __construct(public int $promotedProp, ?int $normalArg) {}
83+
}

src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public function getErrorList()
6363
72 => 2,
6464
73 => 3,
6565
74 => 3,
66+
78 => 3,
67+
82 => 2,
6668
];
6769

6870
}//end getErrorList()

0 commit comments

Comments
 (0)