File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
InventoryDistanceBasedSourceSelection/Model/DistanceProvider/GoogleMap
InventoryInStorePickup/Model/SearchRequest/Area/SearchTerm
InventoryReservations/Model Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ public function __construct(
4141 */
4242 public function execute (): string
4343 {
44- $ apiKey = trim ((string ) $ this ->scopeConfig ->getValue (self ::XML_PATH_API_KEY ));
44+ $ apiKey = trim ((string ) $ this ->scopeConfig ->getValue (self ::XML_PATH_API_KEY ) ?? '' );
4545 if (!$ apiKey ) {
4646 throw new LocalizedException (__ ('Google API key is not defined ' ));
4747 }
Original file line number Diff line number Diff line change @@ -61,6 +61,6 @@ private function getCountry(string $searchTerm): ?string
6161 }
6262 $ searchTerm = explode ($ this ->delimiterConfig ->getDelimiter (), $ searchTerm );
6363
64- return trim (end ($ searchTerm ));
64+ return trim (end ($ searchTerm ) ?? '' );
6565 }
6666}
Original file line number Diff line number Diff line change @@ -133,6 +133,8 @@ public function build(): ReservationInterface
133133 }
134134
135135 /**
136+ * Validate
137+ *
136138 * @return ValidationResult
137139 */
138140 private function validate ()
@@ -143,7 +145,7 @@ private function validate()
143145 $ errors [] = __ ('"%field" is expected to be a number. ' , ['field ' => ReservationInterface::STOCK_ID ]);
144146 }
145147
146- if (null === $ this ->sku || '' === trim ($ this ->sku )) {
148+ if (null === $ this ->sku || '' === trim ($ this ->sku ?? '' )) {
147149 $ errors [] = __ ('"%field" can not be empty. ' , ['field ' => ReservationInterface::SKU ]);
148150 }
149151
@@ -156,6 +158,7 @@ private function validate()
156158
157159 /**
158160 * Used to clean state after object creation
161+ *
159162 * @return void
160163 */
161164 private function reset ()
@@ -168,7 +171,8 @@ private function reset()
168171
169172 /**
170173 * Used to convert database field names (that use snake case) into constructor parameter names (that use camel case)
171- * to avoid to define them twice in domain model interface.
174+ *
175+ * To avoid to define them twice in domain model interface.
172176 *
173177 * @param array $array
174178 * @return array
You can’t perform that action at this time.
0 commit comments