Skip to content

Commit

Permalink
add test for override parent
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 11, 2023
1 parent b890cb8 commit 6ff7f77
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace Rector\Tests\DowngradePhp82\Rector\Class_\DowngradeStandaloneNullTrueFalseReturnTypeRector\Fixture;

use Rector\Tests\DowngradePhp82\Rector\FunctionLike\DowngradeStandaloneNullTrueFalseReturnTypeRector\ParentClass;

final class OverrideParentMethod extends ParentClass
{
public function run(): null
{
return null;
}
}

?>
-----
<?php

namespace Rector\Tests\DowngradePhp82\Rector\Class_\DowngradeStandaloneNullTrueFalseReturnTypeRector\Fixture;

use Rector\Tests\DowngradePhp82\Rector\FunctionLike\DowngradeStandaloneNullTrueFalseReturnTypeRector\ParentClass;

final class OverrideParentMethod extends ParentClass
{
/**
* @return null
*/
public function run(): ?string
{
return null;
}
}

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

declare(strict_types=1);

namespace Rector\Tests\DowngradePhp82\Rector\FunctionLike\DowngradeStandaloneNullTrueFalseReturnTypeRector;

class ParentClass
{
public function getSomeString(): ?string
{
return 'test';
}
}

0 comments on commit 6ff7f77

Please sign in to comment.