lib/3rdParty/composer/symfony/serializer/Mapping/Factory/ClassMetadataFactoryInterface.php
raw symbols SCIP| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of the Symfony package. |
| 5 | * |
| 6 | * (c) Fabien Potencier <[email protected]> |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | */ |
| 11 | |
| 12 | namespace Symfony\Component\Serializer\Mapping\Factory; |
| 13 | |
| 14 | use Symfony\Component\Serializer\Exception\InvalidArgumentException; |
| 15 | use Symfony\Component\Serializer\Mapping\ClassMetadataInterface; |
| 16 | |
| 17 | /** |
| 18 | * Returns a {@see ClassMetadataInterface}. |
| 19 | * |
| 20 | * @author Kévin Dunglas <[email protected]> |
| 21 | */ |
| 22 | interface ClassMetadataFactoryInterface |
| 23 | { |
| 24 | /** |
| 25 | * If the method was called with the same class name (or an object of that |
| 26 | * class) before, the same metadata instance is returned. |
| 27 | * |
| 28 | * If the factory was configured with a cache, this method will first look |
| 29 | * for an existing metadata instance in the cache. If an existing instance |
| 30 | * is found, it will be returned without further ado. |
| 31 | * |
| 32 | * Otherwise, a new metadata instance is created. If the factory was |
| 33 | * configured with a loader, the metadata is passed to the |
| 34 | * {@link \Symfony\Component\Serializer\Mapping\Loader\LoaderInterface::loadClassMetadata()} method for further |
| 35 | * configuration. At last, the new object is returned. |
| 36 | * |
| 37 | * @throws InvalidArgumentException |
| 38 | */ |
| 39 | public function getMetadataFor(string|object $value): ClassMetadataInterface; |
| 40 | |
| 41 | /** |
| 42 | * Checks if class has metadata. |
| 43 | */ |
| 44 | public function hasMetadataFor(mixed $value): bool; |
| 45 | } |