Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/php_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.2']
dependencies: ['latest', 'lowest']
include:
- php: '8.2'
dependencies: 'lowest'

- php: '8.4'
dependencies: 'latest'
actions:
- {name: composer, run: make check-composer}
- {name: monorepo, run: make check-monorepo}
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/split_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.2']
dependencies: ['latest', 'lowest']
include:
- php: '8.2'
dependencies: 'lowest'

- php: '8.4'
dependencies: 'latest'
package: ${{ fromJson(needs.provide_packages_json.outputs.matrix) }}

name: ${{ matrix.package.dir }} (${{ matrix.php }}${{ matrix.dependencies == 'lowest' && ' - lowest dependencies' || '' }})
Expand Down
69 changes: 35 additions & 34 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"ext-openssl": "*",
"ext-pdo": "*",
"ext-sodium": "*",
"api-platform/core": "^3.4.17 || ^4.2.1",
"api-platform/core": "^4.2.11",
"async-aws/secrets-manager": "^2.5",
"aws/aws-sdk-php": "^3.288.1",
"bugsnag/bugsnag": "^3.29",
Expand All @@ -36,36 +36,37 @@
"psr/cache": "^3.0",
"psr/log": "^3.0",
"spatie/url": "^2.2",
"symfony/cache": "^7.2",
"symfony/cache": "^7.4 || ^8.0",
"symfony/cache-contracts": "^3.5",
"symfony/config": "^7.2",
"symfony/console": "^7.2",
"symfony/dependency-injection": "^7.2",
"symfony/doctrine-bridge": "^7.2",
"symfony/error-handler": "^7.2",
"symfony/event-dispatcher": "^7.2",
"symfony/config": "^7.4 || ^8.0",
"symfony/console": "^7.4 || ^8.0",
"symfony/dependency-injection": "^7.4 || ^8.0",
"symfony/doctrine-bridge": "^7.4 || ^8.0",
"symfony/error-handler": "^7.4 || ^8.0",
"symfony/event-dispatcher": "^7.4 || ^8.0",
"symfony/event-dispatcher-contracts": "^3.5",
"symfony/expression-language": "^7.2",
"symfony/filesystem": "^7.2",
"symfony/finder": "^7.2",
"symfony/framework-bundle": "^7.2",
"symfony/http-client": "^7.2",
"symfony/expression-language": "^7.4 || ^8.0",
"symfony/filesystem": "^7.4 || ^8.0",
"symfony/finder": "^7.4 || ^8.0",
"symfony/framework-bundle": "^7.4 || ^8.0",
"symfony/http-client": "^7.4 || ^8.0",
"symfony/http-client-contracts": "^3.5",
"symfony/http-foundation": "^7.2",
"symfony/http-kernel": "^7.2",
"symfony/lock": "^7.2",
"symfony/messenger": "^7.2",
"symfony/property-access": "^7.2",
"symfony/runtime": "^7.2",
"symfony/security-bundle": "^7.2",
"symfony/security-core": "^7.2",
"symfony/security-http": "^7.2",
"symfony/serializer": "^7.2",
"symfony/http-foundation": "^7.4 || ^8.0",
"symfony/http-kernel": "^7.4 || ^8.0",
"symfony/lock": "^7.4 || ^8.0",
"symfony/messenger": "^7.4 || ^8.0",
"symfony/property-access": "^7.4 || ^8.0",
"symfony/property-info": "^7.4 || ^8.0",
"symfony/runtime": "^7.4 || ^8.0",
"symfony/security-bundle": "^7.4 || ^8.0",
"symfony/security-core": "^7.4 || ^8.0",
"symfony/security-http": "^7.4 || ^8.0",
"symfony/serializer": "^7.4 || ^8.0",
"symfony/service-contracts": "^3.5",
"symfony/string": "^7.2",
"symfony/translation": "^7.2",
"symfony/uid": "^7.2",
"symfony/var-dumper": "^7.2",
"symfony/string": "^7.4 || ^8.0",
"symfony/translation": "^7.4 || ^8.0",
"symfony/uid": "^7.4 || ^8.0",
"symfony/var-dumper": "^7.4 || ^8.0",
"twig/twig": "^3.14.1"
},
"require-dev": {
Expand Down Expand Up @@ -95,13 +96,13 @@
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/phpstan": "^1.11",
"psr-discovery/discovery": "^1.0.2",
"symfony/amazon-sqs-messenger": "^7.2",
"symfony/browser-kit": "^7.2",
"symfony/process": "^7.2",
"symfony/routing": "^7.2",
"symfony/twig-bundle": "^7.2",
"symfony/validator": "^7.2",
"symfony/yaml": "^7.2",
"symfony/amazon-sqs-messenger": "^7.4 || ^8.0",
"symfony/browser-kit": "^7.4 || ^8.0",
"symfony/process": "^7.4 || ^8.0",
"symfony/routing": "^7.4 || ^8.0",
"symfony/twig-bundle": "^7.4 || ^8.0",
"symfony/validator": "^7.4 || ^8.0",
"symfony/yaml": "^7.4 || ^8.0",
"symplify/monorepo-builder": "^11.2.22"
},
"autoload": {
Expand Down
18 changes: 9 additions & 9 deletions packages/EasyActivity/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
"eonx-com/easy-doctrine": "^6.18",
"eonx-com/easy-lock": "^6.18",
"nesbot/carbon": "^3.8.4",
"symfony/config": "^7.2",
"symfony/dependency-injection": "^7.2",
"symfony/event-dispatcher": "^7.2",
"symfony/http-kernel": "^7.2",
"symfony/messenger": "^7.2",
"symfony/property-access": "^7.2",
"symfony/serializer": "^7.2",
"symfony/uid": "^7.2"
"symfony/config": "^7.4 || ^8.0",
"symfony/dependency-injection": "^7.4 || ^8.0",
"symfony/event-dispatcher": "^7.4 || ^8.0",
"symfony/http-kernel": "^7.4 || ^8.0",
"symfony/messenger": "^7.4 || ^8.0",
"symfony/property-access": "^7.4 || ^8.0",
"symfony/serializer": "^7.4 || ^8.0",
"symfony/uid": "^7.4 || ^8.0"
},
"require-dev": {
"doctrine/doctrine-bundle": "^2.12",
"eonx-com/easy-test": "^6.18",
"phpunit/phpunit": "^10.2|^11.4",
"symfony/framework-bundle": "^7.2"
"symfony/framework-bundle": "^7.4 || ^8.0"
},
"autoload": {
"psr-4": {
Expand Down
31 changes: 16 additions & 15 deletions packages/EasyApiPlatform/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@
"license": "MIT",
"require": {
"php": "^8.2",
"api-platform/core": "^3.4.17 || ^4.2.1",
"api-platform/core": "^4.2.11",
"doctrine/collections": "^1.7.2 || ^2.1",
"doctrine/dbal": "^3.8",
"doctrine/orm": "^2.20",
"doctrine/persistence": "^3.3",
"nesbot/carbon": "^3.8.4",
"psr/log": "^3.0",
"symfony/config": "^7.2",
"symfony/dependency-injection": "^7.2",
"symfony/http-foundation": "^7.2",
"symfony/http-kernel": "^7.2",
"symfony/property-access": "^7.2",
"symfony/serializer": "^7.2",
"symfony/uid": "^7.2"
"symfony/config": "^7.4 || ^8.0",
"symfony/dependency-injection": "^7.4 || ^8.0",
"symfony/http-foundation": "^7.4 || ^8.0",
"symfony/http-kernel": "^7.4 || ^8.0",
"symfony/property-access": "^7.4 || ^8.0",
"symfony/property-info": "^7.4 || ^8.0",
"symfony/serializer": "^7.4 || ^8.0",
"symfony/uid": "^7.4 || ^8.0"
},
"require-dev": {
"doctrine/annotations": "^2.0",
Expand All @@ -28,13 +29,13 @@
"eonx-com/easy-test": "^6.18",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^10.2|^11.4",
"symfony/browser-kit": "^7.2",
"symfony/expression-language": "^7.2",
"symfony/framework-bundle": "^7.2",
"symfony/http-client": "^7.2",
"symfony/security-bundle": "^7.2",
"symfony/twig-bundle": "^7.2",
"symfony/validator": "^7.2"
"symfony/browser-kit": "^7.4 || ^8.0",
"symfony/expression-language": "^7.4 || ^8.0",
"symfony/framework-bundle": "^7.4 || ^8.0",
"symfony/http-client": "^7.4 || ^8.0",
"symfony/security-bundle": "^7.4 || ^8.0",
"symfony/twig-bundle": "^7.4 || ^8.0",
"symfony/validator": "^7.4 || ^8.0"
},
"autoload": {
"psr-4": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Doctrine\ORM\Query\Expr\Join;
use Doctrine\ORM\QueryBuilder;
use Doctrine\Persistence\ManagerRegistry;
use EonX\EasyApiPlatform\Common\IriConverter\IriConverterTrait;
use Psr\Log\LoggerInterface;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
Expand Down Expand Up @@ -46,7 +45,6 @@
*/
final class AdvancedSearchFilter extends AbstractFilter implements SearchFilterInterface
{
use IriConverterTrait;
use SearchFilterTrait;

public const DOCTRINE_INTEGER_TYPE = Types::INTEGER;
Expand Down Expand Up @@ -457,6 +455,11 @@ protected function getIdFromValue(string $value): mixed
}
}

protected function getIriConverter(): IriConverterInterface
{
return $this->iriConverter;
}

protected function getPropertyAccessor(): PropertyAccessorInterface
{
return $this->propertyAccessor;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace EonX\EasyApiPlatform\Common\Paginator;

use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Attribute\Groups;

interface CustomPaginatorInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,72 +4,36 @@
namespace EonX\EasyApiPlatform\Common\SerializerContextBuilder;

use ApiPlatform\Metadata\GetCollection;
use ApiPlatform\Serializer\SerializerContextBuilderInterface as LegacySerializerContextBuilderInterface;
use ApiPlatform\State\SerializerContextBuilderInterface;
use EonX\EasyApiPlatform\Common\Paginator\CustomPaginatorInterface;
use Symfony\Component\HttpFoundation\Request;

// @todo Remove this class when dropping support for API Platform 3
if (\interface_exists(LegacySerializerContextBuilderInterface::class)) {
final readonly class SerializerContextBuilder implements
SerializerContextBuilderInterface,
LegacySerializerContextBuilderInterface
{
public function __construct(
private SerializerContextBuilderInterface $decorated,
) {
}

public function createFromRequest(
Request $request,
bool $normalization,
?array $extractedAttributes = null,
): array {
$context = $this->decorated->createFromRequest($request, $normalization, $extractedAttributes);
$operation = $context['operation'] ?? null;

// Customize context only for collection get
if ($operation instanceof GetCollection) {
$groups = (array)($context['groups'] ?? []);

if (\in_array(CustomPaginatorInterface::SERIALIZER_GROUP, $groups, true) === false) {
$groups[] = CustomPaginatorInterface::SERIALIZER_GROUP;
}

$context['groups'] = $groups;
}

return $context;
}
final readonly class SerializerContextBuilder implements SerializerContextBuilderInterface
{
public function __construct(
private SerializerContextBuilderInterface $decorated,
) {
}
} else {
final readonly class SerializerContextBuilder implements SerializerContextBuilderInterface
{
public function __construct(
private SerializerContextBuilderInterface $decorated,
) {
}

public function createFromRequest(
Request $request,
bool $normalization,
?array $extractedAttributes = null,
): array {
$context = $this->decorated->createFromRequest($request, $normalization, $extractedAttributes);
$operation = $context['operation'] ?? null;
public function createFromRequest(
Request $request,
bool $normalization,
?array $extractedAttributes = null,
): array {
$context = $this->decorated->createFromRequest($request, $normalization, $extractedAttributes);
$operation = $context['operation'] ?? null;

// Customize context only for collection get
if ($operation instanceof GetCollection) {
$groups = (array)($context['groups'] ?? []);
// Customize context only for collection get
if ($operation instanceof GetCollection) {
$groups = (array)($context['groups'] ?? []);

if (\in_array(CustomPaginatorInterface::SERIALIZER_GROUP, $groups, true) === false) {
$groups[] = CustomPaginatorInterface::SERIALIZER_GROUP;
}

$context['groups'] = $groups;
if (\in_array(CustomPaginatorInterface::SERIALIZER_GROUP, $groups, true) === false) {
$groups[] = CustomPaginatorInterface::SERIALIZER_GROUP;
}

return $context;
$context['groups'] = $groups;
}

return $context;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ protected function buildViolationsForNotNormalizableValueException(NotNormalizab
\preg_match(self::MESSAGE_PATTERN_CLASS, $throwable->getMessage(), $matches);

if (isset($matches[1])) {
$path = $this->nameConverter->normalize((string)$path, (string)$matches[1]);
/** @var class-string $class */
$class = (string)$matches[1];
$path = $this->nameConverter->normalize((string)$path, $class);
}

return [
Expand Down
Loading
Loading