Exemplo n.º 1
0
 /**
  * Fills EventList and Event Objects with infos taken by config files.
  * 
  * Declares EventList and Event as "report ready".
  *
  * @param SQLI_CodeSniffer_EventList $events
  */
 protected function setEventsInfos(SQLI_CodeSniffer_EventList &$events)
 {
     foreach ($events as $event) {
         if ($this->isConfiguredEventCode($event->getCode())) {
             $eventLevel = $this->getEventLevel($event);
             $eventMessage = $this->getEventMessage($event);
             $event->setReportInfos($eventMessage, $eventLevel);
         } else {
             $eventLevel = $this->getEventLevel($event);
         }
         $events->addLevelCount($eventLevel);
     }
     $events->setReportReady();
 }
 /**
  * Add events in $eventList1 that are not in $eventList2 to $errors array.
  * 
  * Works by reference on $errors by adding $message errors.
  * 
  * @param SQLI_CodeSniffer_EventList $eventList1
  * @param SQLI_CodeSniffer_EventList $eventList2
  * @param string $message
  * @param array $errors
  * @return void
  */
 protected static function _getMissingEvents($eventList1, $eventList2, $message, &$errors)
 {
     if (count($eventList1) == 0) {
         return;
     }
     foreach ($eventList1 as $event) {
         if (!$eventList2->hasEvent($event)) {
             $errors[$event->getLine()][$event->getColumn()][] = str_replace(':code', $event->getCode(), $message);
         }
     }
 }
Exemplo n.º 3
0
 /**
  * Returns the events raised from processing this file.
  *
  * If $line and/or $column are specified, only relative Events are returned.
  * 
  * @param int $line
  * @param int $column
  * 
  * @return array
  */
 public function getEvents($line = null, $column = null)
 {
     return $this->_events->getEvents($line, $column);
 }