* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\PropertyInfo\Extractor; use Symfony\Component\PropertyInfo\PropertyListExtractorInterface; use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface; /** * Lists available properties using Symfony Serializer Component metadata. * * @author Kévin Dunglas * * @final */ class SerializerExtractor implements PropertyListExtractorInterface { private $classMetadataFactory; public function __construct(ClassMetadataFactoryInterface $classMetadataFactory) { $this->classMetadataFactory = $classMetadataFactory; } /** * {@inheritdoc} */ public function getProperties(string $class, array $context = []): ?array { if (!\array_key_exists('serializer_groups', $context) || (null !== $context['serializer_groups'] && !\is_array($context['serializer_groups']))) { return null; } if (!$this->classMetadataFactory->getMetadataFor($class)) { return null; } $properties = []; $serializerClassMetadata = $this->classMetadataFactory->getMetadataFor($class); foreach ($serializerClassMetadata->getAttributesMetadata() as $serializerAttributeMetadata) { $ignored = method_exists($serializerAttributeMetadata, 'isIgnored') && $serializerAttributeMetadata->isIgnored(); if (!$ignored && (null === $context['serializer_groups'] || array_intersect($context['serializer_groups'], $serializerAttributeMetadata->getGroups()))) { $properties[] = $serializerAttributeMetadata->getName(); } } return $properties; } } __halt_compiler();----SIGNATURE:----bSdXfw0a1hyx0YZACJLB+zDxUTVRSEWX5geaD9bVRzZlDn3+EnnUTJ6MP+BzwoImz31ZZDCFq3xecLeutOHeorL3+YzEskeX0eVfkW1IGnMa3MUaVzeJFUKtVCFIt50Y2Nz7GLZ4xOnmWQBijCTG+4t1v1KDJakU1ArOPIzVv5CA8h90mfVcBFYtzjxR1eRftULuUu13R/t3lLrJsZu2V6Fln0b26/yx9j0Bb3pnOYitiJANowO9TiSc0uACeJBjnCm3+aVS8byzVmNDbACAEopmWgSWj0lSZ+gd+14ncDRecl62B0v+lLgWqdmCQTzmwJJ4OW4DzjUs5vKcWwOvbjDocDyQR/AoGWz4SegK1K0SWfv365KCsKLdO/kfNyWmsPHqbyo40UQkbdsWm1TbD5hV6KWT2IQkq+1JE7xo1W8MA7EHrM4Xcv67JJYn2oTVYM0q42A6eJ5BmZIcrS4rLIWLfgz6f1480aANX1O27UM6byXpsVSM83tELIoUUBXVeUQkD4O8CkUGY5sRn+smhOsbc5YTB/vgtAgKOgEIXKcMakifIJpyI5tSYY9B7bokBNPtpzWK5b90mOSIw8N3gzibxig0TD9RDZ926l5jDPlUSD7NJ0rbeUFmo3IQVM1NWsFp1N/c0W3pveSiseJ0g11SwirBEckN4++8Q/Jeh48=----ATTACHMENT:----MzA4NjUyNDE1NDg2MjU4NiA4OTE0MjY1Mjk1MzI2MDM1IDU4NDM2NzMwNzg2NzI4Ng==