dev-master
9999999-devSearch unused code
MIT
The Requires
- php >=5.3
- ext-xdebug >=2.1.4
The Development Requires
by Oleg Koltunov
Wallogit.com
2017 © Pedro Peláez
Search unused code
Found unused code in your project, (*1)
PHPHD is a library that provides collection and rendering functionality for PHP code coverage information. PHPHD uses xdebug for collecting information. PHPHD is similar to the PHP_CodeCoverage, but PHPHD much faster and can be used in web sites., (*2)
To add PHPHD as a local, per-project dependency to your project, simply add a dependency on olegkolt/phphd to your project's composer.json file. Here is a minimal example of a composer.json file that just defines a dependency on PHPHD:, (*3)
{
"require": {
"olegkolt/phphd": "dev-master"
}
}
<?php
use PHPHD\DataSource\Serialize;
use PHPHD\Collect
$dataSrc = new Serialize('/tmp/phphd/data.dump'); // data.dump - file for saving code coverage data
$collector = new Collect($dataSrc, __DIR__ . '/lib'); // Second argument is code directory path
$collector->startCollection();
// your job
$collector->save();
Or just add this code to the entry point of your application:, (*4)
<?php
use PHPHD\DataSource\Serialize;
use PHPHD\Collect
Collect::register(
Serialize('/tmp/phphd/data.dump'), // Dump file path
__DIR__ . '/lib' // Code directory path
);
Collect::register from the second sample uses register_shutdown_function for saving code coverage data., (*5)
<?php
use PHPHD\View\Html;
use PHPHD\DataSource\Serialize;
$dataSrc = new Serialize('/tmp/phphd/data.dump');
$html = new Html($dataSrc);
$html->output();
Search unused code
MIT