mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-22 18:54:39 +01:00
Add failing test case for use of $this
in the same class.
This commit is contained in:
parent
5a5d5dc340
commit
08b681999e
@ -15,7 +15,7 @@ class ThisA
|
||||
}
|
||||
}
|
||||
|
||||
class UseOfThis extends ThisA
|
||||
class UseOfThisInherited extends ThisA
|
||||
{
|
||||
public function thisMethodUsesAThisThatThrowsAnException()
|
||||
{
|
||||
@ -42,7 +42,7 @@ class ThisA
|
||||
}
|
||||
}
|
||||
|
||||
class UseOfThis extends ThisA
|
||||
class UseOfThisInherited extends ThisA
|
||||
{
|
||||
/**
|
||||
* @throws \Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\Exceptions\TheException
|
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
|
||||
|
||||
use Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\Exceptions\TheException;
|
||||
|
||||
class UseOfThisSameClass
|
||||
{
|
||||
/**
|
||||
* @throws TheException
|
||||
*/
|
||||
public function thisMethodThrowsAnException():string
|
||||
{
|
||||
throw new TheException('');
|
||||
}
|
||||
|
||||
public function thisMethodUsesAThisThatThrowsAnException()
|
||||
{
|
||||
$this->thisMethodThrowsAnException();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
|
||||
|
||||
use Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\Exceptions\TheException;
|
||||
|
||||
class UseOfThisSameClass
|
||||
{
|
||||
/**
|
||||
* @throws TheException
|
||||
*/
|
||||
public function thisMethodThrowsAnException():string
|
||||
{
|
||||
throw new TheException('');
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\Exceptions\TheException
|
||||
*/
|
||||
public function thisMethodUsesAThisThatThrowsAnException()
|
||||
{
|
||||
$this->thisMethodThrowsAnException();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user