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.
Passed
Push — refactoring/metadata-adapter/2... ( e1a364...ab9001 )
by Simone
12:07 queued 09:32
created

MetaDataAdapter   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 28
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getEntityAlias() 0 7 1
A getFields() 0 3 1
A setClassMetadata() 0 3 1
A setEntityName() 0 3 1
1
<?php
2
3
namespace Mado\QueryBundle\Services;
4
5
use Doctrine\ORM\EntityRepository;
6
7
class MetaDataAdapter
8
{
9
    private $metadata;
10
11
    private $entityName;
12
13 1
    public function setClassMetadata($metadata)
14
    {
15 1
        $this->metadata = $metadata;
16 1
    }
17
18 1
    public function setEntityName($entityName)
19
    {
20 1
        $this->entityName = $entityName;
21 1
    }
22
23 1
    public function getFields()
24
    {
25 1
        return array_keys($this->metadata->fieldMappings);
26
    }
27
28 1
    public function getEntityAlias()
29
    {
30 1
        $entityName = explode('\\', strtolower($this->entityName));
31
32 1
        $entityName = $entityName[count($entityName) - 1][0];
33
34 1
        return $entityName[0];
35
    }
36
}
37