| Total Complexity | 6 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class SettingsSectionLoader implements SettingsSectionLoaderInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var callable |
||
| 14 | */ |
||
| 15 | protected $outputLoader; |
||
| 16 | |||
| 17 | public function __construct(callable $outputLoader) |
||
| 18 | { |
||
| 19 | $this->outputLoader = $outputLoader; |
||
| 20 | } |
||
| 21 | |||
| 22 | public function getOutputLoader(): callable |
||
| 25 | } |
||
| 26 | |||
| 27 | public function registerOne(SettingsSectionInterface $section, ServerRequestInterface $request) |
||
| 28 | { |
||
| 29 | if ($section->shouldBeRendered($request)) { |
||
| 30 | add_settings_section( |
||
|
|
|||
| 31 | $section->getId(), |
||
| 32 | $section->getTitle(), |
||
| 33 | $this->getOutputLoader(), |
||
| 34 | $section->getPage() |
||
| 35 | ); |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | public function registerMany(SettingsSectionCollectionInterface $sections, ServerRequestInterface $request) |
||
| 43 | } |
||
| 44 | } |
||
| 46 |