Skip to content

Commit

Permalink
Coding Style - PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhelias committed Jun 5, 2024
1 parent d51b50f commit b0381b7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Doctrine/DBAL/Types/PhoneNumberType.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform): st
{
// DBAL < 4
if (method_exists(AbstractPlatform::class, 'getVarcharTypeDeclarationSQL')) {
// @phpstan-ignore-next-line
return $platform->getVarcharTypeDeclarationSQL(['length' => $column['length'] ?? 35]);
}

Expand Down Expand Up @@ -78,7 +79,6 @@ public function convertToPHPValue($value, AbstractPlatform $platform): ?PhoneNum
}

// DBAL 4
// @phpstan-ignore-next-line
throw InvalidType::new($value, self::NAME, ['null', 'string']);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Validator/Constraints/PhoneNumberValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public function validate(mixed $value, Constraint $constraint): void
}
}

private function getRegion(PhoneNumberConstraint $constraint): ?string
private function getRegion(PhoneNumberConstraint $constraint): string
{
$defaultRegion = null;
if (null !== $path = $constraint->regionPath) {
Expand Down
7 changes: 5 additions & 2 deletions tests/Doctrine/DBAL/Types/PhoneNumberTypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class PhoneNumberTypeTest extends TestCase
* @var ObjectProphecy<AbstractPlatform>
*/
private ObjectProphecy $platform;
private Type $type;
private PhoneNumberType $type;
private PhoneNumberUtil $phoneNumberUtil;

public static function setUpBeforeClass(): void
Expand All @@ -53,7 +53,10 @@ protected function setUp(): void
$this->platform->getStringTypeDeclarationSQL()->willReturn('DUMMYVARCHAR()');
}

$this->type = Type::getType('phone_number');
/** @var PhoneNumberType $type */
$type = Type::getType('phone_number');

$this->type = $type;
$this->phoneNumberUtil = PhoneNumberUtil::getInstance();
}

Expand Down

0 comments on commit b0381b7

Please sign in to comment.