Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function analyze(array $tokenList, FileFeedback $fileFeedback)
 {
     foreach ($tokenList as $token) {
         $fileFeedback->setCurrentToken($token);
         $this->validateIndentation($token, $fileFeedback);
         $this->assertExtraWhitespaces($token, $fileFeedback);
     }
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function analyze(array $tokenList, FileFeedback $fileFeedback)
 {
     if (count($tokenList) > 350) {
         $fileFeedback->add('Warning: Is this all about Star Wars? TL;DR. Please split it up');
     }
     foreach ($tokenList as $token) {
         $fileFeedback->setCurrentToken($token);
         $this->validateTagLine($token, $fileFeedback);
     }
 }
Exemplo n.º 3
0
 /**
  * Analyze the content
  *
  * @param string $content
  *
  * @return \IC\Gherkinics\Feedback\FileFeedback
  */
 public function analyze($content)
 {
     $tokenList = $this->lexer->analyze($content);
     $fileFeedback = new FileFeedback($tokenList);
     foreach ($this->analyzerList as $analyzer) {
         $fileFeedback->setCurrentToken(null);
         $analyzer->analyze($tokenList, $fileFeedback);
     }
     return $fileFeedback;
 }
Exemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function analyze(array $tokenList, FileFeedback $fileFeedback)
 {
     $this->previousToken = null;
     foreach ($tokenList as $token) {
         $fileFeedback->setCurrentToken($token);
         if ($token instanceof Model\Node || $token instanceof Model\Blank || $token instanceof Model\Feature || $token instanceof Model\TagLine || $token instanceof Model\Example || $token instanceof Model\TabularData) {
             continue;
         }
         if ($token instanceof Model\Background || $token instanceof Model\Scenario) {
             $this->previousToken = null;
             continue;
         }
         $this->assertContextFlow($token, $fileFeedback);
         $this->assertSemanticQuality($token, $fileFeedback);
         // Disregard this token as the previous token.
         if ($token instanceof Model\Continuation) {
             continue;
         }
         $this->previousToken = $token;
     }
 }