/** * Static Constructor. * * @param Word $word * @param string $language * @param int $length * @param int $level * @param int $lives * @param PlayerOptions[] $players * * @throws IllegalOptionException * * @return HangmanOptions */ public static function create(Word $word = null, $language = 'en', $length = null, $level = null, $lives = 6, array $players = []) { $obj = new self(); $obj->init($players); $obj->lives = $lives; $obj->word = $word; $obj->language = $language; $obj->length = $length; $obj->level = $level; $obj->checkOptions(); return $obj; }