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 (#68)
by Bidesh
03:32
created

MarathonEntityUtils   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 7
c 2
b 0
f 0
lcom 0
cbo 0
dl 0
loc 30
ccs 15
cts 15
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setPropertyIfExist() 0 8 3
A setAllPossibleProperties() 0 13 4
1
<?php
2
/**
3
 * @package: chapi
4
 *
5
 * @author: bthapaliya
6
 * @since: 2016-10-16
7
 *
8
 */
9
namespace Chapi\Entity\Marathon;
10
11
12
class MarathonEntityUtils
13
{
14 27
    public static function setPropertyIfExist($oSource, $oTarget, $sProperty)
15
    {
16 27
        if (isset($oSource[$sProperty]) &&
17 23
            property_exists($oTarget, $sProperty))
18 27
        {
19 23
            $oTarget->{$sProperty} = $oSource[$sProperty];
20 23
        }
21 27
    }
22
23
    /**
24
     * Sets all possible properties in the class from oData.
25
     * If the type is array or object, then it is ignored.
26
     * @param $oData
27
     */
28 36
    public static function setAllPossibleProperties($oData, $oTarget)
29
    {
30 36
        foreach($oData as $attrName => $attrValue)
31
        {
32
            // dont set array or objects.
33
            // Because this would need further type information to properly set.
34 27
            if (is_array($attrValue) || is_object($attrValue))
35 27
            {
36 21
                continue;
37
            }
38 17
            self::setPropertyIfExist($oData, $oTarget, $attrName);
39 36
        }
40
    }
41
}