for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace vfalies\tmdb\Results;
use vfalies\tmdb\Abstracts\Results;
use vfalies\tmdb\Tmdb;
use vfalies\tmdb\Interfaces\Results\CompanyResultsInterface;
class Company extends Results implements CompanyResultsInterface
{
protected $name = null;
protected $logo_path = null;
/**
* Constructor
* @param \vfalies\tmdb\Tmdb $tmdb
* @param \stdClass $result
*/
public function __construct(Tmdb $tmdb, \stdClass $result)
parent::__construct($tmdb, $result);
// Populate data
$this->id = $this->data->id;
data
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
id
$this->name = $this->data->name;
$this->logo_path = $this->data->logo_path;
}
public function getId()
return $this->id;
public function getLogoPath()
return $this->logo_path;
public function getName()
return $this->name;
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: