phpmyadmin/libraries/classes/Controllers/Setup/AbstractController.php
Maurício Meneghini Fauth 6a2c12bdc8
Add missing traversable type hints
Replace array type hint with mixed[] type hint, since it means the same.
This way it's possible to require traversable type hint for new code.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2023-04-02 01:32:12 -03:00

39 lines
908 B
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Controllers\Setup;
use PhpMyAdmin\Config\ConfigFile;
use PhpMyAdmin\Config\Forms\BaseForm;
use PhpMyAdmin\Config\Forms\Setup\SetupFormList;
use PhpMyAdmin\Template;
use function in_array;
abstract class AbstractController
{
public function __construct(protected ConfigFile $config, protected Template $template)
{
}
/** @return mixed[] */
protected function getPages(): array
{
$ignored = ['Config', 'Servers'];
$pages = [];
foreach (SetupFormList::getAllFormNames() as $formset) {
if (in_array($formset, $ignored)) {
continue;
}
/** @var BaseForm $formClass */
$formClass = SetupFormList::get($formset);
$pages[$formset] = ['name' => $formClass::getName(), 'formset' => $formset];
}
return $pages;
}
}