Skip to content

Commit

Permalink
[automated] Apply Coding Standard (#3663)
Browse files Browse the repository at this point in the history
* [automated] Apply Coding Standard

* [ci-review] Rector Rectify

---------

Co-authored-by: TomasVotruba <TomasVotruba@users.noreply.github.com>
Co-authored-by: GitHub Action <actions@github.com>
  • Loading branch information
3 people committed Apr 23, 2023
1 parent ff6fa32 commit a729d72
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function correct(Type $mainType): Type | IntersectionType
return $mainType;
}

if (!$mainType->isNonEmptyString()->yes()) {
if (! $mainType->isNonEmptyString()->yes()) {
return $mainType;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/NodeTypeResolver/NodeTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ private function isObjectTypeOfObjectType(ObjectType $resolvedObjectType, Object
}

$resolvedClassReflection = $this->reflectionProvider->getClass($resolvedClassName);

foreach ($resolvedClassReflection->getAncestors() as $ancestorClassReflection) {
if ($ancestorClassReflection->hasTraitUse($requiredClassName)) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function refactor(Node $node): ?Node
return null;
}

if($firstArrayItem->unpack){
if ($firstArrayItem->unpack) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private function processNegationBooleanOr(BooleanOr $booleanOr): ?BooleanOr
}

/** @var BooleanOr|null $result */
$result = $this->processsNullableInstance($booleanOr);
$result = $this->processsNullableInstance($booleanOr);
return $result;
}

Expand Down
2 changes: 1 addition & 1 deletion src/NodeAnalyzer/PropertyFetchAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function isLocalPropertyFetchName(Node $node, string $desiredPropertyName
return false;
}

if (!$this->nodeNameResolver->isName($node->name, $desiredPropertyName)) {
if (! $this->nodeNameResolver->isName($node->name, $desiredPropertyName)) {
return false;
}

Expand Down
9 changes: 5 additions & 4 deletions src/PhpParser/Comparing/NodeComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,24 @@ public function printWithoutComments(Node | array | null $node): string
*/
public function areNodesEqual(Node | array | null $firstNode, Node | array | null $secondNode): bool
{
if ($firstNode instanceof Node && !$secondNode instanceof Node) {
if ($firstNode instanceof Node && ! $secondNode instanceof Node) {
return false;
}
if (!$firstNode instanceof Node && $secondNode instanceof Node) {

if (! $firstNode instanceof Node && $secondNode instanceof Node) {
return false;
}

if (is_array($firstNode)) {
if (!is_array($secondNode)) {
if (! is_array($secondNode)) {
return false;
}

Assert::allIsAOf($firstNode, Node::class);
}

if (is_array($secondNode)) {
if (!is_array($firstNode)) {
if (! is_array($firstNode)) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
use Rector\Config\RectorConfig;
use Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector;
use Rector\Php70\Rector\Ternary\TernaryToNullCoalescingRector;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rules([
TernaryToNullCoalescingRector::class,
AddDefaultValueForUndefinedVariableRector::class,
]);
$rectorConfig->rules([TernaryToNullCoalescingRector::class, AddDefaultValueForUndefinedVariableRector::class]);
};

0 comments on commit a729d72

Please sign in to comment.