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 — master ( 84c999...d04245 )
by Scott van
06:21
created

ConfigMapLocator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 31
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 2
A getConfig() 0 4 1
1
<?php
2
/**
3
 * Copyright (c) 2013-2014 eBay Enterprise, Inc.
4
 *
5
 * NOTICE OF LICENSE
6
 *
7
 * This source file is subject to the Open Software License (OSL 3.0)
8
 * that is bundled with this package in the file LICENSE.md.
9
 * It is also available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * @copyright   Copyright (c) 2013-2014 eBay Enterprise, Inc. (http://www.ebayenterprise.com/)
13
 * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
14
 */
15
16
namespace eBayEnterprise\RetailOrderManagement\Payload;
17
18
/**
19
 * Payload locator using a default mapping found in PayloadConfigMap.php.
20
 */
21
class ConfigMapLocator extends AbstractConfigLocator
22
{
23
    /**
24
     * Array of configuration data used to describe how to construct various
25
     * types of payloads. Stored as a static property so each instance doesn't
26
     * need it's own copy of the configuration, which has grown quite large.
27
     *
28
     * @var array
29
     */
30
    protected static $config;
31
32
    /**
33
     * @param array $config Payload locator configuration
0 ignored issues
show
Bug introduced by
There is no parameter named $config. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
34
     */
35
    public function __construct()
36
    {
37
        if (!self::$config) {
0 ignored issues
show
Bug Best Practice introduced by
The expression self::$config of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
38
            self::$config = require 'PayloadConfigMap.php';
39
        }
40
    }
41
42
    /**
43
     * Get the blob of payload config data.
44
     *
45
     * @return array
46
     */
47
    protected function getConfig()
48
    {
49
        return self::$config;
50
    }
51
}
52