public function testGetCollection() { $mediaTypes = new MediaTypeCollection(); $mediaTypes->add(new MediaType('gif', 'image', ['image/gif'])); $classifier = new MediaClassifier($mediaTypes, 'image:gif'); $this->assertSame($mediaTypes, $classifier->getCollection()); }
/** * {@inheritdoc} */ public function extract($filename, Specification $targetFormat) { $mediaType = $this->mediaClassifier->classify($filename); if (!$mediaType) { return null; } $extractor = $this->resolver->resolve($filename, $mediaType, $targetFormat); if (!$extractor) { return null; } return $extractor->extract($filename, $targetFormat); }