original_string: public function insertAfter($class, $middleware)
      {
          $found = false;
          $i = null;
          foreach ($this->queue as $i => $object) {
              if ((is_string($object) && $object === $class)
                  || is_a($object, $class)
              ) {
                  $found = true;
                  break;
              }
          }
          if ($found) {
              return $this->insertAt($i + 1, $middleware);
          }
  
          return $this->add($middleware);
      }
code: public function insertAfter($class, $middleware)
      {
          $found = false;
          $i = null;
          foreach ($this->queue as $i => $object) {
              if ((is_string($object) && $object === $class)
                  || is_a($object, $class)
              ) {
                  $found = true;
                  break;
              }
          }
          if ($found) {
              return $this->insertAt($i + 1, $middleware);
          }
  
          return $this->add($middleware);
      }
code_tokens: public function insertAfter ( $ class , $ middleware ) { $ found = false ; $ i = null ; foreach ( $ this -> queue as $ i => $ object ) { if ( ( is_string ( $ object ) && $ object === $ class ) || is_a ( $ object , $ class ) ) { $ found = true ; break ; } } if ( $ found ) { return $ this -> insertAt ( $ i + 1 , $ middleware ) ; } return $ this -> add ( $ middleware ) ; }
docstring: Insert a middleware object after the first matching class.
  
  Finds the index of the first middleware that matches the provided class,
  and inserts the supplied callable after it. If the class is not found,
  this method will behave like add().
  
  @param string $class The classname to insert the middleware before.
  @param callable|string $middleware The middleware to insert.
  @return $this
docstring_tokens: Insert a middleware object after the first matching class .