Skip to content

Commit

Permalink
Merge ae58e16 into 950cae3
Browse files Browse the repository at this point in the history
  • Loading branch information
OndraM committed May 12, 2021
2 parents 950cae3 + ae58e16 commit 4682a78
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,5 +1,5 @@
composer.lock
composer.phar
/vendor/
.php_cs.cache
.php-cs-fixer.cache
.phpunit.result.cache
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,8 @@
<!-- There is always Unreleased section on the top. Subsections (Added, Changed, Fixed, Removed) should be added as needed. -->

## Unreleased
- Use php-cs-fixer 3.0.
- Use new prefixed version of symplify/easy-coding-standard.

## 3.0.1 - 2021-04-21
- `PhpUnitExpectationFixer` is now used only on PHP 8.0+. See [symplify#3130](https://github.com/symplify/symplify/issues/3130).
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Expand Up @@ -11,9 +11,11 @@
],
"require": {
"php": "^7.3 || ^8.0",
"friendsofphp/php-cs-fixer": "^2.16.3",
"friendsofphp/php-cs-fixer": "^3.0",
"nette/utils": "^3.2",
"slevomat/coding-standard": "^6.4.1",
"symplify/easy-coding-standard": "^9.0.50"
"squizlabs/php_codesniffer": "^3.6",
"symplify/easy-coding-standard": "^9.3.10"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.13.2",
Expand Down
11 changes: 5 additions & 6 deletions ecs.php
Expand Up @@ -41,7 +41,6 @@
use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer;
use PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer;
use PhpCsFixer\Fixer\ArrayNotation\NoTrailingCommaInSinglelineArrayFixer;
use PhpCsFixer\Fixer\ArrayNotation\TrailingCommaInMultilineArrayFixer;
use PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer;
use PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer;
use PhpCsFixer\Fixer\Basic\BracesFixer;
Expand All @@ -60,6 +59,7 @@
use PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer;
use PhpCsFixer\Fixer\ControlStructure\NoUselessElseFixer;
use PhpCsFixer\Fixer\ControlStructure\SwitchContinueToBreakFixer;
use PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer;
use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer;
use PhpCsFixer\Fixer\FunctionNotation\CombineNestedDirnameFixer;
use PhpCsFixer\Fixer\FunctionNotation\FopenFlagOrderFixer;
Expand Down Expand Up @@ -275,8 +275,8 @@
$services->set(NormalizeIndexBraceFixer::class);
// PHP single-line arrays should not have trailing comma
$services->set(NoTrailingCommaInSinglelineArrayFixer::class);
// PHP multi-line arrays should have a trailing comma
$services->set(TrailingCommaInMultilineArrayFixer::class);
// Multi-line arrays, arguments list and parameters list must have a trailing comma
$services->set(TrailingCommaInMultilineFixer::class);
// Arrays should be formatted like function/method arguments
$services->set(TrimArraySpacesFixer::class);
// In array declaration, there MUST be a whitespace after each comma
Expand Down Expand Up @@ -351,9 +351,8 @@
$services->set(OrderedImportsFixer::class);

$services->set(DeclareEqualNormalizeFixer::class);

$services->set(IsNullFixer::class)
->call('configure', [['use_yoda_style' => false]]);
// Replaces `is_null($var)` expression with `null === $var`
$services->set(IsNullFixer::class);
// Ensures a single space after language constructs.
$services->set(SingleSpaceAfterConstructFixer::class);

Expand Down
4 changes: 2 additions & 2 deletions phpstan.neon
Expand Up @@ -4,8 +4,8 @@ parameters:
- src/
- tests/
bootstrapFiles:
- vendor/squizlabs/php_codesniffer/autoload.php
- vendor/squizlabs/php_codesniffer/src/Util/Tokens.php
- vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/autoload.php
- vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/src/Util/Tokens.php
ignoreErrors:
- message: '#Parameter \#(2|3) \$(argumentStart|argumentEnd) of method PhpCsFixer\\Tokenizer\\Analyzer\\ArgumentsAnalyzer::getArgumentInfo\(\) expects int#'
path: %currentWorkingDirectory%/src/Fixer/SpecifyArgSeparatorFixer.php
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="./vendor/squizlabs/php_codesniffer/tests/bootstrap.php"
bootstrap="./vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/tests/bootstrap.php"
colors="true"
>
<testsuites>
Expand Down
6 changes: 2 additions & 4 deletions src/Fixer/SpecifyArgSeparatorFixer.php
Expand Up @@ -2,7 +2,7 @@

namespace Lmc\CodingStandard\Fixer;

use PhpCsFixer\Fixer\DefinedFixerInterface;
use PhpCsFixer\Fixer\FixerInterface;
use PhpCsFixer\FixerDefinition\CodeSample;
use PhpCsFixer\FixerDefinition\FixerDefinition;
use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
Expand All @@ -12,7 +12,7 @@
use PhpCsFixer\Tokenizer\Token;
use PhpCsFixer\Tokenizer\Tokens;

class SpecifyArgSeparatorFixer implements DefinedFixerInterface
class SpecifyArgSeparatorFixer implements FixerInterface
{
public function getDefinition(): FixerDefinitionInterface
{
Expand All @@ -25,8 +25,6 @@ public function getDefinition(): FixerDefinitionInterface
. 'however when its default value "&" is changed, query string assembled by the method will be '
. 'unexpectedly invalid. This Fixer forces you to not rely on ini settings and rather define '
. '`$arg_separator` in third argument of the function.',
null,
null,
'Risky when other than default "&" argument separator should be used in query strings.'
);
}
Expand Down

0 comments on commit 4682a78

Please sign in to comment.