Completed
Push — master ( e6cea0...5c122a )
by Marcin
01:53
created

Container   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 47
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A addElement() 0 6 1
A move() 0 8 2
A getElements() 0 4 1
1
<?php
2
/**
3
 * Grandstream-XMLApp
4
 *
5
 * Copyright (c) 2017 pudelek.org.pl
6
 *
7
 * @license MIT License (MIT)
8
 *
9
 * For the full copyright and license information, please view source file
10
 * that is bundled with this package in the file LICENSE
11
 *
12
 * @author Marcin Pudełek <[email protected]>
13
 */
14
15
namespace mrcnpdlk\Grandstream\XMLApp\Application\Model;
16
17
use mrcnpdlk\Grandstream\XMLApp\Application\Model\Components\ElemInterface;
18
19
/**
20
 * Class Container
21
 *
22
 * @package mrcnpdlk\Grandstream\XMLApp\Application\Model\Components
23
 */
24
class Container
25
{
26
27
    /**
28
     * @var \mrcnpdlk\Grandstream\XMLApp\Application\Model\Components\ElemInterface[]
29
     */
30
    private $tElements = [];
31
32
    public function __construct()
33
    {
34
    }
35
36
    /**
37
     * @param \mrcnpdlk\Grandstream\XMLApp\Application\Model\Components\ElemInterface $oElement
38
     *
39
     * @return $this
40
     */
41
    public function addElement(ElemInterface $oElement)
42
    {
43
        $this->tElements[] = $oElement;
44
45
        return $this;
46
    }
47
48
    /**
49
     * @param int $iX
50
     * @param int $iY
51
     *
52
     * @return $this
53
     */
54
    public function move(int $iX, int $iY)
55
    {
56
        foreach ($this->tElements as $element) {
57
            $element->move($iX, $iY);
58
        }
59
60
        return $this;
61
    }
62
63
    /**
64
     * @return \mrcnpdlk\Grandstream\XMLApp\Application\Model\Components\ElemInterface[]
65
     */
66
    public function getElements()
67
    {
68
        return $this->tElements;
69
    }
70
}