Skip to content

Commit

Permalink
[TypeDeclaration] More tests for native type with sub namespace and a…
Browse files Browse the repository at this point in the history
…liased on TypedPropertyFromAssignsRector (#6496)
  • Loading branch information
samsonasik authored Nov 24, 2024
1 parent fead5bd commit 23f8e4a
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector\Fixture;

use PhpParser\Node as PHPParser;

final class AssignObjectAliased
{
private $int;

public function __construct()
{
$this->int = new PHPParser\Scalar\Int_(1);
}
}

?>
-----
<?php

namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector\Fixture;

use PhpParser\Node as PHPParser;

final class AssignObjectAliased
{
private \PhpParser\Node\Scalar\Int_ $int;

public function __construct()
{
$this->int = new PHPParser\Scalar\Int_(1);
}
}

?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector\Fixture;

use PhpParser\Node;

final class AssignObjectSubnamespace
{
private $int;

public function __construct()
{
$this->int = new Node\Scalar\Int_(1);
}
}

?>
-----
<?php

namespace Rector\Tests\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector\Fixture;

use PhpParser\Node;

final class AssignObjectSubnamespace
{
private \PhpParser\Node\Scalar\Int_ $int;

public function __construct()
{
$this->int = new Node\Scalar\Int_(1);
}
}

?>

0 comments on commit 23f8e4a

Please sign in to comment.