55class Result
66{
77 public function __construct (
8- public readonly bool $ matched ,
8+ public readonly bool $ matched ,
99 public readonly string $ firstName = '' ,
1010 public readonly string $ lastName = '' ,
11- public readonly mixed $ origin = null ,
12- ) {}
11+ public readonly mixed $ origin = null ,
12+ ) {
13+ }
1314
1415 public function with (Result $ result ): Result
1516 {
@@ -19,19 +20,19 @@ public function with(Result $result): Result
1920
2021 return new self (
2122 true ,
22- $ result -> firstName !== '' ? $ result ->firstName : $ this ->firstName ,
23- $ result -> lastName !== '' ? $ result ->lastName : $ this ->lastName ,
23+ '' !== $ result -> firstName ? $ result ->firstName : $ this ->firstName ,
24+ '' !== $ result -> lastName ? $ result ->lastName : $ this ->lastName ,
2425 $ this ->origin // oder $result->origin, je nach gewünschter Semantik
2526 );
2627 }
2728
2829 public function isComplete (): bool
2930 {
30- return $ this ->matched && $ this ->firstName !== '' && $ this ->lastName !== '' ;
31+ return $ this ->matched && '' !== $ this ->firstName && '' !== $ this ->lastName ;
3132 }
3233
3334 public function isEmpty (): bool
3435 {
35- return $ this ->firstName === '' && $ this ->lastName === '' ;
36+ return '' === $ this ->firstName && '' === $ this ->lastName ;
3637 }
37- }
38+ }
0 commit comments