diff --git a/config/serializer.php b/config/serializer.php index 44512213..37e554f0 100644 --- a/config/serializer.php +++ b/config/serializer.php @@ -2,13 +2,19 @@ declare(strict_types=1); +use Symfony\Component\Serializer\Mapping\Loader\LoaderInterface; +use WayOfDev\Serializer\Contracts\EncoderRegistrationStrategy; +use WayOfDev\Serializer\Contracts\NormalizerRegistrationStrategy; +use WayOfDev\Serializer\DefaultEncoderRegistrationStrategy; +use WayOfDev\Serializer\DefaultNormalizerRegistrationStrategy; + /** * @return array{ * default: string, * debug: bool, - * normalizerRegistrationStrategy: class-string, - * encoderRegistrationStrategy: class-string, - * metadataLoader: class-string|null, + * normalizerRegistrationStrategy: class-string, + * encoderRegistrationStrategy: class-string, + * metadataLoader: class-string|null, * } */ return [ @@ -38,7 +44,7 @@ * Allows you to specify the strategy class for registering your normalizers. * Default is 'WayOfDev\Serializer\DefaultNormalizerRegistrationStrategy'. */ - 'normalizerRegistrationStrategy' => WayOfDev\Serializer\DefaultNormalizerRegistrationStrategy::class, + 'normalizerRegistrationStrategy' => DefaultNormalizerRegistrationStrategy::class, /* * Allows you to register your custom encoders. @@ -53,7 +59,7 @@ * You can replace the default encoders with your custom ones by implementing * your own registration strategy. */ - 'encoderRegistrationStrategy' => WayOfDev\Serializer\DefaultEncoderRegistrationStrategy::class, + 'encoderRegistrationStrategy' => DefaultEncoderRegistrationStrategy::class, /* * Allows you to register your custom metadata loader. diff --git a/src/Bridge/Laravel/Facades/Serializer.php b/src/Bridge/Laravel/Facades/Serializer.php index da11941e..b97f7c9c 100644 --- a/src/Bridge/Laravel/Facades/Serializer.php +++ b/src/Bridge/Laravel/Facades/Serializer.php @@ -4,8 +4,26 @@ namespace WayOfDev\Serializer\Bridge\Laravel\Facades; +use ArrayObject; use Illuminate\Support\Facades\Facade; +use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; +use Symfony\Component\Serializer\Normalizer\NormalizerInterface; +/** + * @method static string serialize(mixed $data, string $format, array $context = []) + * @method static mixed deserialize(string $data, string $type, string $format, array $context = []) + * @method static array|string|int|float|bool|ArrayObject|null normalize(mixed $data, string $format, array $context = []) + * @method static mixed denormalize(mixed $data, string $type, ?string $format = null, array $context = []) + * @method static array getSupportedTypes(?string $format) + * @method static bool supportsNormalization(mixed $data, ?string $format = null, array $context = []) + * @method static bool supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []) + * @method static NormalizerInterface|null getNormalizer(mixed $data, ?string $format, array $context) + * @method static DenormalizerInterface|null getDenormalizer(mixed $data, string $type, ?string $format, array $context) + * @method static string encode(mixed $data, string $format, array $context = []) + * @method static mixed decode(string $data, string $type, string $format, array $context = []) + * @method static bool supportsEncoding(string $format, array $context = []) + * @method static bool supportsDecoding(string $format, array $context = []) + */ class Serializer extends Facade { protected static function getFacadeAccessor(): string