Skip to content

willpower232/cloverparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cloverparser

run-tests Coverage

This is a parser for one or more clover coverage files, as generated by phpunit/phpunit, with the aim of producing a percentage for code coverage.

This is intended to be the basis of parsing some clover files for use in other ways such as willpower232/cloverparser-laravel which creates an SVG from the coverage percentage and stores it using Laravels framework.


A former casual user of codecov and interested in controlling my own data, I decided to see how complicated it would be to operate a similar setup myself after their uploader script was compromised.

This is the first part of this project, discovering how to get the coverage values out of a clover file.


Installation

composer require willpower232/cloverparser

Usage

use WillPower232\CloverParser\CloverParser;

$parser = new CloverParser;

$parser->addFile($pathToCloverFile);

$percentage = $parser->getPercentage();