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
Push — develop ( a8c5e8...9b3cdc )
by Tom Van
25s
created

guardInvalidArguments()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 5

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
dl 10
loc 10
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 5
nc 3
nop 3
1
<?php
2
/**
3
 * Trait with method to validate arguments of ::mapField
4
 * from Iptc\*Mapper classes
5
 *
6
 * @link        http://github.com/PHPExif/php-exif-common for the canonical source repository
7
 * @copyright   Copyright (c) 2016 Tom Van Herreweghe <[email protected]>
8
 * @license     http://github.com/PHPExif/php-exif-common/blob/master/LICENSE MIT License
9
 * @category    PHPExif
10
 * @package     Common
11
 */
12
13
namespace PHPExif\Common\Mapper;
14
15
use PHPExif\Common\Data\IptcInterface;
16
use PHPExif\Common\Exception\Mapper\UnsupportedFieldException;
17
use PHPExif\Common\Exception\Mapper\UnsupportedOutputException;
18
19
/**
20
 * Common method to check the arguments of an Iptc\* mapper
21
 *
22
 * @category    PHPExif
23
 * @package     Common
24
 */
25 View Code Duplication
trait GuardInvalidArgumentsForIptcTrait
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
26
{
27
    /**
28
     * Guard function for invalid arguments
29
     *
30
     * @codeCoverageIgnore
31
     *
32
     * @param string $field
33
     * @param array $input
34
     * @param object $output
35
     *
36
     * @throws UnsupportedFieldException when asked to map an unsupported field
37
     * @throws UnsupportedOutputException when asked to map data on an unsupported output object
38
     *
39
     * @return void
40
     */
41
    private function guardInvalidArguments($field, array $input, $output)
0 ignored issues
show
Unused Code introduced by
This method is not used, and could be removed.
Loading history...
Unused Code introduced by
The parameter $input is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
42
    {
43
        if (!in_array($field, $this->getSupportedFields())) {
44
            throw UnsupportedFieldException::forField($field);
45
        }
46
47
        if (!($output instanceof IptcInterface)) {
48
            throw UnsupportedOutputException::forOutput($output);
49
        }
50
    }
51
52
    /**
53
     * {@inheritDoc}
54
     */
55
    abstract public function getSupportedFields();
56
}
57