/** * @param \PHPWeekly\Entity\Prisoner $prisoner * * @return bool */ public function writeFile(Prisoner $prisoner) { $txt = $this->readFile(); $txt .= strtolower($prisoner->getPreviousResponse()) . PHP_EOL; file_put_contents($this->fileName, $txt); return; }
/** * @param Prisoner $me * @param Prisoner $otherGuy */ public function __construct(Prisoner $me, Prisoner $otherGuy) { $this->myLastAnswer = strtolower($me->getPreviousResponse()); $this->otherGuyLastAnswer = strtolower($otherGuy->getPreviousResponse()); }