original_string: public function encrypt($data, $key) {
        $this->validateData($data);
        $this->validateKey($key);
  
        $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length(self::CIPHER_METHOD));
  
        $encrypted = openssl_encrypt($data, self::CIPHER_METHOD, $key, 0, $iv);
        $encoded = base64_encode($encrypted . self::ENCRYPTED_IV_SEPERATOR . $iv);
  
        return new Encrypted($encoded);
      }
code: public function encrypt($data, $key) {
        $this->validateData($data);
        $this->validateKey($key);
  
        $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length(self::CIPHER_METHOD));
  
        $encrypted = openssl_encrypt($data, self::CIPHER_METHOD, $key, 0, $iv);
        $encoded = base64_encode($encrypted . self::ENCRYPTED_IV_SEPERATOR . $iv);
  
        return new Encrypted($encoded);
      }
code_tokens: public function encrypt ( $ data , $ key ) { $ this -> validateData ( $ data ) ; $ this -> validateKey ( $ key ) ; $ iv = openssl_random_pseudo_bytes ( openssl_cipher_iv_length ( self :: CIPHER_METHOD ) ) ; $ encrypted = openssl_encrypt ( $ data , self :: CIPHER_METHOD , $ key , 0 , $ iv ) ; $ encoded = base64_encode ( $ encrypted . self :: ENCRYPTED_IV_SEPERATOR . $ iv ) ; return new Encrypted ( $ encoded ) ; }
docstring: Encrypt data by key
  
  @param string $data
  @param string $key
  @return Encrypted
docstring_tokens: Encrypt data by key