Skip to content

Commit 35864f6

Browse files
authored
Merge pull request #4 from 77web/feat/phpstan
Introduced phpstan
2 parents dd6e39c + 99687e4 commit 35864f6

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"type": "library",
55
"require-dev": {
66
"phpunit/phpunit": "^10.3",
7-
"symplify/easy-coding-standard": "^12.0"
7+
"symplify/easy-coding-standard": "^12.0",
8+
"phpstan/phpstan": "^1.10"
89
},
910
"license": "MIT",
1011
"autoload": {

phpstan.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
parameters:
2+
paths:
3+
- src
4+
level: max
5+
checkGenericClassInNonGenericObjectType: false
6+

src/TsTzRangeType.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ public function getSQLDeclaration(array $column, AbstractPlatform $platform)
2828
*/
2929
public function convertToPHPValue($value, AbstractPlatform $platform)
3030
{
31+
if (!is_string($value)) {
32+
throw new \RuntimeException('tstzrange expects only string. unexpected value from DB: ' . $value);
33+
}
3134
if (!preg_match('/(\[|\()(.*)\,(.*)(\]|\))/', $value, $matches)) {
3235
throw new \RuntimeException('unexpected value from DB: ' . $value);
3336
}

0 commit comments

Comments
 (0)