Start your All-Access Pass to unlock this challenge
Challenge 1 / 1
Check out the following class:
class Animal
{
private $name;
private $species;
public function getSummary()
{
return "The animal's name is " . $this->name . " and its species is " . $this->species . ".";
}
}
To guarantee that both $name
and $species
are always set (so that getSummary()
doesn't return a nonsensical string), where could we enforce this requirement? Choose the best option:
Skip challenges and