public function transform(SplFileInfo $file)
    {
        $data = $this->parser->parse($file->getContents());
        $missingFields = $this->getMissingFields($data);

        if (false === empty($missingFields)) {
            throw new TransformationFailure(sprintf(
                'Missing required fields (%s) in taxonomy file: %s',
                implode(', ', $this->getMissingFields($data)),
                $file->getRealPath()
            ));
        }

        $filename = $file->getFilename();
        $ext = $file->getExtension();
        $slug = explode('.'.$ext, $filename)[0];

        return new TaxonomyFile(
            $slug,
            $data['name'],
            $data['plural_name'],
            $data['terms']
        );
    }