original_string: public function setAlgorithm($algorithm)
      {
          if (!in_array($algorithm, $this->allowedAlgorithms)) {
              throw new \InvalidArgumentException('Not an allowed algorithm: ' . $algorithm);
          }
          
          $this->algorithm = $algorithm;
          
          return $this;
      }
code: public function setAlgorithm($algorithm)
      {
          if (!in_array($algorithm, $this->allowedAlgorithms)) {
              throw new \InvalidArgumentException('Not an allowed algorithm: ' . $algorithm);
          }
          
          $this->algorithm = $algorithm;
          
          return $this;
      }
code_tokens: public function setAlgorithm ( $ algorithm ) { if ( ! in_array ( $ algorithm , $ this -> allowedAlgorithms ) ) { throw new \ InvalidArgumentException ( 'Not an allowed algorithm: ' . $ algorithm ) ; } $ this -> algorithm = $ algorithm ; return $ this ; }
docstring: Changing the used algorithm for hashing
  
  Can only be one of the algorithms in the allowedAlgorithms property.
  
  @param string $algorithm
  @throws \InvalidArgumentException
  @return \Otp\Otp
docstring_tokens: Changing the used algorithm for hashing