for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Graze\CiffRenderer\Renderer\GraphicResolver;
use Graze\CiffRenderer\Renderer\GraphicResolver\GraphicResolverInterface;
use Urbanplum\Bmp\Bmp;
use Graze\CiffRenderer\Exception\RuntimeException;
/**
* Resolves an image resource from it's file path
*/
class GraphicResolverFilePath implements GraphicResolverInterface
{
* @var Bmp
private $bmp;
* @param Bmp $bmp
public function __construct(Bmp $bmp)
$this->bmp = $bmp;
}
* @param string $filePath
* @return Resource
public function __invoke($filePath)
try {
return $this->bmp->create($filePath);
} catch (\Exception $e) {
throw new RuntimeException($e);
* @return GraphicResolverInterface
public static function factory()
return new static(
new Bmp()
);