We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 278b643 commit fbe5bfbCopy full SHA for fbe5bfb
src/Util/Standards.php
@@ -10,6 +10,7 @@
10
namespace PHP_CodeSniffer\Util;
11
12
use PHP_CodeSniffer\Config;
13
+use Phar;
14
15
class Standards
16
{
@@ -33,9 +34,17 @@ public static function getInstalledStandardPaths()
33
34
}
35
36
$resolvedInstalledPaths = [];
37
+
38
+ $phar = Phar::running(false);
39
+ if (strlen($phar) > 0) {
40
+ $baseDir = dirname($phar);
41
+ } else {
42
+ $baseDir = __DIR__.$ds.'..'.$ds.'..';
43
+ }
44
45
foreach ($installedPaths as $installedPath) {
46
if (substr($installedPath, 0, 1) === '.') {
- $installedPath = Common::realPath(__DIR__.$ds.'..'.$ds.'..'.$ds.$installedPath);
47
+ $installedPath = Common::realPath($baseDir.$ds.$installedPath);
48
if ($installedPath === false) {
49
continue;
50
0 commit comments