for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Staticus\Resources\Png;
use League\Flysystem\FilesystemInterface;
use Staticus\Config\ConfigInterface;
use Staticus\Resources\Exceptions\SaveResourceErrorException;
use Staticus\Resources\Middlewares\Image\SaveImageMiddlewareAbstract;
class SaveResourceMiddleware extends SaveImageMiddlewareAbstract
{
public function __construct(ResourceDO $resourceDO, FilesystemInterface $filesystem, ConfigInterface $config)
parent::__construct($resourceDO, $filesystem, $config);
}
protected function writeFile($filePath, $content)
if (!imagepng($content, $filePath)) {
imagedestroy($content);
throw new SaveResourceErrorException('File cannot be written to the path ' . $filePath);