Skip to content

Commit 7d05d79

Browse files
committed
Fix build
1 parent 514978d commit 7d05d79

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

src/Type/Doctrine/Descriptors/BigIntType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function getWritableToPropertyType(): Type
3131

3232
public function getWritableToDatabaseType(): Type
3333
{
34-
return TypeCombinator::union(new StringType());
34+
return TypeCombinator::union(new StringType(), new IntegerType());
3535
}
3636

3737
public function getDatabaseInternalType(Driver $driver): Type

src/Type/Doctrine/Descriptors/Ramsey/UuidTypeDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace PHPStan\Type\Doctrine\Descriptors\Ramsey;
44

5-
use PHPStan\Rules\Doctrine\ORM\FakeTestingUuidType;
65
use Doctrine\DBAL\Driver;
6+
use PHPStan\Rules\Doctrine\ORM\FakeTestingUuidType;
77
use PHPStan\ShouldNotHappenException;
88
use PHPStan\Type\Doctrine\Descriptors\DoctrineTypeDescriptor;
99
use PHPStan\Type\ObjectType;

tests/Platform/Entity/PlatformEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types = 1);
22

3-
namespace Platform\Entity;
3+
namespace PHPStan\Platform\Entity;
44

55
use Doctrine\ORM\Mapping as ORM;
66

tests/Platform/QueryResultTypeWalkerFetchTypeMatrixTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use mysqli;
2020
use PDO;
2121
use PHPStan\Php\PhpVersion;
22+
use PHPStan\Platform\Entity\PlatformEntity;
2223
use PHPStan\Testing\PHPStanTestCase;
2324
use PHPStan\Type\Accessory\AccessoryNumericStringType;
2425
use PHPStan\Type\BooleanType;
@@ -43,7 +44,6 @@
4344
use PHPStan\Type\VerbosityLevel;
4445
use PHPUnit\Framework\Constraint\IsEqual;
4546
use PHPUnit\Framework\Constraint\IsIdentical;
46-
use Platform\Entity\PlatformEntity;
4747
use SQLite3;
4848
use Throwable;
4949
use function floor;

tests/Type/Doctrine/Query/QueryResultTypeWalkerTest.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ public static function getAdditionalConfigFiles(): array
7070

7171
public static function setUpBeforeClass(): void
7272
{
73+
if (PHP_VERSION_ID < 80100) {
74+
self::markTestSkipped('Test uses asserts without stringification, those work only with PHP >= 8.1. Stringification is tested in platform test.');
75+
}
76+
7377
$em = require __DIR__ . '/../data/QueryResult/entity-manager.php';
7478
self::$em = $em;
7579

@@ -162,17 +166,15 @@ public static function setUpBeforeClass(): void
162166
$em->persist($child);
163167
}
164168

165-
if (property_exists(Column::class, 'enumType') && PHP_VERSION_ID >= 80100) {
166-
assert(class_exists(StringEnum::class));
167-
assert(class_exists(IntEnum::class));
169+
assert(class_exists(StringEnum::class));
170+
assert(class_exists(IntEnum::class));
168171

169-
$entityWithEnum = new EntityWithEnum();
170-
$entityWithEnum->id = '1';
171-
$entityWithEnum->stringEnumColumn = StringEnum::A;
172-
$entityWithEnum->intEnumColumn = IntEnum::A;
173-
$entityWithEnum->intEnumOnStringColumn = IntEnum::A;
174-
$em->persist($entityWithEnum);
175-
}
172+
$entityWithEnum = new EntityWithEnum();
173+
$entityWithEnum->id = '1';
174+
$entityWithEnum->stringEnumColumn = StringEnum::A;
175+
$entityWithEnum->intEnumColumn = IntEnum::A;
176+
$entityWithEnum->intEnumOnStringColumn = IntEnum::A;
177+
$em->persist($entityWithEnum);
176178

177179
$em->flush();
178180
}

0 commit comments

Comments
 (0)