Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add static types to Manager Facade #204

Merged
merged 1 commit into from
Jun 19, 2024
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
6 changes: 3 additions & 3 deletions config/serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

declare(strict_types=1);

use Symfony\Component\Serializer\Mapping\Loader\LoaderInterface;

/**
* @return array{
* default: string,
* debug: bool,
* normalizerRegistrationStrategy: class-string<WayOfDev\Serializer\Contracts\NormalizerRegistrationStrategy>,
* encoderRegistrationStrategy: class-string<WayOfDev\Serializer\Contracts\EncoderRegistrationStrategy>,
* metadataLoader: class-string<LoaderInterface>|null,
* metadataLoader: class-string<Symfony\Component\Serializer\Mapping\Loader\LoaderInterface>|null,
* }
*/
return [
Expand Down Expand Up @@ -59,6 +57,8 @@

/*
* Allows you to register your custom metadata loader.
*
* By default Symfony\Component\Serializer\Mapping\Loader\AttributeLoader is used.
*/
'metadataLoader' => null,
];
10 changes: 10 additions & 0 deletions src/Bridge/Laravel/Facades/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
namespace WayOfDev\Serializer\Bridge\Laravel\Facades;

use Illuminate\Support\Facades\Facade;
use Stringable;
use WayOfDev\Serializer\Contracts\SerializerInterface;

/**
* @method static string format()
* @method static SerializerInterface serializer(?string $format = null)
* @method static string serialize(mixed $payload, ?string $format = null, ?array $context = [])
* @method static mixed deserialize(string|Stringable $payload, string|object|null $type = null, ?string $format = null, ?array $context = [])
*
* @see \WayOfDev\Serializer\Manager\SerializerManager
*/
class Manager extends Facade
{
protected static function getFacadeAccessor(): string
Expand Down
Loading