File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ final class GeocodeQuery implements Query
24
24
/**
25
25
* The address or text that should be geocoded.
26
26
*
27
- * @var string
27
+ * @var string | null
28
28
*/
29
29
private $ text ;
30
30
@@ -48,16 +48,12 @@ final class GeocodeQuery implements Query
48
48
*/
49
49
private $ data = [];
50
50
51
- private function __construct (string $ text )
51
+ private function __construct (? string $ text )
52
52
{
53
- if ('' === $ text ) {
54
- throw new InvalidArgument ('Geocode query cannot be empty ' );
55
- }
56
-
57
53
$ this ->text = $ text ;
58
54
}
59
55
60
- public static function create (string $ text ): self
56
+ public static function create (? string $ text ): self
61
57
{
62
58
return new self ($ text );
63
59
}
@@ -102,7 +98,7 @@ public function withData(string $name, mixed $value): self
102
98
return $ new ;
103
99
}
104
100
105
- public function getText (): string
101
+ public function getText (): ? string
106
102
{
107
103
return $ this ->text ;
108
104
}
You can’t perform that action at this time.
0 commit comments