GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — develop (#4)
by Tom Van
09:15
created

ApertureFieldMapper   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 33
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getSupportedFields() 0 6 1
A mapField() 0 15 3
1
<?php
2
/**
3
 * Mapper for mapping data between raw input and an Aperture VO
4
 *
5
 * @link        http://github.com/PHPExif/php-exif-native for the canonical source repository
6
 * @copyright   Copyright (c) 2016 Tom Van Herreweghe <[email protected]>
7
 * @license     http://github.com/PHPExif/php-exif-native/blob/master/LICENSE MIT License
8
 * @category    PHPExif
9
 * @package     Native
10
 */
11
12
namespace PHPExif\Adapter\Native\Reader\Mapper\Exif;
13
14
use PHPExif\Common\Data\ExifInterface;
15
use PHPExif\Common\Data\ValueObject\Exif\Aperture;
16
use PHPExif\Common\Mapper\FieldMapper;
17
18
/**
19
 * Mapper
20
 *
21
 * @category    PHPExif
22
 * @package     Native
23
 */
24
class ApertureFieldMapper implements FieldMapper
25
{
26
    use GuardInvalidArgumentsTrait;
27
28
    /**
29
     * {@inheritDoc}
30
     */
31
    public function getSupportedFields()
32
    {
33
        return array(
34
            Aperture::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('COMPUTED', $input)
46
            || !array_key_exists('ApertureFNumber', $input['COMPUTED'])) {
47
            return;
48
        }
49
50
        $aperture = Aperture::fromFocalLength(
51
            $input['COMPUTED']['ApertureFNumber']
52
        );
53
54
        $output = $output->withAperture($aperture);
55
    }
56
}
57