Example #1
0
 /**
  * Constructor.
  *
  * @param  string                              $scope
  * @param  ReflectionFunction|ReflectionMethod $function
  * @param  array                               $codeCoverage
  */
 protected function __construct($scope, $function, &$codeCoverage = array())
 {
     $this->scope = $scope;
     $this->function = $function;
     $source = PHPUnit_Util_Class::getMethodSource($scope, $function->getName());
     if ($source !== FALSE) {
         $this->tokens = token_get_all('<?php' . $source . '?>');
         $this->parameters = $function->getNumberOfParameters();
         $this->calculateCCN();
         $this->calculateNPath();
         $this->calculateDependencies();
     }
     $this->setCoverage($codeCoverage);
 }