Class CoverageRecorder

Description

The Coverage Recorder utility

This is the main class for the CoverageRecorder. User should instantiate this class and set various parameters of it. The startInstrumentation and stopInstrumentation methods will switch code coverage recording on and off respectively.

The code coverage is recorded using XDebug Zend Extension. Therefore, it is required to install that extension on the system where code coverage measurement is going to take place. See www.xdebug.org for more information.

Located in /CoverageRecorder.php (line 35)


	
			
Direct descendents
Class Description
RemoteCoverageRecorder A Coverage recorder extension for remote Coverage measurement.
Variable Summary
Method Summary
CoverageRecorder __construct ([$includePaths $includePaths = array(".")], [$excludePaths $excludePaths = array()], [$reporter $reporter = "new HtmlCoverageReporter()"])
void addFiles ()
void generateReport ()
Array getErrors ()
void getExcludePaths ()
void getFilesAndDirs ($dir $dir, &$files &$files)
void getIncludePaths ()
void getReporter ()
void getVersion ()
void logErrors ()
void removeAbsentPaths (&$dirs &$dirs)
void setExcludePaths (mixed $excludePaths)
void setIncludePaths (mixed $includePaths)
void setPhpExtensions (mixed &$extensions)
void setReporter (mixed &$reporter)
Processed stripCoverageData ()
Variables
mixed $coverageData (line 42)
  • access: protected
mixed $excludePaths (line 40)
  • access: protected
mixed $includePaths (line 39)
  • access: protected
mixed $isRemote = false (line 43)
  • access: protected
mixed $phpCoverageFiles = array("phpcoverage.inc.php") (line 45)
  • access: protected
mixed $phpExtensions = array("php", "tpl") (line 53)

What extensions are treated as php files.

  • access: protected
mixed $reporter (line 41)
  • access: protected
mixed $stripped = false (line 44)
  • access: protected
mixed $version (line 46)
  • access: protected
Methods
Constructor __construct (line 66)

Constructor (PHP5 only)

  • access: public
CoverageRecorder __construct ([$includePaths $includePaths = array(".")], [$excludePaths $excludePaths = array()], [$reporter $reporter = "new HtmlCoverageReporter()"])
  • $includePaths $includePaths: Directories to be included in code coverage report
  • $excludePaths $excludePaths: Directories to be excluded from code coverage report
  • $reporter $reporter: Instance of a Reporter subclass

Redefined in descendants as:
addFiles (line 228)

Add all source files to the list of files that need to be parsed.

  • access: protected
void addFiles ()
excludeCoverageDir (line 399)

Exclude the directory containing the coverage measurement code.

  • access: public
void excludeCoverageDir ()
generateReport (line 120)

Generate the code coverage report

  • access: public
void generateReport ()

Redefined in descendants as:
getErrors (line 335)

Returns the errors array containing all error encountered so far.

  • return: of error messages
  • access: public
Array getErrors ()
getExcludePaths (line 362)
  • access: public
void getExcludePaths ()
getFilesAndDirs (line 190)

Get the list of files that match the extensions in $this->phpExtensions

  • access: protected
void getFilesAndDirs ($dir $dir, &$files &$files)
  • $dir $dir: Root directory
  • &$files &$files: Array of filenames to append to
getIncludePaths (line 354)
  • access: public
void getIncludePaths ()
getPhpExtensions (line 379)
  • access: public
void getPhpExtensions ()
getReporter (line 371)
  • access: public
void getReporter ()
getVersion (line 387)
  • access: public
void getVersion ()
logErrors (line 347)

Writes all error messages to error log

  • access: public
void logErrors ()
processSourcePaths (line 173)

Processes and validates the source directories

  • access: protected
void processSourcePaths ()
removeAbsentPaths (line 150)

Remove the directories that do not exist from the input array

  • access: protected
void removeAbsentPaths (&$dirs &$dirs)
  • &$dirs &$dirs: Array of directory names
setExcludePaths (line 366)
  • access: public
void setExcludePaths (mixed $excludePaths)
setIncludePaths (line 358)
  • access: public
void setIncludePaths (mixed $includePaths)
setPhpExtensions (line 383)
  • access: public
void setPhpExtensions (mixed &$extensions)
setReporter (line 375)
  • access: public
void setReporter (mixed &$reporter)
startInstrumentation (line 84)

Starts the code coverage recording

  • access: public
void startInstrumentation ()
stopInstrumentation (line 102)

Stops code coverage recording

  • access: public
void stopInstrumentation ()
stripCoverageData (line 264)

Removes the unwanted coverage data from the recordings

  • return: coverage data
  • access: protected
Processed stripCoverageData ()
unixifyCoverageData (line 317)

Convert filepaths in coverage data to forward slash separated paths.

  • access: protected
void unixifyCoverageData ()

Documentation generated on Mon, 20 Jun 2005 13:11:03 -0700 by phpDocumentor 1.3.0RC3