X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fsymfony%2Fserializer%2FTests%2FFixtures%2FStaticConstructorNormalizer.php;fp=vendor%2Fsymfony%2Fserializer%2FTests%2FFixtures%2FStaticConstructorNormalizer.php;h=67304831f892287fc9ffa30ac7b6a52e3234ff85;hp=0000000000000000000000000000000000000000;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/vendor/symfony/serializer/Tests/Fixtures/StaticConstructorNormalizer.php b/vendor/symfony/serializer/Tests/Fixtures/StaticConstructorNormalizer.php new file mode 100644 index 000000000..67304831f --- /dev/null +++ b/vendor/symfony/serializer/Tests/Fixtures/StaticConstructorNormalizer.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Serializer\Tests\Fixtures; + +use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; + +/** + * @author Guilhem N. + */ +class StaticConstructorNormalizer extends ObjectNormalizer +{ + /** + * {@inheritdoc} + */ + protected function getConstructor(array &$data, $class, array &$context, \ReflectionClass $reflectionClass, $allowedAttributes) + { + if (is_a($class, StaticConstructorDummy::class, true)) { + return new \ReflectionMethod($class, 'create'); + } + + return parent::getConstructor($data, $class, $context, $reflectionClass, $allowedAttributes); + } +}