1<?php
2
3declare(strict_types=1);
4
5namespace JMS\Serializer\Metadata\Driver;
6
7use JMS\Serializer\Metadata\ClassMetadata;
8use Metadata\ClassMetadata as BaseClassMetadata;
9use Metadata\Driver\DriverInterface;
10
11class NullDriver implements DriverInterface
12{
13    public function loadMetadataForClass(\ReflectionClass $class): ?BaseClassMetadata
14    {
15        $classMetadata = new ClassMetadata($name = $class->name);
16        $fileResource =  $class->getFilename();
17        if (false !== $fileResource) {
18            $classMetadata->fileResources[] = $fileResource;
19        }
20
21        return $classMetadata;
22    }
23}
24