Skip to content

Commit

Permalink
add few more checks for class name
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Nov 29, 2021
1 parent 23679ac commit c19a849
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rules/Renaming/ValueObject/RenameProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Rector\Renaming\ValueObject;

use PHPStan\Type\ObjectType;
use Rector\Core\Validation\RectorAssert;

final class RenameProperty
{
Expand All @@ -13,6 +14,7 @@ public function __construct(
private string $oldProperty,
private string $newProperty
) {
RectorAssert::className($type);
}

public function getObjectType(): ObjectType
Expand Down
2 changes: 2 additions & 0 deletions rules/Transform/ValueObject/NewArgToMethodCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Rector\Transform\ValueObject;

use PHPStan\Type\ObjectType;
use Rector\Core\Validation\RectorAssert;

final class NewArgToMethodCall
{
Expand All @@ -16,6 +17,7 @@ public function __construct(
private $value,
private string $methodCall
) {
RectorAssert::className($type);
}

public function getObjectType(): ObjectType
Expand Down
3 changes: 3 additions & 0 deletions rules/Transform/ValueObject/NewToStaticCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Rector\Transform\ValueObject;

use PHPStan\Type\ObjectType;
use Rector\Core\Validation\RectorAssert;

final class NewToStaticCall
{
Expand All @@ -13,6 +14,8 @@ public function __construct(
private string $staticCallClass,
private string $staticCallMethod
) {
RectorAssert::className($type);
RectorAssert::className($staticCallClass);
}

public function getObjectType(): ObjectType
Expand Down
2 changes: 2 additions & 0 deletions rules/Transform/ValueObject/UnsetAndIssetToMethodCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Rector\Transform\ValueObject;

use PHPStan\Type\ObjectType;
use Rector\Core\Validation\RectorAssert;

final class UnsetAndIssetToMethodCall
{
Expand All @@ -13,6 +14,7 @@ public function __construct(
private string $issetMethodCall,
private string $unsedMethodCall
) {
RectorAssert::className($type);
}

public function getObjectType(): ObjectType
Expand Down
2 changes: 2 additions & 0 deletions rules/Transform/ValueObject/WrapReturn.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Rector\Transform\ValueObject;

use PHPStan\Type\ObjectType;
use Rector\Core\Validation\RectorAssert;

final class WrapReturn
{
Expand All @@ -13,6 +14,7 @@ public function __construct(
private string $method,
private bool $isArrayWrap
) {
RectorAssert::className($type);
}

public function getObjectType(): ObjectType
Expand Down

0 comments on commit c19a849

Please sign in to comment.