for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SolutionDrive\HipchatAPIv2Client\Model;
class File implements FileInterface
{
protected $name = '';
protected $size = 0;
protected $thumbUrl = '';
protected $url = '';
/**
* File constructor
*/
public function __construct($json = null)
$this->parseJson($json);
}
* @inheritdoc
public function parseJson($json)
if (! $json) {
return;
$this->name = $json['name'];
$this->size = (int) $json['size'];
$this->url = $json['url'];
if (isset($json['thumb_url'])) {
$this->thumbUrl = $json['thumb_url'];
public function toJson()
$json = array(
'name' => $this->name,
'size' => $this->size,
'url' => $this->url,
);
if ($this->thumbUrl) {
$json['thumb_url'] = $this->thumbUrl;
return $json;
public function setName($name)
$this->name = $name;
return $this;
public function getName()
return $this->name;
public function setSize($size)
$this->size = (int) $size;
public function getSize()
return $this->size;
public function setThumbUrl($thumbUrl)
$this->thumbUrl = $thumbUrl;
public function getThumbUrl()
return $this->thumbUrl;
public function setUrl($url)
$this->url = $url;
public function getUrl()
return $this->url;