sixty-nine/php-cloud-lib

View on GitHub
src/SixtyNine/Cloud/Placer/AbstractPlacer.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace SixtyNine\Cloud\Placer;

use Imagine\Image\Point;

abstract class AbstractPlacer implements PlacerInterface
{
    /** @var int */
    protected $imgWidth;
    /** @var int */
    protected $imgHeight;

    /**
     * @param int $imgWidth
     * @param int $imgHeight
     */
    public function __construct($imgWidth, $imgHeight)
    {
        $this->imgWidth = $imgWidth;
        $this->imgHeight = $imgHeight;
    }

    /** {@inheritdoc} */
    public function getFirstPlaceToTry()
    {
        return new Point((int)($this->imgWidth / 2), (int)($this->imgHeight / 2));
    }
}