Skip to content

Commit

Permalink
mise à jour du cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitLeveque committed Feb 25, 2023
1 parent 855e532 commit ea23b34
Show file tree
Hide file tree
Showing 110 changed files with 351 additions and 387 deletions.
41 changes: 24 additions & 17 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,36 @@
__DIR__ . '/src',
])
;
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('config')
->exclude('var')
->exclude('public/bundles')
->exclude('public/build')
// exclude files generated by Symfony Flex recipes
->notPath('bin/console')
->notPath('public/index.php')
;

return (new PhpCsFixer\Config())
->setUsingCache(true)
->setRiskyAllowed(true)
->setFinder($finder)
->setRules([
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'concat_space' => ['spacing' => 'one'],
'declare_strict_types' => true,
'native_function_invocation' => ['include' => ['@compiler_optimized']],
'@Symfony:risky' => true,
'no_superfluous_phpdoc_tags' => true,
'ordered_imports' => true,
'phpdoc_summary' => false,
'phpdoc_annotation_without_dot' => false,
'linebreak_after_opening_tag' => true,
'mb_str_functions' => true,
'no_php4_constructor' => true,
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'php_unit_strict' => true,
'phpdoc_order' => true,
'psr_autoloading' => false,
'single_line_throw' => false,
'simplified_null_return' => false,
'visibility_required' => ['elements' => ['property', 'method']],
'yoda_style' => [
'equal' => null,
'identical' => null,
'less_and_greater' => null,
],
'strict_comparison' => true,
'strict_param' => true,
'blank_line_between_import_groups' => false,
])
->setFinder($finder)
->setCacheFile(__DIR__.'/var/.php-cs-fixer.cache')
;
2 changes: 1 addition & 1 deletion migrations/Version20141013205317.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Application\Migrations;

use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

class Version20141013205317 extends AbstractMigration
{
Expand Down
8 changes: 1 addition & 7 deletions migrations/Version20160918141903.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@

namespace Application\Migrations;

use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

class Version20160918141903 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE response ADD otherLanguage INT DEFAULT NULL');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema): void
{
}
Expand Down
9 changes: 1 addition & 8 deletions migrations/Version20160918144731.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

namespace Application\Migrations;

use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20160918144731 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema): void
{
$this->addSql(<<<'SQL'
Expand All @@ -23,12 +20,8 @@ public function up(Schema $schema): void
);
}

/**
* @param Schema $schema
*/
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs

}
}
8 changes: 1 addition & 7 deletions migrations/Version20160918150320.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@

namespace Application\Migrations;

use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

class Version20160918150320 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE response ADD remoteUsage INT DEFAULT NULL');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema): void
{
}
Expand Down
8 changes: 1 addition & 7 deletions migrations/Version20160918153515.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@

namespace Application\Migrations;

use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

class Version20160918153515 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE response ADD meetupParticipation INT DEFAULT NULL');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema): void
{
}
Expand Down
8 changes: 1 addition & 7 deletions migrations/Version20161009134550.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,16 @@

namespace Application\Migrations;

use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

class Version20161009134550 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE response CHANGE isRecentTrainingHadSalaryImpact isRecentTrainingHadSalaryImpact TINYINT(1) DEFAULT NULL');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema): void
{
}
Expand Down
8 changes: 1 addition & 7 deletions migrations/Version20171014173955.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,19 @@

namespace Application\Migrations;

use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20171014173955 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE response ADD companyOrigin VARCHAR(255) DEFAULT NULL');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema): void
{
}
Expand Down
12 changes: 3 additions & 9 deletions migrations/Version20191223141442.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@

namespace Application\Migrations;

