Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
80.00% |
4 / 5 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| AbstractAdministrationApiController | |
80.00% |
4 / 5 |
|
0.00% |
0 / 1 |
2.03 | |
0.00% |
0 / 1 |
| initializeFromContainer | |
80.00% |
4 / 5 |
|
0.00% |
0 / 1 |
2.03 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | /** |
| 6 | * The abstract Administration API controller |
| 7 | * |
| 8 | * This Source Code Form is subject to the terms of the Mozilla Public License, |
| 9 | * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
| 10 | * obtain one at https://mozilla.org/MPL/2.0/. |
| 11 | * |
| 12 | * @package phpMyFAQ |
| 13 | * @author Thorsten Rinne <thorsten@phpmyfaq.de> |
| 14 | * @copyright 2026 phpMyFAQ Team |
| 15 | * @license https://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
| 16 | * @link https://www.phpmyfaq.de |
| 17 | * @since 2026-01-06 |
| 18 | */ |
| 19 | |
| 20 | namespace phpMyFAQ\Controller\Administration\Api; |
| 21 | |
| 22 | use Override; |
| 23 | use phpMyFAQ\Administration\AdminLog; |
| 24 | use phpMyFAQ\Controller\AbstractController; |
| 25 | |
| 26 | abstract class AbstractAdministrationApiController extends AbstractController |
| 27 | { |
| 28 | protected AdminLog $adminLog; |
| 29 | |
| 30 | #[Override] |
| 31 | protected function initializeFromContainer(): void |
| 32 | { |
| 33 | parent::initializeFromContainer(); |
| 34 | |
| 35 | $adminLog = $this->container->get(id: 'phpmyfaq.admin.admin-log'); |
| 36 | if (!$adminLog instanceof AdminLog) { |
| 37 | throw new \LogicException('AdminLog service not found in container.'); |
| 38 | } |
| 39 | |
| 40 | $this->adminLog = $adminLog; |
| 41 | } |
| 42 | } |