private function validateSecret(string $cipher)
    {
        if ($this->secret->getType() === SecretTypes::KEY) {
            if (\mb_strlen($this->secret->getValue(), '8bit') < $this->getKeyByteLengthForCipher($cipher)) {
                throw new EncryptionException("Key must be at least {$this->getKeyByteLengthForCipher($cipher)} bytes long");
            }
        } elseif (\mb_strlen($this->secret->getValue(), '8bit') === 0) {
            throw new EncryptionException('Password cannot be empty');
        }
    }
private function validateSecret(string $cipher)
    {
        if ($this->secret->getType() === SecretTypes::KEY) {
            if (\mb_strlen($this->secret->getValue(), '8bit') < $this->getKeyByteLengthForCipher($cipher)) {
                throw new EncryptionException("Key must be at least {$this->getKeyByteLengthForCipher($cipher)} bytes long");
            }
        } elseif (\mb_strlen($this->secret->getValue(), '8bit') === 0) {
            throw new EncryptionException('Password cannot be empty');
        }
    }
private function validateSecret ( string $ cipher ) { if ( $ this -> secret -> getType ( ) === SecretTypes :: KEY ) { if ( \ mb_strlen ( $ this -> secret -> getValue ( ) , '8bit' ) < $ this -> getKeyByteLengthForCipher ( $ cipher ) ) { throw new EncryptionException ( "Key must be at least {$this->getKeyByteLengthForCipher($cipher)} bytes long" ) ; } } elseif ( \ mb_strlen ( $ this -> secret -> getValue ( ) , '8bit' ) === 0 ) { throw new EncryptionException ( 'Password cannot be empty' ) ; } }
Validates the secret

@param string $cipher The cipher used
@throws EncryptionException Thrown if the secret is not valid
Validates the secret