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 — master (#104)
by
unknown
03:25
created

FetchEntity::__construct()   B

Complexity

Conditions 5
Paths 4

Size

Total Lines 14
Code Lines 9

Duplication

Lines 14
Ratio 100 %

Code Coverage

Tests 7
CRAP Score 5.0488

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 14
loc 14
ccs 7
cts 8
cp 0.875
rs 8.8571
cc 5
eloc 9
nc 4
nop 1
crap 5.0488
1
<?php
2
/**
3
 * @package: chapi
4
 *
5
 * @author:  sbrueggen
6
 * @since:   2018-03-29
7
 */
8
9
namespace Chapi\Entity\Chronos\JobEntity;
10
11
class FetchEntity
12
{
13
    /**
14
     * @param array|object $jobData
15
     * @throws \InvalidArgumentException
16
     */
17 2 View Code Duplication
    public function __construct($jobData = [])
18
    {
19 2
        if (is_array($jobData) || is_object($jobData)) {
20 2
            foreach ($jobData as $key => $value) {
21 2
                if (property_exists($this, $key)) {
22 2
                    $this->{$key} = $value;
23
                } else {
24 2
                    $this->unknownFields[$key] = $value;
25
                }
26
            }
27
        } else {
28
            throw new \InvalidArgumentException(sprintf('Argument 1 passed to "%s" must be an array or object', __METHOD__));
29
        }
30 2
    }
31
32
    public $unknownFields = [];
33
    
34
    /** @var string  */
35
    public $uri = "";
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
36
    
37
    /** @var string  */
38
    public $destPath = '';
39
    
40
    /** @var bool */
41
    public $extract = false;
42
    
43
    /** @var bool  */
44
    public $cache = false;
45
    
46
    /** @var bool  */
47
    public $executable = false;
48
}
49