66
77namespace Opengento \StorePathUrl \Service ;
88
9+ use Magento \Framework \App \ScopeInterface ;
910use Magento \Store \Api \Data \StoreInterface ;
1011use Opengento \StorePathUrl \Model \Config ;
1112use Opengento \StorePathUrl \Model \Config \PathType ;
@@ -18,14 +19,14 @@ class PathResolver
1819{
1920 public function __construct (private Config $ config ) {}
2021
21- public function resolve (StoreInterface $ store ): string
22+ public function resolve (ScopeInterface | StoreInterface $ scope ): string
2223 {
2324 return strtolower (match ($ this ->config ->getStorePathType ()) {
24- PathType::StoreCode => $ store ->getCode (),
25- PathType::CountryCode => $ this ->config ->getCountry ($ store ),
26- PathType::LocaleUnderscore => $ this ->config ->getLocale ($ store ),
27- PathType::LocaleHyphen => implode ('- ' , explode ('_ ' , $ this ->config ->getLocale ($ store ))),
28- PathType::Custom => $ this ->config ->getCustomPathMapper ()[(int )$ store ->getId ()] ?? $ store ->getCode (),
25+ PathType::StoreCode => $ scope ->getCode (),
26+ PathType::CountryCode => $ this ->config ->getCountry ($ scope ),
27+ PathType::LocaleUnderscore => $ this ->config ->getLocale ($ scope ),
28+ PathType::LocaleHyphen => implode ('- ' , explode ('_ ' , $ this ->config ->getLocale ($ scope ))),
29+ PathType::Custom => $ this ->config ->getCustomPathMapper ()[(int )$ scope ->getId ()] ?? $ scope ->getCode (),
2930 });
3031 }
3132}
0 commit comments