Skip to content
Merged
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
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
php: ['8.3']
php: ['8.4']

steps:
- name: Checkout Code
Expand All @@ -33,6 +33,8 @@ jobs:

- name: Run Linters
run: composer run-script lint
env:
PHP_CS_FIXER_IGNORE_ENV: 1

- name: Run Tests
run: composer run-script test
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
1.3.3
=====

* (improvement) Add convenience default parameters.
* (improvement) Require PHP 8.4+
* (improvement) Bump dependencies.


1.3.2
=====

Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
],
"homepage": "https://github.com/21TORR/simple-normalizer",
"require": {
"php": ">= 8.3",
"21torr/bundle-helpers": "^2.1",
"symfony/dependency-injection": "^6.4 || ^7.0",
"symfony/http-kernel": "^6.4 || ^7.0"
"php": ">= 8.4",
"21torr/bundle-helpers": "^2.3",
"symfony/dependency-injection": "^7.2",
"symfony/http-kernel": "^7.2"
},
"require-dev": {
"21torr/janus": "^1.4",
"bamarni/composer-bin-plugin": "^1.8",
"doctrine/common": "^3.4",
"doctrine/common": "^3.5",
"roave/security-advisories": "dev-latest",
"symfony/phpunit-bridge": "^7.0"
"symfony/phpunit-bridge": "^7.2"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions src/Normalizer/SimpleNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function normalize (mixed $value, array $context = []) : mixed

/**
*/
public function normalizeArray (array $array, array $context) : array
public function normalizeArray (array $array, array $context = []) : array
{
$result = [];
$isList = array_is_list($array);
Expand Down Expand Up @@ -112,7 +112,7 @@ public function normalizeArray (array $array, array $context) : array
* Normalizes a map of values.
* Will JSON-encode to `{}` when empty.
*/
public function normalizeMap (array $array, array $context) : array|\stdClass
public function normalizeMap (array $array, array $context = []) : array|\stdClass
{
// return stdClass if the array is empty here, as it will be automatically normalized to `{}` in JSON.
return $this->normalizeArray($array, $context) ?: new \stdClass();
Expand Down