mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-26 17:43:54 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -14,7 +14,6 @@ namespace Chill\Migrations\Report;
|
||||
use Chill\MainBundle\Entity\Scope;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
use RuntimeException;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
@@ -28,7 +27,7 @@ class Version20150622233319 extends AbstractMigration implements ContainerAwareI
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->abortIf(
|
||||
$this->connection->getDatabasePlatform()->getName() !== 'postgresql',
|
||||
'postgresql' !== $this->connection->getDatabasePlatform()->getName(),
|
||||
'Migration can only be executed safely on \'postgresql\'.'
|
||||
);
|
||||
|
||||
@@ -38,11 +37,10 @@ class Version20150622233319 extends AbstractMigration implements ContainerAwareI
|
||||
$this->addSql('ALTER TABLE Report DROP scope_id');
|
||||
}
|
||||
|
||||
public function setContainer(?ContainerInterface $container = null)
|
||||
public function setContainer(ContainerInterface $container = null)
|
||||
{
|
||||
if (null === $container) {
|
||||
throw new RuntimeException('Container is not provided. This migration '
|
||||
. 'need container to set a default center');
|
||||
throw new \RuntimeException('Container is not provided. This migration need container to set a default center');
|
||||
}
|
||||
|
||||
$this->container = $container;
|
||||
@@ -51,7 +49,7 @@ class Version20150622233319 extends AbstractMigration implements ContainerAwareI
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->abortIf(
|
||||
$this->connection->getDatabasePlatform()->getName() !== 'postgresql',
|
||||
'postgresql' !== $this->connection->getDatabasePlatform()->getName(),
|
||||
'Migration can only be executed safely on \'postgresql\'.'
|
||||
);
|
||||
|
||||
@@ -101,10 +99,10 @@ class Version20150622233319 extends AbstractMigration implements ContainerAwareI
|
||||
}
|
||||
}*/
|
||||
|
||||
$this->addSql('ALTER TABLE report DROP scope'); //before this migration, scope was never used
|
||||
$this->addSql('ALTER TABLE report DROP scope'); // before this migration, scope was never used
|
||||
$this->addSql('ALTER TABLE report ADD CONSTRAINT FK_report_scope '
|
||||
. 'FOREIGN KEY (scope_id) '
|
||||
. 'REFERENCES scopes (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
.'FOREIGN KEY (scope_id) '
|
||||
.'REFERENCES scopes (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
|
||||
if (isset($defaultScopeId)) {
|
||||
$this->addSql('UPDATE report SET scope_id = :id', [
|
||||
|
Reference in New Issue
Block a user