Skip to content

Commit

Permalink
[TypeDeclaration] Separated inferred and no types (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed May 22, 2021
1 parent db00e23 commit 617c04a
Show file tree
Hide file tree
Showing 20 changed files with 194 additions and 1,252 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public function mapToPHPStan(Node $node): Type
$fullyQualifiedName = $node->toString();

// is aliased?
if ($this->isAliasedName($originalName, $fullyQualifiedName)) {
if ($this->isAliasedName($originalName, $fullyQualifiedName) && $originalName !== $fullyQualifiedName
) {
return new AliasedObjectType($originalName, $fullyQualifiedName);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ use DateTimeInterface;

class NullableType
{
private ?DatetimeInterface $time;
private ?DateTimeInterface $time;

public function __construct(DatetimeInterface $time = null)
public function __construct(DateTimeInterface $time = null)
{
$this->time = $time;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Rector\Tests\Php80\Rector\Class_\ClassPropertyAssignToConstructorPromotionRector\Fixture;

final class SkipPropertyAssign
{
private $command;

public function __construct(\Closure $command)
{
$this->command = $command;
}

public function getCommand()
{
if (!$this->command instanceof \Closure) {
return $this->command;
}

$this->command = ($this->command)();

return $this->command;
}
}
Loading

0 comments on commit 617c04a

Please sign in to comment.