Kelunik\AcmeClient\Commands\Issue::findSuitableCombination PHP Метод

findSuitableCombination() приватный Метод

private findSuitableCombination ( stdClass $response )
$response stdClass
    private function findSuitableCombination(stdClass $response)
    {
        $challenges = isset($response->challenges) ? $response->challenges : [];
        $combinations = isset($response->combinations) ? $response->combinations : [];
        $goodChallenges = [];
        foreach ($challenges as $i => $challenge) {
            if ($challenge->type === "http-01") {
                $goodChallenges[] = $i;
            }
        }
        foreach ($goodChallenges as $i => $challenge) {
            if (!in_array([$challenge], $combinations)) {
                unset($goodChallenges[$i]);
            }
        }
        return $goodChallenges;
    }