for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author Peter Gribanov <[email protected]>
*/
namespace GpsLab\Component\ImageMeta;
use Symfony\Component\Filesystem\Filesystem;
class ParserMeta
{
* @var Filesystem
protected $fs;
* @param Filesystem $fs
public function __construct(Filesystem $fs)
$this->fs = $fs;
}
* @param string $path
*
* @return DataMeta|null
public function getMeta($path)
if ($this->fs->exists($path) && ($info = @getimagesize($path))) {
return new DataMeta($info[0], $info[1], $info['mime']);
} else {
return null;