Remove containerAwareInterface, no longer supported in sf72

This commit is contained in:
2025-05-27 14:06:36 +02:00
parent 46f9e4968b
commit ebaff8d170
9 changed files with 23 additions and 67 deletions

View File

@@ -14,12 +14,9 @@ namespace Chill\Migrations\ThirdParty;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use libphonenumber\PhoneNumberUtil;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
final class Version20220302143821 extends AbstractMigration implements ContainerAwareInterface
final class Version20220302143821 extends AbstractMigration
{
use ContainerAwareTrait;
public function down(Schema $schema): void
{
@@ -35,11 +32,10 @@ final class Version20220302143821 extends AbstractMigration implements Container
public function up(Schema $schema): void
{
$carrier_code = $this->container
->getParameter('chill_main')['phone_helper']['default_carrier_code'];
$carrierCode = getenv('DEFAULT_CARRIER_CODE'); // Directly from the .env
if (null === $carrier_code) {
throw new \RuntimeException('no carrier code');
if (!$carrierCode) {
throw new \RuntimeException('Environment variable DEFAULT_CARRIER_CODE is not set.');
}
$this->addSql('ALTER TABLE chill_3party.third_party ALTER telephone TYPE VARCHAR(35)');
@@ -49,7 +45,7 @@ final class Version20220302143821 extends AbstractMigration implements Container
$this->addSql(
'UPDATE chill_3party.third_party SET '.
$this->buildMigrationPhonenumberClause($carrier_code, 'telephone')
$this->buildMigrationPhonenumberClause($carrierCode, 'telephone')
);
}