original_string: public function verify(ExerciseInterface $exercise, Input $input)
      {
          $exercise->configure($this);
  
          $runner = $this->runnerManager->getRunner($exercise);
  
          foreach ($runner->getRequiredChecks() as $requiredCheck) {
              $this->requireCheck($requiredCheck);
          }
  
          $this->eventDispatcher->dispatch(new ExerciseRunnerEvent('verify.start', $exercise, $input));
  
          $this->validateChecks($this->checksToRunBefore, $exercise);
          $this->validateChecks($this->checksToRunAfter, $exercise);
  
          foreach ($this->checksToRunBefore as $check) {
              $this->results->add($check->check($exercise, $input));
  
              if (!$this->results->isSuccessful()) {
                  return $this->results;
              }
          }
  
          $this->eventDispatcher->dispatch(new ExerciseRunnerEvent('verify.pre.execute', $exercise, $input));
  
          try {
              $this->results->add($runner->verify($input));
          } finally {
              $this->eventDispatcher->dispatch(new ExerciseRunnerEvent('verify.post.execute', $exercise, $input));
          }
  
          foreach ($this->checksToRunAfter as $check) {
              $this->results->add($check->check($exercise, $input));
          }
  
          $this->eventDispatcher->dispatch(new ExerciseRunnerEvent('verify.post.check', $exercise, $input));
          $exercise->tearDown();
  
          $this->eventDispatcher->dispatch(new ExerciseRunnerEvent('verify.finish', $exercise, $input));
          return $this->results;
      }
code: public function verify(ExerciseInterface $exercise, Input $input)
      {
          $exercise->configure($this);
  
          $runner = $this->runnerManager->getRunner($exercise);
  
          foreach ($runner->getRequiredChecks() as $requiredCheck) {
              $this->requireCheck($requiredCheck);
          }
  
          $this->eventDispatcher->dispatch(new ExerciseRunnerEvent('verify.start', $exercise, $input));
  
          $this->validateChecks($this->checksToRunBefore, $exercise);
          $this->validateChecks($this->checksToRunAfter, $exercise);
  
          foreach ($this->checksToRunBefore as $check) {
              $this->results->add($check->check($exercise, $input));
  
              if (!$this->results->isSuccessful()) {
                  return $this->results;
              }
          }
  
          $this->eventDispatcher->dispatch(new ExerciseRunnerEvent('verify.pre.execute', $exercise, $input));
  
          try {
              $this->results->add($runner->verify($input));
          } finally {
              $this->eventDispatcher->dispatch(new ExerciseRunnerEvent('verify.post.execute', $exercise, $input));
          }
  
          foreach ($this->checksToRunAfter as $check) {
              $this->results->add($check->check($exercise, $input));
          }
  
          $this->eventDispatcher->dispatch(new ExerciseRunnerEvent('verify.post.check', $exercise, $input));
          $exercise->tearDown();
  
          $this->eventDispatcher->dispatch(new ExerciseRunnerEvent('verify.finish', $exercise, $input));
          return $this->results;
      }
code_tokens: public function verify ( ExerciseInterface $ exercise , Input $ input ) { $ exercise -> configure ( $ this ) ; $ runner = $ this -> runnerManager -> getRunner ( $ exercise ) ; foreach ( $ runner -> getRequiredChecks ( ) as $ requiredCheck ) { $ this -> requireCheck ( $ requiredCheck ) ; } $ this -> eventDispatcher -> dispatch ( new ExerciseRunnerEvent ( 'verify.start' , $ exercise , $ input ) ) ; $ this -> validateChecks ( $ this -> checksToRunBefore , $ exercise ) ; $ this -> validateChecks ( $ this -> checksToRunAfter , $ exercise ) ; foreach ( $ this -> checksToRunBefore as $ check ) { $ this -> results -> add ( $ check -> check ( $ exercise , $ input ) ) ; if ( ! $ this -> results -> isSuccessful ( ) ) { return $ this -> results ; } } $ this -> eventDispatcher -> dispatch ( new ExerciseRunnerEvent ( 'verify.pre.execute' , $ exercise , $ input ) ) ; try { $ this -> results -> add ( $ runner -> verify ( $ input ) ) ; } finally { $ this -> eventDispatcher -> dispatch ( new ExerciseRunnerEvent ( 'verify.post.execute' , $ exercise , $ input ) ) ; } foreach ( $ this -> checksToRunAfter as $ check ) { $ this -> results -> add ( $ check -> check ( $ exercise , $ input ) ) ; } $ this -> eventDispatcher -> dispatch ( new ExerciseRunnerEvent ( 'verify.post.check' , $ exercise , $ input ) ) ; $ exercise -> tearDown ( ) ; $ this -> eventDispatcher -> dispatch ( new ExerciseRunnerEvent ( 'verify.finish' , $ exercise , $ input ) ) ; return $ this -> results ; }
docstring: Verify a students solution against a specific exercise. Runs queued checks based on their position. Invokes the
  correct runner for the exercise based on the exercise type. Various events are triggered throughout the process.
  
  @param ExerciseInterface $exercise The exercise instance.
  @param Input $input The command line arguments passed to the command.
  @return ResultAggregator Contains all the results injected via the runner, checks and events.
  @throws CheckNotApplicableException If the check is not applicable to the exercise type.
  @throws ExerciseNotConfiguredException If the exercise does not implement the correct interface based on
  the checks required.
docstring_tokens: Verify a students solution against a specific exercise . Runs queued checks based on their position . Invokes the correct runner for the exercise based on the exercise type . Various events are triggered throughout the process .