This commit is contained in:
Nicolas Grekas
2022-06-27 15:16:42 +02:00
parent 9eedd60225
commit 5cee9cdc4f
5 changed files with 12 additions and 12 deletions

View File

@@ -50,8 +50,8 @@ class ExecutableFinder
*/
public function find($name, $default = null, array $extraDirs = [])
{
if (ini_get('open_basedir')) {
$searchPath = array_merge(explode(\PATH_SEPARATOR, ini_get('open_basedir')), $extraDirs);
if (\ini_get('open_basedir')) {
$searchPath = array_merge(explode(\PATH_SEPARATOR, \ini_get('open_basedir')), $extraDirs);
$dirs = [];
foreach ($searchPath as $path) {
// Silencing against https://bugs.php.net/69240

View File

@@ -104,7 +104,7 @@ abstract class AbstractPipes implements PipesInterface
stream_set_blocking($input, 0);
} elseif (!isset($this->inputBuffer[0])) {
if (!\is_string($input)) {
if (!is_scalar($input)) {
if (!\is_scalar($input)) {
throw new InvalidArgumentException(sprintf('"%s" yielded a value of type "%s", but only scalars and stream resources are supported.', \get_class($this->input), \gettype($input)));
}
$input = (string) $input;

View File

@@ -48,7 +48,7 @@ class ProcessUtils
if (\is_string($input)) {
return $input;
}
if (is_scalar($input)) {
if (\is_scalar($input)) {
return (string) $input;
}
if ($input instanceof Process) {

View File

@@ -37,7 +37,7 @@ class ExecutableFinderTest extends TestCase
public function testFind()
{
if (ini_get('open_basedir')) {
if (\ini_get('open_basedir')) {
$this->markTestSkipped('Cannot test when open_basedir is set');
}
@@ -51,7 +51,7 @@ class ExecutableFinderTest extends TestCase
public function testFindWithDefault()
{
if (ini_get('open_basedir')) {
if (\ini_get('open_basedir')) {
$this->markTestSkipped('Cannot test when open_basedir is set');
}
@@ -67,7 +67,7 @@ class ExecutableFinderTest extends TestCase
public function testFindWithNullAsDefault()
{
if (ini_get('open_basedir')) {
if (\ini_get('open_basedir')) {
$this->markTestSkipped('Cannot test when open_basedir is set');
}
@@ -82,7 +82,7 @@ class ExecutableFinderTest extends TestCase
public function testFindWithExtraDirs()
{
if (ini_get('open_basedir')) {
if (\ini_get('open_basedir')) {
$this->markTestSkipped('Cannot test when open_basedir is set');
}
@@ -105,7 +105,7 @@ class ExecutableFinderTest extends TestCase
$this->markTestSkipped('Cannot run test on windows');
}
if (ini_get('open_basedir')) {
if (\ini_get('open_basedir')) {
$this->markTestSkipped('Cannot test when open_basedir is set');
}
@@ -122,7 +122,7 @@ class ExecutableFinderTest extends TestCase
*/
public function testFindProcessInOpenBasedir()
{
if (ini_get('open_basedir')) {
if (\ini_get('open_basedir')) {
$this->markTestSkipped('Cannot test when open_basedir is set');
}
if ('\\' === \DIRECTORY_SEPARATOR) {
@@ -140,7 +140,7 @@ class ExecutableFinderTest extends TestCase
public function testFindBatchExecutableOnWindows()
{
if (ini_get('open_basedir')) {
if (\ini_get('open_basedir')) {
$this->markTestSkipped('Cannot test when open_basedir is set');
}
if ('\\' !== \DIRECTORY_SEPARATOR) {

View File

@@ -1133,7 +1133,7 @@ class ProcessTest extends TestCase
public function responsesCodeProvider()
{
return [
//expected output / getter / code to execute
// expected output / getter / code to execute
// [1,'getExitCode','exit(1);'],
// [true,'isSuccessful','exit();'],
['output', 'getOutput', 'echo \'output\';'],