Skip to content

Commit e714dc8

Browse files
author
Spencer Rinehart
committed
Use phpcs as a library.
Rather than executing phpcs via passthru, pull it in as a library. This enables more programmatic access to it.
1 parent 26e8f3d commit e714dc8

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

build.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@
88
exit(1);
99
}
1010

11-
passthru('./vendor/bin/phpcs --standard=' . __DIR__ . '/vendor/dominionenterprises/dws-coding-standard/DWS -n src tests *.php', $returnStatus);
12-
if ($returnStatus !== 0) {
11+
require 'vendor/autoload.php';
12+
13+
$phpcsCLI = new PHP_CodeSniffer_CLI();
14+
$phpcsArguments = array(
15+
'standard' => array(__DIR__ . '/vendor/dominionenterprises/dws-coding-standard/DWS'),
16+
'files' => array('src', 'tests', 'build.php'),
17+
'warningSeverity' => 0,
18+
);
19+
$phpcsViolations = $phpcsCLI->process($phpcsArguments);
20+
if ($phpcsViolations > 0) {
1321
exit(1);
1422
}
1523

0 commit comments

Comments
 (0)