diff --git a/extension.neon b/extension.neon index 9b0c264c..272f1343 100644 --- a/extension.neon +++ b/extension.neon @@ -7,6 +7,13 @@ parameters: - stubs/ChoiceLoaderInterface.stub - stubs/Constraint.stub - stubs/ContainerBuilder.stub + - stubs/ContextAwareDecoderInterface.stub + - stubs/ContextAwareDenormalizerInterface.stub + - stubs/ContextAwareNormalizerInterface.stub + - stubs/DecoderInterface.stub + - stubs/DenormalizableInterface.stub + - stubs/DenormalizerInterface.stub + - stubs/EncoderInterface.stub - stubs/EventSubscriberInterface.stub - stubs/ExtensionInterface.stub - stubs/FormBuilderInterface.stub @@ -15,6 +22,8 @@ parameters: - stubs/FormTypeInterface.stub - stubs/FormView.stub - stubs/HeaderBag.stub + - stubs/NormalizableInterface.stub + - stubs/NormalizerInterface.stub - stubs/Process.stub - stubs/Session.stub diff --git a/stubs/ContextAwareDecoderInterface.stub b/stubs/ContextAwareDecoderInterface.stub new file mode 100644 index 00000000..39e12d2f --- /dev/null +++ b/stubs/ContextAwareDecoderInterface.stub @@ -0,0 +1,13 @@ + $context + * @return bool + */ + public function supportsDecoding($format, array $context = []); +} diff --git a/stubs/ContextAwareDenormalizerInterface.stub b/stubs/ContextAwareDenormalizerInterface.stub new file mode 100644 index 00000000..4c3bdbc8 --- /dev/null +++ b/stubs/ContextAwareDenormalizerInterface.stub @@ -0,0 +1,14 @@ + $context + * @return bool + */ + public function supportsDenormalization($data, $type, $format = null, array $context = []); +} diff --git a/stubs/ContextAwareNormalizerInterface.stub b/stubs/ContextAwareNormalizerInterface.stub new file mode 100644 index 00000000..282354a8 --- /dev/null +++ b/stubs/ContextAwareNormalizerInterface.stub @@ -0,0 +1,14 @@ + $context + * @return bool + */ + public function supportsNormalization($data, $format = null, array $context = []); +} diff --git a/stubs/DecoderInterface.stub b/stubs/DecoderInterface.stub new file mode 100644 index 00000000..715dadc4 --- /dev/null +++ b/stubs/DecoderInterface.stub @@ -0,0 +1,22 @@ + $context + * @return mixed + */ + public function decode($data, $format, array $context = []); + + /** + * @param string $format Format name + * @return bool + */ + public function supportsDecoding($format); +} diff --git a/stubs/DenormalizableInterface.stub b/stubs/DenormalizableInterface.stub new file mode 100644 index 00000000..17d6b118 --- /dev/null +++ b/stubs/DenormalizableInterface.stub @@ -0,0 +1,16 @@ +|string|int|float|bool $data + * @param string|null $format + * @param array $context + * + * @return object|object[] + */ + public function denormalize($denormalizer, $data, $format = null, array $context = []); +} diff --git a/stubs/DenormalizerInterface.stub b/stubs/DenormalizerInterface.stub new file mode 100644 index 00000000..86ca8bec --- /dev/null +++ b/stubs/DenormalizerInterface.stub @@ -0,0 +1,23 @@ + $context + * @return object|array + */ + public function denormalize($data, $type, $format = null, array $context = []); + + /** + * @param mixed $data + * @param string $type + * @param string $format + * @return bool + */ + public function supportsDenormalization($data, $type, $format = null); +} diff --git a/stubs/EncoderInterface.stub b/stubs/EncoderInterface.stub new file mode 100644 index 00000000..a3092757 --- /dev/null +++ b/stubs/EncoderInterface.stub @@ -0,0 +1,20 @@ + $context + * @return string|int|float|bool + */ + public function encode($data, $format, array $context = []); + + /** + * @param string $format Format name + * @return bool + */ + public function supportsEncoding($format); +} diff --git a/stubs/NormalizableInterface.stub b/stubs/NormalizableInterface.stub new file mode 100644 index 00000000..c7958c55 --- /dev/null +++ b/stubs/NormalizableInterface.stub @@ -0,0 +1,14 @@ + $context + * @return array|string|int|float|bool + */ + public function normalize(NormalizerInterface $normalizer, $format = null, array $context = []); +} diff --git a/stubs/NormalizerInterface.stub b/stubs/NormalizerInterface.stub new file mode 100644 index 00000000..907e296e --- /dev/null +++ b/stubs/NormalizerInterface.stub @@ -0,0 +1,14 @@ + $context + * @return array|string|int|float|bool|null + */ + public function normalize($object, $format = null, array $context = []); +}