Skip to content

Commit

Permalink
Merge pull request #2 from silbeckdevs/feature/fix-log-version
Browse files Browse the repository at this point in the history
refactor: Remover `monolog ` das dependências
  • Loading branch information
edson-nascimento authored Nov 14, 2024
2 parents dddb5ae + 599cb66 commit d771a6f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"php": "^8.2",
"ext-curl": "*",
"ext-json": "*",
"psr/log": ">=3.0.2",
"monolog/monolog": ">=3.8"
"psr/log": "*"
},
"require-dev": {
"phpunit/phpunit": "^11.4.3",
Expand All @@ -30,6 +29,9 @@
"Rede\\Tests\\": "tests/"
}
},
"suggest": {
"monolog/monolog": "Allows more advanced logging of the application flow"
},
"scripts": {
"start": "php -S localhost:8879 -t .",
"format:check": "php-cs-fixer fix --dry-run --stop-on-violation",
Expand Down
12 changes: 9 additions & 3 deletions src/Rede/SerializeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ trait SerializeTrait
*/
public function jsonSerialize(): array
{
return array_filter(get_object_vars($this), function ($value) {
return null !== $value;
});
return $this->toArray();
}

/**
* @return array<string,mixed>
*/
public function toArray(): array
{
return array_filter(get_object_vars($this), fn ($value): bool => null !== $value);
}
}

0 comments on commit d771a6f

Please sign in to comment.