File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change 3535 <rule ref =" SlevomatCodingStandard.Attributes.RequireAttributeAfterDocComment" />
3636
3737 <rule ref =" SlevomatCodingStandard.Classes.ClassConstantVisibility" />
38- <rule ref =" SlevomatCodingStandard.Classes.DisallowConstructorPropertyPromotion" />
38+ <!-- < rule ref="SlevomatCodingStandard.Classes.DisallowConstructorPropertyPromotion"/> -- >
3939 <rule ref =" SlevomatCodingStandard.Classes.ForbiddenPublicProperty" />
4040 <rule ref =" SlevomatCodingStandard.Classes.ModernClassNameReference" />
4141
Original file line number Diff line number Diff line change 2121#[Attribute(Attribute::TARGET_CLASS )]
2222final class ThrowOnInvalidProperty{
2323
24- private readonly bool $ throwOnInvalid ;
25-
26- public function __construct (bool $ throwOnInvalid ){
27- $ this ->throwOnInvalid = $ throwOnInvalid ;
28- }
29-
30- public function throwOnInvalid ():bool {
31- return $ this ->throwOnInvalid ;
32- }
24+ public function __construct (
25+ public readonly bool $ throwOnInvalid ,
26+ ){}
3327
3428}
Original file line number Diff line number Diff line change @@ -153,8 +153,10 @@ final protected function throwOnInvalidProperty():bool{
153153 if ($ attributes === []){
154154 return false ;
155155 }
156+ /** @var \chillerlan\Settings\Attributes\ThrowOnInvalidProperty $attr */
157+ $ attr = $ attributes [0 ]->newInstance ();
156158
157- return $ attributes [ 0 ]-> newInstance ()-> throwOnInvalid () ;
159+ return $ attr -> throwOnInvalid ;
158160 }
159161
160162 public function toArray ():array {
You can’t perform that action at this time.
0 commit comments