use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20191223141442 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('CREATE TABLE hosting_type (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(100) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE response_hostingtype (response_id INT NOT NULL, hostingtype_id INT NOT NULL, INDEX IDX_4AC9A7EDFBF32840 (response_id), INDEX IDX_4AC9A7ED61CE1A05 (hostingtype_id), PRIMARY KEY(response_id, hostingtype_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
Expand All @@ -29,13 +26,10 @@ public function up(Schema $schema): void
$this->addSql('ALTER TABLE response ADD freelanceTjm INT DEFAULT NULL, ADD freelanceAverageWorkDayPerYear INT DEFAULT NULL, ADD contractWorkDuration INT DEFAULT NULL, ADD workMethod INT DEFAULT NULL, ADD phpDocumentationSource INT DEFAULT NULL, ADD frenchPhpDocumentationQuality INT DEFAULT NULL');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE response_hostingtype DROP FOREIGN KEY FK_4AC9A7ED61CE1A05');
$this->addSql('ALTER TABLE response_containerenvironmentusage DROP FOREIGN KEY FK_6608F85E443CCD38');
Expand Down
8 changes: 1 addition & 7 deletions migrations/Version20200103170544.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@

namespace Application\Migrations;

use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

class Version20200103170544 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema): void
{
$sqlHostingType = 'INSERT INTO hosting_type (name) VALUE (:name)';
Expand Down Expand Up @@ -38,9 +35,6 @@ public function up(Schema $schema): void
}
}

/**
* @param Schema $schema
*/
public function down(Schema $schema): void
{
}
Expand Down
12 changes: 3 additions & 9 deletions migrations/Version20210110093130.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,26 @@

namespace Application\Migrations;

use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20210110093130 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE response ADD cmsUsageInProject INT DEFAULT NULL, ADD covid19CompanyTrust INT DEFAULT NULL, ADD covid19CompanyHandle INT DEFAULT NULL, ADD covid19Layoff INT DEFAULT NULL, ADD covid19FuturePlan INT DEFAULT NULL, ADD covid19SalaryImpact INT DEFAULT NULL, ADD covid19PartialUnemployment INT DEFAULT NULL, ADD covid19RegularRemoteFeeling INT DEFAULT NULL, ADD covid19RemoteIdealPace INT DEFAULT NULL');
}

/**
* @param Schema $schema
*/
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE response DROP cmsUsageInProject, DROP covid19CompanyTrust, DROP covid19CompanyHandle, DROP covid19Layoff, DROP covid19FuturePlan, DROP covid19SalaryImpact, DROP covid19PartialUnemployment, DROP covid19RegularRemoteFeeling, DROP covid19RemoteIdealPace');
}
Expand Down
7 changes: 3 additions & 4 deletions migrations/Version20220205130603.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function getDescription(): string

public function up(Schema $schema): void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('CREATE TABLE job_interest (id INT NOT NULL, name VARCHAR(100) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
$this->addSql('CREATE TABLE response_jobinterest (response_id INT NOT NULL, jobinterest_id INT NOT NULL, INDEX IDX_2240560EFBF32840 (response_id), INDEX IDX_2240560E53A99FEC (jobinterest_id), PRIMARY KEY(response_id, jobinterest_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
Expand All @@ -26,7 +26,7 @@ public function up(Schema $schema): void

$this->addSql(<<<SQL
INSERT INTO job_interest (id, name)
VALUES
VALUES
(0, 'Autre'),
(1, 'La qualité de vie autour de votre emploi'),
(2, 'L\'intérêt technique de vos projets'),
Expand All @@ -38,13 +38,12 @@ public function up(Schema $schema): void

$this->addSql('INSERT INTO response_jobinterest (response_id, jobinterest_id) SELECT id, jobInterest FROM response');


$this->addSql('ALTER TABLE response DROP jobInterest');
}

public function down(Schema $schema): void
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');

$this->addSql('ALTER TABLE response_jobinterest DROP FOREIGN KEY FK_2240560E53A99FEC');
$this->addSql('DROP TABLE job_interest');
Expand Down
2 changes: 1 addition & 1 deletion src/Campaign/Format/FormatFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class FormatFactory
*/
public function createFromCode($code)
{
$class = '\App\Campaign\Format\Formats\Format' . $code;
$class = '\App\Campaign\Format\Formats\Format'.$code;
if (!class_exists($class)) {
throw new \InvalidArgumentException(sprintf('Code %s invalid', $code));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Campaign/Format/Formats/Format2013.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function alterData(array $data)

$data['gender'] = '';

if ($data['initial_training'] === 'Niveau Master2 ou ingénieur') {
if ('Niveau Master2 ou ingénieur' === $data['initial_training']) {
$data['initial_training'] = 'Niveau Master2 ou ingénieur';
}

Expand Down
Loading

0 comments on commit ea23b34

Please sign in to comment.