88
99class Address {
1010
11- private const TYPE_PERSONAL = 'personal ' ;
12-
13- private const TYPE_COMPANY = 'company ' ;
14-
1511 /**
1612 * @var int|null
1713 * @phpstan-ignore-next-line
@@ -36,8 +32,6 @@ class Address {
3632
3733 private string $ country = '' ;
3834
39- private string $ addressType ;
40-
4135 private function __construct (
4236 string $ salutation ,
4337 string $ company ,
@@ -47,8 +41,8 @@ private function __construct(
4741 string $ address ,
4842 string $ postcode ,
4943 string $ city ,
50- string $ country,
51- string $ addressType ) {
44+ string $ country
45+ ) {
5246 $ this ->salutation = $ salutation ;
5347 $ this ->company = $ company ;
5448 $ this ->title = $ title ;
@@ -58,7 +52,6 @@ private function __construct(
5852 $ this ->postcode = $ postcode ;
5953 $ this ->city = $ city ;
6054 $ this ->country = $ country ;
61- $ this ->addressType = $ addressType ;
6255 }
6356
6457 public static function newPersonalAddress (
@@ -78,7 +71,7 @@ public static function newPersonalAddress(
7871 self ::assertNotEmpty ( 'City ' , $ city );
7972 self ::assertNotEmpty ( 'Country ' , $ country );
8073
81- return new self ( $ salutation , '' , $ title , $ firstName , $ lastName , $ address , $ postcode , $ city , $ country, self :: TYPE_PERSONAL );
74+ return new self ( $ salutation , '' , $ title , $ firstName , $ lastName , $ address , $ postcode , $ city , $ country );
8275 }
8376
8477 public static function newCompanyAddress (
@@ -92,7 +85,7 @@ public static function newCompanyAddress(
9285 self ::assertNotEmpty ( 'Post Code ' , $ postcode );
9386 self ::assertNotEmpty ( 'City ' , $ city );
9487 self ::assertNotEmpty ( 'Country ' , $ country );
95- return new self ( '' , $ company , '' , '' , '' , $ address , $ postcode , $ city , $ country, self :: TYPE_COMPANY );
88+ return new self ( '' , $ company , '' , '' , '' , $ address , $ postcode , $ city , $ country );
9689 }
9790
9891 private static function assertNotEmpty ( string $ field , string $ value ): void {
@@ -101,14 +94,6 @@ private static function assertNotEmpty( string $field, string $value ): void {
10194 }
10295 }
10396
104- public function isPersonalAddress (): bool {
105- return $ this ->addressType === self ::TYPE_PERSONAL ;
106- }
107-
108- public function isCompanyAddress (): bool {
109- return $ this ->addressType === self ::TYPE_COMPANY ;
110- }
111-
11297 public function getSalutation (): string {
11398 return $ this ->salutation ;
11499 }
0 commit comments