Example #1
0
 /**
  * Displays report or generates its files
  *
  * @param VcsStats_Report $report Report
  * @return void
  */
 public function render(VcsStats_Report $report)
 {
     VcsStats_Runner_Cli::displayMessage('Rendering report to text');
     foreach ($report->getSections() as $section) {
         foreach ($section->getElements() as $element) {
             switch (get_class($element)) {
                 case 'VcsStats_Report_Element_Table':
                     $this->renderTable($element);
                     break;
             }
         }
     }
 }
Example #2
0
 /**
  * Class constructor
  *
  * @param VcsStats_Cache $cache Cache instance
  * @return void
  */
 public function __construct(VcsStats_Cache $cache)
 {
     VcsStats_Runner_Cli::displayMessage('Initializing analyzer');
     $this->_cache = $cache;
 }
Example #3
0
 /**
  * Updates the cache data
  *
  * @param int|null $endRevisionId Id of the last revision to retrieve
  * @return void
  */
 public function updateData($endRevisionId = null)
 {
     VcsStats_Runner_Cli::displayMessage('Updating cache data');
     $startRevisionId = $this->getLastCachedRevisionId();
     if (null === $startRevisionId) {
         $startRevisionId = 1;
     }
     if ($startRevisionId >= $endRevisionId) {
         VcsStats_Runner_Cli::displayDebug('Everything is already in cache');
         return;
     }
     if (null === $endRevisionId) {
         $endRevisionId = 'HEAD';
     }
     $data = $this->_wrapper->getRevisionsData($startRevisionId, $endRevisionId);
     $this->_populate($data);
 }
Example #4
0
 /**
  * Class constructor
  *
  * @param array $options Options
  * @return void
  */
 public function __construct(array $options)
 {
     VcsStats_Runner_Cli::displayMessage('Initializing wrapper');
     $this->_options = $options;
 }