Skip to content

Commit

Permalink
cleanup RecastingRemovalRector tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jul 13, 2023
1 parent 8346c9b commit e919149
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 48 deletions.
1 change: 0 additions & 1 deletion packages/NodeTypeResolver/NodeTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ public function getType(Node $node): Type

if ($type instanceof Type) {
$type = $this->accessoryNonEmptyStringTypeCorrector->correct($type);

$type = $this->genericClassStringTypeCorrector->correct($type);

if ($type instanceof ObjectType) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\DeadCode\Rector\Cast\RecastingRemovalRector\Fixture;

use Rector\Cast\RecastingRemovalRector\Source\ExternalNonStrictTypedProperty;
use Rector\Tests\DeadCode\Rector\Cast\RecastingRemovalRector\Source\ExternalNonStrictTypedProperty;

final class SkipNonTypedProperty2
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace Rector\Tests\DeadCode\Rector\Cast\RecastingRemovalRector\Fixture;

use Rector\Tests\DeadCode\Rector\Cast\RecastingRemovalRector\Source\ExternalStrictTypedProperty;

final class SomeTypedProperty
{
public int $someProperty = 1;

public function run()
public function run(ExternalStrictTypedProperty $externalStrictTypedProperty)
{
$value = (int) $this->someProperty;
$value = (int) $externalStrictTypedProperty->property;
}
}

Expand All @@ -18,13 +18,13 @@ final class SomeTypedProperty

namespace Rector\Tests\DeadCode\Rector\Cast\RecastingRemovalRector\Fixture;

use Rector\Tests\DeadCode\Rector\Cast\RecastingRemovalRector\Source\ExternalStrictTypedProperty;

final class SomeTypedProperty
{
public int $someProperty = 1;

public function run()
public function run(ExternalStrictTypedProperty $externalStrictTypedProperty)
{
$value = $this->someProperty;
$value = $externalStrictTypedProperty->property;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

namespace Rector\Cast\RecastingRemovalRector\Source;
declare(strict_types=1);

namespace Rector\Tests\DeadCode\Rector\Cast\RecastingRemovalRector\Source;

final class ExternalNonStrictTypedProperty
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace Rector\Tests\DeadCode\Rector\Cast\RecastingRemovalRector\Source;

final class ExternalStrictTypedProperty
{
public int $property = 1;
}

0 comments on commit e919149

Please sign in to comment.