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

Container::move()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 4
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 2
crap 6
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
}