Missing dependancies
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet;
|
||||
|
||||
use PhpCsFixer\Preg;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
abstract class AbstractMigrationSetDescription extends AbstractRuleSetDescription
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
$name = $this->getName();
|
||||
|
||||
if (0 !== Preg::match('#^@PHPUnit([\d]{2})Migration.*$#', $name, $matches)) {
|
||||
return sprintf('Rules to improve tests code for PHPUnit %d.%d compatibility.', $matches[1][0], $matches[1][1]);
|
||||
}
|
||||
|
||||
if (0 !== Preg::match('#^@PHP([\d]{2})Migration.*$#', $name, $matches)) {
|
||||
return sprintf('Rules to improve code for PHP %d.%d compatibility.', $matches[1][0], $matches[1][1]);
|
||||
}
|
||||
|
||||
throw new \RuntimeException(sprintf('Cannot generate description for "%s" "%s".', static::class, $name));
|
||||
}
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
abstract class AbstractRuleSetDescription implements RuleSetDescriptionInterface
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function getName(): string
|
||||
{
|
||||
$name = substr(static::class, 1 + strrpos(static::class, '\\'), -3);
|
||||
|
||||
return '@'.str_replace('Risky', ':risky', $name);
|
||||
}
|
||||
|
||||
public function isRisky(): bool
|
||||
{
|
||||
return str_contains(static::class, 'Risky');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet;
|
||||
|
||||
use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException;
|
||||
|
||||
/**
|
||||
* Set of rules to be used by fixer.
|
||||
*
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
final class RuleSet implements RuleSetInterface
|
||||
{
|
||||
/**
|
||||
* Group of rules generated from input set.
|
||||
*
|
||||
* The key is name of rule, value is bool if the rule/set should be used.
|
||||
* The key must not point to any set.
|
||||
*
|
||||
* @var array<string, array<string, mixed>|bool>
|
||||
*/
|
||||
private array $rules;
|
||||
|
||||
public function __construct(array $set = [])
|
||||
{
|
||||
foreach ($set as $name => $value) {
|
||||
if ('' === $name) {
|
||||
throw new \InvalidArgumentException('Rule/set name must not be empty.');
|
||||
}
|
||||
|
||||
// @phpstan-ignore-next-line
|
||||
if (\is_int($name)) {
|
||||
throw new \InvalidArgumentException(sprintf('Missing value for "%s" rule/set.', $value));
|
||||
}
|
||||
|
||||
// @phpstan-ignore-next-line
|
||||
if (!\is_bool($value) && !\is_array($value)) {
|
||||
$message = str_starts_with($name, '@') ? 'Set must be enabled (true) or disabled (false). Other values are not allowed.' : 'Rule must be enabled (true), disabled (false) or configured (non-empty, assoc array). Other values are not allowed.';
|
||||
|
||||
if (null === $value) {
|
||||
$message .= ' To disable the '.(str_starts_with($name, '@') ? 'set' : 'rule').', use "FALSE" instead of "NULL".';
|
||||
}
|
||||
|
||||
throw new InvalidFixerConfigurationException($name, $message);
|
||||
}
|
||||
}
|
||||
|
||||
$this->resolveSet($set);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function hasRule(string $rule): bool
|
||||
{
|
||||
return \array_key_exists($rule, $this->rules);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getRuleConfiguration(string $rule): ?array
|
||||
{
|
||||
if (!$this->hasRule($rule)) {
|
||||
throw new \InvalidArgumentException(sprintf('Rule "%s" is not in the set.', $rule));
|
||||
}
|
||||
|
||||
if (true === $this->rules[$rule]) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->rules[$rule];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getRules(): array
|
||||
{
|
||||
return $this->rules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve input set into group of rules.
|
||||
*
|
||||
* @param array<string, array<string, mixed>|bool> $rules
|
||||
*/
|
||||
private function resolveSet(array $rules): void
|
||||
{
|
||||
$resolvedRules = [];
|
||||
|
||||
// expand sets
|
||||
foreach ($rules as $name => $value) {
|
||||
if (str_starts_with($name, '@')) {
|
||||
if (!\is_bool($value)) {
|
||||
throw new \UnexpectedValueException(sprintf('Nested rule set "%s" configuration must be a boolean.', $name));
|
||||
}
|
||||
|
||||
$set = $this->resolveSubset($name, $value);
|
||||
$resolvedRules = array_merge($resolvedRules, $set);
|
||||
} else {
|
||||
$resolvedRules[$name] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// filter out all resolvedRules that are off
|
||||
$resolvedRules = array_filter($resolvedRules);
|
||||
|
||||
$this->rules = $resolvedRules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve set rules as part of another set.
|
||||
*
|
||||
* If set value is false then disable all fixers in set,
|
||||
* if not then get value from set item.
|
||||
*
|
||||
* @return array<string, array<string, mixed>|bool>
|
||||
*/
|
||||
private function resolveSubset(string $setName, bool $setValue): array
|
||||
{
|
||||
$rules = RuleSets::getSetDefinition($setName)->getRules();
|
||||
|
||||
foreach ($rules as $name => $value) {
|
||||
if (str_starts_with($name, '@')) {
|
||||
$set = $this->resolveSubset($name, $setValue);
|
||||
unset($rules[$name]);
|
||||
$rules = array_merge($rules, $set);
|
||||
} elseif (!$setValue) {
|
||||
$rules[$name] = false;
|
||||
} else {
|
||||
$rules[$name] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
interface RuleSetDescriptionInterface
|
||||
{
|
||||
public function getDescription(): string;
|
||||
|
||||
public function getName(): string;
|
||||
|
||||
/**
|
||||
* Get all rules from rules set.
|
||||
*
|
||||
* @return array<string, array<string, mixed>|bool>
|
||||
*/
|
||||
public function getRules(): array;
|
||||
|
||||
public function isRisky(): bool;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet;
|
||||
|
||||
/**
|
||||
* Set of rules to be used by fixer.
|
||||
*
|
||||
* Example of set: ["@PSR2" => true, "@PSR1" => false, "strict" => true].
|
||||
*
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*/
|
||||
interface RuleSetInterface
|
||||
{
|
||||
/**
|
||||
* @param array<string, array<string, mixed>|bool> $set
|
||||
*/
|
||||
public function __construct(array $set = []);
|
||||
|
||||
/**
|
||||
* Get configuration for given rule.
|
||||
*
|
||||
* @return null|array<string, mixed>
|
||||
*/
|
||||
public function getRuleConfiguration(string $rule): ?array;
|
||||
|
||||
/**
|
||||
* Get all rules from rules set.
|
||||
*
|
||||
* @return array<string, array<string, mixed>|bool>
|
||||
*/
|
||||
public function getRules(): array;
|
||||
|
||||
/**
|
||||
* Check given rule is in rules set.
|
||||
*/
|
||||
public function hasRule(string $rule): bool;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet;
|
||||
|
||||
use Symfony\Component\Finder\Finder;
|
||||
|
||||
/**
|
||||
* Set of rule sets to be used by fixer.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
final class RuleSets
|
||||
{
|
||||
/**
|
||||
* @var array<string,RuleSetDescriptionInterface>
|
||||
*/
|
||||
private static $setDefinitions;
|
||||
|
||||
/**
|
||||
* @return array<string, RuleSetDescriptionInterface>
|
||||
*/
|
||||
public static function getSetDefinitions(): array
|
||||
{
|
||||
if (null === self::$setDefinitions) {
|
||||
self::$setDefinitions = [];
|
||||
|
||||
foreach (Finder::create()->files()->in(__DIR__.'/Sets') as $file) {
|
||||
$class = 'PhpCsFixer\RuleSet\Sets\\'.$file->getBasename('.php');
|
||||
$set = new $class();
|
||||
|
||||
self::$setDefinitions[$set->getName()] = $set;
|
||||
}
|
||||
|
||||
ksort(self::$setDefinitions);
|
||||
}
|
||||
|
||||
return self::$setDefinitions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public static function getSetDefinitionNames(): array
|
||||
{
|
||||
return array_keys(self::getSetDefinitions());
|
||||
}
|
||||
|
||||
public static function getSetDefinition(string $name): RuleSetDescriptionInterface
|
||||
{
|
||||
$definitions = self::getSetDefinitions();
|
||||
|
||||
if (!isset($definitions[$name])) {
|
||||
throw new \InvalidArgumentException(sprintf('Set "%s" does not exist.', $name));
|
||||
}
|
||||
|
||||
return $definitions[$name];
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractRuleSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class DoctrineAnnotationSet extends AbstractRuleSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'doctrine_annotation_array_assignment' => [
|
||||
'operator' => ':',
|
||||
],
|
||||
'doctrine_annotation_braces' => true,
|
||||
'doctrine_annotation_indentation' => true,
|
||||
'doctrine_annotation_spaces' => [
|
||||
'before_array_assignments_colon' => false,
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Rules covering Doctrine annotations with configuration based on examples found in `Doctrine Annotation documentation <https://www.doctrine-project.org/projects/doctrine-annotations/en/latest/annotations.html>`_ and `Symfony documentation <https://symfony.com/doc/master/bundles/SensioFrameworkExtraBundle/annotations/routing.html>`_.';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractRuleSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* Last updated to PER Coding Style v1.0.0.
|
||||
*/
|
||||
final class PERRiskySet extends AbstractRuleSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PSR12:risky' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Rules that follow `PER Coding Style <https://www.php-fig.org/per/coding-style/>`_.';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractRuleSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* Last updated to PER Coding Style v1.0.0.
|
||||
*/
|
||||
final class PERSet extends AbstractRuleSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PSR12' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Rules that follow `PER Coding Style <https://www.php-fig.org/per/coding-style/>`_.';
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHP54MigrationSet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'array_syntax' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHP56MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'pow_to_exponentiation' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHP70MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHP56Migration:risky' => true,
|
||||
'combine_nested_dirname' => true,
|
||||
'declare_strict_types' => true,
|
||||
'non_printable_character' => true,
|
||||
'random_api_migration' => [
|
||||
'replacements' => [
|
||||
'mt_rand' => 'random_int',
|
||||
'rand' => 'random_int',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHP70MigrationSet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHP54Migration' => true,
|
||||
'ternary_to_null_coalescing' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHP71MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHP70Migration:risky' => true,
|
||||
'void_return' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHP71MigrationSet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHP70Migration' => true,
|
||||
'list_syntax' => true,
|
||||
'visibility_required' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHP73MigrationSet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHP71Migration' => true,
|
||||
'heredoc_indentation' => true,
|
||||
'method_argument_space' => ['after_heredoc' => true],
|
||||
'no_whitespace_before_comma_in_array' => ['after_heredoc' => true],
|
||||
'trailing_comma_in_multiline' => ['after_heredoc' => true],
|
||||
];
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHP74MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHP71Migration:risky' => true,
|
||||
'implode_call' => true,
|
||||
'no_alias_functions' => true,
|
||||
'use_arrow_functions' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHP74MigrationSet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHP73Migration' => true,
|
||||
'assign_null_coalescing_to_coalesce_equal' => true,
|
||||
'normalize_index_brace' => true,
|
||||
'short_scalar_cast' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHP80MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHP74Migration:risky' => true,
|
||||
'get_class_to_class_keyword' => true,
|
||||
'modernize_strpos' => true,
|
||||
'no_alias_functions' => [
|
||||
'sets' => [
|
||||
'@all',
|
||||
],
|
||||
],
|
||||
'no_php4_constructor' => true,
|
||||
'no_unneeded_final_method' => true, // final private method (not constructor) are no longer allowed >= PHP8.0
|
||||
'no_unreachable_default_argument_value' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHP80MigrationSet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHP74Migration' => true,
|
||||
'clean_namespace' => true,
|
||||
'no_unset_cast' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHP81MigrationSet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHP80Migration' => true,
|
||||
'octal_notation' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHP82MigrationSet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHP81Migration' => true,
|
||||
'simple_to_complex_string_variable' => true,
|
||||
];
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion;
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHPUnit30MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'php_unit_dedicate_assert' => [
|
||||
'target' => PhpUnitTargetVersion::VERSION_3_0,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion;
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHPUnit32MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHPUnit30Migration:risky' => true,
|
||||
'php_unit_no_expectation_annotation' => [
|
||||
'target' => PhpUnitTargetVersion::VERSION_3_2,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion;
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHPUnit35MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHPUnit32Migration:risky' => true,
|
||||
'php_unit_dedicate_assert' => [
|
||||
'target' => PhpUnitTargetVersion::VERSION_3_5,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion;
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHPUnit43MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHPUnit35Migration:risky' => true,
|
||||
'php_unit_no_expectation_annotation' => [
|
||||
'target' => PhpUnitTargetVersion::VERSION_4_3,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion;
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHPUnit48MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHPUnit43Migration:risky' => true,
|
||||
'php_unit_namespaced' => [
|
||||
'target' => PhpUnitTargetVersion::VERSION_4_8,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion;
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHPUnit50MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHPUnit48Migration:risky' => true,
|
||||
'php_unit_dedicate_assert' => [
|
||||
'target' => PhpUnitTargetVersion::VERSION_5_0,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion;
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHPUnit52MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHPUnit50Migration:risky' => true,
|
||||
'php_unit_expectation' => [
|
||||
'target' => PhpUnitTargetVersion::VERSION_5_2,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion;
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHPUnit54MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHPUnit52Migration:risky' => true,
|
||||
'php_unit_mock' => [
|
||||
'target' => PhpUnitTargetVersion::VERSION_5_4,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion;
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHPUnit55MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHPUnit54Migration:risky' => true,
|
||||
'php_unit_mock' => [
|
||||
'target' => PhpUnitTargetVersion::VERSION_5_5,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion;
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHPUnit56MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHPUnit55Migration:risky' => true,
|
||||
'php_unit_dedicate_assert' => [
|
||||
'target' => PhpUnitTargetVersion::VERSION_5_6,
|
||||
],
|
||||
'php_unit_expectation' => [
|
||||
'target' => PhpUnitTargetVersion::VERSION_5_6,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion;
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHPUnit57MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHPUnit56Migration:risky' => true,
|
||||
'php_unit_namespaced' => [
|
||||
'target' => PhpUnitTargetVersion::VERSION_5_7,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion;
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHPUnit60MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHPUnit57Migration:risky' => true,
|
||||
'php_unit_namespaced' => [
|
||||
'target' => PhpUnitTargetVersion::VERSION_6_0,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion;
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHPUnit75MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHPUnit60Migration:risky' => true,
|
||||
'php_unit_dedicate_assert_internal_type' => [
|
||||
'target' => PhpUnitTargetVersion::VERSION_7_5,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTargetVersion;
|
||||
use PhpCsFixer\RuleSet\AbstractMigrationSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PHPUnit84MigrationRiskySet extends AbstractMigrationSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHPUnit60Migration:risky' => true,
|
||||
'@PHPUnit75Migration:risky' => true,
|
||||
'php_unit_expectation' => [
|
||||
'target' => PhpUnitTargetVersion::VERSION_8_4,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractRuleSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PSR12RiskySet extends AbstractRuleSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'no_trailing_whitespace_in_string' => true,
|
||||
'no_unreachable_default_argument_value' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Rules that follow `PSR-12 <https://www.php-fig.org/psr/psr-12/>`_ standard.';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractRuleSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PSR12Set extends AbstractRuleSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PSR2' => true,
|
||||
'blank_line_after_opening_tag' => true,
|
||||
'blank_line_between_import_groups' => true,
|
||||
'braces' => [
|
||||
'allow_single_line_anonymous_class_with_empty_body' => true,
|
||||
],
|
||||
'class_definition' => [
|
||||
'inline_constructor_arguments' => false, // handled by method_argument_space fixer
|
||||
'space_before_parenthesis' => true, // defined in PSR12 ¶8. Anonymous Classes
|
||||
],
|
||||
'compact_nullable_typehint' => true,
|
||||
'declare_equal_normalize' => true,
|
||||
'lowercase_cast' => true,
|
||||
'lowercase_static_reference' => true,
|
||||
'new_with_braces' => true,
|
||||
'no_blank_lines_after_class_opening' => true,
|
||||
'no_leading_import_slash' => true,
|
||||
'no_whitespace_in_blank_line' => true,
|
||||
'ordered_class_elements' => [
|
||||
'order' => [
|
||||
'use_trait',
|
||||
],
|
||||
],
|
||||
'ordered_imports' => [
|
||||
'imports_order' => [
|
||||
'class',
|
||||
'function',
|
||||
'const',
|
||||
],
|
||||
'sort_algorithm' => 'none',
|
||||
],
|
||||
'return_type_declaration' => true,
|
||||
'short_scalar_cast' => true,
|
||||
'single_blank_line_before_namespace' => true,
|
||||
'single_import_per_statement' => ['group_to_single_imports' => false],
|
||||
'single_trait_insert_per_statement' => true,
|
||||
'ternary_operator_spaces' => true,
|
||||
'visibility_required' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Rules that follow `PSR-12 <https://www.php-fig.org/psr/psr-12/>`_ standard.';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractRuleSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PSR1Set extends AbstractRuleSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'encoding' => true,
|
||||
'full_opening_tag' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Rules that follow `PSR-1 <https://www.php-fig.org/psr/psr-1/>`_ standard.';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractRuleSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PSR2Set extends AbstractRuleSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PSR1' => true,
|
||||
'blank_line_after_namespace' => true,
|
||||
'braces' => true,
|
||||
'class_definition' => true,
|
||||
'constant_case' => true,
|
||||
'elseif' => true,
|
||||
'function_declaration' => true,
|
||||
'indentation_type' => true,
|
||||
'line_ending' => true,
|
||||
'lowercase_keywords' => true,
|
||||
'method_argument_space' => [
|
||||
'on_multiline' => 'ensure_fully_multiline',
|
||||
],
|
||||
'no_break_comment' => true,
|
||||
'no_closing_tag' => true,
|
||||
'no_space_around_double_colon' => true,
|
||||
'no_spaces_after_function_name' => true,
|
||||
'no_spaces_inside_parenthesis' => true,
|
||||
'no_trailing_whitespace' => true,
|
||||
'no_trailing_whitespace_in_comment' => true,
|
||||
'single_blank_line_at_eof' => true,
|
||||
'single_class_element_per_statement' => [
|
||||
'elements' => [
|
||||
'property',
|
||||
],
|
||||
],
|
||||
'single_import_per_statement' => true,
|
||||
'single_line_after_imports' => true,
|
||||
'switch_case_semicolon_to_colon' => true,
|
||||
'switch_case_space' => true,
|
||||
'visibility_required' => ['elements' => ['method', 'property']],
|
||||
];
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Rules that follow `PSR-2 <https://www.php-fig.org/psr/psr-2/>`_ standard.';
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractRuleSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PhpCsFixerRiskySet extends AbstractRuleSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PER:risky' => true,
|
||||
'@Symfony:risky' => true,
|
||||
'comment_to_phpdoc' => true,
|
||||
'final_internal_class' => true,
|
||||
// @TODO: consider switching to `true`, like in @Symfony
|
||||
'native_constant_invocation' => [
|
||||
'fix_built_in' => false,
|
||||
'include' => [
|
||||
'DIRECTORY_SEPARATOR',
|
||||
'PHP_INT_SIZE',
|
||||
'PHP_SAPI',
|
||||
'PHP_VERSION_ID',
|
||||
],
|
||||
'scope' => 'namespaced',
|
||||
'strict' => true,
|
||||
],
|
||||
'no_alias_functions' => [
|
||||
'sets' => [
|
||||
'@all',
|
||||
],
|
||||
],
|
||||
'no_unreachable_default_argument_value' => true,
|
||||
'no_unset_on_property' => true,
|
||||
'php_unit_strict' => true,
|
||||
'php_unit_test_case_static_method_calls' => true,
|
||||
'strict_comparison' => true,
|
||||
'strict_param' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Rule set as used by the PHP-CS-Fixer development team, highly opinionated.';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractRuleSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class PhpCsFixerSet extends AbstractRuleSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PER' => true,
|
||||
'@Symfony' => true,
|
||||
'align_multiline_comment' => true,
|
||||
'array_indentation' => true,
|
||||
'blank_line_before_statement' => [
|
||||
'statements' => [
|
||||
'break',
|
||||
'case',
|
||||
'continue',
|
||||
'declare',
|
||||
'default',
|
||||
'exit',
|
||||
'goto',
|
||||
'include',
|
||||
'include_once',
|
||||
'phpdoc',
|
||||
'require',
|
||||
'require_once',
|
||||
'return',
|
||||
'switch',
|
||||
'throw',
|
||||
'try',
|
||||
'yield',
|
||||
'yield_from',
|
||||
],
|
||||
],
|
||||
'combine_consecutive_issets' => true,
|
||||
'combine_consecutive_unsets' => true,
|
||||
'empty_loop_body' => true,
|
||||
'escape_implicit_backslashes' => true,
|
||||
'explicit_indirect_variable' => true,
|
||||
'explicit_string_variable' => true,
|
||||
'heredoc_to_nowdoc' => true,
|
||||
'method_argument_space' => [
|
||||
'on_multiline' => 'ensure_fully_multiline',
|
||||
],
|
||||
'method_chaining_indentation' => true,
|
||||
'multiline_comment_opening_closing' => true,
|
||||
'multiline_whitespace_before_semicolons' => [
|
||||
'strategy' => 'new_line_for_chained_calls',
|
||||
],
|
||||
'no_extra_blank_lines' => [
|
||||
'tokens' => [
|
||||
'attribute',
|
||||
'break',
|
||||
'case',
|
||||
'continue',
|
||||
'curly_brace_block',
|
||||
'default',
|
||||
'extra',
|
||||
'parenthesis_brace_block',
|
||||
'return',
|
||||
'square_brace_block',
|
||||
'switch',
|
||||
'throw',
|
||||
'use',
|
||||
],
|
||||
],
|
||||
'no_null_property_initialization' => true,
|
||||
'no_superfluous_elseif' => true,
|
||||
'no_unneeded_control_parentheses' => [
|
||||
'statements' => [
|
||||
'break',
|
||||
'clone',
|
||||
'continue',
|
||||
'echo_print',
|
||||
'negative_instanceof',
|
||||
'others',
|
||||
'return',
|
||||
'switch_case',
|
||||
'yield',
|
||||
'yield_from',
|
||||
],
|
||||
],
|
||||
'no_useless_else' => true,
|
||||
'no_useless_return' => true,
|
||||
'operator_linebreak' => [
|
||||
'only_booleans' => true,
|
||||
],
|
||||
'ordered_class_elements' => true,
|
||||
'php_unit_internal_class' => true,
|
||||
'php_unit_test_class_requires_covers' => true,
|
||||
'phpdoc_add_missing_param_annotation' => true,
|
||||
'phpdoc_no_empty_return' => true,
|
||||
'phpdoc_order_by_value' => true,
|
||||
'phpdoc_types_order' => true,
|
||||
'phpdoc_var_annotation_correct_order' => true,
|
||||
'return_assignment' => true,
|
||||
'single_line_comment_style' => true,
|
||||
'single_line_throw' => false,
|
||||
'whitespace_after_comma_in_array' => ['ensure_single_space' => true],
|
||||
];
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Rule set as used by the PHP-CS-Fixer development team, highly opinionated.';
|
||||
}
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractRuleSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class SymfonyRiskySet extends AbstractRuleSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PHP56Migration:risky' => true,
|
||||
'@PSR12:risky' => true,
|
||||
'array_push' => true,
|
||||
'combine_nested_dirname' => true,
|
||||
'dir_constant' => true,
|
||||
'ereg_to_preg' => true,
|
||||
'error_suppression' => true,
|
||||
'fopen_flag_order' => true,
|
||||
'fopen_flags' => [
|
||||
'b_mode' => false,
|
||||
],
|
||||
'function_to_constant' => true,
|
||||
'implode_call' => true,
|
||||
'is_null' => true,
|
||||
'logical_operators' => true,
|
||||
'modernize_types_casting' => true,
|
||||
'native_constant_invocation' => true,
|
||||
'native_function_invocation' => [
|
||||
'include' => [
|
||||
'@compiler_optimized',
|
||||
],
|
||||
'scope' => 'namespaced',
|
||||
'strict' => true,
|
||||
],
|
||||
'no_alias_functions' => true,
|
||||
'no_homoglyph_names' => true,
|
||||
'no_php4_constructor' => true,
|
||||
'no_unneeded_final_method' => true,
|
||||
'no_unreachable_default_argument_value' => false,
|
||||
'no_useless_sprintf' => true,
|
||||
'non_printable_character' => true,
|
||||
'ordered_traits' => true,
|
||||
'php_unit_construct' => true,
|
||||
'php_unit_mock_short_will_return' => true,
|
||||
'php_unit_set_up_tear_down_visibility' => true,
|
||||
'php_unit_test_annotation' => true,
|
||||
'psr_autoloading' => true,
|
||||
'self_accessor' => true,
|
||||
'set_type_to_cast' => true,
|
||||
'string_length_to_empty' => true,
|
||||
'string_line_ending' => true,
|
||||
'ternary_to_elvis_operator' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Rules that follow the official `Symfony Coding Standards <https://symfony.com/doc/current/contributing/code/standards.html>`_.';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* This file is part of PHP CS Fixer.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
namespace PhpCsFixer\RuleSet\Sets;
|
||||
|
||||
use PhpCsFixer\RuleSet\AbstractRuleSetDescription;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class SymfonySet extends AbstractRuleSetDescription
|
||||
{
|
||||
public function getRules(): array
|
||||
{
|
||||
return [
|
||||
'@PSR12' => true,
|
||||
'array_syntax' => true,
|
||||
'backtick_to_shell_exec' => true,
|
||||
'binary_operator_spaces' => true,
|
||||
'blank_line_before_statement' => [
|
||||
'statements' => [
|
||||
'return',
|
||||
],
|
||||
],
|
||||
'braces' => [
|
||||
'allow_single_line_anonymous_class_with_empty_body' => true,
|
||||
'allow_single_line_closure' => true,
|
||||
],
|
||||
'cast_spaces' => true,
|
||||
'class_attributes_separation' => [
|
||||
'elements' => [
|
||||
'method' => 'one',
|
||||
],
|
||||
],
|
||||
'class_definition' => [
|
||||
'single_line' => true,
|
||||
],
|
||||
'class_reference_name_casing' => true,
|
||||
'clean_namespace' => true,
|
||||
'concat_space' => true,
|
||||
'echo_tag_syntax' => true,
|
||||
'empty_loop_body' => ['style' => 'braces'],
|
||||
'empty_loop_condition' => true,
|
||||
'fully_qualified_strict_types' => true,
|
||||
'function_typehint_space' => true,
|
||||
'general_phpdoc_tag_rename' => [
|
||||
'replacements' => [
|
||||
'inheritDocs' => 'inheritDoc',
|
||||
],
|
||||
],
|
||||
'global_namespace_import' => [
|
||||
'import_classes' => false,
|
||||
'import_constants' => false,
|
||||
'import_functions' => false,
|
||||
],
|
||||
'include' => true,
|
||||
'increment_style' => true,
|
||||
'integer_literal_case' => true,
|
||||
'lambda_not_used_import' => true,
|
||||
'linebreak_after_opening_tag' => true,
|
||||
'magic_constant_casing' => true,
|
||||
'magic_method_casing' => true,
|
||||
'method_argument_space' => [
|
||||
'on_multiline' => 'ignore',
|
||||
],
|
||||
'native_function_casing' => true,
|
||||
'native_function_type_declaration_casing' => true,
|
||||
'no_alias_language_construct_call' => true,
|
||||
'no_alternative_syntax' => true,
|
||||
'no_binary_string' => true,
|
||||
'no_blank_lines_after_phpdoc' => true,
|
||||
'no_empty_comment' => true,
|
||||
'no_empty_phpdoc' => true,
|
||||
'no_empty_statement' => true,
|
||||
'no_extra_blank_lines' => [
|
||||
'tokens' => [
|
||||
'attribute',
|
||||
'case',
|
||||
'continue',
|
||||
'curly_brace_block',
|
||||
'default',
|
||||
'extra',
|
||||
'parenthesis_brace_block',
|
||||
'square_brace_block',
|
||||
'switch',
|
||||
'throw',
|
||||
'use',
|
||||
],
|
||||
],
|
||||
'no_leading_namespace_whitespace' => true,
|
||||
'no_mixed_echo_print' => true,
|
||||
'no_multiline_whitespace_around_double_arrow' => true,
|
||||
'no_short_bool_cast' => true,
|
||||
'no_singleline_whitespace_before_semicolons' => true,
|
||||
'no_spaces_around_offset' => true,
|
||||
'no_superfluous_phpdoc_tags' => [
|
||||
'allow_mixed' => true,
|
||||
'allow_unused_params' => true,
|
||||
],
|
||||
'no_trailing_comma_in_singleline' => true,
|
||||
'no_unneeded_control_parentheses' => [
|
||||
'statements' => [
|
||||
'break',
|
||||
'clone',
|
||||
'continue',
|
||||
'echo_print',
|
||||
'others',
|
||||
'return',
|
||||
'switch_case',
|
||||
'yield',
|
||||
'yield_from',
|
||||
],
|
||||
],
|
||||
'no_unneeded_curly_braces' => [
|
||||
'namespaces' => true,
|
||||
],
|
||||
'no_unneeded_import_alias' => true,
|
||||
'no_unset_cast' => true,
|
||||
'no_unused_imports' => true,
|
||||
'no_useless_concat_operator' => true,
|
||||
'no_useless_nullsafe_operator' => true,
|
||||
'no_whitespace_before_comma_in_array' => true,
|
||||
'normalize_index_brace' => true,
|
||||
'object_operator_without_whitespace' => true,
|
||||
'ordered_imports' => true,
|
||||
'php_unit_fqcn_annotation' => true,
|
||||
'php_unit_method_casing' => true,
|
||||
'phpdoc_align' => true,
|
||||
'phpdoc_annotation_without_dot' => true,
|
||||
'phpdoc_indent' => true,
|
||||
'phpdoc_inline_tag_normalizer' => true,
|
||||
'phpdoc_no_access' => true,
|
||||
'phpdoc_no_alias_tag' => true,
|
||||
'phpdoc_no_package' => true,
|
||||
'phpdoc_no_useless_inheritdoc' => true,
|
||||
'phpdoc_order' => [
|
||||
'order' => [
|
||||
'param',
|
||||
'return',
|
||||
'throws',
|
||||
],
|
||||
],
|
||||
'phpdoc_return_self_reference' => true,
|
||||
'phpdoc_scalar' => true,
|
||||
'phpdoc_separation' => true,
|
||||
'phpdoc_single_line_var_spacing' => true,
|
||||
'phpdoc_summary' => true,
|
||||
'phpdoc_tag_type' => [
|
||||
'tags' => [
|
||||
'inheritDoc' => 'inline',
|
||||
],
|
||||
],
|
||||
'phpdoc_to_comment' => true,
|
||||
'phpdoc_trim' => true,
|
||||
'phpdoc_trim_consecutive_blank_line_separation' => true,
|
||||
'phpdoc_types' => true,
|
||||
'phpdoc_types_order' => [
|
||||
'null_adjustment' => 'always_last',
|
||||
'sort_algorithm' => 'none',
|
||||
],
|
||||
'phpdoc_var_without_name' => true,
|
||||
'protected_to_private' => true,
|
||||
'semicolon_after_instruction' => true,
|
||||
'simple_to_complex_string_variable' => true,
|
||||
'single_class_element_per_statement' => true,
|
||||
'single_import_per_statement' => true,
|
||||
'single_line_comment_spacing' => true,
|
||||
'single_line_comment_style' => [
|
||||
'comment_types' => [
|
||||
'hash',
|
||||
],
|
||||
],
|
||||
'single_line_throw' => true,
|
||||
'single_quote' => true,
|
||||
'single_space_after_construct' => [
|
||||
'constructs' => [
|
||||
'abstract',
|
||||
'as',
|
||||
'attribute',
|
||||
'break',
|
||||
'case',
|
||||
'catch',
|
||||
'class',
|
||||
'clone',
|
||||
'comment',
|
||||
'const',
|
||||
'const_import',
|
||||
'continue',
|
||||
'do',
|
||||
'echo',
|
||||
'else',
|
||||
'elseif',
|
||||
'enum',
|
||||
'extends',
|
||||
'final',
|
||||
'finally',
|
||||
'for',
|
||||
'foreach',
|
||||
'function',
|
||||
'function_import',
|
||||
'global',
|
||||
'goto',
|
||||
'if',
|
||||
'implements',
|
||||
'include',
|
||||
'include_once',
|
||||
'instanceof',
|
||||
'insteadof',
|
||||
'interface',
|
||||
'match',
|
||||
'named_argument',
|
||||
'namespace',
|
||||
'new',
|
||||
'open_tag_with_echo',
|
||||
'php_doc',
|
||||
'php_open',
|
||||
'print',
|
||||
'private',
|
||||
'protected',
|
||||
'public',
|
||||
'readonly',
|
||||
'require',
|
||||
'require_once',
|
||||
'return',
|
||||
'static',
|
||||
'switch',
|
||||
'throw',
|
||||
'trait',
|
||||
'try',
|
||||
'type_colon',
|
||||
'use',
|
||||
'use_lambda',
|
||||
'use_trait',
|
||||
'var',
|
||||
'while',
|
||||
'yield',
|
||||
'yield_from',
|
||||
],
|
||||
],
|
||||
'space_after_semicolon' => [
|
||||
'remove_in_empty_for_expressions' => true,
|
||||
],
|
||||
'standardize_increment' => true,
|
||||
'standardize_not_equals' => true,
|
||||
'switch_continue_to_break' => true,
|
||||
'trailing_comma_in_multiline' => true,
|
||||
'trim_array_spaces' => true,
|
||||
'types_spaces' => true,
|
||||
'unary_operator_spaces' => true,
|
||||
'whitespace_after_comma_in_array' => true,
|
||||
'yoda_style' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Rules that follow the official `Symfony Coding Standards <https://symfony.com/doc/current/contributing/code/standards.html>`_.';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user