cs: Fix code style (safe rules only).

This commit is contained in:
Pol Dellaiera
2021-11-23 14:06:38 +01:00
parent 149d7ce991
commit 8f96a1121d
1223 changed files with 65199 additions and 64625 deletions

View File

@@ -1,5 +1,12 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\Migrations\Calendar;
@@ -8,10 +15,34 @@ use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Create the schema chill_calendar and several calendar entities
* Create the schema chill_calendar and several calendar entities.
*/
final class Version20210715141731 extends AbstractMigration
{
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_calendar.calendar_to_persons DROP CONSTRAINT FK_AEE94715A40A2C8');
$this->addSql('ALTER TABLE chill_calendar.calendar_to_non_professionals DROP CONSTRAINT FK_FADF2C77A40A2C8');
$this->addSql('ALTER TABLE chill_calendar.calendar_to_thirdparties DROP CONSTRAINT FK_2BAB7EFDA40A2C8');
$this->addSql('ALTER TABLE chill_calendar.calendar_to_invites DROP CONSTRAINT FK_FCBEAAAA40A2C8');
$this->addSql('ALTER TABLE chill_calendar.calendar DROP CONSTRAINT FK_712315ACC5CB285D');
$this->addSql('ALTER TABLE chill_calendar.calendar DROP CONSTRAINT FK_712315ACE980772F');
$this->addSql('ALTER TABLE chill_calendar.calendar_to_invites DROP CONSTRAINT FK_FCBEAAAEA417747');
$this->addSql('DROP SEQUENCE chill_calendar.calendar_id_seq CASCADE');
$this->addSql('DROP SEQUENCE chill_calendar.calendar_range_id_seq CASCADE');
$this->addSql('DROP SEQUENCE chill_calendar.cancel_reason_id_seq CASCADE');
$this->addSql('DROP SEQUENCE chill_calendar.invite_id_seq CASCADE');
$this->addSql('DROP TABLE chill_calendar.calendar');
$this->addSql('DROP TABLE chill_calendar.calendar_to_persons');
$this->addSql('DROP TABLE chill_calendar.calendar_to_non_professionals');
$this->addSql('DROP TABLE chill_calendar.calendar_to_thirdparties');
$this->addSql('DROP TABLE chill_calendar.calendar_to_invites');
$this->addSql('DROP TABLE chill_calendar.calendar_range');
$this->addSql('DROP TABLE chill_calendar.cancel_reason');
$this->addSql('DROP TABLE chill_calendar.invite');
$this->addSql('DROP SCHEMA chill_calendar');
}
public function getDescription(): string
{
return 'Create the schema chill_calendar and several calendar entities';
@@ -69,28 +100,4 @@ final class Version20210715141731 extends AbstractMigration
$this->addSql('ALTER TABLE chill_calendar.calendar_range ADD CONSTRAINT FK_38D57D05A76ED395 FOREIGN KEY (user_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_calendar.invite ADD CONSTRAINT FK_F517FFA7A76ED395 FOREIGN KEY (user_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_calendar.calendar_to_persons DROP CONSTRAINT FK_AEE94715A40A2C8');
$this->addSql('ALTER TABLE chill_calendar.calendar_to_non_professionals DROP CONSTRAINT FK_FADF2C77A40A2C8');
$this->addSql('ALTER TABLE chill_calendar.calendar_to_thirdparties DROP CONSTRAINT FK_2BAB7EFDA40A2C8');
$this->addSql('ALTER TABLE chill_calendar.calendar_to_invites DROP CONSTRAINT FK_FCBEAAAA40A2C8');
$this->addSql('ALTER TABLE chill_calendar.calendar DROP CONSTRAINT FK_712315ACC5CB285D');
$this->addSql('ALTER TABLE chill_calendar.calendar DROP CONSTRAINT FK_712315ACE980772F');
$this->addSql('ALTER TABLE chill_calendar.calendar_to_invites DROP CONSTRAINT FK_FCBEAAAEA417747');
$this->addSql('DROP SEQUENCE chill_calendar.calendar_id_seq CASCADE');
$this->addSql('DROP SEQUENCE chill_calendar.calendar_range_id_seq CASCADE');
$this->addSql('DROP SEQUENCE chill_calendar.cancel_reason_id_seq CASCADE');
$this->addSql('DROP SEQUENCE chill_calendar.invite_id_seq CASCADE');
$this->addSql('DROP TABLE chill_calendar.calendar');
$this->addSql('DROP TABLE chill_calendar.calendar_to_persons');
$this->addSql('DROP TABLE chill_calendar.calendar_to_non_professionals');
$this->addSql('DROP TABLE chill_calendar.calendar_to_thirdparties');
$this->addSql('DROP TABLE chill_calendar.calendar_to_invites');
$this->addSql('DROP TABLE chill_calendar.calendar_range');
$this->addSql('DROP TABLE chill_calendar.cancel_reason');
$this->addSql('DROP TABLE chill_calendar.invite');
$this->addSql('DROP SCHEMA chill_calendar');
}
}

View File

