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.

KeywordsFieldMapper::getSupportedFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
/**
3
 * Mapper for mapping data between raw input and Keyword VO's
4
 *
5
 * @link        http://github.com/PHPExif/php-exif-native for the canonical source repository
6
 * @title   Title (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\Iptc;
13
14
use Doctrine\Common\Collections\ArrayCollection;
15
use PHPExif\Common\Data\IptcInterface;
16
use PHPExif\Common\Data\ValueObject\Keyword;
17
use PHPExif\Common\Mapper\FieldMapper;
18
use PHPExif\Common\Mapper\GuardInvalidArgumentsForIptcTrait;
19
20
/**
21
 * Mapper
22
 *
23
 * @category    PHPExif
24
 * @package     Native
25
 */
26
class KeywordsFieldMapper implements FieldMapper
27
{
28
    use GuardInvalidArgumentsForIptcTrait;
29
30
    /**
31
     * {@inheritDoc}
32
     */
33
    public function getSupportedFields()
34
    {
35
        return array(
36
            Keyword::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('2#025', $input)) {
48
            return;
49
        }
50
51
        $collection = new ArrayCollection;
52
53
        foreach ($input['2#025'] as $keywordData) {
54
            $collection->add(
55
                new Keyword($keywordData)
56
            );
57
        }
58
59
        $output = $output->withKeywords($collection);
60
    }
61
}
62