original_string: public function createToken($payload, $secret = null, $algo = null)
      {
          $algo = $algo ?: $this->algorithm();
          $secret = $secret ?: $this->secret();
  
          if($payload instanceof JwtPayloadInterface) {
              $payload = $payload->getPayload();
          }
  
          $newToken = $this->jwt->createToken($payload, $secret, $algo);
  
          $token = clone $this;
          $token->setToken($newToken);
  
          return $token;
      }
code: public function createToken($payload, $secret = null, $algo = null)
      {
          $algo = $algo ?: $this->algorithm();
          $secret = $secret ?: $this->secret();
  
          if($payload instanceof JwtPayloadInterface) {
              $payload = $payload->getPayload();
          }
  
          $newToken = $this->jwt->createToken($payload, $secret, $algo);
  
          $token = clone $this;
          $token->setToken($newToken);
  
          return $token;
      }
code_tokens: public function createToken ( $ payload , $ secret = null , $ algo = null ) { $ algo = $ algo ? : $ this -> algorithm ( ) ; $ secret = $ secret ? : $ this -> secret ( ) ; if ( $ payload instanceof JwtPayloadInterface ) { $ payload = $ payload -> getPayload ( ) ; } $ newToken = $ this -> jwt -> createToken ( $ payload , $ secret , $ algo ) ; $ token = clone $ this ; $ token -> setToken ( $ newToken ) ; return $ token ; }
docstring: Create a new token with the provided payload
  
  The default algorithm used is HS256. To set a custom one, set
  the env variable JWT_ALGO.
  
  @todo Support for enforcing required claims in payload as well as defaults
  
  @param JwtPayloadInterface|array $payload
  @param string|null               $secret
  @param string|null               $algo
  
  @return JwtToken
docstring_tokens: Create a new token with the provided payload