Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions blink/testdata/dirty.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
namespace App;

namespace App;

function greet($name)
{
$greeting = 'Hello ' . $name ;
{
$greeting = 'Hello ' . $name;

$count=1;$total=2;
$count = 1;
$total = 2;
return $greeting;
}


2 changes: 1 addition & 1 deletion build/config/config-downgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
->withSkip([
'*/Tests/*',
'*/tests/*',
'*/Fixtures/DirectoryExpansion/.hiddenAbove/*'
'*/Fixtures/DirectoryExpansion/.hiddenAbove/*',
]);
2 changes: 1 addition & 1 deletion build/target-repository/tests-released/config/some_ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
return (ECSConfig::configure())
->withSets([
// PHP 7.2+ compatible config, to enable PHP 7.2 tests
\Symplify\EasyCodingStandard\ValueObject\Set\SetList::PSR_12
\Symplify\EasyCodingStandard\ValueObject\Set\SetList::PSR_12,
]);
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@

use Exception;

final class ShouldNotHappenException extends Exception
{
}
final class ShouldNotHappenException extends Exception {}
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private function isEventDescriptionLine(string $docblockLine, string $methodName

$descriptionWords = array_filter(
$descriptionWords,
static fn (string $word): bool => $word !== 'event'
static fn(string $word): bool => $word !== 'event'
);

if ($descriptionWords === []) {
Expand All @@ -149,7 +149,7 @@ private function isEventDescriptionLine(string $docblockLine, string $methodName
$methodWords = array_filter(
$this->resolveWords($methodName),
// event subscriber handlers are commonly prefixed with "on"
static fn (string $word): bool => $word !== 'on'
static fn(string $word): bool => $word !== 'on'
);

sort($descriptionWords);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ final class RemovePHPStormAnnotationFixer extends AbstractSymplifyFixer

public function __construct(
private readonly TokenReverser $tokenReverser
) {
}
) {}

public function getDefinition(): FixerDefinitionInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public function __construct(
private readonly ArrayItemNewliner $arrayItemNewliner,
private readonly ArrayAnalyzer $arrayAnalyzer,
private readonly ArrayBlockInfoFinder $arrayBlockInfoFinder,
) {
}
) {}

public function getDefinition(): FixerDefinitionInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public function __construct(
private readonly ArrayBlockInfoFinder $arrayBlockInfoFinder,
private readonly WhitespacesFixerConfig $whitespacesFixerConfig,
private readonly ArrayAnalyzer $arrayAnalyzer
) {
}
) {}

public function getDefinition(): FixerDefinitionInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public function __construct(
private readonly ArrayWrapperFactory $arrayWrapperFactory,
private readonly TokensNewliner $tokensNewliner,
private readonly BlockFinder $blockFinder
) {
}
) {}

public function getDefinition(): FixerDefinitionInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ abstract class AbstractDocBlockFixer extends AbstractSymplifyFixer

public function __construct(
protected readonly TokenReverser $tokenReverser
) {
}
) {}

/**
* @param Tokens<Token> $tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function processDocContent(string $docContent, Tokens $tokens, int $po
return Regex::replace(
$docContent,
self::VAR_WITHOUT_NAME_REGEX,
static fn (array $match): string => $match['open'] . $match['type'] . ' ' . $nextVariableToken->getContent() . $match['close']
static fn(array $match): string => $match['open'] . $match['type'] . ' ' . $nextVariableToken->getContent() . $match['close']
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ public function isCandidate(Tokens $tokens): bool
/**
* @param Tokens<Token> $tokens
*/
public function fix(SplFileInfo $fileInfo, Tokens $tokens): void
{
}
public function fix(SplFileInfo $fileInfo, Tokens $tokens): void {}

