OTPHP\Factory::populateOTP PHP Method

populateOTP() private static method

private static populateOTP ( otphp\OTPInterface &$otp, array $data )
$otp otphp\OTPInterface
$data array
    private static function populateOTP(OTPInterface &$otp, array $data)
    {
        self::populateParameters($otp, $data);
        $result = explode(':', rawurldecode(mb_substr($data['path'], 1, null, '8bit')));
        if (2 > count($result)) {
            $otp->setIssuerIncludedAsParameter(false);
            return;
        }
        if (!empty($otp->getIssuer())) {
            Assertion::eq($result[0], $otp->getIssuer(), 'Invalid OTP: invalid issuer in parameter');
            $otp->setIssuerIncludedAsParameter(true);
        }
        $otp->setIssuer($result[0]);
    }