-
Notifications
You must be signed in to change notification settings - Fork 2
/
http.php
80 lines (62 loc) · 2.4 KB
/
http.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/**
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* Version 2015
*
* Copyright (C) 2015 Fadel Chafai <[email protected]>
*
* Everyone is permitted to copy and distribute verbatim or modified
* copies of this license document, and changing it is allowed as long
* as the name is changed.
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
* 0. You just DO WHAT THE FUCK YOU WANT TO.
*/
error_reporting(E_ALL);
use \Lib\Fixers\Fixer;
require 'vendor/autoload.php';
if(!empty($_GET['file'])){
if(empty($_GET['stdr']))
$_GET['stdr'] = 'psr2';
$fixer = new Fixer($_GET['file'], $_GET['stdr']);
$checker = $fixer->chackFile();
if(!empty($_GET['checker'])){
if(!$checker[0]) {
echo $checker[1];
return;
}
switch ($_GET['checker']){
case 'phpmd':
echo $fixer->phpmd();
break;
case 'phpcs':
echo '<b>Standard : '.$_GET['stdr'].'</b><br><pre>'.$fixer->phpcs().'</pre>';
break;
case 'phpcsfixer' :
echo '<b>Standard : '.$_GET['stdr'].'</b><br><pre>'.$fixer->phpcsfixer().'</pre>';
break;
case 'phpmetrics':
echo '<pre>'.$fixer->phpmetrics().'</pre><br><h4>Metric Report</h4>';
echo '<a href="report/'.$fixer->getMetricReportFile().'" target="_blank">Show report</a>';
break;
case 'phpcpd':
echo '<b>Standard : '.$_GET['stdr'].'</b><br><pre>'.$fixer->phpcpd().'</pre>';
break;
case 'phploc':
echo '<b>Standard : '.$_GET['stdr'].'</b><br><pre>'.$fixer->phploc().'</pre>';
break;
case 'phpcodecoverage':
$result = $fixer->phpcodecoverage();
echo '<b>Standard : '.$_GET['stdr'].'</b><br><a href="report/'.$fixer->getCoverageFolder().'">View generated report</a><br><pre>'.$result.'</pre>';
break;
case 'phpunit':
echo '<b>Standard : '.$_GET['stdr'].'</b><br><pre>'.$fixer->phpunit().'</pre>';
break;
}
}else{
echo $checker[1];
}
}else{
echo '<div class="alert alert-danger" role="alert"><b>Ooops :</b> Empty file path</div>';
}