Skip to content

Commit 0aca96d

Browse files
janedbalondrejmirtes
authored andcommitted
Add descriptor for AsciiStringType
1 parent 3313ae0 commit 0aca96d

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

extension.neon

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,9 @@ services:
278278
-
279279
class: PHPStan\Type\Doctrine\Descriptors\ArrayType
280280
tags: [phpstan.doctrine.typeDescriptor]
281+
-
282+
class: PHPStan\Type\Doctrine\Descriptors\AsciiStringType
283+
tags: [phpstan.doctrine.typeDescriptor]
281284
-
282285
class: PHPStan\Type\Doctrine\Descriptors\BigIntType
283286
tags: [phpstan.doctrine.typeDescriptor]
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace PHPStan\Type\Doctrine\Descriptors;
4+
5+
use PHPStan\Type\StringType;
6+
use PHPStan\Type\Type;
7+
8+
class AsciiStringType implements DoctrineTypeDescriptor
9+
{
10+
11+
public function getType(): string
12+
{
13+
return \Doctrine\DBAL\Types\AsciiStringType::class;
14+
}
15+
16+
public function getWritableToPropertyType(): Type
17+
{
18+
return new StringType();
19+
}
20+
21+
public function getWritableToDatabaseType(): Type
22+
{
23+
return new StringType();
24+
}
25+
26+
public function getDatabaseInternalType(): Type
27+
{
28+
return new StringType();
29+
}
30+
31+
}

0 commit comments

Comments
 (0)