Skip to content

Commit 1e624fc

Browse files
Merge pull request #8182 from BacLuc/fix-propertyinfo-type-deprecation
api: fix "Symfony\Component\PropertyInfo\Type" class is deprecated
2 parents 61e9282 + 51d792a commit 1e624fc

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

api/src/Doctrine/Filter/ContentNodeCampFilter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
use Doctrine\ORM\QueryBuilder;
1313
use Doctrine\Persistence\ManagerRegistry;
1414
use Psr\Log\LoggerInterface;
15-
use Symfony\Component\PropertyInfo\Type;
1615
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
16+
use Symfony\Component\TypeInfo\Type;
1717

1818
final class ContentNodeCampFilter extends AbstractFilter {
1919
use FiltersByCampCollaboration;
@@ -34,7 +34,7 @@ public function __construct(
3434
public function getDescription(string $resourceClass): array {
3535
return ['camp' => [
3636
'property' => self::CAMP_QUERY_NAME,
37-
'type' => Type::BUILTIN_TYPE_STRING,
37+
'type' => Type::string()->__toString(),
3838
'required' => false,
3939
]];
4040
}

api/src/Doctrine/Filter/ContentNodeIsRootFilter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
use Doctrine\ORM\QueryBuilder;
1010
use Doctrine\Persistence\ManagerRegistry;
1111
use Psr\Log\LoggerInterface;
12-
use Symfony\Component\PropertyInfo\Type;
1312
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
13+
use Symfony\Component\TypeInfo\Type;
1414

1515
final class ContentNodeIsRootFilter extends AbstractFilter {
1616
public const IS_ROOT_QUERY_NAME = 'isRoot';
@@ -28,7 +28,7 @@ public function __construct(
2828
public function getDescription(string $resourceClass): array {
2929
return ['isRoot' => [
3030
'property' => self::IS_ROOT_QUERY_NAME,
31-
'type' => Type::BUILTIN_TYPE_BOOL,
31+
'type' => Type::bool()->__toString(),
3232
'required' => false,
3333
]];
3434
}

api/src/Doctrine/Filter/ContentNodePeriodFilter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
use Doctrine\ORM\QueryBuilder;
1414
use Doctrine\Persistence\ManagerRegistry;
1515
use Psr\Log\LoggerInterface;
16-
use Symfony\Component\PropertyInfo\Type;
1716
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
17+
use Symfony\Component\TypeInfo\Type;
1818

1919
final class ContentNodePeriodFilter extends AbstractFilter {
2020
use FiltersByCampCollaboration;
@@ -35,7 +35,7 @@ public function __construct(
3535
public function getDescription(string $resourceClass): array {
3636
return ['period' => [
3737
'property' => self::PERIOD_QUERY_NAME,
38-
'type' => Type::BUILTIN_TYPE_STRING,
38+
'type' => Type::string()->__toString(),
3939
'required' => false,
4040
]];
4141
}

api/src/Doctrine/Filter/MaterialItemPeriodFilter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
use Doctrine\ORM\QueryBuilder;
1212
use Doctrine\Persistence\ManagerRegistry;
1313
use Psr\Log\LoggerInterface;
14-
use Symfony\Component\PropertyInfo\Type;
1514
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
15+
use Symfony\Component\TypeInfo\Type;
1616

1717
final class MaterialItemPeriodFilter extends AbstractFilter {
1818
public const PERIOD_QUERY_NAME = 'period';
@@ -31,7 +31,7 @@ public function __construct(
3131
public function getDescription(string $resourceClass): array {
3232
return ['period' => [
3333
'property' => self::PERIOD_QUERY_NAME,
34-
'type' => Type::BUILTIN_TYPE_STRING,
34+
'type' => Type::string()->__toString(),
3535
'required' => false,
3636
]];
3737
}

api/tests/Serializer/PreventAutomaticEmbeddingPropertyMetadataFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
77
use App\Serializer\PreventAutomaticEmbeddingPropertyMetadataFactory;
88
use PHPUnit\Framework\TestCase;
9-
use Symfony\Component\PropertyInfo\Type as PropertyInfoType;
9+
use Symfony\Component\TypeInfo\Type;
1010

1111
/**
1212
* @internal
@@ -35,7 +35,7 @@ public function testCreateResetsReadableLinkAndWritableLinkToNull() {
3535
security: true,
3636
securityPostDenormalize: 'securityPostDenormalize',
3737
types: ['types'],
38-
builtinTypes: [new PropertyInfoType(builtinType: PropertyInfoType::BUILTIN_TYPE_INT)],
38+
builtinTypes: [Type::int()],
3939
schema: ['schema'],
4040
initializable: true,
4141
iris: ['iris'],

0 commit comments

Comments
 (0)