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 ( 719445...c6607f )
by Bruno
03:00
created

VisitedAssociationLogger::getVisitedAssociations()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Onurb\Doctrine\ORMMetadataGrapher\YumlMetadataGrapher\StringGenerator;
4
5
class VisitedAssociationLogger implements VisitedAssociationLoggerInterface
6
{
7
    /**
8
     * Temporary array where already visited collections are stored
9
     *
10
     * @var array
11
     */
12
    protected $visitedAssociations = array();
13
14
    /**
15
     * @return array
16
     */
17 2
    public function getVisitedAssociations()
18
    {
19 2
        return $this->visitedAssociations;
20
    }
21
22
    /**
23
     * Visit a given association and mark it as visited
24
     *
25
     * @param string      $className
26
     * @param string|null $association
27
     *
28
     * @return bool true if the association was visited before
29
     */
30 5
    public function visitAssociation($className, $association = null)
31
    {
32 5
        if (null === $association) {
33 5
            if (isset($this->visitedAssociations[$className])) {
34 4
                return false;
35
            }
36
37 5
            $this->visitedAssociations[$className] = array();
38
39 5
            return true;
40
        }
41
42 4
        if (isset($this->visitedAssociations[$className][$association])) {
43 1
            return false;
44
        }
45
46 4
        if (!isset($this->visitedAssociations[$className])) {
47 4
            $this->visitedAssociations[$className] = array();
48 4
        }
49
50 4
        $this->visitedAssociations[$className][$association] = true;
51
52 4
        return true;
53
    }
54
}
55