for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace WSW\SimpleUpload\Entities;
use DateTime;
/**
* Class File
* @package WSW\SimpleUpload\Entities
*/
class File
{
* @var string
private $path;
* @var DateTime
private $timestamp;
private $mimetype;
* @var int
private $size;
* @return string
public function getPath()
return $this->path;
}
* @param string $path
* @return self
public function setPath($path)
$this->path = $path;
return $this;
* @return DateTime
public function getTimestamp()
return $this->timestamp;
* @param int $timestamp
public function setTimestamp($timestamp)
$this->timestamp = (new DateTime())->setTimestamp($timestamp);
public function getMimetype()
return $this->mimetype;
* @param string $mimetype
*
public function setMimetype($mimetype)
$this->mimetype = $mimetype;
* @return int
public function getSize()
return $this->size;
* @param int $size
public function setSize($size)
$this->size = $size;
public function getFilePath()
return dirname($this->getPath());
public function getName()
return pathinfo($this->getPath(), PATHINFO_FILENAME);
public function getFileName()
return basename($this->getPath());
public function getExtension()
return strtolower(pathinfo($this->getPath(), PATHINFO_EXTENSION));