Aggiornato Composer
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
@@ -29,7 +29,7 @@ abstract class AbstractDefaultParametersMatcher extends AbstractContextAwareMatc
|
||||
|
||||
$defaultValue = $this->valueToShortString($parameter->getDefaultValue());
|
||||
|
||||
$parametersProcessed[] = "\${$parameter->getName()} = $defaultValue";
|
||||
$parametersProcessed[] = \sprintf('$%s = %s', $parameter->getName(), $defaultValue);
|
||||
}
|
||||
|
||||
if (empty($parametersProcessed)) {
|
||||
@@ -45,8 +45,6 @@ abstract class AbstractDefaultParametersMatcher extends AbstractContextAwareMatc
|
||||
* This is not 100% true to the original (newlines are inlined, for example).
|
||||
*
|
||||
* @param mixed $value
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function valueToShortString($value): string
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
@@ -48,7 +48,7 @@ abstract class AbstractMatcher
|
||||
*
|
||||
* @param array $tokens Tokenized readline input
|
||||
*
|
||||
* @return bool
|
||||
* @return false
|
||||
*/
|
||||
public function hasMatched(array $tokens): bool
|
||||
{
|
||||
@@ -59,8 +59,6 @@ abstract class AbstractMatcher
|
||||
* Get current readline input word.
|
||||
*
|
||||
* @param array $tokens Tokenized readline input (see token_get_all)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getInput(array $tokens): string
|
||||
{
|
||||
@@ -77,8 +75,6 @@ abstract class AbstractMatcher
|
||||
* Get current namespace and class (if any) from readline input.
|
||||
*
|
||||
* @param array $tokens Tokenized readline input (see token_get_all)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function getNamespaceAndClass(array $tokens): string
|
||||
{
|
||||
@@ -112,8 +108,6 @@ abstract class AbstractMatcher
|
||||
*
|
||||
* @param string $prefix
|
||||
* @param string $word
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function startsWith(string $prefix, string $word): bool
|
||||
{
|
||||
@@ -125,8 +119,6 @@ abstract class AbstractMatcher
|
||||
*
|
||||
* @param mixed $token A PHP token (see token_get_all)
|
||||
* @param string $syntax A syntax pattern (default: variable pattern)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function hasSyntax($token, string $syntax = self::VAR_SYNTAX): bool
|
||||
{
|
||||
@@ -144,8 +136,6 @@ abstract class AbstractMatcher
|
||||
*
|
||||
* @param mixed $token A PHP token (see token_get_all)
|
||||
* @param string $which A PHP token type
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function tokenIs($token, string $which): bool
|
||||
{
|
||||
@@ -160,8 +150,6 @@ abstract class AbstractMatcher
|
||||
* Check whether $token is an operator.
|
||||
*
|
||||
* @param mixed $token A PHP token (see token_get_all)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isOperator($token): bool
|
||||
{
|
||||
@@ -182,8 +170,6 @@ abstract class AbstractMatcher
|
||||
*
|
||||
* @param array $coll A list of token types
|
||||
* @param mixed $token A PHP token (see token_get_all)
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function hasToken(array $coll, $token): bool
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
@@ -36,6 +36,7 @@ class ClassNamesMatcher extends AbstractMatcher
|
||||
// get the number of namespace separators
|
||||
$nsPos = \substr_count($class, '\\');
|
||||
$pieces = \explode('\\', $className);
|
||||
|
||||
// $methods = Mirror::get($class);
|
||||
return \implode('\\', \array_slice($pieces, $nsPos, \count($pieces)));
|
||||
},
|
||||
|
||||
@@ -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.
|
||||
@@ -55,8 +55,6 @@ class CommandsMatcher extends AbstractMatcher
|
||||
* Check whether a command $name is defined.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function isCommand(string $name): bool
|
||||
{
|
||||
@@ -67,8 +65,6 @@ class CommandsMatcher extends AbstractMatcher
|
||||
* Check whether input matches a defined command.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function matchCommand(string $name): bool
|
||||
{
|
||||
@@ -103,9 +99,9 @@ class CommandsMatcher extends AbstractMatcher
|
||||
|
||||
switch (true) {
|
||||
case self::tokenIs($command, self::T_STRING) &&
|
||||
!$this->isCommand($command[1]) &&
|
||||
$this->matchCommand($command[1]) &&
|
||||
empty($tokens):
|
||||
!$this->isCommand($command[1]) &&
|
||||
$this->matchCommand($command[1]) &&
|
||||
empty($tokens):
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
@@ -32,7 +32,7 @@ class KeywordsMatcher extends AbstractMatcher
|
||||
/**
|
||||
* Get all (completable) PHP keywords.
|
||||
*
|
||||
* @return array
|
||||
* @return string[]
|
||||
*/
|
||||
public function getKeywords(): array
|
||||
{
|
||||
@@ -43,8 +43,6 @@ class KeywordsMatcher extends AbstractMatcher
|
||||
* Check whether $keyword is a (completable) PHP keyword.
|
||||
*
|
||||
* @param string $keyword
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isKeyword(string $keyword): bool
|
||||
{
|
||||
@@ -75,7 +73,7 @@ class KeywordsMatcher extends AbstractMatcher
|
||||
case self::hasToken([self::T_OPEN_TAG, self::T_VARIABLE], $token):
|
||||
// case is_string($token) && $token === '$':
|
||||
case self::hasToken([self::T_OPEN_TAG, self::T_VARIABLE], $prevToken) &&
|
||||
self::tokenIs($token, self::T_STRING):
|
||||
self::tokenIs($token, self::T_STRING):
|
||||
case self::isOperator($token):
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user