LeagueWrap\Api\Summoner::infoByNames PHP Метод

infoByNames() защищенный Метод

Gets the information by the name of the summoner.
protected infoByNames ( array $names ) : LeagueWrap\Dto\Summoner | LeagueWrap\Dto\Summoner[];
$names array
Результат LeagueWrap\Dto\Summoner | LeagueWrap\Dto\Summoner[];
    protected function infoByNames(array $names)
    {
        if (count($names) > 40) {
            throw new ListMaxException('this request can only support a list of 40 elements, ' . count($names) . ' given.');
        }
        $nameList = implode(',', $names);
        // clean the name
        $nameList = htmlspecialchars($nameList);
        $array = $this->request('summoner/by-name/' . $nameList);
        $summoners = [];
        if (!empty($array)) {
            foreach ($array as $name => $info) {
                $summoner = $this->attachStaticDataToDto(new Dto\Summoner($info));
                $this->summoners[$name] = $summoner;
                $summoners[$name] = $summoner;
            }
        }
        return $summoners;
    }