File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 77 * @license https://github.com/olivertappin/phpcs-diff/blob/master/LICENCE.md MIT Licence
88 */
99
10- if (is_file (__DIR__ . '/../../../autoload.php ' ) === true ) {
10+ if (is_file (__DIR__ . '/../../../autoload.php ' )) {
1111 include_once __DIR__ . '/../../../autoload.php ' ;
12- } elseif (is_file (__DIR__ . '/../autoload.php ' ) === true ) {
12+ } elseif (is_file (__DIR__ . '/../autoload.php ' )) {
1313 include_once __DIR__ . '/../autoload.php ' ;
1414} else {
1515 include_once 'vendor/autoload.php ' ;
Original file line number Diff line number Diff line change @@ -196,8 +196,16 @@ public function run()
196196 */
197197 protected function runPhpcs (array $ files = [], $ ruleset = 'ruleset.xml ' )
198198 {
199+ $ exec = 'vendor/bin/phpcs ' ;
200+
201+ if (is_file (__DIR__ . '/../../../bin/phpcs ' )) {
202+ $ exec = __DIR__ . '/../../../bin/phpcs ' ;
203+ } elseif (is_file (__DIR__ . '/../bin/phpcs ' )) {
204+ $ exec = realpath (__DIR__ . '/../bin/phpcs ' );
205+ }
206+
199207 return json_decode (
200- shell_exec (' vendor/bin/phpcs --report=json --standard= ' . $ ruleset . ' ' . implode (' ' , $ files )),
208+ shell_exec ($ exec . ' --report=json --standard= ' . $ ruleset . ' ' . implode (' ' , $ files )),
201209 true
202210 );
203211 }
You can’t perform that action at this time.
0 commit comments