apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -24,7 +24,7 @@ final class Version20190307111314 extends AbstractMigration
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('DROP SEQUENCE chill_third_party_id_seq CASCADE');
$this->addSql('DROP TABLE chill_third_party');
@@ -33,7 +33,7 @@ final class Version20190307111314 extends AbstractMigration
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('CREATE SEQUENCE chill_third_party_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE chill_third_party (id INT NOT NULL, name VARCHAR(255) NOT NULL, telephone VARCHAR(64) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, comment TEXT DEFAULT NULL, type JSON DEFAULT NULL, PRIMARY KEY(id))');

View File

@@ -23,7 +23,7 @@ final class Version20190307131650 extends AbstractMigration
{
// this down() migration is auto-generated, please modify it to your needs
$this->throwIrreversibleMigrationException('The down version of this migration is '
. 'not written');
.'not written');
}
public function up(Schema $schema): void

View File

@@ -21,7 +21,7 @@ final class Version20190418090842 extends AbstractMigration
{
public function down(Schema $schema): void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('DROP TABLE chill_3party.party_center');
$this->addSql('ALTER TABLE chill_3party.third_party DROP active');
@@ -29,7 +29,7 @@ final class Version20190418090842 extends AbstractMigration
public function up(Schema $schema): void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('CREATE TABLE chill_3party.party_center (thirdparty_id INT NOT NULL, center_id INT NOT NULL, PRIMARY KEY(thirdparty_id, center_id))');
$this->addSql('CREATE INDEX IDX_C65D4397C7D3A8E6 ON chill_3party.party_center (thirdparty_id)');

View File

@@ -27,8 +27,8 @@ final class Version20190429171109 extends AbstractMigration
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_3party.third_party RENAME COLUMN type '
. 'TO types');
.'TO types');
$this->addSql('ALTER TABLE chill_3party.third_party ALTER COLUMN types '
. 'SET DATA TYPE jsonb');
.'SET DATA TYPE jsonb');
}
}

View File

@@ -21,7 +21,7 @@ final class Version20190502144206 extends AbstractMigration
{
public function down(Schema $schema): void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE chill_3party.third_party DROP CONSTRAINT FK_D952467BF5B7AF75');
$this->addSql('ALTER TABLE chill_3party.third_party DROP address_id');
@@ -29,7 +29,7 @@ final class Version20190502144206 extends AbstractMigration
public function up(Schema $schema): void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE chill_3party.third_party ADD address_id INT DEFAULT NULL');
$this->addSql('COMMENT ON COLUMN chill_3party.third_party.types IS NULL');

View File

@@ -14,7 +14,6 @@ namespace Chill\Migrations\ThirdParty;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use libphonenumber\PhoneNumberUtil;
use RuntimeException;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
@@ -40,7 +39,7 @@ final class Version20220302143821 extends AbstractMigration implements Container
->getParameter('chill_main')['phone_helper']['default_carrier_code'];
if (null === $carrier_code) {
throw new RuntimeException('no carrier code');
throw new \RuntimeException('no carrier code');
}
$this->addSql('ALTER TABLE chill_3party.third_party ALTER telephone TYPE VARCHAR(35)');
@@ -49,7 +48,7 @@ final class Version20220302143821 extends AbstractMigration implements Container
$this->addSql('COMMENT ON COLUMN chill_3party.third_party.telephone IS \'(DC2Type:phone_number)\'');
$this->addSql(
'UPDATE chill_3party.third_party SET ' .
'UPDATE chill_3party.third_party SET '.
$this->buildMigrationPhonenumberClause($carrier_code, 'telephone')
);
}

View File

@@ -11,12 +11,8 @@ declare(strict_types=1);
namespace Chill\Migrations\ThirdParty;
use Chill\ThirdPartyBundle\Entity\ThirdPartyProfession;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Types\Types;
use Doctrine\Migrations\AbstractMigration;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
final class Version20230215175150 extends AbstractMigration
{
@@ -30,10 +26,9 @@ final class Version20230215175150 extends AbstractMigration
return 'Change profession to a string field and transfer values';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_3party.third_party ADD profession TEXT DEFAULT \'\' NOT NULL');
$this->addSql('UPDATE chill_3party.third_party SET profession = party_profession.name->>\'fr\' FROM chill_3party.party_profession WHERE party_profession.id = third_party.profession_id') ;
$this->addSql('UPDATE chill_3party.third_party SET profession = party_profession.name->>\'fr\' FROM chill_3party.party_profession WHERE party_profession.id = third_party.profession_id');
}
}