@@ -1,5 +1,12 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\Migrations\Calendar;
@@ -8,10 +15,21 @@ use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Adapt calendar entities
* Adapt calendar entities.
*/
final class Version20210723074557 extends AbstractMigration
{
public function down(Schema $schema): void
{
$this->addSql('CREATE TABLE chill_calendar.calendar_to_non_professionals (calendar_id INT NOT NULL, person_id INT NOT NULL, PRIMARY KEY(calendar_id, person_id))');
$this->addSql('CREATE INDEX idx_fadf2c77217bbb47 ON chill_calendar.calendar_to_non_professionals (person_id)');
$this->addSql('CREATE INDEX idx_fadf2c77a40a2c8 ON chill_calendar.calendar_to_non_professionals (calendar_id)');
$this->addSql('ALTER TABLE chill_calendar.calendar_to_non_professionals ADD CONSTRAINT fk_fadf2c77a40a2c8 FOREIGN KEY (calendar_id) REFERENCES chill_calendar.calendar (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_calendar.calendar_to_non_professionals ADD CONSTRAINT fk_fadf2c77217bbb47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_calendar.cancel_reason ALTER canceledBy TYPE JSON');
$this->addSql('ALTER TABLE chill_calendar.cancel_reason ALTER canceledBy DROP DEFAULT');
}
public function getDescription(): string
{
return 'Adapt calendar entities';
@@ -24,15 +42,4 @@ final class Version20210723074557 extends AbstractMigration
$this->addSql('ALTER TABLE chill_calendar.cancel_reason ALTER canceledby DROP DEFAULT');
$this->addSql('COMMENT ON COLUMN chill_calendar.cancel_reason.canceledBy IS NULL');
}
public function down(Schema $schema): void
{
$this->addSql('CREATE TABLE chill_calendar.calendar_to_non_professionals (calendar_id INT NOT NULL, person_id INT NOT NULL, PRIMARY KEY(calendar_id, person_id))');
$this->addSql('CREATE INDEX idx_fadf2c77217bbb47 ON chill_calendar.calendar_to_non_professionals (person_id)');
$this->addSql('CREATE INDEX idx_fadf2c77a40a2c8 ON chill_calendar.calendar_to_non_professionals (calendar_id)');
$this->addSql('ALTER TABLE chill_calendar.calendar_to_non_professionals ADD CONSTRAINT fk_fadf2c77a40a2c8 FOREIGN KEY (calendar_id) REFERENCES chill_calendar.calendar (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_calendar.calendar_to_non_professionals ADD CONSTRAINT fk_fadf2c77217bbb47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE chill_calendar.cancel_reason ALTER canceledBy TYPE JSON');
$this->addSql('ALTER TABLE chill_calendar.cancel_reason ALTER canceledBy DROP DEFAULT');
}
}

View File

@@ -1,5 +1,12 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\Migrations\Calendar;
@@ -8,10 +15,20 @@ use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Alter startDate and endDate to datetimetz_immutable
* Alter startDate and endDate to datetimetz_immutable.
*/
final class Version20210723142003 extends AbstractMigration
{
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_calendar.calendar ALTER startDate TYPE DATE');
$this->addSql('ALTER TABLE chill_calendar.calendar ALTER startDate DROP DEFAULT');
$this->addSql('ALTER TABLE chill_calendar.calendar ALTER endDate TYPE DATE');
$this->addSql('ALTER TABLE chill_calendar.calendar ALTER endDate DROP DEFAULT');
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar.startdate IS \'(DC2Type:date_immutable)\'');
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar.enddate IS \'(DC2Type:date_immutable)\'');
}
public function getDescription(): string
{
return 'Alter startDate and endDate to datetimetz_immutable';
@@ -26,14 +43,4 @@ final class Version20210723142003 extends AbstractMigration
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar.startDate IS \'(DC2Type:datetimetz_immutable)\'');
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar.endDate IS \'(DC2Type:datetimetz_immutable)\'');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_calendar.calendar ALTER startDate TYPE DATE');
$this->addSql('ALTER TABLE chill_calendar.calendar ALTER startDate DROP DEFAULT');
$this->addSql('ALTER TABLE chill_calendar.calendar ALTER endDate TYPE DATE');
$this->addSql('ALTER TABLE chill_calendar.calendar ALTER endDate DROP DEFAULT');
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar.startdate IS \'(DC2Type:date_immutable)\'');
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar.enddate IS \'(DC2Type:date_immutable)\'');
}
}

View File

@@ -1,5 +1,12 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\Migrations\Calendar;
@@ -8,10 +15,20 @@ use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Alter startDate and endDate to datetimetz_immutable on calendarRange
* Alter startDate and endDate to datetimetz_immutable on calendarRange.
*/
final class Version20210723142842 extends AbstractMigration
{
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER startDate TYPE DATE');
$this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER startDate DROP DEFAULT');
$this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER endDate TYPE DATE');
$this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER endDate DROP DEFAULT');
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.startdate IS \'(DC2Type:date_immutable)\'');
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.enddate IS \'(DC2Type:date_immutable)\'');
}
public function getDescription(): string
{
return 'Alter startDate and endDate to datetimetz_immutable on calendarRange';
@@ -26,14 +43,4 @@ final class Version20210723142842 extends AbstractMigration
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.startDate IS \'(DC2Type:datetimetz_immutable)\'');
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.endDate IS \'(DC2Type:datetimetz_immutable)\'');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER startDate TYPE DATE');
$this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER startDate DROP DEFAULT');
$this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER endDate TYPE DATE');
$this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER endDate DROP DEFAULT');
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.startdate IS \'(DC2Type:date_immutable)\'');
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.enddate IS \'(DC2Type:date_immutable)\'');
}
}

View File

@@ -1,5 +1,12 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\Migrations\Calendar;
@@ -9,6 +16,11 @@ use Doctrine\Migrations\AbstractMigration;
final class Version20211119173557 extends AbstractMigration
{
public function down(Schema $schema): void
{
$this->throwIrreversibleMigrationException();
}
public function getDescription(): string
{
return 'remove comment on deprecated json_array type';
@@ -22,12 +34,7 @@ final class Version20211119173557 extends AbstractMigration
];
foreach ($columns as $col) {
$this->addSql("COMMENT ON COLUMN $col IS NULL");
$this->addSql("COMMENT ON COLUMN {$col} IS NULL");
}
}
public function down(Schema $schema): void
{
$this->throwIrreversibleMigrationException();
}
}