Skip to content

Commit 2706975

Browse files
authored
Merge pull request #1 from phone-do-inc/update-to-api-platform-3
Update to API Platform v3 compatibility
2 parents 47572a0 + cf5bc4b commit 2706975

File tree

7 files changed

+30
-22
lines changed

7 files changed

+30
-22
lines changed

composer.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"cs": "vendor/bin/php-cs-fixer fix src"
1616
},
1717
"suggest": {
18-
"doctrine/orm": "^2.9",
19-
"api-platform/core": "^2.6",
20-
"symfony/messenger": "^5.3|^6.0|^6.2"
18+
"doctrine/orm": "^2.10",
19+
"api-platform/api-pack": "^3.0",
20+
"symfony/messenger": "^6.4"
2121
},
2222
"autoload": {
2323
"psr-4": {
@@ -30,23 +30,23 @@
3030
}
3131
},
3232
"require": {
33-
"php": "^8.0|^8.1",
33+
"php": "^8.3",
3434
"ext-intl": "*",
3535
"giggsey/libphonenumber-for-php": "^8.11",
3636
"myclabs/php-enum": "^1.7",
3737
"moneyphp/money": "^3",
38-
"symfony/intl": "^5.3|^6.0|^6.2",
38+
"symfony/intl": "^6.4",
3939
"symfony/polyfill-uuid": "^1.23",
4040
"phpdocumentor/reflection-docblock": "^5.2",
41-
"symfony/serializer": "^5.3|6.0.1|^6.2"
41+
"symfony/serializer": "^6.4"
4242
},
4343
"require-dev": {
4444
"phpstan/phpstan": "^1.9",
4545
"friendsofphp/php-cs-fixer": "^3.0",
46-
"doctrine/orm": "^2.9",
47-
"symfony/messenger": "^5.3|^6.0|^6.2",
48-
"api-platform/core": "^2.6",
49-
"symfony/validator": "^5.3|^6.0|^6.2",
46+
"doctrine/orm": "^2.10",
47+
"symfony/messenger": "^6.4",
48+
"api-platform/core": "^3.0",
49+
"symfony/validator": "^6.4",
5050
"phpunit/phpunit": "^9.5",
5151
"spatie/phpunit-snapshot-assertions": "^4.2"
5252
}

src/ApiPlatform/Filter/AbstractFullTextSearchFilter.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
namespace Riverwaysoft\ApiTools\ApiPlatform\Filter;
44

5-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\AbstractContextAwareFilter;
6-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface;
5+
use ApiPlatform\Doctrine\Orm\Filter\AbstractContextAwareFilter;
6+
use ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface;
77
use Doctrine\ORM\QueryBuilder;
8+
use ApiPlatform\Metadata;
89

910
abstract class AbstractFullTextSearchFilter extends AbstractContextAwareFilter
1011
{
@@ -16,8 +17,8 @@ protected function filterProperty(
1617
QueryBuilder $queryBuilder,
1718
QueryNameGeneratorInterface $queryNameGenerator,
1819
string $resourceClass,
19-
string $operationName = null
20-
) {
20+
Operation $operation = null,
21+
) : void {
2122
if ($property !== 'fullText') {
2223
return;
2324
}

src/ApiPlatform/Filter/RiverAdminBooleanFilter.php

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

33
namespace Riverwaysoft\ApiTools\ApiPlatform\Filter;
44

5-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
5+
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
66

77
class RiverAdminBooleanFilter extends SearchFilter
88
{

src/ApiPlatform/Filter/RiverAdminEntityDropdownFilter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace Riverwaysoft\ApiTools\ApiPlatform\Filter;
66

7-
use ApiPlatform\Core\Api\IdentifiersExtractorInterface;
8-
use ApiPlatform\Core\Api\IriConverterInterface;
9-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
7+
use ApiPlatform\Api\IdentifiersExtractorInterface;
8+
use ApiPlatform\Api\IriConverterInterface;
9+
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
1010
use Doctrine\Persistence\ManagerRegistry;
1111
use Psr\Log\LoggerInterface;
1212
use Symfony\Component\HttpFoundation\RequestStack;

src/ApiPlatform/Filter/RiverAdminEnumSearchFilter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
namespace Riverwaysoft\ApiTools\ApiPlatform\Filter;
66

7-
use ApiPlatform\Core\Api\IdentifiersExtractorInterface;
8-
use ApiPlatform\Core\Api\IriConverterInterface;
9-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
7+
use ApiPlatform\Api\IdentifiersExtractorInterface;
8+
use ApiPlatform\Api\IriConverterInterface;
9+
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
1010
use Doctrine\Persistence\ManagerRegistry;
1111
use Psr\Log\LoggerInterface;
1212
use Symfony\Component\HttpFoundation\RequestStack;

src/ApiPlatform/Filter/RiverAdminSearchFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Riverwaysoft\ApiTools\ApiPlatform\Filter;
66

7-
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
7+
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
88

99
class RiverAdminSearchFilter extends SearchFilter
1010
{

src/ApiPlatform/Serializer/EnumNormalizer.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,11 @@ public function supportsNormalization($data, string $format = null): bool
3838
{
3939
return $data instanceof Enum;
4040
}
41+
42+
public function getSupportedTypes($format)
43+
{
44+
return [
45+
Enum::class => true,
46+
];
47+
}
4148
}

0 commit comments

Comments
 (0)