/**
* @return list<string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function processDocContent(string $docContent, Tokens $tokens, int $po
return Regex::replace(
$docContent,
self::PARAM_NAME_REGEX,
static fn ($match): string => $match['param'] . $match['paramName']
static fn($match): string => $match['param'] . $match['paramName']
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public function __construct(
private readonly UselessDocBlockCleaner $uselessDocBlockCleaner,
private readonly TokenReverser $tokenReverser,
private readonly ClassNameResolver $classNameResolver,
) {
}
) {}

public function getDefinition(): FixerDefinitionInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ final class TypeToVarTagFixer extends AbstractSymplifyFixer

public function __construct(
private readonly TokenReverser $tokenReverser
) {
}
) {}

public function getDefinition(): FixerDefinitionInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ public function __construct(
private readonly MethodNameResolver $methodNameResolver,
private readonly HeredocAnalyzer $heredocAnalyzer,
private readonly ?StandaloneLineConstructorParamFixer $standaloneLineConstructorParamFixer = null
) {
}
) {}

public function getDefinition(): FixerDefinitionInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ public function __construct(
private readonly WhitespacesFixerConfig $whitespacesFixerConfig,
private readonly BlockFinder $blockFinder,
private readonly ChainMethodCallAnalyzer $chainMethodCallAnalyzer
) {
}
) {}

public function getDefinition(): FixerDefinitionInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ final class StandaloneLineConstructorParamFixer extends AbstractSymplifyFixer
public function __construct(
private readonly ParamNewliner $paramNewliner,
private readonly MethodNameResolver $methodNameResolver
) {
}
) {}

/**
* Must run before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ final class StandaloneLinePlainConstructorParamFixer extends AbstractSymplifyFix
public function __construct(
private readonly ParamNewliner $paramNewliner,
private readonly MethodNameResolver $methodNameResolver
) {
}
) {}

/**
* Must run before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ final class StandaloneLinePromotedPropertyFixer extends AbstractSymplifyFixer
public function __construct(
private readonly ParamNewliner $paramNewliner,
private readonly MethodNameResolver $methodNameResolver
) {
}
) {}

/**
* Must run before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ final class StandaloneLineRequiredParamFixer extends AbstractSymplifyFixer

public function __construct(
private readonly ParamNewliner $paramNewliner
) {
}
) {}

/**
* Must run before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ final class StandaloneLineSymfonyAttributeParamFixer extends AbstractSymplifyFix

public function __construct(
private readonly TokensNewliner $tokensNewliner
) {
}
) {}

/**
* Must run before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ final class ChainMethodCallAnalyzer

public function __construct(
private readonly NewlineAnalyzer $newlineAnalyzer
) {
}
) {}

/**
* Matches e.g: return app()->some(), app()->some(), (clone app)->some()
Expand Down
3 changes: 1 addition & 2 deletions packages/coding-standard/src/TokenAnalyzer/ParamNewliner.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
public function __construct(
private BlockFinder $blockFinder,
private TokensNewliner $tokensNewliner,
) {
}
) {}

/**
* @param Tokens<Token> $tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
{
public function __construct(
private TokenSkipper $tokenSkipper
) {
}
) {}

/**
* @param Tokens<Token> $tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
{
public function __construct(
private WhitespacesFixerConfig $whitespacesFixerConfig
) {
}
) {}

/**
* @param Tokens<Token> $tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
{
public function __construct(
private BlockFinder $blockFinder
) {
}
) {}

/**
* @param Tokens<Token> $tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
public function __construct(
private ArrayAnalyzer $arrayAnalyzer,
private WhitespacesFixerConfig $whitespacesFixerConfig
) {
}
) {}

/**
* @param Tokens<Token> $tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@

use Exception;

final class MissingImplementationException extends Exception
{
}
final class MissingImplementationException extends Exception {}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
{
public function __construct(
private LineLengthAndPositionFactory $lineLengthAndPositionFactory
) {
}
) {}

/**
* @param Tokens<Token> $tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
public function __construct(
private CallAnalyzer $callAnalyzer,
private TokenFinder $tokenFinder
) {
}
) {}

/**
* @param Tokens<Token> $tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
{
public function __construct(
private CallAnalyzer $callAnalyzer
) {
}
) {}

/**
* @param Tokens<Token> $tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ public function __construct(
private TokensInliner $tokensInliner,
private FirstLineLengthResolver $firstLineLengthResolver,
private TokensNewliner $tokensNewliner
) {
}
) {}

/**
* @param Tokens<Token> $tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
{
public function __construct(
private TokenSkipper $tokenSkipper
) {
}
) {}

/**
* @param Tokens<Token> $tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ public function __construct(
private LineLengthOpenerTransformer $lineLengthOpenerTransformer,
private WhitespacesFixerConfig $whitespacesFixerConfig,
private IndentResolver $indentResolver
) {
}
) {}

/**
* @param Tokens<Token> $tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
{
public function __construct(
private BlockFinder $blockFinder
) {
}
) {}

/**
* @param Tokens<Token> $tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
public function __construct(
private int $start,
private int $end
) {
}
) {}

public function getStart(): int
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
public function __construct(
private int $lineLength,
private int $currentPosition
) {
}
) {}

public function getLineLength(): int
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ public function __construct(
private Tokens $tokens,
private BlockInfo $blockInfo,
private TokenSkipper $tokenSkipper
) {
}
) {}

public function isAssociativeArray(): bool
{
Expand Down
Loading
Loading