Add type hint to canvas interface.
This commit is contained in:
parent
84c138d738
commit
da772fca8c
@ -2,9 +2,11 @@
|
||||
|
||||
namespace StaticMapLite\Canvas;
|
||||
|
||||
use Imagine\Image\ImageInterface;
|
||||
|
||||
interface CanvasInterface
|
||||
{
|
||||
public function getImage();
|
||||
public function getImage(): ImageInterface;
|
||||
public function getWidth(): int;
|
||||
public function getHeight(): int;
|
||||
public function getCenterX(): float;
|
||||
|
@ -78,7 +78,8 @@ class MapCache
|
||||
public function cache(CanvasInterface $canvas): void
|
||||
{
|
||||
$this->mkdir_recursive(dirname($this->mapCacheIDToFilename()), 0777);
|
||||
imagepng($canvas->getImage(), $this->mapCacheIDToFilename(), 9);
|
||||
|
||||
$canvas->getImage()->save($this->mapCacheIDToFilename());
|
||||
|
||||
$output = new CacheOutput();
|
||||
$output->setFilename($this->mapCacheIDToFilename())
|
||||
|
Loading…
Reference in New Issue
Block a user