mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-04 20:39:40 +00:00
Remove containerAwareInterface, no longer supported in sf72
This commit is contained in:
@@ -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.
|
||||
|
@@ -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.
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
|
@@ -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')
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user