AbstractPlacer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 23
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getFirstPlaceToTry() 0 4 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