1717use PHP_CodeSniffer \Exceptions \DeepExitException ;
1818use PHP_CodeSniffer \Exceptions \RuntimeException ;
1919use PHP_CodeSniffer \Util \Common ;
20+ use PHP_CodeSniffer \Util \Standards ;
2021
2122/**
2223 * Stores the configuration used to run PHPCS and PHPCBF.
@@ -267,7 +268,7 @@ public function __set($name, $value)
267268 $ cleaned = [];
268269
269270 // Check if the standard name is valid, or if the case is invalid.
270- $ installedStandards = Util \ Standards::getInstalledStandards ();
271+ $ installedStandards = Standards::getInstalledStandards ();
271272 foreach ($ value as $ standard ) {
272273 foreach ($ installedStandards as $ validStandard ) {
273274 if (strtolower ($ standard ) === strtolower ($ validStandard )) {
@@ -422,7 +423,7 @@ public function __construct(array $cliArgs=[], $dieOnUnknownArg=true)
422423
423424 // Check for content on STDIN.
424425 if ($ this ->stdin === true
425- || (Util \ Common::isStdinATTY () === false
426+ || (Common::isStdinATTY () === false
426427 && feof ($ handle ) === false )
427428 ) {
428429 $ readStreams = [$ handle ];
@@ -649,7 +650,7 @@ public function processShortArgument($arg, $pos)
649650 throw new DeepExitException ($ output , 0 );
650651 case 'i ' :
651652 ob_start ();
652- Util \ Standards::printInstalledStandards ();
653+ Standards::printInstalledStandards ();
653654 $ output = ob_get_contents ();
654655 ob_end_clean ();
655656 throw new DeepExitException ($ output , 0 );
@@ -922,7 +923,7 @@ public function processLongArgument($arg, $pos)
922923 $ this ->cache = true ;
923924 $ this ->overriddenDefaults ['cache ' ] = true ;
924925
925- $ this ->cacheFile = Util \ Common::realpath (substr ($ arg , 6 ));
926+ $ this ->cacheFile = Common::realpath (substr ($ arg , 6 ));
926927
927928 // It may not exist and return false instead.
928929 if ($ this ->cacheFile === false ) {
@@ -941,9 +942,9 @@ public function processLongArgument($arg, $pos)
941942 } else {
942943 if ($ dir [0 ] === '/ ' ) {
943944 // An absolute path.
944- $ dir = Util \ Common::realpath ($ dir );
945+ $ dir = Common::realpath ($ dir );
945946 } else {
946- $ dir = Util \ Common::realpath (getcwd ().'/ ' .$ dir );
947+ $ dir = Common::realpath (getcwd ().'/ ' .$ dir );
947948 }
948949
949950 if ($ dir !== false ) {
@@ -964,7 +965,7 @@ public function processLongArgument($arg, $pos)
964965 $ files = explode (', ' , substr ($ arg , 10 ));
965966 $ bootstrap = [];
966967 foreach ($ files as $ file ) {
967- $ path = Util \ Common::realpath ($ file );
968+ $ path = Common::realpath ($ file );
968969 if ($ path === false ) {
969970 $ error = 'ERROR: The specified bootstrap file " ' .$ file .'" does not exist ' .PHP_EOL .PHP_EOL ;
970971 $ error .= $ this ->printShortUsage (true );
@@ -978,7 +979,7 @@ public function processLongArgument($arg, $pos)
978979 $ this ->overriddenDefaults ['bootstrap ' ] = true ;
979980 } else if (substr ($ arg , 0 , 10 ) === 'file-list= ' ) {
980981 $ fileList = substr ($ arg , 10 );
981- $ path = Util \ Common::realpath ($ fileList );
982+ $ path = Common::realpath ($ fileList );
982983 if ($ path === false ) {
983984 $ error = 'ERROR: The specified file list " ' .$ fileList .'" does not exist ' .PHP_EOL .PHP_EOL ;
984985 $ error .= $ this ->printShortUsage (true );
@@ -1001,7 +1002,7 @@ public function processLongArgument($arg, $pos)
10011002 break ;
10021003 }
10031004
1004- $ this ->stdinPath = Util \ Common::realpath (substr ($ arg , 11 ));
1005+ $ this ->stdinPath = Common::realpath (substr ($ arg , 11 ));
10051006
10061007 // It may not exist and return false instead, so use whatever they gave us.
10071008 if ($ this ->stdinPath === false ) {
@@ -1014,13 +1015,13 @@ public function processLongArgument($arg, $pos)
10141015 break ;
10151016 }
10161017
1017- $ this ->reportFile = Util \ Common::realpath (substr ($ arg , 12 ));
1018+ $ this ->reportFile = Common::realpath (substr ($ arg , 12 ));
10181019
10191020 // It may not exist and return false instead.
10201021 if ($ this ->reportFile === false ) {
10211022 $ this ->reportFile = substr ($ arg , 12 );
10221023
1023- $ dir = Util \ Common::realpath (dirname ($ this ->reportFile ));
1024+ $ dir = Common::realpath (dirname ($ this ->reportFile ));
10241025 if (is_dir ($ dir ) === false ) {
10251026 $ error = 'ERROR: The specified report file path " ' .$ this ->reportFile .'" points to a non-existent directory ' .PHP_EOL .PHP_EOL ;
10261027 $ error .= $ this ->printShortUsage (true );
@@ -1056,7 +1057,7 @@ public function processLongArgument($arg, $pos)
10561057 break ;
10571058 }
10581059
1059- $ this ->basepath = Util \ Common::realpath (substr ($ arg , 9 ));
1060+ $ this ->basepath = Common::realpath (substr ($ arg , 9 ));
10601061
10611062 // It may not exist and return false instead.
10621063 if ($ this ->basepath === false ) {
@@ -1083,7 +1084,7 @@ public function processLongArgument($arg, $pos)
10831084 if ($ output === false ) {
10841085 $ output = null ;
10851086 } else {
1086- $ dir = Util \ Common::realpath (dirname ($ output ));
1087+ $ dir = Common::realpath (dirname ($ output ));
10871088 if (is_dir ($ dir ) === false ) {
10881089 $ error = 'ERROR: The specified ' .$ report .' report file path " ' .$ output .'" points to a non-existent directory ' .PHP_EOL .PHP_EOL ;
10891090 $ error .= $ this ->printShortUsage (true );
@@ -1299,7 +1300,7 @@ public function processFilePath($path)
12991300 return ;
13001301 }
13011302
1302- $ file = Util \ Common::realpath ($ path );
1303+ $ file = Common::realpath ($ path );
13031304 if (file_exists ($ file ) === false ) {
13041305 if ($ this ->dieOnUnknownArg === false ) {
13051306 return ;
@@ -1633,7 +1634,7 @@ public function setConfigData($key, $value, $temp=false)
16331634 // If the installed paths are being set, make sure all known
16341635 // standards paths are added to the autoloader.
16351636 if ($ key === 'installed_paths ' ) {
1636- $ installedStandards = Util \ Standards::getInstalledStandardDetails ();
1637+ $ installedStandards = Standards::getInstalledStandardDetails ();
16371638 foreach ($ installedStandards as $ name => $ details ) {
16381639 Autoload::addSearchPath ($ details ['path ' ], $ details ['namespace ' ]);
16391640 }
0 commit comments