add few more checks for class name

This commit is contained in:
Tomas Votruba 2021-11-29 12:44:16 +03:00
parent 23679ac81a
commit c19a849702
5 changed files with 11 additions and 0 deletions

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Rector\Renaming\ValueObject;
use PHPStan\Type\ObjectType;
use Rector\Core\Validation\RectorAssert;
final class RenameProperty
{
@ -13,6 +14,7 @@ final class RenameProperty
private string $oldProperty,
private string $newProperty
) {
RectorAssert::className($type);
}
public function getObjectType(): ObjectType

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Rector\Transform\ValueObject;
use PHPStan\Type\ObjectType;
use Rector\Core\Validation\RectorAssert;
final class NewArgToMethodCall
{
@ -16,6 +17,7 @@ final class NewArgToMethodCall
private $value,
private string $methodCall
) {
RectorAssert::className($type);
}
public function getObjectType(): ObjectType

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Rector\Transform\ValueObject;
use PHPStan\Type\ObjectType;
use Rector\Core\Validation\RectorAssert;
final class NewToStaticCall
{
@ -13,6 +14,8 @@ final class NewToStaticCall
private string $staticCallClass,
private string $staticCallMethod
) {
RectorAssert::className($type);
RectorAssert::className($staticCallClass);
}
public function getObjectType(): ObjectType

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Rector\Transform\ValueObject;
use PHPStan\Type\ObjectType;
use Rector\Core\Validation\RectorAssert;
final class UnsetAndIssetToMethodCall
{
@ -13,6 +14,7 @@ final class UnsetAndIssetToMethodCall
private string $issetMethodCall,
private string $unsedMethodCall
) {
RectorAssert::className($type);
}
public function getObjectType(): ObjectType

View File

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Rector\Transform\ValueObject;
use PHPStan\Type\ObjectType;
use Rector\Core\Validation\RectorAssert;
final class WrapReturn
{
@ -13,6 +14,7 @@ final class WrapReturn
private string $method,
private bool $isArrayWrap
) {
RectorAssert::className($type);
}
public function getObjectType(): ObjectType