1
0
Fork 0

update composer/pcre to 1.0.1 (#10496)

pull/10512/head
Markus Staab 2022-02-02 21:35:37 +01:00 committed by GitHub
parent db8ea45295
commit 6be6ce7d9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 34 additions and 30 deletions

14
composer.lock generated
View File

@ -153,23 +153,23 @@
}, },
{ {
"name": "composer/pcre", "name": "composer/pcre",
"version": "1.0.0", "version": "1.0.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/composer/pcre.git", "url": "https://github.com/composer/pcre.git",
"reference": "3d322d715c43a1ac36c7fe215fa59336265500f2" "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/composer/pcre/zipball/3d322d715c43a1ac36c7fe215fa59336265500f2", "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560",
"reference": "3d322d715c43a1ac36c7fe215fa59336265500f2", "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^5.3.2 || ^7.0 || ^8.0" "php": "^5.3.2 || ^7.0 || ^8.0"
}, },
"require-dev": { "require-dev": {
"phpstan/phpstan": "^1", "phpstan/phpstan": "^1.3",
"phpstan/phpstan-strict-rules": "^1.1", "phpstan/phpstan-strict-rules": "^1.1",
"symfony/phpunit-bridge": "^4.2 || ^5" "symfony/phpunit-bridge": "^4.2 || ^5"
}, },
@ -204,7 +204,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/composer/pcre/issues", "issues": "https://github.com/composer/pcre/issues",
"source": "https://github.com/composer/pcre/tree/1.0.0" "source": "https://github.com/composer/pcre/tree/1.0.1"
}, },
"funding": [ "funding": [
{ {
@ -220,7 +220,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2021-12-06T15:17:27+00:00" "time": "2022-01-21T20:24:37+00:00"
}, },
{ {
"name": "composer/semver", "name": "composer/semver",

View File

@ -20,10 +20,10 @@ use Composer\Pcre\Preg;
*/ */
class PhpFileCleaner class PhpFileCleaner
{ {
/** @var array<array{name: string, length: int, pattern: string}> */ /** @var array<array{name: string, length: int, pattern: non-empty-string}> */
private static $typeConfig; private static $typeConfig;
/** @var string */ /** @var non-empty-string */
private static $restPattern; private static $restPattern;
/** /**
@ -266,7 +266,7 @@ class PhpFileCleaner
} }
/** /**
* @param string $regex * @param non-empty-string $regex
* @param ?array<int, string> $match * @param ?array<int, string> $match
* @return bool * @return bool
*/ */

View File

@ -15,12 +15,12 @@ use Composer\Semver\Intervals;
final class IgnoreListPlatformRequirementFilter implements PlatformRequirementFilterInterface final class IgnoreListPlatformRequirementFilter implements PlatformRequirementFilterInterface
{ {
/** /**
* @var string * @var non-empty-string
*/ */
private $ignoreRegex; private $ignoreRegex;
/** /**
* @var string * @var non-empty-string
*/ */
private $ignoreUpperBoundRegex; private $ignoreUpperBoundRegex;

View File

@ -26,7 +26,7 @@ abstract class BaseExcludeFilter
protected $sourcePath; protected $sourcePath;
/** /**
* @var array<array{0: string, 1: bool, 2: bool}> array of [$pattern, $negate, $stripLeadingSlash] arrays * @var array<array{0: non-empty-string, 1: bool, 2: bool}> array of [$pattern, $negate, $stripLeadingSlash] arrays
*/ */
protected $excludePatterns; protected $excludePatterns;
@ -78,7 +78,7 @@ abstract class BaseExcludeFilter
* @param string[] $lines A set of lines to be parsed * @param string[] $lines A set of lines to be parsed
* @param callable $lineParser The parser to be used on each line * @param callable $lineParser The parser to be used on each line
* *
* @return array<array{0: string, 1: bool, 2: bool}> Exclude patterns to be used in filter() * @return array<array{0: non-empty-string, 1: bool, 2: bool}> Exclude patterns to be used in filter()
*/ */
protected function parseLines(array $lines, $lineParser) protected function parseLines(array $lines, $lineParser)
{ {
@ -106,7 +106,7 @@ abstract class BaseExcludeFilter
* *
* @param string[] $rules A list of exclude rules in gitignore syntax * @param string[] $rules A list of exclude rules in gitignore syntax
* *
* @return array<int, array{0: string, 1: bool, 2: bool}> Exclude patterns * @return array<int, array{0: non-empty-string, 1: bool, 2: bool}> Exclude patterns
*/ */
protected function generatePatterns($rules) protected function generatePatterns($rules)
{ {
@ -123,7 +123,7 @@ abstract class BaseExcludeFilter
* *
* @param string $rule An exclude rule in gitignore syntax * @param string $rule An exclude rule in gitignore syntax
* *
* @return array{0: string, 1: bool, 2: bool} An exclude pattern * @return array{0: non-empty-string, 1: bool, 2: bool} An exclude pattern
*/ */
protected function generatePattern($rule) protected function generatePattern($rule)
{ {

View File

@ -254,8 +254,8 @@ abstract class BasePackage implements PackageInterface
* Build a regexp from a package name, expanding * globs as required * Build a regexp from a package name, expanding * globs as required
* *
* @param string $allowPattern * @param string $allowPattern
* @param string $wrap Wrap the cleaned string by the given string * @param non-empty-string $wrap Wrap the cleaned string by the given string
* @return string * @return non-empty-string
*/ */
public static function packageNameToRegexp($allowPattern, $wrap = '{^%s$}i') public static function packageNameToRegexp($allowPattern, $wrap = '{^%s$}i')
{ {
@ -268,8 +268,8 @@ abstract class BasePackage implements PackageInterface
* Build a regexp from package names, expanding * globs as required * Build a regexp from package names, expanding * globs as required
* *
* @param string[] $packageNames * @param string[] $packageNames
* @param string $wrap * @param non-empty-string $wrap
* @return string * @return non-empty-string
*/ */
public static function packageNamesToRegexp(array $packageNames, $wrap = '{^(?:%s)$}iD') public static function packageNamesToRegexp(array $packageNames, $wrap = '{^(?:%s)$}iD')
{ {

View File

@ -55,12 +55,12 @@ class PluginManager
protected $registeredPlugins = array(); protected $registeredPlugins = array();
/** /**
* @var array<string, bool>|null * @var array<non-empty-string, bool>|null
*/ */
private $allowPluginRules; private $allowPluginRules;
/** /**
* @var array<string, bool>|null * @var array<non-empty-string, bool>|null
*/ */
private $allowGlobalPluginRules; private $allowGlobalPluginRules;
@ -643,7 +643,7 @@ class PluginManager
/** /**
* @param array<string, bool>|bool|null $allowPluginsConfig * @param array<string, bool>|bool|null $allowPluginsConfig
* @return array<string, bool>|null * @return array<non-empty-string, bool>|null
*/ */
private function parseAllowedPlugins($allowPluginsConfig) private function parseAllowedPlugins($allowPluginsConfig)
{ {

View File

@ -25,9 +25,9 @@ use Symfony\Component\Console\Question\Question;
*/ */
class StrictConfirmationQuestion extends Question class StrictConfirmationQuestion extends Question
{ {
/** @var string */ /** @var non-empty-string */
private $trueAnswerRegex; private $trueAnswerRegex;
/** @var string */ /** @var non-empty-string */
private $falseAnswerRegex; private $falseAnswerRegex;
/** /**
@ -35,8 +35,8 @@ class StrictConfirmationQuestion extends Question
* *
* @param string $question The question to ask to the user * @param string $question The question to ask to the user
* @param bool $default The default answer to return, true or false * @param bool $default The default answer to return, true or false
* @param string $trueAnswerRegex A regex to match the "yes" answer * @param non-empty-string $trueAnswerRegex A regex to match the "yes" answer
* @param string $falseAnswerRegex A regex to match the "no" answer * @param non-empty-string $falseAnswerRegex A regex to match the "no" answer
*/ */
public function __construct($question, $default = true, $trueAnswerRegex = '/^y(?:es)?$/i', $falseAnswerRegex = '/^no?$/i') public function __construct($question, $default = true, $trueAnswerRegex = '/^y(?:es)?$/i', $falseAnswerRegex = '/^no?$/i')
{ {

View File

@ -80,7 +80,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
protected $hasAvailablePackageList = false; protected $hasAvailablePackageList = false;
/** @var ?array<string> */ /** @var ?array<string> */
protected $availablePackages = null; protected $availablePackages = null;
/** @var ?array<string> */ /** @var ?array<non-empty-string> */
protected $availablePackagePatterns = null; protected $availablePackagePatterns = null;
/** @var ?string */ /** @var ?string */
protected $lazyProvidersUrl = null; protected $lazyProvidersUrl = null;

View File

@ -25,7 +25,7 @@ class FilterRepository implements RepositoryInterface
{ {
/** @var ?string */ /** @var ?string */
private $only = null; private $only = null;
/** @var ?string */ /** @var ?non-empty-string */
private $exclude = null; private $exclude = null;
/** @var bool */ /** @var bool */
private $canonical = true; private $canonical = true;
@ -206,6 +206,10 @@ class FilterRepository implements RepositoryInterface
return Preg::isMatch($this->only, $name); return Preg::isMatch($this->only, $name);
} }
if ($this->exclude === null) {
return true;
}
return !Preg::isMatch($this->exclude, $name); return !Preg::isMatch($this->exclude, $name);
} }
} }

View File

@ -95,7 +95,7 @@ class BasePackageTest extends TestCase
/** /**
* @param string[] $packageNames * @param string[] $packageNames
* @param string $wrap * @param non-empty-string $wrap
* @param string $expectedRegexp * @param string $expectedRegexp
* *
* @dataProvider dataPackageNamesToRegexp * @dataProvider dataPackageNamesToRegexp