Skip to content

Commit

Permalink
Merge pull request #12 from answear/support-symfony6
Browse files Browse the repository at this point in the history
Support Symfony6
  • Loading branch information
lukasz-falda authored Aug 18, 2022
2 parents c325724 + fcc7b60 commit 280c414
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 54 deletions.
1 change: 1 addition & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
php-version:
- "7.4"
- "8.0"
- "8.1"
deps:
- "normal"
include:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
php-version:
- "7.4"
- "8.0"
- "8.1"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
Expand Down
103 changes: 53 additions & 50 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,56 @@
{
"name": "answear/overseas-bundle",
"description": "Symfony bundle for Overseas api.",
"type": "symfony-bundle",
"license": "MIT",
"require": {
"php": ">=7.4|^8.0",
"ext-json": "*",
"guzzlehttp/guzzle": "^6.0 || ^7.0",
"marc-mabe/php-enum": "^3.0|^4.3",
"psr/log": "^1.0",
"symfony/http-kernel": "^4.4|^5.1.5",
"symfony/property-info": "^4.4|^5.0",
"symfony/serializer": "^4.4|^5.0",
"webmozart/assert": "^1.3"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.2",
"matthiasnoback/symfony-config-test": "^4.2",
"phpro/grumphp": "^1.4.0",
"phpstan/phpstan": "^1.0",
"phpstan/phpstan-webmozart-assert": "^1.0",
"phpunit/phpunit": "^9.5",
"roave/security-advisories": "dev-master",
"symfony/phpunit-bridge": "^5.3"
},
"autoload": {
"psr-4": {
"Answear\\OverseasBundle\\": "src/"
"name": "answear/overseas-bundle",
"description": "Symfony bundle for Overseas api.",
"type": "symfony-bundle",
"license": "MIT",
"require": {
"php": ">=7.4|^8.0",
"ext-json": "*",
"guzzlehttp/guzzle": "^6.0 || ^7.0",
"marc-mabe/php-enum": "^3.0|^4.3",
"psr/log": "^1.0",
"symfony/http-kernel": "^5.4|^6.0",
"symfony/property-info": "^5.4|^6.0",
"symfony/serializer": "^5.4|^6.0",
"webmozart/assert": "^1.3"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.4",
"matthiasnoback/symfony-config-test": "^4.2",
"phpro/grumphp": "^1.5.0",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-webmozart-assert": "^1.0",
"phpunit/phpunit": "^9.5",
"roave/security-advisories": "dev-master",
"symfony/phpunit-bridge": "6.1.*"
},
"autoload": {
"psr-4": {
"Answear\\OverseasBundle\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Answear\\OverseasBundle\\Tests\\": "tests/"
}
},
"scripts": {
"post-install-cmd": [
"GrumPHP\\Composer\\DevelopmentIntegrator::integrate"
],
"post-update-cmd": [
"GrumPHP\\Composer\\DevelopmentIntegrator::integrate"
]
},
"extra": {
"grumphp": {
"config-default-path": "grumphp.yaml"
}
},
"config": {
"sort-packages": true,
"allow-plugins": {
"phpro/grumphp": true
}
}
},
"autoload-dev": {
"psr-4": {
"Answear\\OverseasBundle\\Tests\\": "tests/"
}
},
"scripts": {
"post-install-cmd": [
"GrumPHP\\Composer\\DevelopmentIntegrator::integrate"
],
"post-update-cmd": [
"GrumPHP\\Composer\\DevelopmentIntegrator::integrate"
]
},
"extra": {
"grumphp": {
"config-default-path": "grumphp.yaml"
}
},
"config": {
"sort-packages": true
}
}
8 changes: 4 additions & 4 deletions src/Serializer/Normalizer/EnumNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public function normalize($object, $format = null, array $context = [])
return $object->getValue();
}

public function supportsNormalization($data, $format = null): bool
public function supportsNormalization($data, $format = null, array $context = []): bool
{
return $data instanceof Enum;
}

public function supportsDenormalization($data, $type, $format = null): bool
public function supportsDenormalization($data, $type, $format = null, array $context = []): bool
{
try {
$type::get($data);
Expand All @@ -40,9 +40,9 @@ public function supportsDenormalization($data, $type, $format = null): bool
}

/**
* @see Enum for $type
*
* @return array|string|int|float|bool|\ArrayObject|null
*
* @see Enum for $type
*/
public function denormalize($data, $type, $format = null, array $context = [])
{
Expand Down

0 comments on commit 280c414

Please sign in to comment.