SkuskuHelper::getAbstractEntitiesValues()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 6
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 12
rs 10
1
<?php
2
3
namespace GGGGino\SkuskuCartBundle\Service;
4
5
use Doctrine\ORM\EntityManager;
6
7
/**
8
 * Class SkuskuHelper
9
 * @package GGGGino\SkuskuCartBundle\Service
10
 */
11
class SkuskuHelper
12
{
13
    /**
14
     * @var EntityManager
15
     */
16
    private $em;
17
18
    /**
19
     * @var array
20
     */
21
    private $abstractEntities;
22
23
    /**
24
     * CartExtension constructor.
25
     * @param EntityManager $em
26
     * @param array $abstractEntities
27
     */
28
    public function __construct(EntityManager $em, array $abstractEntities)
29
    {
30
        $this->em = $em;
31
        $this->abstractEntities = $abstractEntities;
32
    }
33
34
    public function getAbstractEntities()
35
    {
36
        return $this->abstractEntities;
37
    }
38
39
    public function getAbstractEntitiesValues()
40
    {
41
        $resultArray = array();
42
43
        foreach ($this->getAbstractEntities() as $key => $value) {
44
            $resultArray[] = array(
45
                'interface' => $key,
46
                'concrete' => $value
47
            );
48
        }
49
50
        return $resultArray;
51
    }
52
}