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
2424 /**
2525 * The address or text that should be geocoded.
2626 *
27- * @var string
27+ * @var string | null
2828 */
2929 private $ text ;
3030
@@ -48,16 +48,12 @@ final class GeocodeQuery implements Query
4848 */
4949 private $ data = [];
5050
51- private function __construct (string $ text )
51+ private function __construct (? string $ text )
5252 {
53- if ('' === $ text ) {
54- throw new InvalidArgument ('Geocode query cannot be empty ' );
55- }
56-
5753 $ this ->text = $ text ;
5854 }
5955
60- public static function create (string $ text ): self
56+ public static function create (? string $ text ): self
6157 {
6258 return new self ($ text );
6359 }
@@ -102,7 +98,7 @@ public function withData(string $name, mixed $value): self
10298 return $ new ;
10399 }
104100
105- public function getText (): string
101+ public function getText (): ? string
106102 {
107103 return $ this ->text ;
108104 }
You can’t perform that action at this time.
0 commit comments