Mercurial > hg > isophonics-drupal-site
diff vendor/psy/psysh/src/functions.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | c2387f117808 |
children |
line wrap: on
line diff
--- a/vendor/psy/psysh/src/functions.php Tue Jul 10 15:07:59 2018 +0100 +++ b/vendor/psy/psysh/src/functions.php Thu Feb 28 13:21:36 2019 +0000 @@ -18,7 +18,7 @@ use Symfony\Component\Console\Input\InputOption; use XdgBaseDir\Xdg; -if (!function_exists('Psy\sh')) { +if (!\function_exists('Psy\sh')) { /** * Command to return the eval-able code to startup PsySH. * @@ -32,7 +32,7 @@ } } -if (!function_exists('Psy\debug')) { +if (!\function_exists('Psy\debug')) { /** * Invoke a Psy Shell from the current context. * @@ -89,7 +89,7 @@ $sh->addInput('whereami -n2', true); } - if (is_string($bindTo)) { + if (\is_string($bindTo)) { $sh->setBoundClass($bindTo); } elseif ($bindTo !== null) { $sh->setBoundObject($bindTo); @@ -101,7 +101,7 @@ } } -if (!function_exists('Psy\info')) { +if (!\function_exists('Psy\info')) { /** * Get a bunch of debugging info about the current PsySH environment and * configuration. @@ -123,12 +123,12 @@ } $xdg = new Xdg(); - $home = rtrim(str_replace('\\', '/', $xdg->getHomeDir()), '/'); - $homePattern = '#^' . preg_quote($home, '#') . '/#'; + $home = \rtrim(\str_replace('\\', '/', $xdg->getHomeDir()), '/'); + $homePattern = '#^' . \preg_quote($home, '#') . '/#'; $prettyPath = function ($path) use ($homePattern) { - if (is_string($path)) { - return preg_replace($homePattern, '~/', $path); + if (\is_string($path)) { + return \preg_replace($homePattern, '~/', $path); } else { return $path; } @@ -146,7 +146,7 @@ 'config file' => [ 'default config file' => $prettyPath($config->getConfigFile()), 'local config file' => $prettyPath($config->getLocalConfigFile()), - 'PSYSH_CONFIG env' => $prettyPath(getenv('PSYSH_CONFIG')), + 'PSYSH_CONFIG env' => $prettyPath(\getenv('PSYSH_CONFIG')), ], // 'config dir' => $config->getConfigDir(), // 'data dir' => $config->getDataDir(), @@ -171,12 +171,12 @@ ]; if ($config->hasReadline()) { - $info = readline_info(); + $info = \readline_info(); $readline = [ 'readline available' => true, 'readline enabled' => $config->useReadline(), - 'readline service' => get_class($config->getReadline()), + 'readline service' => \get_class($config->getReadline()), ]; if (isset($info['library_version'])) { @@ -193,12 +193,12 @@ } $pcntl = [ - 'pcntl available' => function_exists('pcntl_signal'), - 'posix available' => function_exists('posix_getpid'), + 'pcntl available' => \function_exists('pcntl_signal'), + 'posix available' => \function_exists('posix_getpid'), ]; - $disabledFuncs = array_map('trim', explode(',', ini_get('disable_functions'))); - if (in_array('pcntl_signal', $disabledFuncs) || in_array('pcntl_fork', $disabledFuncs)) { + $disabledFuncs = \array_map('trim', \explode(',', \ini_get('disable_functions'))); + if (\in_array('pcntl_signal', $disabledFuncs) || \in_array('pcntl_fork', $disabledFuncs)) { $pcntl['pcntl disabled'] = true; } @@ -226,7 +226,7 @@ $val = $d->format(\DateTime::RFC2822); break; } - $key = 'db ' . str_replace('_', ' ', $key); + $key = 'db ' . \str_replace('_', ' ', $key); $docs[$key] = $val; } } else { @@ -243,25 +243,25 @@ $autocomplete = [ 'tab completion enabled' => $config->useTabCompletion(), - 'custom matchers' => array_map('get_class', $config->getTabCompletionMatchers()), + 'custom matchers' => \array_map('get_class', $config->getTabCompletionMatchers()), 'bracketed paste' => $config->useBracketedPaste(), ]; // Shenanigans, but totally justified. if ($shell = Sudo::fetchProperty($config, 'shell')) { - $core['loop listeners'] = array_map('get_class', Sudo::fetchProperty($shell, 'loopListeners')); - $core['commands'] = array_map('get_class', $shell->all()); + $core['loop listeners'] = \array_map('get_class', Sudo::fetchProperty($shell, 'loopListeners')); + $core['commands'] = \array_map('get_class', $shell->all()); - $autocomplete['custom matchers'] = array_map('get_class', Sudo::fetchProperty($shell, 'matchers')); + $autocomplete['custom matchers'] = \array_map('get_class', Sudo::fetchProperty($shell, 'matchers')); } // @todo Show Presenter / custom casters. - return array_merge($core, compact('updates', 'pcntl', 'readline', 'history', 'docs', 'autocomplete')); + return \array_merge($core, \compact('updates', 'pcntl', 'readline', 'history', 'docs', 'autocomplete')); } } -if (!function_exists('Psy\bin')) { +if (!\function_exists('Psy\bin')) { /** * `psysh` command line executable. * @@ -313,7 +313,7 @@ } $version = $shell->getVersion(); - $name = basename(reset($_SERVER['argv'])); + $name = \basename(\reset($_SERVER['argv'])); echo <<<EOL $version