@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | if ($profile->getName() !== $this->session['profileName']) { |
| 47 | 47 | $this->session['profileName'] = $profile->getName(); |
| 48 | 48 | |
| 49 | - foreach ([ 'profileCountry', 'profileLanguage', 'profileCurrency' ] as $item) { |
|
| 49 | + foreach (['profileCountry', 'profileLanguage', 'profileCurrency'] as $item) { |
|
| 50 | 50 | if (isset($this->session[$item])) { |
| 51 | 51 | unset($this->session[$item]); |
| 52 | 52 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | return $profile; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - foreach ([ 'changeCountry' => 'profileCountry', 'changeLanguage' => 'profileLanguage', 'changeCurrency' => 'profileCurrency'] as $method => $item) { |
|
| 58 | + foreach (['changeCountry' => 'profileCountry', 'changeLanguage' => 'profileLanguage', 'changeCurrency' => 'profileCurrency'] as $method => $item) { |
|
| 59 | 59 | if (!isset($this->session[$item])) { |
| 60 | 60 | continue; |
| 61 | 61 | } |
@@ -64,11 +64,11 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function getConfigSchema(): Schema |
| 66 | 66 | { |
| 67 | - $profileAttributeExpectationFactory = static function (string $attribute) { |
|
| 67 | + $profileAttributeExpectationFactory = static function(string $attribute) { |
|
| 68 | 68 | return Expect::anyOf(Expect::string(), Expect::arrayOf('string')) |
| 69 | 69 | ->required() |
| 70 | 70 | ->castTo('array') |
| 71 | - ->assert(static function (array $value) { |
|
| 71 | + ->assert(static function(array $value) { |
|
| 72 | 72 | return !empty($value); |
| 73 | 73 | }, sprintf('Almost one %s must be defined.', $attribute)); |
| 74 | 74 | }; |
@@ -89,13 +89,13 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | 'storage' => Expect::anyOf(Expect::string(), Expect::type(Statement::class)) |
| 91 | 91 | ->default(SessionProfileStorage::class) |
| 92 | - ->before(static function ($def) { |
|
| 92 | + ->before(static function($def) { |
|
| 93 | 93 | return $def instanceof Statement ? $def : new Statement($def); |
| 94 | 94 | }), |
| 95 | 95 | |
| 96 | 96 | 'detector' => Expect::anyOf(Expect::string(), Expect::type(Statement::class)) |
| 97 | 97 | ->default(NetteRequestDetector::class) |
| 98 | - ->before(static function ($def) { |
|
| 98 | + ->before(static function($def) { |
|
| 99 | 99 | return $def instanceof Statement ? $def : new Statement($def); |
| 100 | 100 | }), |
| 101 | 101 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | ]), |
| 109 | 109 | ]); |
| 110 | 110 | |
| 111 | - $schema->assert(static function ($schema) { |
|
| 111 | + $schema->assert(static function($schema) { |
|
| 112 | 112 | return !empty($schema->profiles); |
| 113 | 113 | }, 'You must define almost one profile in your configuration.'); |
| 114 | 114 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | ->setType(ProfileContainerInterface::class) |
| 154 | 154 | ->setFactory(ProfileContainer::class, [ |
| 155 | 155 | 'defaultProfile' => $defaultProfile, |
| 156 | - 'profiles' => array_map(function ($config, $key) { |
|
| 156 | + 'profiles' => array_map(function($config, $key) { |
|
| 157 | 157 | return $this->createProfile((string) $key, $config); |
| 158 | 158 | }, $profiles, array_keys($profiles)), |
| 159 | 159 | ]) |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | return $this->languages; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - return $this->languages = $this->getUniqueElements(static function (ProfileInterface $profile) { |
|
| 93 | + return $this->languages = $this->getUniqueElements(static function(ProfileInterface $profile) { |
|
| 94 | 94 | return $profile->getLanguages(); |
| 95 | 95 | }); |
| 96 | 96 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | return $this->countries; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - return $this->countries = $this->getUniqueElements(static function (ProfileInterface $profile) { |
|
| 107 | + return $this->countries = $this->getUniqueElements(static function(ProfileInterface $profile) { |
|
| 108 | 108 | return $profile->getCountries(); |
| 109 | 109 | }); |
| 110 | 110 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | return $this->currencies; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - return $this->currencies = $this->getUniqueElements(static function (ProfileInterface $profile) { |
|
| 121 | + return $this->currencies = $this->getUniqueElements(static function(ProfileInterface $profile) { |
|
| 122 | 122 | return $profile->getCurrencies(); |
| 123 | 123 | }); |
| 124 | 124 | } |