mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-17 00:22:24 +00:00
fix fixtures
This commit is contained in:
parent
1c273c902c
commit
69c18b87ca
|
@ -15,6 +15,7 @@ $finder->files();
|
|||
$finder->name('*.php.inc');
|
||||
$finder->in(__DIR__ . '/../tests');
|
||||
$finder->in(__DIR__ . '/../packages/*/tests');
|
||||
$finder->in(__DIR__ . '/../rules/*/tests');
|
||||
|
||||
$finderSanitizer = new FinderSanitizer();
|
||||
$smartFileInfos = $finderSanitizer->sanitize($finder);
|
||||
|
|
|
@ -9,19 +9,3 @@ function throwCustomExceptionAlreadyAnnotatedInFunction()
|
|||
{
|
||||
throw new \Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheException();
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
|
||||
|
||||
/**
|
||||
* @throws \Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheException
|
||||
*/
|
||||
function throwCustomExceptionAlreadyAnnotatedInFunction()
|
||||
{
|
||||
throw new \Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheException();
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -9,19 +9,3 @@ function throwRootExceptionAlreadyAnnotatedInFunction()
|
|||
{
|
||||
throw new \RuntimeException();
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
|
||||
|
||||
/**
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
function throwRootExceptionAlreadyAnnotatedInFunction()
|
||||
{
|
||||
throw new \RuntimeException();
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -12,22 +12,3 @@ class RootExceptionAlreadyAnnotatedInMethod
|
|||
throw new \RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
|
||||
|
||||
class RootExceptionAlreadyAnnotatedInMethod
|
||||
{
|
||||
/**
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function throwException()
|
||||
{
|
||||
throw new \RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -11,21 +11,3 @@ function throwRootImportedExceptionAlreadyAnnotatedInFunction()
|
|||
{
|
||||
throw new RuntimeException();
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
|
||||
|
||||
use \RuntimeException;
|
||||
|
||||
/**
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
function throwRootImportedExceptionAlreadyAnnotatedInFunction()
|
||||
{
|
||||
throw new RuntimeException();
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -14,24 +14,3 @@ class RootImportedExceptionAlreadyAnnotatedInMethod
|
|||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
|
||||
|
||||
use \RuntimeException;
|
||||
|
||||
class RootImportedExceptionAlreadyAnnotatedInMethod
|
||||
{
|
||||
/**
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public function throwException()
|
||||
{
|
||||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -18,28 +18,3 @@ function throwWithFactoryMethodNoReturnTypeHinting()
|
|||
{
|
||||
throw ExceptionsFactoryNotAnnotated::createException(1);
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
|
||||
|
||||
use Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheException;
|
||||
use Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheExceptionTheSecond;
|
||||
use Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheExceptionTheThird;
|
||||
|
||||
class ExceptionsFactoryNoReturnTypeHingting
|
||||
{
|
||||
public static function createException(int $code)
|
||||
{
|
||||
return new TheException();
|
||||
}
|
||||
}
|
||||
|
||||
function throwWithFactoryMethodNoReturnTypeHinting()
|
||||
{
|
||||
throw ExceptionsFactoryNotAnnotated::createException(1);
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -28,38 +28,3 @@ function throwWithFactoryMethodNotAnnotated()
|
|||
$factory = new ExceptionsFactoryMethodNothingAnnotated();
|
||||
throw $factory->cercoQuestoMetodoQui(1);
|
||||
}
|
||||
|
||||
?>
|
||||
-----
|
||||
<?php
|
||||
|
||||
namespace Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Fixture;
|
||||
|
||||
use Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheException;
|
||||
use Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheExceptionTheSecond;
|
||||
use Rector\CodingStyle\Tests\Rector\Throw_\AnnotateThrowablesRector\Source\TheExceptionTheThird;
|
||||
|
||||
class ExceptionsFactoryMethodNothingAnnotated
|
||||
{
|
||||
public function cercoQuestoMetodoQui(int $code)
|
||||
{
|
||||
switch ($code) {
|
||||
case 1:
|
||||
return new TheException();
|
||||
case 2:
|
||||
return new TheExceptionTheSecond();
|
||||
case 3:
|
||||
return new TheExceptionTheThird();
|
||||
default:
|
||||
return new \RuntimeException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function throwWithFactoryMethodNotAnnotated()
|
||||
{
|
||||
$factory = new ExceptionsFactoryMethodNothingAnnotated();
|
||||
throw $factory->cercoQuestoMetodoQui(1);
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue
Block a user