‪TYPO3CMS  10.4
PlaceholderProcessorList.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
21 
26 {
30  protected ‪$processors;
31 
32  public function ‪__construct($processorList = [])
33  {
34  $this->processors = $processorList;
35  }
36 
40  public function ‪compile(): array
41  {
42  ‪$processors = [];
43  $orderingService = GeneralUtility::makeInstance(DependencyOrderingService::class);
44  $orderedProcessors = $orderingService->orderByDependencies($this->processors, 'before', 'after');
45 
46  foreach ($orderedProcessors as $processorClassName => $providerConfig) {
47  if (isset($providerConfig['disabled']) && $providerConfig['disabled'] === true) {
48  continue;
49  }
50 
51  $processor = GeneralUtility::makeInstance($processorClassName);
52  if (!$processor instanceof PlaceholderProcessorInterface) {
53  throw new \UnexpectedValueException(
54  'Placeholder processor ' . $processorClassName . ' must implement PlaceholderProcessorInterface',
55  1581343410
56  );
57  }
58  ‪$processors[] = $processor;
59  }
60  return ‪$processors;
61  }
62 }
‪TYPO3\CMS\Core\Configuration\Processor\PlaceholderProcessorList\compile
‪PlaceholderProcessorInterface[] compile()
Definition: PlaceholderProcessorList.php:39
‪TYPO3\CMS\Core\Configuration\Processor
‪TYPO3\CMS\Core\Configuration\Processor\PlaceholderProcessorList\__construct
‪__construct($processorList=[])
Definition: PlaceholderProcessorList.php:31
‪TYPO3\CMS\Core\Service\DependencyOrderingService
Definition: DependencyOrderingService.php:32
‪TYPO3\CMS\Core\Configuration\Processor\Placeholder\PlaceholderProcessorInterface
Definition: PlaceholderProcessorInterface.php:19
‪TYPO3\CMS\Core\Configuration\Processor\PlaceholderProcessorList
Definition: PlaceholderProcessorList.php:26
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Core\Configuration\Processor\PlaceholderProcessorList\$processors
‪PlaceholderProcessorInterface[] $processors
Definition: PlaceholderProcessorList.php:29