public function getOpenSslEncryptor(int $cipher, string $password): OpenSslEncryptor {
        if (false === extension_loaded('openssl')) {
            throw new \Exception('OpenSSL Extension not available');
        }
        $encryptor = new OpenSslEncryptor($cipher, $password);
        if (false === $encryptor->isEncryptionCipherSupported($cipher)) {
            throw new \Exception('Trying to use unsupported encryption cipher');
        }
        return $encryptor;
    }
public function getOpenSslEncryptor(int $cipher, string $password): OpenSslEncryptor {
        if (false === extension_loaded('openssl')) {
            throw new \Exception('OpenSSL Extension not available');
        }
        $encryptor = new OpenSslEncryptor($cipher, $password);
        if (false === $encryptor->isEncryptionCipherSupported($cipher)) {
            throw new \Exception('Trying to use unsupported encryption cipher');
        }
        return $encryptor;
    }
public function getOpenSslEncryptor ( int $ cipher , string $ password ) : OpenSslEncryptor { if ( false === extension_loaded ( 'openssl' ) ) { throw new \ Exception ( 'OpenSSL Extension not available' ) ; } $ encryptor = new OpenSslEncryptor ( $ cipher , $ password ) ; if ( false === $ encryptor -> isEncryptionCipherSupported ( $ cipher ) ) { throw new \ Exception ( 'Trying to use unsupported encryption cipher' ) ; } return $ encryptor ; }
Factorymethod for OpenSSL Encryptor

@param int $cipher
@param string $password
@return OpenSslEncryptor
@throws \Exception
Factorymethod for OpenSSL Encryptor