Add failing test case for use of $this in same class with assignment.

This commit is contained in:
Aerendir 2020-03-07 12:07:43 +01:00
parent 47a18fca6b
commit 8be8bc73ed

View File

@ -0,0 +1,50 @@
<?php
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
use Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\Exceptions\TheException;
class UseOfThisSameClassWithAssignment
{
/**
* @throws TheException
*/
public function thisMethodThrowsAnException():string
{
throw new TheException('');
}
public function thisMethodUsesAThisThatThrowsAnException()
{
$assign = $this->thisMethodThrowsAnException();
}
}
?>
-----
<?php
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
use Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\Exceptions\TheException;
class UseOfThisSameClassWithAssignment
{
/**
* @throws TheException
*/
public function thisMethodThrowsAnException():string
{
throw new TheException('');
}
/**
* @throws \Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\Exceptions\TheException
*/
public function thisMethodUsesAThisThatThrowsAnException()
{
$assign = $this->thisMethodThrowsAnException();
}
}
?>