Remove containerAwareInterface, no longer supported in sf72

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

View File

@@ -16,8 +16,7 @@ use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Load countries into database.

View File

@@ -13,11 +13,8 @@ namespace Chill\MainBundle\DataFixtures\ORM;
use Chill\MainBundle\Entity\Language;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Load languages into database.

View File

@@ -16,7 +16,6 @@ use Chill\MainBundle\Entity\User;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Persistence\ObjectManager;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\Security\Core\Encoder\EncoderFactory;
/**

View File

@@ -14,13 +14,9 @@ namespace Chill\Migrations\Main;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use libphonenumber\PhoneNumberUtil;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
final class Version20220302132728 extends AbstractMigration implements ContainerAwareInterface
final class Version20220302132728 extends AbstractMigration
{
use ContainerAwareTrait;
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 TYPE VARCHAR(64)');
@@ -38,11 +34,10 @@ final class Version20220302132728 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');
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_main_location ALTER phonenumber1 TYPE VARCHAR(35)');
@@ -56,9 +51,9 @@ final class Version20220302132728 extends AbstractMigration implements Container
$this->addSql(
'UPDATE chill_main_location SET '.
$this->buildMigrationPhonenumberClause($carrier_code, 'phonenumber1').
$this->buildMigrationPhonenumberClause($carrierCode, 'phonenumber1').
', '.
$this->buildMigrationPhoneNumberClause($carrier_code, 'phonenumber2')
$this->buildMigrationPhoneNumberClause($carrierCode, 'phonenumber2')
);
}