| @@ 24-53 (lines=30) @@ | ||
| 21 | * @category PHPExif |
|
| 22 | * @package Native |
|
| 23 | */ |
|
| 24 | class ExposureTimeFieldMapper implements FieldMapper |
|
| 25 | { |
|
| 26 | use GuardInvalidArgumentsTrait; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * {@inheritDoc} |
|
| 30 | */ |
|
| 31 | public function getSupportedFields() |
|
| 32 | { |
|
| 33 | return array( |
|
| 34 | ExposureTime::class, |
|
| 35 | ); |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * {@inheritDoc} |
|
| 40 | */ |
|
| 41 | public function mapField($field, array $input, &$output) |
|
| 42 | { |
|
| 43 | $this->guardInvalidArguments($field, $input, $output); |
|
| 44 | ||
| 45 | if (!array_key_exists('ExposureTime', $input)) { |
|
| 46 | return; |
|
| 47 | } |
|
| 48 | ||
| 49 | $iso = new ExposureTime($input['ExposureTime']); |
|
| 50 | ||
| 51 | $output = $output->withExposureTime($iso); |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| @@ 24-53 (lines=30) @@ | ||
| 21 | * @category PHPExif |
|
| 22 | * @package Native |
|
| 23 | */ |
|
| 24 | class FilenameFieldMapper implements FieldMapper |
|
| 25 | { |
|
| 26 | use GuardInvalidArgumentsTrait; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * {@inheritDoc} |
|
| 30 | */ |
|
| 31 | public function getSupportedFields() |
|
| 32 | { |
|
| 33 | return array( |
|
| 34 | Filename::class, |
|
| 35 | ); |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * {@inheritDoc} |
|
| 40 | */ |
|
| 41 | public function mapField($field, array $input, &$output) |
|
| 42 | { |
|
| 43 | $this->guardInvalidArguments($field, $input, $output); |
|
| 44 | ||
| 45 | if (!array_key_exists('FileName', $input)) { |
|
| 46 | return; |
|
| 47 | } |
|
| 48 | ||
| 49 | $filename = new Filename($input['FileName']); |
|
| 50 | ||
| 51 | $output = $output->withFilename($filename); |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| @@ 24-53 (lines=30) @@ | ||
| 21 | * @category PHPExif |
|
| 22 | * @package Native |
|
| 23 | */ |
|
| 24 | class FilesizeFieldMapper implements FieldMapper |
|
| 25 | { |
|
| 26 | use GuardInvalidArgumentsTrait; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * {@inheritDoc} |
|
| 30 | */ |
|
| 31 | public function getSupportedFields() |
|
| 32 | { |
|
| 33 | return array( |
|
| 34 | Filesize::class, |
|
| 35 | ); |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * {@inheritDoc} |
|
| 40 | */ |
|
| 41 | public function mapField($field, array $input, &$output) |
|
| 42 | { |
|
| 43 | $this->guardInvalidArguments($field, $input, $output); |
|
| 44 | ||
| 45 | if (!array_key_exists('FileSize', $input)) { |
|
| 46 | return; |
|
| 47 | } |
|
| 48 | ||
| 49 | $filesize = new Filesize($input['FileSize']); |
|
| 50 | ||
| 51 | $output = $output->withFilesize($filesize); |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| @@ 24-53 (lines=30) @@ | ||
| 21 | * @category PHPExif |
|
| 22 | * @package Native |
|
| 23 | */ |
|
| 24 | class IsoFieldMapper implements FieldMapper |
|
| 25 | { |
|
| 26 | use GuardInvalidArgumentsTrait; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * {@inheritDoc} |
|
| 30 | */ |
|
| 31 | public function getSupportedFields() |
|
| 32 | { |
|
| 33 | return array( |
|
| 34 | IsoSpeed::class, |
|
| 35 | ); |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * {@inheritDoc} |
|
| 40 | */ |
|
| 41 | public function mapField($field, array $input, &$output) |
|
| 42 | { |
|
| 43 | $this->guardInvalidArguments($field, $input, $output); |
|
| 44 | ||
| 45 | if (!array_key_exists('ISOSpeedRatings', $input)) { |
|
| 46 | return; |
|
| 47 | } |
|
| 48 | ||
| 49 | $iso = new IsoSpeed((int) $input['ISOSpeedRatings']); |
|
| 50 | ||
| 51 | $output = $output->withIsoSpeed($iso); |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| @@ 24-53 (lines=30) @@ | ||
| 21 | * @category PHPExif |
|
| 22 | * @package Native |
|
| 23 | */ |
|
| 24 | class MakeFieldMapper implements FieldMapper |
|
| 25 | { |
|
| 26 | use GuardInvalidArgumentsTrait; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * {@inheritDoc} |
|
| 30 | */ |
|
| 31 | public function getSupportedFields() |
|
| 32 | { |
|
| 33 | return array( |
|
| 34 | Make::class, |
|
| 35 | ); |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * {@inheritDoc} |
|
| 40 | */ |
|
| 41 | public function mapField($field, array $input, &$output) |
|
| 42 | { |
|
| 43 | $this->guardInvalidArguments($field, $input, $output); |
|
| 44 | ||
| 45 | if (!array_key_exists('Make', $input)) { |
|
| 46 | return; |
|
| 47 | } |
|
| 48 | ||
| 49 | $make = new Make($input['Make']); |
|
| 50 | ||
| 51 | $output = $output->withMake($make); |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| @@ 24-53 (lines=30) @@ | ||
| 21 | * @category PHPExif |
|
| 22 | * @package Native |
|
| 23 | */ |
|
| 24 | class MimeTypeFieldMapper implements FieldMapper |
|
| 25 | { |
|
| 26 | use GuardInvalidArgumentsTrait; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * {@inheritDoc} |
|
| 30 | */ |
|
| 31 | public function getSupportedFields() |
|
| 32 | { |
|
| 33 | return array( |
|
| 34 | MimeType::class, |
|
| 35 | ); |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * {@inheritDoc} |
|
| 40 | */ |
|
| 41 | public function mapField($field, array $input, &$output) |
|
| 42 | { |
|
| 43 | $this->guardInvalidArguments($field, $input, $output); |
|
| 44 | ||
| 45 | if (!array_key_exists('MimeType', $input)) { |
|
| 46 | return; |
|
| 47 | } |
|
| 48 | ||
| 49 | $mimeType = new MimeType($input['MimeType']); |
|
| 50 | ||
| 51 | $output = $output->withMimeType($mimeType); |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| @@ 24-53 (lines=30) @@ | ||
| 21 | * @category PHPExif |
|
| 22 | * @package Native |
|
| 23 | */ |
|
| 24 | class ModelFieldMapper implements FieldMapper |
|
| 25 | { |
|
| 26 | use GuardInvalidArgumentsTrait; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * {@inheritDoc} |
|
| 30 | */ |
|
| 31 | public function getSupportedFields() |
|
| 32 | { |
|
| 33 | return array( |
|
| 34 | Model::class, |
|
| 35 | ); |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * {@inheritDoc} |
|
| 40 | */ |
|
| 41 | public function mapField($field, array $input, &$output) |
|
| 42 | { |
|
| 43 | $this->guardInvalidArguments($field, $input, $output); |
|
| 44 | ||
| 45 | if (!array_key_exists('Model', $input)) { |
|
| 46 | return; |
|
| 47 | } |
|
| 48 | ||
| 49 | $model = new Model($input['Model']); |
|
| 50 | ||
| 51 | $output = $output->withModel($model); |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| @@ 24-53 (lines=30) @@ | ||
| 21 | * @category PHPExif |
|
| 22 | * @package Native |
|
| 23 | */ |
|
| 24 | class SoftwareFieldMapper implements FieldMapper |
|
| 25 | { |
|
| 26 | use GuardInvalidArgumentsTrait; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * {@inheritDoc} |
|
| 30 | */ |
|
| 31 | public function getSupportedFields() |
|
| 32 | { |
|
| 33 | return array( |
|
| 34 | Software::class, |
|
| 35 | ); |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * {@inheritDoc} |
|
| 40 | */ |
|
| 41 | public function mapField($field, array $input, &$output) |
|
| 42 | { |
|
| 43 | $this->guardInvalidArguments($field, $input, $output); |
|
| 44 | ||
| 45 | if (!array_key_exists('Software', $input)) { |
|
| 46 | return; |
|
| 47 | } |
|
| 48 | ||
| 49 | $software = new Software($input['Software']); |
|
| 50 | ||
| 51 | $output = $output->withSoftware($software); |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| @@ 24-53 (lines=30) @@ | ||
| 21 | * @category PHPExif |
|
| 22 | * @package Native |
|
| 23 | */ |
|
| 24 | class CaptionFieldMapper implements FieldMapper |
|
| 25 | { |
|
| 26 | use GuardInvalidArgumentsTrait; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * {@inheritDoc} |
|
| 30 | */ |
|
| 31 | public function getSupportedFields() |
|
| 32 | { |
|
| 33 | return array( |
|
| 34 | Caption::class, |
|
| 35 | ); |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * {@inheritDoc} |
|
| 40 | */ |
|
| 41 | public function mapField($field, array $input, &$output) |
|
| 42 | { |
|
| 43 | $this->guardInvalidArguments($field, $input, $output); |
|
| 44 | ||
| 45 | if (!array_key_exists('2#120', $input)) { |
|
| 46 | return; |
|
| 47 | } |
|
| 48 | ||
| 49 | $caption = new Caption($input['2#120']); |
|
| 50 | ||
| 51 | $output = $output->withCaption($caption); |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| @@ 24-53 (lines=30) @@ | ||
| 21 | * @category PHPExif |
|
| 22 | * @package Native |
|
| 23 | */ |
|
| 24 | class CopyrightFieldMapper implements FieldMapper |
|
| 25 | { |
|
| 26 | use GuardInvalidArgumentsTrait; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * {@inheritDoc} |
|
| 30 | */ |
|
| 31 | public function getSupportedFields() |
|
| 32 | { |
|
| 33 | return array( |
|
| 34 | Copyright::class, |
|
| 35 | ); |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * {@inheritDoc} |
|
| 40 | */ |
|
| 41 | public function mapField($field, array $input, &$output) |
|
| 42 | { |
|
| 43 | $this->guardInvalidArguments($field, $input, $output); |
|
| 44 | ||
| 45 | if (!array_key_exists('2#116', $input)) { |
|
| 46 | return; |
|
| 47 | } |
|
| 48 | ||
| 49 | $copyright = new Copyright($input['2#116']); |
|
| 50 | ||
| 51 | $output = $output->withCopyright($copyright); |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| @@ 24-53 (lines=30) @@ | ||
| 21 | * @category PHPExif |
|
| 22 | * @package Native |
|
| 23 | */ |
|
| 24 | class CreditFieldMapper implements FieldMapper |
|
| 25 | { |
|
| 26 | use GuardInvalidArgumentsTrait; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * {@inheritDoc} |
|
| 30 | */ |
|
| 31 | public function getSupportedFields() |
|
| 32 | { |
|
| 33 | return array( |
|
| 34 | Credit::class, |
|
| 35 | ); |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * {@inheritDoc} |
|
| 40 | */ |
|
| 41 | public function mapField($field, array $input, &$output) |
|
| 42 | { |
|
| 43 | $this->guardInvalidArguments($field, $input, $output); |
|
| 44 | ||
| 45 | if (!array_key_exists('2#110', $input)) { |
|
| 46 | return; |
|
| 47 | } |
|
| 48 | ||
| 49 | $credit = new Credit($input['2#110']); |
|
| 50 | ||
| 51 | $output = $output->withCredit($credit); |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||
| @@ 24-53 (lines=30) @@ | ||
| 21 | * @category PHPExif |
|
| 22 | * @package Native |
|
| 23 | */ |
|
| 24 | class HeadlineFieldMapper implements FieldMapper |
|
| 25 | { |
|
| 26 | use GuardInvalidArgumentsTrait; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * {@inheritDoc} |
|
| 30 | */ |
|
| 31 | public function getSupportedFields() |
|
| 32 | { |
|
| 33 | return array( |
|
| 34 | Headline::class, |
|
| 35 | ); |
|
| 36 | } |
|
| 37 | ||
| 38 | /** |
|
| 39 | * {@inheritDoc} |
|
| 40 | */ |
|
| 41 | public function mapField($field, array $input, &$output) |
|
| 42 | { |
|
| 43 | $this->guardInvalidArguments($field, $input, $output); |
|
| 44 | ||
| 45 | if (!array_key_exists('2#105', $input)) { |
|
| 46 | return; |
|
| 47 | } |
|
| 48 | ||
| 49 | $headline = new Headline($input['2#105']); |
|
| 50 | ||
| 51 | $output = $output->withHeadline($headline); |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||