Skip to content
Merged
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
2 changes: 1 addition & 1 deletion build/config/phpstan-for-downgrade.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ parameters:
inferPrivatePropertyTypeFromConstructor: true

scanDirectories:
# this is needed for symfony/dependendency-injection as it has hidden dependency on symfony/expression-language that we don't use here
# this is needed for symfony/dependency-injection as it has hidden dependency on symfony/expression-language that we don't use here
- ../../stubs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\CodeQuality\Rector\Concat\JoinStringConcatRector\Fixture;

class SkipMultiplelines
class SkipMultipleLines
{
public function run()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\CodeQuality\Rector\Foreach_\ForeachItemsAssignToEmptyArrayToAssignRector\Fixture;

class SkipMultipleAssignbeforeForeach
class SkipMultipleAssignBeforeForeach
{
public function run(array $items)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\CodeQuality\Rector\Foreach_\ForeachItemsAssignToEmptyArrayToAssignRector\Fixture;

class SkipMultipleAssignbeforeForeach2
class SkipMultipleAssignBeforeForeach2
{
public function run(array $items)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Rector\Tests\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector\Fixture

final class WithParentheses
{
public static function isLeapyear(int $year): bool
public static function isLeapYear(int $year): bool
{
if (($year % 400) == 0 || (($year & 4) == 0 && ($year % 100) != 0)) {
return true;
Expand All @@ -21,7 +21,7 @@ namespace Rector\Tests\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector\Fixture

final class WithParentheses
{
public static function isLeapyear(int $year): bool
public static function isLeapYear(int $year): bool
{
return ($year % 400) == 0 || (($year & 4) == 0 && ($year % 100) != 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector\Fixture;

function some_variales_with_braces($hello, $world)
function some_variables_with_braces($hello, $world)
{
return "$hello {$world}!";
}
Expand All @@ -13,7 +13,7 @@ function some_variales_with_braces($hello, $world)

namespace Rector\Tests\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector\Fixture;

function some_variales_with_braces($hello, $world)
function some_variables_with_braces($hello, $world)
{
return "{$hello} {$world}!";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Rector\Tests\CodingStyle\Rector\FuncCall\ArraySpreadInsteadOfArrayMerg

use Symfony\Component\Finder\Finder;

class SkipGetIreator
class SkipGetIterator
{
public function run()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Rector\Tests\CodingStyle\Rector\FuncCall\ArraySpreadInsteadOfArrayMerg

use stdClass;

class SkipSpreadyArrayMerge
class SkipSpreadArrayMerge
{
public function run()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Rector\Tests\CodingStyle\Rector\FuncCall\ArraySpreadInsteadOfArrayMerg

use Symfony\Component\Finder\Finder;

class SkipGetIreator
class SkipGetIterator
{
public function run()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Rector\Tests\CodingStyle\Rector\FuncCall\ArraySpreadInsteadOfArrayMerg

use stdClass;

class SkipSpreadyArrayMerge
class SkipSpreadArrayMerge
{
public function run()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector\Fixture;

class FixturNotIdentical
class FixtureNotIdentical
{
public function run()
{
Expand All @@ -25,7 +25,7 @@ class FixturNotIdentical

namespace Rector\Tests\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector\Fixture;

class FixturNotIdentical
class FixtureNotIdentical
{
public function run()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\DeadCode\Rector\If_\UnwrapFutureCompatibleIfPhpVersionRector\Fixture;

class SkipElsefis
class SkipElseifs
{
public function run()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ final class SkipOtherCommentBeforeVar
public function get()
{
/** @var \stdClass $nonExisting */
// Load data also with projekt...
// Load data also with project...
$return[] = $this->getReturnData();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ final class SkipOtherCommentBeforeVar
public function get()
{
/** @var \stdClass $nonExisting */
// Load data also with projekt...
// Load data also with project...
$return[] = $this->getReturnData();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if (mt_rand(0, 1000)) {

return 2;

// it can be still autoloaded and used abvoe
// it can be still autoloaded and used above
class SkipClassUnder
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\Php70\Rector\Break_\BreakNotInLoopOrSwitchToReturnRector\Fixture;

function break_missplaced_function()
function break_misplaced_function()
{
$zhrs = abs($gmt)/3600;
$hrs = floor($zhrs);
Expand All @@ -13,7 +13,7 @@ function break_missplaced_function()
break;
}

function break_missplace_again()
function break_misplace_again()
{
$errors = [];
if (isset($errors)) {
Expand All @@ -32,7 +32,7 @@ function break_missplace_again()

namespace Rector\Tests\Php70\Rector\Break_\BreakNotInLoopOrSwitchToReturnRector\Fixture;

function break_missplaced_function()
function break_misplaced_function()
{
$zhrs = abs($gmt)/3600;
$hrs = floor($zhrs);
Expand All @@ -42,7 +42,7 @@ function break_missplaced_function()
return sprintf('%s%02d%02d',($gmt<0)?'+':'-',floor($zhrs),($zhrs-$hrs)*60);
}

function break_missplace_again()
function break_misplace_again()
{
$errors = [];
if (isset($errors)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\Php70\Rector\Break_\BreakNotInLoopOrSwitchToReturnRector\Fixture;

function break_missplaced_function_foreach()
function break_misplaced_function_foreach()
{
$ip_block = [];

Expand All @@ -25,7 +25,7 @@ function break_missplaced_function_foreach()

namespace Rector\Tests\Php70\Rector\Break_\BreakNotInLoopOrSwitchToReturnRector\Fixture;

function break_missplaced_function_foreach()
function break_misplaced_function_foreach()
{
$ip_block = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\Php70\Rector\Break_\BreakNotInLoopOrSwitchToReturnRector\Fixture;

function break_missplaced_return()
function break_misplaced_return()
{
if (true == $objWebsite ) {
$arrobjProperties = (array) $objWebsite->fetchProperties( );
Expand All @@ -21,7 +21,7 @@ function break_missplaced_return()

namespace Rector\Tests\Php70\Rector\Break_\BreakNotInLoopOrSwitchToReturnRector\Fixture;

function break_missplaced_return()
function break_misplaced_return()
{
if (true == $objWebsite ) {
$arrobjProperties = (array) $objWebsite->fetchProperties( );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Rector\Tests\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCa

use Webmozart\Assert\Assert;

final class SkipTestWebmozzart
final class SkipTestWebmozart
{
public function doWork($values)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ final class SkipConcatenationDot
{
public function run()
{
$string = 'this is a string to cancatenate with the number';
$string = 'this is a string to concatenate with the number';
$number = 10;
$value = $string . ' ' . $number;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ final class PropertyWithAttribute

#[Immutable]
#[Deprecated]
public float $longiture;
public float $longitude;

public function __construct(float $latitude, float $longiture)
public function __construct(float $latitude, float $longitude)
{
$this->latitude = $latitude;
$this->longiture = $longiture;
$this->longitude = $longitude;

}
}
Expand All @@ -41,7 +41,7 @@ final class PropertyWithAttribute
public float $latitude,
#[Immutable]
#[Deprecated]
public float $longiture
public float $longitude
)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\Php80\Rector\Switch_\ChangeSwitchToMatchRector\Fixture;

class SkipThrowenException
class SkipThrownException
{
public function save(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Rector\Tests\Transform\Rector\FuncCall\FuncCallToMethodCallRector\Fixt

use function Rector\Tests\Transform\Rector\FuncCall\FuncCallToMethodCallRector\Source\some_view_function;

function anothehFunction()
function anotherFunction()
{
some_view_function('template');
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ namespace Rector\Tests\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionRetu

final class SkipVoidReturn
{
public function doNohing(string $a): void
public function doNothing(string $a): void
{
echo $a;
}

public function run()
{
fn (string $a) => $this->doNohing($a);
fn (string $a) => $this->doNothing($a);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

namespace Rector\Tests\TypeDeclaration\Rector\ArrowFunction\AddArrowFunctionReturnTypeRector\Fixture;

final class SkipVoidReturnOnCallbackDockblock
final class SkipVoidReturnOnCallbackDocblock
{
public function doNohing(string $a): void
public function doNothing(string $a): void
{
echo $a;
}

public function run()
{
fn() => $this->executesCallback(fn() => $this->doNohing('a'));
fn() => $this->executesCallback(fn() => $this->doNothing('a'));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function getNodeTypes(): array
*/
public function refactor(Node $node): ?Node
{
$twoNodeMatch = $this->resolvetwoNodeMatch($node);
$twoNodeMatch = $this->resolveTwoNodeMatch($node);

if (! $twoNodeMatch instanceof TwoNodeMatch) {
return null;
Expand Down Expand Up @@ -77,7 +77,7 @@ public function refactor(Node $node): ?Node
return new Identical($emptyOrNotIdenticalNode->expr, new Array_());
}

private function resolvetwoNodeMatch(BooleanAnd $booleanAnd): ?TwoNodeMatch
private function resolveTwoNodeMatch(BooleanAnd $booleanAnd): ?TwoNodeMatch
{
return $this->binaryOpManipulator->matchFirstAndSecondConditionNode(
$booleanAnd,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function refactor(Node $node): ?Node
unset($node->stmts[$key]);
}

$node->stmts[] = $this->createCealesceReturn($coalescingExprs, $appendExpr);
$node->stmts[] = $this->createCoalesceReturn($coalescingExprs, $appendExpr);

return $node;
}
Expand All @@ -174,7 +174,7 @@ private function isReturnNull(Stmt $stmt): bool
/**
* @param Expr[] $coalescingExprs
*/
private function createCealesceReturn(array $coalescingExprs, ?Expr $appendExpr): Return_
private function createCoalesceReturn(array $coalescingExprs, ?Expr $appendExpr): Return_
{
/** @var Expr $leftExpr */
$leftExpr = array_shift($coalescingExprs);
Expand Down
4 changes: 2 additions & 2 deletions rules/CodingStyle/NodeAnalyzer/UseImportNameMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function matchNameWithUses(string $tag, array $uses): ?string
*/
private function resolveName(string $prefix, string $tag, UseItem $useItem): string
{
// useuse can be renamed on the fly, so just in case, use the original one
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just change useuse to UseItem

// UseItem can be renamed on the fly, so just in case, use the original one
$originalUseUseNode = $useItem->getAttribute(AttributeKey::ORIGINAL_NODE);
if (! $originalUseUseNode instanceof UseItem) {
throw new ShouldNotHappenException();
Expand All @@ -93,7 +93,7 @@ private function resolveName(string $prefix, string $tag, UseItem $useItem): str

private function isUseMatchingName(string $tag, UseItem $useItem): bool
{
// useuse can be renamed on the fly, so just in case, use the original one
// UseItem can be renamed on the fly, so just in case, use the original one
$originalUseUseNode = $useItem->getAttribute(AttributeKey::ORIGINAL_NODE);
if (! $originalUseUseNode instanceof UseItem) {
return false;
Expand Down
Loading
Loading