Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jun 4, 2022
1 parent d2d9e83 commit 6b30001
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ public function removeByName(PhpDocInfo $phpDocInfo, string $name): void
}

if ($phpDocChildNode->value instanceof DoctrineAnnotationTagValueNode) {
$doctrineAnnotationTagValueNode = $phpDocChildNode->value;

if ($doctrineAnnotationTagValueNode->hasClassName($name)) {
if ($phpDocChildNode->value->hasClassName($name)) {
unset($phpDocNode->children[$key]);
$phpDocInfo->markAsChanged();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,13 @@ private function resolveAsAliased(array $uses, string $tag): string
$prefix = $use instanceof GroupUse
? $use->prefix . '\\'
: '';
$useUses = $use->uses;

foreach ($useUses as $useUse) {
foreach ($use->uses as $useUse) {
if (! $useUse->alias instanceof Identifier) {
continue;
}

$alias = $useUse->alias;
if ($alias->toString() === $tag) {
if ($useUse->alias->toString() === $tag) {
return $prefix . $useUse->name->toString();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,10 @@ private function createSpacelessPhpDocTagNode(
GenericTagValueNode $genericTagValueNode,
string $fullyQualifiedAnnotationClass
): SpacelessPhpDocTagNode {
$annotationContent = $genericTagValueNode->value;
$formerStartEnd = $genericTagValueNode->getAttribute(PhpDocAttributeKey::START_AND_END);

return $this->createDoctrineSpacelessPhpDocTagNode(
$annotationContent,
$genericTagValueNode->value,
$tagName,
$fullyQualifiedAnnotationClass,
$formerStartEnd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,9 @@ use PhpParser\Node\Expr\ArrayItem;

final class SkipDimFetchAssign
{
<<<<<<< HEAD
private $items;

<<<<<<< HEAD
public function run()
=======
public function run(Array_ $array)
>>>>>>> 4ffc47e32b... fixup! add skipped assign dim
=======
public function run(Array_ $array)
>>>>>>> 1464b13fdb... add skipped assign dim
{
/** @var ArrayItem[] $items */
$items = $array->items;
Expand Down
4 changes: 2 additions & 2 deletions rules/Naming/Naming/AliasNameResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public function resolveByName(Name $name): ?string
$prefix = $use instanceof GroupUse
? $use->prefix . '\\'
: '';
$useUses = $use->uses;
foreach ($useUses as $useUse) {

foreach ($use->uses as $useUse) {
if (! $useUse->alias instanceof Identifier) {
continue;
}
Expand Down

0 comments on commit 6b30001

Please sign in to comment.