Skip to content

Commit c895e26

Browse files
authored
Remove unnecessary condition
1 parent 2180608 commit c895e26

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Plugin/App/Request/StorePathInfoValidator.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,9 @@ private function resolveByWebUrl(string $uri): string
117117
*/
118118
private function calculatePreferenceScore(Store $store): int
119119
{
120-
$score = 0;
121120
$website = $store->getWebsite();
122-
if ($website->getIsDefault()) {
123-
// Bonus point for the stores which are part of one of the groups from the default website.
124-
$score = in_array($store->getGroupId(), $website->getGroupIds()) ? 2 : 1;
125-
}
121+
// Bonus point for the stores which are part of one of the groups from the default website.
122+
$score = $website->getIsDefault() ? 2 : 0;
126123
// Extra point for the stores which are part of the default group of its website.
127124
$score += (int)$website->getDefaultGroup()->getDefaultStoreId() === (int)$store->getId() ? 1 : 0;
128125
// Extra point is the store is the default one of its group.

0 commit comments

Comments
 (0)