@@ -285,6 +285,8 @@ public function getDefaults()
285
285
$ defaults ['bootstrap ' ] = array ();
286
286
$ defaults ['errorSeverity ' ] = null ;
287
287
$ defaults ['warningSeverity ' ] = null ;
288
+ $ defaults ['stdin ' ] = null ;
289
+ $ defaults ['editorPath ' ] = null ;
288
290
289
291
$ reportFormat = PHP_CodeSniffer::getConfigData ('report_format ' );
290
292
if ($ reportFormat !== null ) {
@@ -704,6 +706,17 @@ public function processLongArgument($arg, $pos)
704
706
$ this ->values ['errorSeverity ' ] = (int ) substr ($ arg , 15 );
705
707
} else if (substr ($ arg , 0 , 17 ) === 'warning-severity= ' ) {
706
708
$ this ->values ['warningSeverity ' ] = (int ) substr ($ arg , 17 );
709
+ } else if (substr ($ arg , 0 , 12 ) === 'editor-path= ' ) {
710
+ $ value = substr ($ arg , 12 );
711
+ if (preg_match ('/^[ \'\"]/ ' , $ value , $ matches )) {
712
+ while (0 === preg_match ("/[ {$ matches [0 ]}]$/ " , $ value )) {
713
+ $ value .= ' ' .$ this ->_cliArgs [++$ pos ];
714
+ $ this ->_cliArgs [$ pos ] = '' ;
715
+ }
716
+ $ value = substr ($ value , 1 , -1 );
717
+ }
718
+
719
+ $ this ->values ['editorPath ' ] = $ value ;
707
720
} else if (substr ($ arg , 0 , 7 ) === 'ignore= ' ) {
708
721
// Split the ignore string on commas, unless the comma is escaped
709
722
// using 1 or 3 slashes (\, or \\\,).
@@ -847,6 +860,7 @@ public function process($values=array())
847
860
$ phpcs ->setTabWidth ($ values ['tabWidth ' ]);
848
861
$ phpcs ->setEncoding ($ values ['encoding ' ]);
849
862
$ phpcs ->setInteractive ($ values ['interactive ' ]);
863
+ $ phpcs ->setEditorPath ($ values ['editorPath ' ]);
850
864
851
865
// Set file extensions if they were specified. Otherwise,
852
866
// let PHP_CodeSniffer decide on the defaults.
@@ -1185,7 +1199,7 @@ public function printUsage()
1185
1199
*/
1186
1200
public function printPHPCSUsage ()
1187
1201
{
1188
- echo 'Usage: phpcs [-nwlsaepvi] [-d key[=value]] [--colors] [--no-colors] ' .PHP_EOL ;
1202
+ echo 'Usage: phpcs [-nwlsaepvi] [-d key[=value]] [--colors] [--no-colors] [--editor-path=<path>] ' .PHP_EOL ;
1189
1203
echo ' [--report=<report>] [--report-file=<reportFile>] [--report-<report>=<reportFile>] ... ' .PHP_EOL ;
1190
1204
echo ' [--report-width=<reportWidth>] [--generator=<generator>] [--tab-width=<tabWidth>] ' .PHP_EOL ;
1191
1205
echo ' [--severity=<severity>] [--error-severity=<severity>] [--warning-severity=<severity>] ' .PHP_EOL ;
0 commit comments