Skip to content

Commit

Permalink
MigrationsExtension: replace deprecated setClass() with setType()
Browse files Browse the repository at this point in the history
  • Loading branch information
JanTvrdik committed Jan 20, 2024
1 parent 03a2891 commit da67747
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions src/Bridges/NetteDI/MigrationsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private function getDbalDefinition($dbal)
if ($factory) {
return $this->getContainerBuilder()
->addDefinition($this->prefix('dbal'))
->setClass(Nextras\Migrations\IDbal::class)
->setType(Nextras\Migrations\IDbal::class)
->setFactory($factory);

} elseif ($dbal === null) {
Expand Down Expand Up @@ -218,7 +218,7 @@ private function getDriverDefinition($driver, $dbal)
if ($factory) {
return $this->getContainerBuilder()
->addDefinition($this->prefix('driver'))
->setClass(Nextras\Migrations\IDriver::class)
->setType(Nextras\Migrations\IDriver::class)
->setFactory($factory);

} elseif ($driver === null) {
Expand Down Expand Up @@ -260,7 +260,7 @@ private function getPrinterDefinition($printer)
if ($factory) {
return $this->getContainerBuilder()
->addDefinition($this->prefix('printer'))
->setClass(Nextras\Migrations\IPrinter::class)
->setType(Nextras\Migrations\IPrinter::class)
->setFactory($factory);

} elseif ($printer === null) {
Expand Down Expand Up @@ -358,7 +358,7 @@ private function createGroupDefinitions(array $groups): array
$groupDefinitions[] = $builder->addDefinition($this->prefix("group.$serviceName"))
->addTag(self::TAG_GROUP, ['for' => [$this->name]])
->setAutowired(false)
->setClass(Nextras\Migrations\Entities\Group::class)
->setType(Nextras\Migrations\Entities\Group::class)
->addSetup('$name', [$groupName])
->addSetup('$enabled', [$enabled])
->addSetup('$directory', [$directory])
Expand All @@ -382,12 +382,12 @@ private function createExtensionHandlerDefinitions($driver, array $phpParams): a
$sqlHandler = $builder->addDefinition($this->prefix('extensionHandler.sql'))
->addTag(self::TAG_EXTENSION_HANDLER, ['for' => [$this->name], 'extension' => 'sql'])
->setAutowired(false)
->setClass(Nextras\Migrations\Extensions\SqlHandler::class)
->setType(Nextras\Migrations\Extensions\SqlHandler::class)
->setArguments([$driver]);

$phpHandler = $builder->addDefinition($this->prefix('extensionHandler.php'))
->addTag(self::TAG_EXTENSION_HANDLER, ['for' => [$this->name], 'extension' => 'php'])
->setClass(Nextras\Migrations\Extensions\PhpHandler::class)
->setType(Nextras\Migrations\Extensions\PhpHandler::class)
->setAutowired(false)
->setArguments([$phpParams]);

Expand All @@ -399,7 +399,7 @@ private function createConfigurationDefinition(): ServiceDefinition
{
return $this->getContainerBuilder()
->addDefinition($this->prefix('configuration'))
->setClass(Nextras\Migrations\IConfiguration::class)
->setType(Nextras\Migrations\IConfiguration::class)
->setFactory(Nextras\Migrations\Configurations\Configuration::class);
}

Expand All @@ -410,7 +410,7 @@ private function createDoctrineStructureDiffGeneratorDefinition(?string $ignored

return $builder->addDefinition($this->prefix('diffGenerator.structures'))
->setAutowired(false)
->setClass(Nextras\Migrations\IDiffGenerator::class)
->setType(Nextras\Migrations\IDiffGenerator::class)
->setFactory(Nextras\Migrations\Bridges\DoctrineOrm\StructureDiffGenerator::class)
->setArguments(['@Doctrine\ORM\EntityManagerInterface', $ignoredQueriesFile]);
}
Expand All @@ -427,17 +427,17 @@ private function createSymfonyCommandDefinitions($driver, $configuration, $print
$builder->addExcludedClasses([Nextras\Migrations\Bridges\SymfonyConsole\BaseCommand::class]);

$builder->addDefinition($this->prefix('continueCommand'))
->setClass(Nextras\Migrations\Bridges\SymfonyConsole\ContinueCommand::class)
->setType(Nextras\Migrations\Bridges\SymfonyConsole\ContinueCommand::class)
->setArguments([$driver, $configuration, $printer])
->addTag('kdyby.console.command');

$builder->addDefinition($this->prefix('createCommand'))
->setClass(Nextras\Migrations\Bridges\SymfonyConsole\CreateCommand::class)
->setType(Nextras\Migrations\Bridges\SymfonyConsole\CreateCommand::class)
->setArguments([$driver, $configuration, $printer])
->addTag('kdyby.console.command');

$builder->addDefinition($this->prefix('resetCommand'))
->setClass(Nextras\Migrations\Bridges\SymfonyConsole\ResetCommand::class)
->setType(Nextras\Migrations\Bridges\SymfonyConsole\ResetCommand::class)
->setArguments([$driver, $configuration, $printer])
->addTag('kdyby.console.command');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/matrix/nette-di/nette-2.4-php-7.1.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
PHP_VERSION_MIN="70100"
PHP_VERSION_MAX="70199"
COMPOSER_REQUIRE="$COMPOSER_REQUIRE nette/di:~2.4.1"
COMPOSER_REQUIRE="$COMPOSER_REQUIRE nette/di:~2.4.10"
COMPOSER_REQUIRE="$COMPOSER_REQUIRE nette/utils:~2.4.0"
COMPOSER_REQUIRE="$COMPOSER_REQUIRE dibi/dibi:~4.0"
COMPOSER_REQUIRE="$COMPOSER_REQUIRE doctrine/dbal:~2.5"
Expand Down
2 changes: 1 addition & 1 deletion tests/matrix/nette-di/nette-2.4-php-7.2.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
PHP_VERSION_MIN="70200"
PHP_VERSION_MAX="70299"
COMPOSER_REQUIRE="$COMPOSER_REQUIRE nette/di:~2.4.7"
COMPOSER_REQUIRE="$COMPOSER_REQUIRE nette/di:~2.4.10"
COMPOSER_REQUIRE="$COMPOSER_REQUIRE nette/utils:~2.4.5"
COMPOSER_REQUIRE="$COMPOSER_REQUIRE dibi/dibi:~4.0"
COMPOSER_REQUIRE="$COMPOSER_REQUIRE doctrine/dbal:~2.5"
Expand Down

0 comments on commit da67747

Please sign in to comment.