Skip to content

Commit 603d778

Browse files
author
Marcin Kurczewski
committed
Fixed very long lines
1 parent 6faa6a9 commit 603d778

File tree

3 files changed

+208
-65
lines changed

3 files changed

+208
-65
lines changed

run.php

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,47 @@
77
* @version 1.12.0
88
*/
99
function usage() {
10+
$options = array(
11+
"--src" =>
12+
"Root of the source directory tree or a file (can be repeated for multiple sources).",
13+
14+
"--exclude" =>
15+
"[Optional] A directory or file that needs to be excluded (can be repeated for multiple exclusions).",
16+
17+
"--format" =>
18+
"[Optional] Output format (html/text/xml/xml_console/console/html_console). Defaults to 'html'.",
19+
20+
"--outdir" =>
21+
"[Optional] Report Directory. Defaults to './style-report'.",
22+
23+
"--config" =>
24+
"[Optional] The name of the config file'.",
25+
26+
"--debug" =>
27+
"[Optional] Add some debug logs (warning, very verbose)'.",
28+
29+
"--linecount" =>
30+
"[Optional] Generate a report on the number of lines of code (JavaNCSS format)'.",
31+
32+
"--progress" =>
33+
"[Optional] Prints a message noting the file and every line that is covered by PHPCheckStyle.",
34+
35+
"--lang" =>
36+
"[Optional] Language file to use for the result (en-us by default).",
37+
38+
"--quiet" =>
39+
"[Optional] Quiet mode.",
40+
41+
"--help" =>
42+
"Display this usage information.",
43+
);
44+
1045
echo "Usage: " . $_SERVER['argv'][0] . " <options>\n";
1146
echo "\n";
1247
echo " Options: \n";
13-
echo " --src Root of the source directory tree or a file (can be repeated for multiple sources).\n";
14-
echo " --exclude [Optional] A directory or file that needs to be excluded (can be repeated for multiple exclusions).\n";
15-
echo " --format [Optional] Output format (html/text/xml/xml_console/console/html_console). Defaults to 'html'.\n";
16-
echo " --outdir [Optional] Report Directory. Defaults to './style-report'.\n";
17-
echo " --config [Optional] The name of the config file'.\n";
18-
echo " --debug [Optional] Add some debug logs (warning, very verbose)'.\n";
19-
echo " --linecount [Optional] Generate a report on the number of lines of code (JavaNCSS format)'.\n";
20-
echo " --progress [Optional] Prints a message noting the file and every line that is covered by PHPCheckStyle.\n";
21-
echo " --lang [Optional] Language file to use for the result (en-us by default).\n";
22-
echo " --quiet [Optional] Quiet mode.\n";
23-
echo " --help Display this usage information.\n";
48+
foreach ($options as $option => $description) {
49+
echo " " . str_pad($option, 16, " ") . $description . "\n";
50+
}
2451
exit();
2552
}
2653

@@ -119,7 +146,7 @@ function usage() {
119146
}
120147

121148
// check that source directory is specified and is valid
122-
if ($options['src'] == false) {
149+
if (!$options['src']) {
123150
echo "\nPlease specify a source directory/file using --src option.\n\n";
124151
usage();
125152
}

runFromWeb.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313
$lange = $_POST['lang'];
1414

1515

16-
if ($_POST['excludeFile']!="") {
16+
if ($_POST['excludeFile']) {
1717
$expFile = explode(',', $_POST['excludeFile']);
1818
$options['exclude'] = $expFile;
19-
}
20-
else {
19+
} else {
2120
$options['exclude'] = array();
2221
}
2322

@@ -40,11 +39,8 @@
4039
}
4140
$style->processFiles($sources, $options['exclude']);
4241

43-
echo "<pre>".print_r($style->_reporter->reporters[0]->outputFile, TRUE)."</pre>";
42+
echo "<pre>" . print_r($style->_reporter->reporters[0]->outputFile, TRUE) . "</pre>";
4443

4544
echo "Reporting Completed.</BR></BR>";
4645

47-
echo 'Display Results : <a href="'.$resultDir.'">'.$resultDir.'</a>';
48-
49-
50-
?>
46+
echo 'Display Results : <a href="' . $resultDir . '">' . $resultDir . '</a>';

0 commit comments

Comments
 (0)