Skip to content

Commit 11534ad

Browse files
committed
Fix typos again
1 parent 3ee96a4 commit 11534ad

File tree

43 files changed

+93
-93
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+93
-93
lines changed

docs/rector_rules_overview.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ include/require to absolute path. This Rector might introduce backwards incompat
245245

246246
### AndAssignsToSeparateLinesRector
247247

248-
Split 2 assigns ands to separate line
248+
Split 2 assigns and to separate line
249249

250250
- class: [`Rector\CodeQuality\Rector\LogicalAnd\AndAssignsToSeparateLinesRector`](../rules/CodeQuality/Rector/LogicalAnd/AndAssignsToSeparateLinesRector.php)
251251

@@ -1598,9 +1598,9 @@ Use ===/!== over ==/!=, it values have the same type
15981598
public function run(int $firstValue, int $secondValue)
15991599
{
16001600
- $isSame = $firstValue == $secondValue;
1601-
- $isDiffernt = $firstValue != $secondValue;
1601+
- $isDifferent = $firstValue != $secondValue;
16021602
+ $isSame = $firstValue === $secondValue;
1603-
+ $isDiffernt = $firstValue !== $secondValue;
1603+
+ $isDifferent = $firstValue !== $secondValue;
16041604
}
16051605
}
16061606
```
@@ -2083,7 +2083,7 @@ Makes array_search search for identical elements
20832083

20842084
<br>
20852085

2086-
### SymplifyQuoteEscapeRector
2086+
### SimplifyQuoteEscapeRector
20872087

20882088
Prefer quote that are not inside the string
20892089

@@ -2279,7 +2279,7 @@ Remove (string) casting when it comes to concat, that does this by default
22792279
- class: [`Rector\DeadCode\Rector\Concat\RemoveConcatAutocastRector`](../rules/DeadCode/Rector/Concat/RemoveConcatAutocastRector.php)
22802280

22812281
```diff
2282-
class SomeConcatingClass
2282+
class SomeConcatenatingClass
22832283
{
22842284
public function run($value)
22852285
{

rules/CodeQuality/Rector/Catch_/ThrowWithPreviousExceptionRector.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function refactor(Node $node) : ?Node
9898
}
9999
return $node;
100100
}
101-
private function refactorThrow(Throw_ $throw, Variable $catchedThrowableVariable) : ?int
101+
private function refactorThrow(Throw_ $throw, Variable $caughtThrowableVariable) : ?int
102102
{
103103
if (!$throw->expr instanceof New_) {
104104
return null;
@@ -123,23 +123,23 @@ private function refactorThrow(Throw_ $throw, Variable $catchedThrowableVariable
123123
$shouldUseNamedArguments = $messageArgument instanceof Arg && $messageArgument->name instanceof Identifier;
124124
if (!isset($new->args[0])) {
125125
// get previous message
126-
$getMessageMethodCall = new MethodCall($catchedThrowableVariable, 'getMessage');
126+
$getMessageMethodCall = new MethodCall($caughtThrowableVariable, 'getMessage');
127127
$new->args[0] = new Arg($getMessageMethodCall);
128-
} elseif ($new->args[0] instanceof Arg && $new->args[0]->name instanceof Identifier && $new->args[0]->name->toString() === 'previous' && $this->nodeComparator->areNodesEqual($new->args[0]->value, $catchedThrowableVariable)) {
128+
} elseif ($new->args[0] instanceof Arg && $new->args[0]->name instanceof Identifier && $new->args[0]->name->toString() === 'previous' && $this->nodeComparator->areNodesEqual($new->args[0]->value, $caughtThrowableVariable)) {
129129
$new->args[0]->name->name = 'message';
130-
$new->args[0]->value = new MethodCall($catchedThrowableVariable, 'getMessage');
130+
$new->args[0]->value = new MethodCall($caughtThrowableVariable, 'getMessage');
131131
}
132132
if (!isset($new->getArgs()[1])) {
133133
// get previous code
134-
$new->args[1] = new Arg(new MethodCall($catchedThrowableVariable, 'getCode'), \false, \false, [], $shouldUseNamedArguments ? new Identifier('code') : null);
134+
$new->args[1] = new Arg(new MethodCall($caughtThrowableVariable, 'getCode'), \false, \false, [], $shouldUseNamedArguments ? new Identifier('code') : null);
135135
}
136136
/** @var Arg $arg1 */
137137
$arg1 = $new->args[1];
138138
if ($arg1->name instanceof Identifier && $arg1->name->toString() === 'previous') {
139-
$new->args[1] = new Arg(new MethodCall($catchedThrowableVariable, 'getCode'), \false, \false, [], $shouldUseNamedArguments ? new Identifier('code') : null);
139+
$new->args[1] = new Arg(new MethodCall($caughtThrowableVariable, 'getCode'), \false, \false, [], $shouldUseNamedArguments ? new Identifier('code') : null);
140140
$new->args[$exceptionArgumentPosition] = $arg1;
141141
} else {
142-
$new->args[$exceptionArgumentPosition] = new Arg($catchedThrowableVariable, \false, \false, [], $shouldUseNamedArguments ? new Identifier('previous') : null);
142+
$new->args[$exceptionArgumentPosition] = new Arg($caughtThrowableVariable, \false, \false, [], $shouldUseNamedArguments ? new Identifier('previous') : null);
143143
}
144144
// null the node, to fix broken format preserving printers, see https://github.com/rectorphp/rector/issues/5576
145145
$new->setAttribute(AttributeKey::ORIGINAL_NODE, null);

rules/CodeQuality/Rector/Class_/DynamicDocBlockPropertyToNativePropertyRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ private function createNewPropertyFromPropertyTagValueNodes(array $propertyPhpDo
167167
}
168168
// is property already defined?
169169
if ($class->getProperty($propertyName) instanceof Property) {
170-
// improve exising one type if needed
170+
// improve existing one type if needed
171171
$existingProperty = $class->getProperty($propertyName);
172172
if ($existingProperty->type instanceof Node) {
173173
continue;

rules/CodeQuality/Rector/Equal/UseIdenticalOverEqualWithSameTypeRector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class SomeClass
2626
public function run(int $firstValue, int $secondValue)
2727
{
2828
$isSame = $firstValue == $secondValue;
29-
$isDiffernt = $firstValue != $secondValue;
29+
$isDifferent = $firstValue != $secondValue;
3030
}
3131
}
3232
CODE_SAMPLE
@@ -36,7 +36,7 @@ class SomeClass
3636
public function run(int $firstValue, int $secondValue)
3737
{
3838
$isSame = $firstValue === $secondValue;
39-
$isDiffernt = $firstValue !== $secondValue;
39+
$isDifferent = $firstValue !== $secondValue;
4040
}
4141
}
4242
CODE_SAMPLE

rules/CodeQuality/Rector/Foreach_/ForeachToInArrayRector.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@ private function matchNodes($binaryOp, Expr $expr) : ?TwoNodeMatch
166166
}
167167
private function isIfBodyABoolReturnNode(If_ $if) : bool
168168
{
169-
$ifStatment = $if->stmts[0];
170-
if (!$ifStatment instanceof Return_) {
169+
$ifStatement = $if->stmts[0];
170+
if (!$ifStatement instanceof Return_) {
171171
return \false;
172172
}
173-
if (!$ifStatment->expr instanceof Expr) {
173+
if (!$ifStatement->expr instanceof Expr) {
174174
return \false;
175175
}
176-
return $this->valueResolver->isTrueOrFalse($ifStatment->expr);
176+
return $this->valueResolver->isTrueOrFalse($ifStatement->expr);
177177
}
178178
/**
179179
* @param \PhpParser\Node\Expr\BinaryOp\Identical|\PhpParser\Node\Expr\BinaryOp\Equal $binaryOp

rules/CodeQuality/Rector/LogicalAnd/AndAssignsToSeparateLinesRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class AndAssignsToSeparateLinesRector extends AbstractRector
1717
{
1818
public function getRuleDefinition() : RuleDefinition
1919
{
20-
return new RuleDefinition('Split 2 assigns ands to separate line', [new CodeSample(<<<'CODE_SAMPLE'
20+
return new RuleDefinition('Split 2 assigns and to separate line', [new CodeSample(<<<'CODE_SAMPLE'
2121
class SomeClass
2222
{
2323
public function run()

rules/CodingStyle/Rector/String_/SymplifyQuoteEscapeRector.php renamed to rules/CodingStyle/Rector/String_/SimplifyQuoteEscapeRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* @see \Rector\Tests\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector\SymplifyQuoteEscapeRectorTest
1515
*/
16-
final class SymplifyQuoteEscapeRector extends AbstractRector
16+
final class SimplifyQuoteEscapeRector extends AbstractRector
1717
{
1818
/**
1919
* @var string

rules/DeadCode/NodeAnalyzer/CallCollectionAnalyzer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public function isExists(array $calls, string $classMethodName, string $classNam
3737
foreach ($calls as $call) {
3838
$callerRoot = $call instanceof StaticCall ? $call->class : $call->var;
3939
$callerType = $this->nodeTypeResolver->getType($callerRoot);
40-
$callerTypeClasName = ClassNameFromObjectTypeResolver::resolve($callerType);
41-
if ($callerTypeClasName === null) {
40+
$callerTypeClassName = ClassNameFromObjectTypeResolver::resolve($callerType);
41+
if ($callerTypeClassName === null) {
4242
// handle fluent by $this->bar()->baz()->qux()
4343
// that methods don't have return type
4444
if ($callerType instanceof MixedType && !$callerType->isExplicitMixed()) {
@@ -65,7 +65,7 @@ public function isExists(array $calls, string $classMethodName, string $classNam
6565
if ($this->isSelfStatic($call) && $this->shouldSkip($call, $classMethodName)) {
6666
return \true;
6767
}
68-
if ($callerTypeClasName !== $className) {
68+
if ($callerTypeClassName !== $className) {
6969
continue;
7070
}
7171
if ($this->shouldSkip($call, $classMethodName)) {

rules/DeadCode/PhpDoc/DeadReturnTagValueNodeAnalyzer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private function isDeadNotEqual(ReturnTagValueNode $returnTagValueNode, Node $no
115115
if ($returnTagValueNode->type instanceof IdentifierTypeNode && (string) $returnTagValueNode->type === 'void') {
116116
return \true;
117117
}
118-
if (!$this->hasUsefullPhpdocType($returnTagValueNode, $node)) {
118+
if (!$this->hasUsefulPhpdocType($returnTagValueNode, $node)) {
119119
return \true;
120120
}
121121
$nodeType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($node);
@@ -140,7 +140,7 @@ private function hasTrueFalsePseudoType(BracketsAwareUnionTypeNode $bracketsAwar
140140
* exact different between @return and node return type
141141
* @param mixed $returnType
142142
*/
143-
private function hasUsefullPhpdocType(ReturnTagValueNode $returnTagValueNode, $returnType) : bool
143+
private function hasUsefulPhpdocType(ReturnTagValueNode $returnTagValueNode, $returnType) : bool
144144
{
145145
if ($returnTagValueNode->type instanceof IdentifierTypeNode && $returnTagValueNode->type->name === 'mixed') {
146146
return \false;

rules/DeadCode/Rector/Assign/RemoveDoubleAssignRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function refactor(Node $node) : ?Node
9595
if (!$stmt->expr->var instanceof Variable && !$stmt->expr->var instanceof PropertyFetch && !$stmt->expr->var instanceof StaticPropertyFetch) {
9696
continue;
9797
}
98-
// remove current Stmt if will be overriden in next stmt
98+
// remove current Stmt if will be overridden in next stmt
9999
unset($node->stmts[$key]);
100100
$hasChanged = \true;
101101
}

0 commit comments

Comments
 (0)