/**
  * Collects & reports coverage information.
  *
  * @param string|null $data_directory Directory for coverage information collection.
  *
  * @return void
  */
 public static function init($data_directory = null)
 {
     $coverage_tool = new self($data_directory);
     $mode = isset($_GET['rct_mode']) ? $_GET['rct_mode'] : '';
     if ($mode == 'output') {
         echo $coverage_tool->aggregateCoverageInformation();
     } else {
         $coverage_tool->startCollection();
         register_shutdown_function(array($coverage_tool, 'stopCollection'));
     }
 }
Example #2
0
 /**
  * @param \PHPHD\DataSource\SourceInterface $src
  * @param string|null $dir
  */
 public static function register(SourceInterface $src, $dir = null)
 {
     $collector = new self($src, $dir);
     $collector->startCollection();
     register_shutdown_function(array($collector, 'save'));
 }