Jose\Behaviour\CommonCipheringMethods::setKeyEncryptionAlgorithms PHP Метод

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

private setKeyEncryptionAlgorithms ( string[] | Jose\Algorithm\KeyEncryptionAlgorithmInterface[] $key_encryption_algorithms )
$key_encryption_algorithms string[] | Jose\Algorithm\KeyEncryptionAlgorithmInterface[]
    private function setKeyEncryptionAlgorithms($key_encryption_algorithms)
    {
        $result = [];
        foreach ($key_encryption_algorithms as $key_encryption_algorithm) {
            if (is_string($key_encryption_algorithm)) {
                $result[] = $key_encryption_algorithm;
            } elseif ($key_encryption_algorithm instanceof KeyEncryptionAlgorithmInterface) {
                $result[] = $key_encryption_algorithm->getAlgorithmName();
            } else {
                throw new \InvalidArgumentException('Parameter must be a string or an instance of KeyEncryptionAlgorithmInterface');
            }
        }
        $this->key_encryption_algorithms = $result;
    }