protected function getEncryptor(int $cipher, string $password): EncryptorInterface {
		try {
			if ($cipher === Ciphers::ENCRYPT_NONE) {
				return null;
			}
			if ($cipher === Ciphers::ENCRYPT_XOR) {
				return $this->getXorEncryptor($cipher, $password);
			}
            $encryptor = $this->getOpenSslEncryptor($cipher, $password);
        } catch (\Exception $exc) {
            trigger_error('Falling back to legacy encryption, openssl failed: ' . $exc->getMessage(), \E_DEPRECATED);
            $encryptor = $this->getLegacyEncryptor($cipher, $password);
        }
        return $encryptor;
    }
protected function getEncryptor(int $cipher, string $password): EncryptorInterface {
		try {
			if ($cipher === Ciphers::ENCRYPT_NONE) {
				return null;
			}
			if ($cipher === Ciphers::ENCRYPT_XOR) {
				return $this->getXorEncryptor($cipher, $password);
			}
            $encryptor = $this->getOpenSslEncryptor($cipher, $password);
        } catch (\Exception $exc) {
            trigger_error('Falling back to legacy encryption, openssl failed: ' . $exc->getMessage(), \E_DEPRECATED);
            $encryptor = $this->getLegacyEncryptor($cipher, $password);
        }
        return $encryptor;
    }
protected function getEncryptor ( int $ cipher , string $ password ) : EncryptorInterface { try { if ( $ cipher === Ciphers :: ENCRYPT_NONE ) { return null ; } if ( $ cipher === Ciphers :: ENCRYPT_XOR ) { return $ this -> getXorEncryptor ( $ cipher , $ password ) ; } $ encryptor = $ this -> getOpenSslEncryptor ( $ cipher , $ password ) ; } catch ( \ Exception $ exc ) { trigger_error ( 'Falling back to legacy encryption, openssl failed: ' . $ exc -> getMessage ( ) , \ E_DEPRECATED ) ; $ encryptor = $ this -> getLegacyEncryptor ( $ cipher , $ password ) ; } return $ encryptor ; }
Tries to figure out correct encryptor for a given cipher

@param int $cipher
@param string $password
@return EncryptorInterface
@throws \Exception
Tries to figure out correct encryptor for a given cipher