Skip to content

Commit 390c718

Browse files
committed
code grooming
1 parent a0769f9 commit 390c718

15 files changed

+25
-16
lines changed

src/AbstractNoUselessElseFixer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
namespace PhpCsFixer;
1414

15-
use PhpCsFixer\Tokenizer\Token;
1615
use PhpCsFixer\Tokenizer\Tokens;
1716

1817
/**

src/Cache/SignatureInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function getRules();
4747
/**
4848
* @param SignatureInterface $signature
4949
*
50-
* @return mixed
50+
* @return bool
5151
*/
5252
public function equals(self $signature);
5353
}

src/Console/Command/DescribeCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ function ($type) {
251251
$output->writeln('');
252252
}
253253

254+
/** @var CodeSampleInterface[] $codeSamples */
254255
$codeSamples = array_filter($definition->getCodeSamples(), static function (CodeSampleInterface $codeSample) {
255256
if ($codeSample instanceof VersionSpecificCodeSampleInterface) {
256257
return $codeSample->isSuitableFor(\PHP_VERSION_ID);

src/Fixer/Basic/NonPrintableCharacterFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function isRisky()
9393
*/
9494
public function isCandidate(Tokens $tokens)
9595
{
96-
return \count($tokens) > 1 && $tokens->isAnyTokenKindsFound(self::$tokens);
96+
return $tokens->isAnyTokenKindsFound(self::$tokens);
9797
}
9898

9999
/**

src/Fixer/Phpdoc/PhpdocOrderFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function getDefinition()
4545
/**
4646
* Hello there!
4747
*
48-
* @throws Exception|RuntimeException dfsdf
48+
* @throws Exception|RuntimeException foo
4949
* @custom Test!
5050
* @return int Return the number of changes.
5151
* @param string $foo

src/Fixer/Phpdoc/PhpdocSummaryFixer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
use PhpCsFixer\AbstractFixer;
1616
use PhpCsFixer\DocBlock\DocBlock;
17-
use PhpCsFixer\DocBlock\Line;
1817
use PhpCsFixer\DocBlock\ShortDescription;
1918
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
2019
use PhpCsFixer\FixerDefinition\CodeSample;

src/FixerFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use PhpCsFixer\Fixer\FixerInterface;
1818
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
1919
use Symfony\Component\Finder\Finder as SymfonyFinder;
20+
use Symfony\Component\Finder\SplFileInfo;
2021

2122
/**
2223
* Class provides a way to create a group of fixers.
@@ -94,6 +95,7 @@ public function registerBuiltInFixers()
9495
if (null === $builtInFixers) {
9596
$builtInFixers = [];
9697

98+
/** @var SplFileInfo $file */
9799
foreach (SymfonyFinder::create()->files()->in(__DIR__.'/Fixer') as $file) {
98100
$relativeNamespace = $file->getRelativePath();
99101
$fixerClass = 'PhpCsFixer\\Fixer\\'.($relativeNamespace ? $relativeNamespace.'\\' : '').$file->getBasename('.php');

src/Tokenizer/Transformers.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
use PhpCsFixer\Utils;
1616
use Symfony\Component\Finder\Finder;
17+
use Symfony\Component\Finder\SplFileInfo;
1718

1819
/**
1920
* Collection of Transformer classes.
@@ -101,6 +102,7 @@ private function registerBuiltInTransformers()
101102
*/
102103
private function findBuiltInTransformers()
103104
{
105+
/** @var SplFileInfo $file */
104106
foreach (Finder::create()->files()->in(__DIR__.'/Transformer') as $file) {
105107
$relativeNamespace = $file->getRelativePath();
106108
$class = __NAMESPACE__.'\\Transformer\\'.($relativeNamespace ? $relativeNamespace.'\\' : '').$file->getBasename('.php');

tests/Fixtures/Integration/set/@PSR2.test-in.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?
22
namespace Vendor\Package;
3-
use FooInterface, FooInterfaceB;
3+
use FooInterfaceA, FooInterfaceB;
44
use BarClass as Bar;
55
use OtherVendor\OtherPackage\BazClass;
6-
class Foo extends Bar implements FooInterface{
6+
class Foo extends Bar implements FooInterfaceA{
77
var $aaa = 1, $bbb = 2;
88

9-
public function sampleFunction($a, $b = null)
9+
public function sampleFunction($a, $arg1, $arg2, $arg3, $foo, $b = null)
1010
{
1111
if ($a === $b) {
1212
bar();

tests/Fixtures/Integration/set/@PSR2.test-out.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?php
22
namespace Vendor\Package;
33

4-
use FooInterface;
4+
use FooInterfaceA;
55
use FooInterfaceB;
66
use BarClass as Bar;
77
use OtherVendor\OtherPackage\BazClass;
88

9-
class Foo extends Bar implements FooInterface
9+
class Foo extends Bar implements FooInterfaceA
1010
{
1111
public $aaa = 1;
1212
public $bbb = 2;
1313

14-
public function sampleFunction($a, $b = null)
14+
public function sampleFunction($a, $arg1, $arg2, $arg3, $foo, $b = null)
1515
{
1616
if ($a === $b) {
1717
bar();

0 commit comments

Comments
 (0)