diff --git a/library/Icinga/Application/Hook/Common/DbMigration.php b/library/Icinga/Application/Hook/Common/DbMigrationStep.php similarity index 98% rename from library/Icinga/Application/Hook/Common/DbMigration.php rename to library/Icinga/Application/Hook/Common/DbMigrationStep.php index ae79da785..97d686f54 100644 --- a/library/Icinga/Application/Hook/Common/DbMigration.php +++ b/library/Icinga/Application/Hook/Common/DbMigrationStep.php @@ -7,7 +7,7 @@ namespace Icinga\Application\Hook\Common; use ipl\Sql\Connection; use RuntimeException; -class DbMigration +class DbMigrationStep { /** @var string The sql string to be executed */ protected $query; @@ -65,7 +65,7 @@ class DbMigration * * @param ?string $description * - * @return DbMigration + * @return DbMigrationStep */ public function setDescription(?string $description): self { diff --git a/library/Icinga/Application/Hook/MigrationHook.php b/library/Icinga/Application/Hook/MigrationHook.php index 4b8c632d0..dc31dd704 100644 --- a/library/Icinga/Application/Hook/MigrationHook.php +++ b/library/Icinga/Application/Hook/MigrationHook.php @@ -9,7 +9,7 @@ use DateTime; use DirectoryIterator; use Exception; use Icinga\Application\ClassLoader; -use Icinga\Application\Hook\Common\DbMigration; +use Icinga\Application\Hook\Common\DbMigrationStep; use Icinga\Application\Icinga; use Icinga\Application\Logger; use Icinga\Application\Modules\Module; @@ -51,7 +51,7 @@ abstract class MigrationHook implements Countable public const ALL_MIGRATIONS = 'all-migrations'; - /** @var ?array All pending database migrations of this hook */ + /** @var ?array All pending database migrations of this hook */ protected $migrations; /** @var ?string The current version of this hook */ @@ -141,7 +141,7 @@ abstract class MigrationHook implements Countable /** * Get all the pending migrations of this hook * - * @return DbMigration[] + * @return DbMigrationStep[] */ public function getMigrations(): array { @@ -159,7 +159,7 @@ abstract class MigrationHook implements Countable * * @param int $limit * - * @return DbMigration[] + * @return DbMigrationStep[] */ public function getLatestMigrations(int $limit): array { @@ -282,7 +282,7 @@ abstract class MigrationHook implements Countable foreach (new DirectoryIterator($path . DIRECTORY_SEPARATOR . $upgradeDir) as $file) { if (preg_match('/^(?:r|v)?((?:\d+\.){0,2}\d+)(?:_([\w+]+))?\.sql$/', $file->getFilename(), $m)) { if (version_compare($m[1], $version, '>')) { - $migration = new DbMigration($m[1], $file->getRealPath()); + $migration = new DbMigrationStep($m[1], $file->getRealPath()); if (isset($descriptions[$migration->getVersion()])) { $migration->setDescription($descriptions[$migration->getVersion()]); } elseif (isset($m[2])) { diff --git a/library/Icinga/Web/Widget/ItemList/MigrationFileListItem.php b/library/Icinga/Web/Widget/ItemList/MigrationFileListItem.php index 9ce63a881..007a730e0 100644 --- a/library/Icinga/Web/Widget/ItemList/MigrationFileListItem.php +++ b/library/Icinga/Web/Widget/ItemList/MigrationFileListItem.php @@ -4,7 +4,7 @@ namespace Icinga\Web\Widget\ItemList; -use Icinga\Application\Hook\Common\DbMigration; +use Icinga\Application\Hook\Common\DbMigrationStep; use ipl\Html\Attributes; use ipl\Html\BaseHtmlElement; use ipl\Html\Html; @@ -20,7 +20,7 @@ class MigrationFileListItem extends BaseListItem { use Translation; - /** @var DbMigration Just for type hint */ + /** @var DbMigrationStep Just for type hint */ protected $item; protected function assembleVisual(BaseHtmlElement $visual): void diff --git a/library/Icinga/Web/Widget/ItemList/MigrationList.php b/library/Icinga/Web/Widget/ItemList/MigrationList.php index b8a153b31..cb6147bae 100644 --- a/library/Icinga/Web/Widget/ItemList/MigrationList.php +++ b/library/Icinga/Web/Widget/ItemList/MigrationList.php @@ -5,7 +5,7 @@ namespace Icinga\Web\Widget\ItemList; use Generator; -use Icinga\Application\Hook\Common\DbMigration; +use Icinga\Application\Hook\Common\DbMigrationStep; use Icinga\Application\Hook\MigrationHook; use Icinga\Application\MigrationManager; use Icinga\Forms\MigrationForm; @@ -31,7 +31,7 @@ class MigrationList extends BaseItemList /** * Create a new migration list * - * @param Generator|array $data + * @param Generator|array $data * * @param ?MigrationForm $form */ diff --git a/library/Icinga/Web/Widget/ItemList/MigrationListItem.php b/library/Icinga/Web/Widget/ItemList/MigrationListItem.php index d9010db22..641ba5541 100644 --- a/library/Icinga/Web/Widget/ItemList/MigrationListItem.php +++ b/library/Icinga/Web/Widget/ItemList/MigrationListItem.php @@ -4,7 +4,7 @@ namespace Icinga\Web\Widget\ItemList; -use Icinga\Application\Hook\Common\DbMigration; +use Icinga\Application\Hook\Common\DbMigrationStep; use Icinga\Application\Hook\MigrationHook; use ipl\Html\Attributes; use ipl\Html\BaseHtmlElement; @@ -69,7 +69,7 @@ class MigrationListItem extends BaseListItem protected function assembleCaption(BaseHtmlElement $caption): void { $migrations = $this->item->getMigrations(); - /** @var DbMigration $migration */ + /** @var DbMigrationStep $migration */ $migration = array_shift($migrations); if ($migration->getLastState()) { if ($migration->getDescription()) {