for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace vfalies\tmdb\Items;
use vfalies\tmdb\Abstracts\Item;
use vfalies\tmdb\Tmdb;
use vfalies\tmdb\Results\Crew;
use vfalies\tmdb\Results\Cast;
class MovieCredit extends Item
{
protected $crew;
/**
* Constructor
* @param \vfalies\tmdb\Tmdb $tmdb
* @param int $movie_id
* @param array $options
*/
public function __construct(Tmdb $tmdb, $movie_id, array $options = array())
parent::__construct($tmdb, '/credits', $options, 'movie/'.$movie_id);
}
public function getCrew()
if (!empty($this->data->crew))
foreach ($this->data->crew as $c)
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;
$crew = new Crew($this->tmdb, $c);
yield $crew;
public function getCast()
if (!empty($this->data->cast))
foreach ($this->data->cast as $c)
$cast = new Cast($this->tmdb, $c);
yield $cast;
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: