Skip to content

Commit

Permalink
Add descriptor for AsciiStringType
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal authored and ondrejmirtes committed Nov 17, 2023
1 parent 3313ae0 commit 0aca96d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ services:
-
class: PHPStan\Type\Doctrine\Descriptors\ArrayType
tags: [phpstan.doctrine.typeDescriptor]
-
class: PHPStan\Type\Doctrine\Descriptors\AsciiStringType
tags: [phpstan.doctrine.typeDescriptor]
-
class: PHPStan\Type\Doctrine\Descriptors\BigIntType
tags: [phpstan.doctrine.typeDescriptor]
Expand Down
31 changes: 31 additions & 0 deletions src/Type/Doctrine/Descriptors/AsciiStringType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php declare(strict_types = 1);

namespace PHPStan\Type\Doctrine\Descriptors;

use PHPStan\Type\StringType;
use PHPStan\Type\Type;

class AsciiStringType implements DoctrineTypeDescriptor
{

public function getType(): string
{
return \Doctrine\DBAL\Types\AsciiStringType::class;
}

public function getWritableToPropertyType(): Type
{
return new StringType();
}

public function getWritableToDatabaseType(): Type
{
return new StringType();
}

public function getDatabaseInternalType(): Type
{
return new StringType();
}

}

0 comments on commit 0aca96d

Please sign in to comment.