Skip to content

Commit 77a6836

Browse files
committed
2 parents 188a53e + d1943dc commit 77a6836

File tree

3 files changed

+8
-29
lines changed

3 files changed

+8
-29
lines changed

src/Config.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,6 +1516,14 @@ public static function getExecutablePath($name)
15161516
return $data;
15171517
}
15181518

1519+
if ($name === "php") {
1520+
/*
1521+
* For php, we know the executable path. There's no need to look it up.
1522+
*/
1523+
1524+
return PHP_BINARY;
1525+
}
1526+
15191527
if (array_key_exists($name, self::$executablePaths) === true) {
15201528
return self::$executablePaths[$name];
15211529
}

src/Standards/Generic/Sniffs/PHP/SyntaxSniff.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@ public function process(File $phpcsFile, $stackPtr)
5050
{
5151
if ($this->phpPath === null) {
5252
$this->phpPath = Config::getExecutablePath('php');
53-
if ($this->phpPath === null) {
54-
// PHP_BINARY is available in PHP 5.4+.
55-
if (defined('PHP_BINARY') === true) {
56-
$this->phpPath = PHP_BINARY;
57-
} else {
58-
return;
59-
}
60-
}
6153
}
6254

6355
$fileName = escapeshellarg($phpcsFile->getFilename());

src/Standards/Generic/Tests/PHP/SyntaxUnitTest.php

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,6 @@ class SyntaxUnitTest extends AbstractSniffUnitTest
1717
{
1818

1919

20-
/**
21-
* Should this test be skipped for some reason.
22-
*
23-
* @return void
24-
*/
25-
protected function shouldSkipTest()
26-
{
27-
if (defined('PHP_BINARY') === true) {
28-
return false;
29-
}
30-
31-
$phpPath = Config::getExecutablePath('php');
32-
if ($phpPath === null) {
33-
return true;
34-
}
35-
36-
return false;
37-
38-
}//end shouldSkipTest()
39-
40-
4120
/**
4221
* Returns the lines where errors should occur.
4322
*

0 commit comments

Comments
 (0)