lochmueller /
language_detection
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace Lochmueller\LanguageDetection\Service; |
||
| 6 | |||
| 7 | use TYPO3\CMS\Core\Exception\SiteNotFoundException; |
||
| 8 | use TYPO3\CMS\Core\Site\SiteFinder; |
||
| 9 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
||
| 10 | |||
| 11 | class TcaLanguageSelection |
||
| 12 | { |
||
| 13 | public function __construct(protected ?SiteFinder $siteFinder = null) |
||
| 14 | { |
||
| 15 | if ($siteFinder === null) { |
||
| 16 | /** @var SiteFinder $siteFinder */ |
||
| 17 | $siteFinder = GeneralUtility::makeInstance(SiteFinder::class); |
||
| 18 | $this->siteFinder = $siteFinder; |
||
| 19 | } |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param mixed[] $configuration |
||
| 24 | */ |
||
| 25 | public function get(array &$configuration): void |
||
| 26 | { |
||
| 27 | if (!isset($configuration['row']['identifier'])) { |
||
| 28 | return; |
||
| 29 | } |
||
| 30 | |||
| 31 | try { |
||
| 32 | $site = $this->siteFinder->getSiteByIdentifier($configuration['row']['identifier']); |
||
|
0 ignored issues
–
show
|
|||
| 33 | } catch (SiteNotFoundException $exception) { |
||
| 34 | return; |
||
| 35 | } |
||
| 36 | |||
| 37 | $configuration['items'][] = ['', '']; |
||
| 38 | foreach ($site->getAllLanguages() as $language) { |
||
| 39 | $configuration['items'][] = [$language->getTitle(), $language->getLanguageId()]; |
||
| 40 | } |
||
| 41 | } |
||
| 42 | } |
||
| 43 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.