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.

ResolutionFieldMapper::mapField()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 15
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 8
nc 2
nop 3
1
<?php
2
/**
3
 * Mapper for mapping data between raw input and a HorizontalResolution 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\LineResolution;
16
use PHPExif\Common\Data\ValueObject\Resolution;
17
use PHPExif\Common\Mapper\FieldMapper;
18
use PHPExif\Common\Mapper\GuardInvalidArgumentsForExifTrait;
19
20
/**
21
 * Mapper
22
 *
23
 * @category    PHPExif
24
 * @package     Native
25
 */
26
class ResolutionFieldMapper implements FieldMapper
27
{
28
    use GuardInvalidArgumentsForExifTrait;
29
30
    /**
31
     * {@inheritDoc}
32
     */
33
    public function getSupportedFields()
34
    {
35
        return array(
36
            Resolution::class,
37
        );
38
    }
39
40
    /**
41
     * {@inheritDoc}
42
     */
43
    public function mapField($field, array $input, &$output)
44
    {
45
        $this->guardInvalidArguments($field, $input, $output);
46
47
        if (!(array_key_exists('xresolution', $input) && array_key_exists('yresolution', $input))) {
48
            return;
49
        }
50
51
        $resolution = new Resolution(
52
            LineResolution::dpi($input['xresolution']), // horizontal
53
            LineResolution::dpi($input['yresolution']) // vertical
54
        );
55
56
        $output = $output->withResolution($resolution);
57
    }
58
}
59