AbstractPlacer::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
ccs 4
cts 4
cp 1
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
namespace SixtyNine\Cloud\Placer;
4
5
use Imagine\Image\Point;
6
7
abstract class AbstractPlacer implements PlacerInterface
8
{
9
    /** @var int */
10
    protected $imgWidth;
11
    /** @var int */
12
    protected $imgHeight;
13
14
    /**
15
     * @param int $imgWidth
16
     * @param int $imgHeight
17
     */
18 6
    public function __construct($imgWidth, $imgHeight)
19
    {
20 6
        $this->imgWidth = $imgWidth;
21 6
        $this->imgHeight = $imgHeight;
22 6
    }
23
24
    /** {@inheritdoc} */
25 5
    public function getFirstPlaceToTry()
26
    {
27 5
        return new Point((int)($this->imgWidth / 2), (int)($this->imgHeight / 2));
28
    }
29
}
30