‪TYPO3CMS  ‪main
CountryFilter.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
23 final class ‪CountryFilter
24 {
29  public function ‪__construct(protected array $excludeCountries = [], protected array $onlyCountries = []) {}
30 
34  public function ‪getExcludeCountries(): array
35  {
36  return array_map(strtoupper(...), $this->excludeCountries);
37  }
38 
43  public function ‪setExcludeCountries(array $excludeCountries): ‪CountryFilter
44  {
45  $this->excludeCountries = $excludeCountries;
46  return $this;
47  }
48 
52  public function ‪getOnlyCountries(): array
53  {
54  return array_map(strtoupper(...), $this->onlyCountries);
55  }
56 
61  public function ‪setOnlyCountries(array $onlyCountries): ‪CountryFilter
62  {
63  $this->onlyCountries = $onlyCountries;
64  return $this;
65  }
66 }
‪TYPO3\CMS\Core\Country\CountryFilter\setExcludeCountries
‪$this setExcludeCountries(array $excludeCountries)
Definition: CountryFilter.php:43
‪TYPO3\CMS\Core\Country\CountryFilter\setOnlyCountries
‪$this setOnlyCountries(array $onlyCountries)
Definition: CountryFilter.php:61
‪TYPO3\CMS\Core\Country\CountryFilter\getOnlyCountries
‪string[] getOnlyCountries()
Definition: CountryFilter.php:52
‪TYPO3\CMS\Core\Country\CountryFilter
Definition: CountryFilter.php:24
‪TYPO3\CMS\Core\Country\CountryFilter\__construct
‪__construct(protected array $excludeCountries=[], protected array $onlyCountries=[])
Definition: CountryFilter.php:29
‪TYPO3\CMS\Core\Country
Definition: Country.php:18
‪TYPO3\CMS\Core\Country\CountryFilter\getExcludeCountries
‪string[] getExcludeCountries()
Definition: CountryFilter.php:34