Skip to content

Commit 7dfeb07

Browse files
authored
Merge pull request #493 from magento-gl/AC-3559
[Arrows] Delivery for RFC: Deprecate passing null
2 parents fabfa98 + 2c91bed commit 7dfeb07

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

InventoryDistanceBasedSourceSelection/Model/DistanceProvider/GoogleMap/GetApiKey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

InventoryInStorePickup/Model/SearchRequest/Area/SearchTerm/CountryParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

InventoryReservations/Model/ReservationBuilder.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)