Aggiornato Composer

This commit is contained in:
Paolo A
2024-05-17 12:24:19 +00:00
parent 4ac62108b5
commit ec201d75b2
2238 changed files with 38684 additions and 59785 deletions

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Psy Shell.
*
* (c) 2012-2022 Justin Hileman
* (c) 2012-2023 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -39,7 +39,7 @@ class CodeArgument extends InputArgument
*
* @throws \InvalidArgumentException When argument mode is not valid
*/
public function __construct(string $name, int $mode = null, string $description = '', $default = null)
public function __construct(string $name, ?int $mode = null, string $description = '', $default = null)
{
if ($mode & InputArgument::IS_ARRAY) {
throw new \InvalidArgumentException('Argument mode IS_ARRAY is not valid');

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Psy Shell.
*
* (c) 2012-2022 Justin Hileman
* (c) 2012-2023 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -73,8 +73,6 @@ class FilterOptions
/**
* Check whether the bound input has filter options.
*
* @return bool
*/
public function hasFilter(): bool
{
@@ -86,10 +84,8 @@ class FilterOptions
*
* @param string $string
* @param array $matches
*
* @return bool
*/
public function match(string $string, array &$matches = null): bool
public function match(string $string, ?array &$matches = null): bool
{
return $this->filter === false || (\preg_match($this->pattern, $string, $matches) xor $this->invert);
}
@@ -116,8 +112,6 @@ class FilterOptions
* Check whether a string appears to be a regular expression.
*
* @param string $string
*
* @return bool
*/
private function stringIsRegex(string $string): bool
{

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Psy Shell.
*
* (c) 2012-2022 Justin Hileman
* (c) 2012-2023 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -19,6 +19,8 @@ use Symfony\Component\Console\Input\StringInput;
*/
class ShellInput extends StringInput
{
public const REGEX_STRING = '([^\s]+?)(?:\s|(?<!\\\\)"|(?<!\\\\)\'|$)';
private $hasCodeArgument = false;
/**
@@ -45,7 +47,7 @@ class ShellInput extends StringInput
*
* @throws \InvalidArgumentException if $definition has CodeArgument before the final argument position
*/
public function bind(InputDefinition $definition)
public function bind(InputDefinition $definition): void
{
$hasCodeArgument = false;
@@ -66,7 +68,7 @@ class ShellInput extends StringInput
$this->hasCodeArgument = $hasCodeArgument;
return parent::bind($definition);
parent::bind($definition);
}
/**
@@ -98,7 +100,7 @@ class ShellInput extends StringInput
\stripcslashes(\substr($match[0], 1, \strlen($match[0]) - 2)),
\stripcslashes(\substr($input, $cursor)),
];
} elseif (\preg_match('/'.StringInput::REGEX_STRING.'/A', $input, $match, 0, $cursor)) {
} elseif (\preg_match('/'.self::REGEX_STRING.'/A', $input, $match, 0, $cursor)) {
$tokens[] = [
\stripcslashes($match[1]),
\stripcslashes(\substr($input, $cursor)),
@@ -119,7 +121,7 @@ class ShellInput extends StringInput
/**
* Same as parent, but with some bonus handling for code arguments.
*/
protected function parse()
protected function parse(): void
{
$parseOptions = true;
$this->parsed = $this->tokenPairs;

View File

@@ -3,7 +3,7 @@
/*
* This file is part of Psy Shell.
*
* (c) 2012-2022 Justin Hileman
* (c) 2012-2023 Justin Hileman
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -34,8 +34,6 @@ class SilentInput
/**
* To. String.
*
* @return string
*/
public function __toString(): string
{