abstract class AbstractMetadataReader implements MetadataReaderInterface

Base class for the default metadata readers.

Methods

readFile(string|LoaderInterface $file)

Reads metadata from a file.

readData(string $data, resource $originalResource = null)

Reads metadata from a binary string.

readStream(resource $resource)

Reads metadata from a stream.

array
extractFromFile(string|LoaderInterface $file)

Extracts metadata from a file.

array
extractFromData($data)

Extracts metadata from raw data.

array
extractFromStream($resource)

Extracts metadata from a stream.

Details

at line 28
MetadataBag readFile(string|LoaderInterface $file)

Reads metadata from a file.

Parameters

string|LoaderInterface $file the path to the file where to read metadata

Return Value

MetadataBag

Exceptions

InvalidArgumentException in case the file does not exist

See also

MetadataReaderInterface::readFile

at line 40
MetadataBag readData(string $data, resource $originalResource = null)

Reads metadata from a binary string.

Parameters

string $data the binary string to read
resource $originalResource an optional resource to gather stream metadata

Return Value

MetadataBag

See also

MetadataReaderInterface::readData

at line 54
MetadataBag readStream(resource $resource)

Reads metadata from a stream.

Parameters

resource $resource the stream to read

Return Value

MetadataBag

Exceptions

InvalidArgumentException in case the resource is not valid

See also

MetadataReaderInterface::readStream

at line 98
abstract protected array extractFromFile(string|LoaderInterface $file)

Extracts metadata from a file.

Parameters

string|LoaderInterface $file

Return Value

array An associative array of metadata

at line 107
abstract protected array extractFromData($data)

Extracts metadata from raw data.

Parameters

$data

Return Value

array An associative array of metadata

at line 116
abstract protected array extractFromStream($resource)

Extracts metadata from a stream.

Parameters

$resource

Return Value

array An associative array of metadata