Mercurial > hg > cmmr2012-drupal-site
diff vendor/psy/psysh/src/Configuration.php @ 4:a9cd425dd02b
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:11:55 +0000 |
parents | c75dbcec494b |
children |
line wrap: on
line diff
--- a/vendor/psy/psysh/src/Configuration.php Thu Feb 28 11:14:44 2019 +0000 +++ b/vendor/psy/psysh/src/Configuration.php Thu Feb 28 13:11:55 2019 +0000 @@ -114,7 +114,7 @@ // explicit configFile option if (isset($config['configFile'])) { $this->configFile = $config['configFile']; - } elseif ($configFile = getenv('PSYSH_CONFIG')) { + } elseif ($configFile = \getenv('PSYSH_CONFIG')) { $this->configFile = $configFile; } @@ -145,8 +145,8 @@ public function init() { // feature detection - $this->hasReadline = function_exists('readline'); - $this->hasPcntl = function_exists('pcntl_signal') && function_exists('posix_getpid'); + $this->hasReadline = \function_exists('readline'); + $this->hasPcntl = \function_exists('pcntl_signal') && \function_exists('posix_getpid'); if ($configFile = $this->getConfigFile()) { $this->loadConfigFile($configFile); @@ -180,9 +180,9 @@ $files = ConfigPaths::getConfigFiles(['config.php', 'rc.php'], $this->configDir); if (!empty($files)) { - if ($this->warnOnMultipleConfigs && count($files) > 1) { - $msg = sprintf('Multiple configuration files found: %s. Using %s', implode($files, ', '), $files[0]); - trigger_error($msg, E_USER_NOTICE); + if ($this->warnOnMultipleConfigs && \count($files) > 1) { + $msg = \sprintf('Multiple configuration files found: %s. Using %s', \implode($files, ', '), $files[0]); + \trigger_error($msg, E_USER_NOTICE); } return $files[0]; @@ -199,9 +199,9 @@ */ public function getLocalConfigFile() { - $localConfig = getcwd() . '/.psysh.php'; + $localConfig = \getcwd() . '/.psysh.php'; - if (@is_file($localConfig)) { + if (@\is_file($localConfig)) { return $localConfig; } } @@ -215,7 +215,7 @@ { foreach (self::$AVAILABLE_OPTIONS as $option) { if (isset($options[$option])) { - $method = 'set' . ucfirst($option); + $method = 'set' . \ucfirst($option); $this->$method($options[$option]); } } @@ -223,14 +223,14 @@ // legacy `tabCompletion` option if (isset($options['tabCompletion'])) { $msg = '`tabCompletion` is deprecated; use `useTabCompletion` instead.'; - @trigger_error($msg, E_USER_DEPRECATED); + @\trigger_error($msg, E_USER_DEPRECATED); $this->setUseTabCompletion($options['tabCompletion']); } foreach (['commands', 'matchers', 'casters'] as $option) { if (isset($options[$option])) { - $method = 'add' . ucfirst($option); + $method = 'add' . \ucfirst($option); $this->$method($options[$option]); } } @@ -238,7 +238,7 @@ // legacy `tabCompletionMatchers` option if (isset($options['tabCompletionMatchers'])) { $msg = '`tabCompletionMatchers` is deprecated; use `matchers` instead.'; - @trigger_error($msg, E_USER_DEPRECATED); + @\trigger_error($msg, E_USER_DEPRECATED); $this->addMatchers($options['tabCompletionMatchers']); } @@ -267,7 +267,7 @@ $result = $load($this); if (!empty($result)) { - if (is_array($result)) { + if (\is_array($result)) { $this->loadConfig($result); } else { throw new \InvalidArgumentException('Psy Shell configuration must return an array of options'); @@ -359,8 +359,8 @@ $this->runtimeDir = ConfigPaths::getRuntimeDir(); } - if (!is_dir($this->runtimeDir)) { - mkdir($this->runtimeDir, 0700, true); + if (!\is_dir($this->runtimeDir)) { + \mkdir($this->runtimeDir, 0700, true); } return $this->runtimeDir; @@ -393,9 +393,9 @@ $files = ConfigPaths::getConfigFiles(['psysh_history', 'history'], $this->configDir); if (!empty($files)) { - if ($this->warnOnMultipleConfigs && count($files) > 1) { - $msg = sprintf('Multiple history files found: %s. Using %s', implode($files, ', '), $files[0]); - trigger_error($msg, E_USER_NOTICE); + if ($this->warnOnMultipleConfigs && \count($files) > 1) { + $msg = \sprintf('Multiple history files found: %s. Using %s', \implode($files, ', '), $files[0]); + \trigger_error($msg, E_USER_NOTICE); } $this->setHistoryFile($files[0]); @@ -462,7 +462,7 @@ */ public function getTempFile($type, $pid) { - return tempnam($this->getRuntimeDir(), $type . '_' . $pid . '_'); + return \tempnam($this->getRuntimeDir(), $type . '_' . $pid . '_'); } /** @@ -477,7 +477,7 @@ */ public function getPipe($type, $pid) { - return sprintf('%s/%s_%s', $this->getRuntimeDir(), $type, $pid); + return \sprintf('%s/%s_%s', $this->getRuntimeDir(), $type, $pid); } /** @@ -861,7 +861,7 @@ */ public function setPager($pager) { - if ($pager && !is_string($pager) && !$pager instanceof OutputPager) { + if ($pager && !\is_string($pager) && !$pager instanceof OutputPager) { throw new \InvalidArgumentException('Unexpected pager instance'); } @@ -879,10 +879,10 @@ public function getPager() { if (!isset($this->pager) && $this->usePcntl()) { - if ($pager = ini_get('cli.pager')) { + if ($pager = \ini_get('cli.pager')) { // use the default pager $this->pager = $pager; - } elseif ($less = exec('which less 2>/dev/null')) { + } elseif ($less = \exec('which less 2>/dev/null')) { // check for the presence of less... $this->pager = $less . ' -R -S -F -X'; } @@ -937,7 +937,7 @@ */ public function addMatchers(array $matchers) { - $this->newMatchers = array_merge($this->newMatchers, $matchers); + $this->newMatchers = \array_merge($this->newMatchers, $matchers); if (isset($this->shell)) { $this->doAddMatchers(); } @@ -977,7 +977,7 @@ */ public function addCommands(array $commands) { - $this->newCommands = array_merge($this->newCommands, $commands); + $this->newCommands = \array_merge($this->newCommands, $commands); if (isset($this->shell)) { $this->doAddCommands(); } @@ -1033,9 +1033,9 @@ $files = ConfigPaths::getDataFiles(['php_manual.sqlite'], $this->dataDir); if (!empty($files)) { - if ($this->warnOnMultipleConfigs && count($files) > 1) { - $msg = sprintf('Multiple manual database files found: %s. Using %s', implode($files, ', '), $files[0]); - trigger_error($msg, E_USER_NOTICE); + if ($this->warnOnMultipleConfigs && \count($files) > 1) { + $msg = \sprintf('Multiple manual database files found: %s. Using %s', \implode($files, ', '), $files[0]); + \trigger_error($msg, E_USER_NOTICE); } return $this->manualDbFile = $files[0]; @@ -1051,7 +1051,7 @@ { if (!isset($this->manualDb)) { $dbFile = $this->getManualDbFile(); - if (is_file($dbFile)) { + if (\is_file($dbFile)) { try { $this->manualDb = new \PDO('sqlite:' . $dbFile); } catch (\PDOException $e) { @@ -1133,7 +1133,7 @@ self::COLOR_MODE_DISABLED, ]; - if (in_array($colorMode, $validColorModes)) { + if (\in_array($colorMode, $validColorModes)) { $this->colorMode = $colorMode; } else { throw new \InvalidArgumentException('invalid color mode: ' . $colorMode); @@ -1226,7 +1226,7 @@ Checker::NEVER, ]; - if (!in_array($interval, $validIntervals)) { + if (!\in_array($interval, $validIntervals)) { throw new \InvalidArgumentException('invalid update check interval: ' . $interval); }