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