From 41dd022935bc2552272855c700b5ea9afbc21cc8 Mon Sep 17 00:00:00 2001 From: azjezz Date: Wed, 19 May 2021 02:44:23 +0100 Subject: [PATCH 01/12] replace thecodingmachine/safe by azjezz/psl --- composer.json | 4 +- composer.lock | 337 ++++++++++-------- src/Change.php | 8 +- src/Command/AssertBackwardsCompatible.php | 41 +-- src/CompareClasses.php | 23 +- .../BCBreak/ClassBased/AncestorRemoved.php | 19 +- .../ClassBased/ClassBecameAbstract.php | 5 +- .../BCBreak/ClassBased/ClassBecameFinal.php | 5 +- .../ClassBased/ClassBecameInterface.php | 5 +- .../ClassBased/ClassBecameInternal.php | 9 +- .../BCBreak/ClassBased/ClassBecameTrait.php | 5 +- .../BCBreak/ClassBased/ConstantRemoved.php | 19 +- .../ClassBased/ExcludeInternalClass.php | 5 +- .../BCBreak/ClassBased/MethodChanged.php | 19 +- .../BCBreak/ClassBased/MethodRemoved.php | 41 +-- .../BCBreak/ClassBased/PropertyRemoved.php | 31 +- .../ClassConstantValueChanged.php | 4 +- .../ClassConstantVisibilityReduced.php | 5 +- .../FunctionBased/ExcludeInternalFunction.php | 5 +- .../FunctionBased/FunctionBecameInternal.php | 9 +- .../ParameterByReferenceChanged.php | 9 +- .../ParameterDefaultValueChanged.php | 11 +- .../FunctionBased/ParameterTypeChanged.php | 15 +- .../ParameterTypeContravarianceChanged.php | 9 +- .../RequiredParameterAmountIncreased.php | 5 +- .../ReturnTypeByReferenceChanged.php | 5 +- .../FunctionBased/ReturnTypeChanged.php | 5 +- .../ReturnTypeCovarianceChanged.php | 5 +- .../InterfaceBased/AncestorRemoved.php | 17 +- .../ExcludeInternalInterface.php | 5 +- .../InterfaceBased/InterfaceBecameClass.php | 5 +- .../InterfaceBased/InterfaceBecameTrait.php | 5 +- .../BCBreak/InterfaceBased/MethodAdded.php | 26 +- .../MethodBased/ExcludeInternalMethod.php | 5 +- .../BCBreak/MethodBased/MethodBecameFinal.php | 5 +- .../MethodBased/MethodConcretenessChanged.php | 5 +- .../MethodBased/MethodScopeChanged.php | 5 +- .../MethodBased/MethodVisibilityReduced.php | 5 +- .../PropertyBased/ExcludeInternalProperty.php | 5 +- .../PropertyBased/PropertyBecameInternal.php | 9 +- .../PropertyDefaultValueChanged.php | 5 +- .../PropertyDocumentedTypeChanged.php | 19 +- .../PropertyBased/PropertyScopeChanged.php | 5 +- .../PropertyVisibilityReduced.php | 5 +- .../TraitBased/ExcludeInternalTrait.php | 11 +- .../BCBreak/TraitBased/TraitBecameClass.php | 5 +- .../TraitBased/TraitBecameInterface.php | 5 +- .../GitCheckoutRevisionToTemporaryPath.php | 17 +- .../LocateDependenciesViaComposer.php | 21 +- .../StaticClassMapSourceLocator.php | 21 +- .../Command/AssertBackwardsCompatibleTest.php | 38 +- .../SymfonyConsoleTextFormatterTest.php | 13 +- test/unit/Git/CheckedOutRepositoryTest.php | 18 +- ...VersionCollectionFromGitRepositoryTest.php | 37 +- ...GitCheckoutRevisionToTemporaryPathTest.php | 48 +-- .../LocateDependenciesViaComposerTest.php | 18 +- .../StaticClassMapSourceLocatorTest.php | 9 +- 57 files changed, 508 insertions(+), 547 deletions(-) diff --git a/composer.json b/composer.json index 2e61f9a7..bf7db623 100644 --- a/composer.json +++ b/composer.json @@ -4,13 +4,13 @@ "require": { "php": "^7.4.7", "ext-json": "*", + "azjezz/psl": "^1.6", "composer/composer": "^2.0", "nikolaposa/version": "^4.1.0", "ocramius/package-versions": "^1.11.0", "roave/better-reflection": "^4.9.0", "symfony/console": "^5.2.6", "symfony/process": "^5.2.4", - "thecodingmachine/safe": "^1.3.3", "webmozart/assert": "^1.9.1" }, "license": "MIT", @@ -30,7 +30,7 @@ "phpunit/phpunit": "^9.2.6", "roave/security-advisories": "dev-master", "squizlabs/php_codesniffer": "^3.6.0", - "vimeo/psalm": "^3.12.2" + "vimeo/psalm": "^4.7" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 258e1b3f..2e7539e0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,65 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a96970f67aae7f4e2dd2d4f2ee559392", + "content-hash": "a0a4c1d24f49b11424e39225f86ddf6f", "packages": [ + { + "name": "azjezz/psl", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/azjezz/psl.git", + "reference": "963a0bb6fd333146469fc064be6977b959a07854" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/azjezz/psl/zipball/963a0bb6fd333146469fc064be6977b959a07854", + "reference": "963a0bb6fd333146469fc064be6977b959a07854", + "shasum": "" + }, + "require": { + "ext-bcmath": "*", + "ext-intl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-sodium": "*", + "php": "^7.4 || ^8.0" + }, + "type": "library", + "extra": { + "psalm": { + "pluginClass": "Psl\\Integration\\Psalm\\Plugin" + }, + "thanks": { + "name": "hhvm/hsl", + "url": "https://github.com/hhvm/hsl" + } + }, + "autoload": { + "psr-4": { + "Psl\\Integration\\": "integration" + }, + "files": [ + "src/bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "azjezz", + "email": "azjezz@protonmail.com" + } + ], + "description": "PHP Standard Library", + "support": { + "issues": "https://github.com/azjezz/psl/issues", + "source": "https://github.com/azjezz/psl/tree/1.6.0" + }, + "time": "2021-04-07T08:13:18+00:00" + }, { "name": "beberlei/assert", "version": "v3.3.0", @@ -2304,145 +2361,6 @@ ], "time": "2021-03-17T17:12:15+00:00" }, - { - "name": "thecodingmachine/safe", - "version": "v1.3.3", - "source": { - "type": "git", - "url": "https://github.com/thecodingmachine/safe.git", - "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/a8ab0876305a4cdaef31b2350fcb9811b5608dbc", - "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "require-dev": { - "phpstan/phpstan": "^0.12", - "squizlabs/php_codesniffer": "^3.2", - "thecodingmachine/phpstan-strict-rules": "^0.12" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.1-dev" - } - }, - "autoload": { - "psr-4": { - "Safe\\": [ - "lib/", - "deprecated/", - "generated/" - ] - }, - "files": [ - "deprecated/apc.php", - "deprecated/libevent.php", - "deprecated/mssql.php", - "deprecated/stats.php", - "lib/special_cases.php", - "generated/apache.php", - "generated/apcu.php", - "generated/array.php", - "generated/bzip2.php", - "generated/calendar.php", - "generated/classobj.php", - "generated/com.php", - "generated/cubrid.php", - "generated/curl.php", - "generated/datetime.php", - "generated/dir.php", - "generated/eio.php", - "generated/errorfunc.php", - "generated/exec.php", - "generated/fileinfo.php", - "generated/filesystem.php", - "generated/filter.php", - "generated/fpm.php", - "generated/ftp.php", - "generated/funchand.php", - "generated/gmp.php", - "generated/gnupg.php", - "generated/hash.php", - "generated/ibase.php", - "generated/ibmDb2.php", - "generated/iconv.php", - "generated/image.php", - "generated/imap.php", - "generated/info.php", - "generated/ingres-ii.php", - "generated/inotify.php", - "generated/json.php", - "generated/ldap.php", - "generated/libxml.php", - "generated/lzf.php", - "generated/mailparse.php", - "generated/mbstring.php", - "generated/misc.php", - "generated/msql.php", - "generated/mysql.php", - "generated/mysqli.php", - "generated/mysqlndMs.php", - "generated/mysqlndQc.php", - "generated/network.php", - "generated/oci8.php", - "generated/opcache.php", - "generated/openssl.php", - "generated/outcontrol.php", - "generated/password.php", - "generated/pcntl.php", - "generated/pcre.php", - "generated/pdf.php", - "generated/pgsql.php", - "generated/posix.php", - "generated/ps.php", - "generated/pspell.php", - "generated/readline.php", - "generated/rpminfo.php", - "generated/rrd.php", - "generated/sem.php", - "generated/session.php", - "generated/shmop.php", - "generated/simplexml.php", - "generated/sockets.php", - "generated/sodium.php", - "generated/solr.php", - "generated/spl.php", - "generated/sqlsrv.php", - "generated/ssdeep.php", - "generated/ssh2.php", - "generated/stream.php", - "generated/strings.php", - "generated/swoole.php", - "generated/uodbc.php", - "generated/uopz.php", - "generated/url.php", - "generated/var.php", - "generated/xdiff.php", - "generated/xml.php", - "generated/xmlrpc.php", - "generated/yaml.php", - "generated/yaz.php", - "generated/zip.php", - "generated/zlib.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHP core functions that throw exceptions instead of returning FALSE on error", - "support": { - "issues": "https://github.com/thecodingmachine/safe/issues", - "source": "https://github.com/thecodingmachine/safe/tree/v1.3.3" - }, - "time": "2020-10-28T17:51:34+00:00" - }, { "name": "webmozart/assert", "version": "1.9.1", @@ -5398,6 +5316,145 @@ }, "time": "2021-04-09T00:54:41+00:00" }, + { + "name": "thecodingmachine/safe", + "version": "v1.3.3", + "source": { + "type": "git", + "url": "https://github.com/thecodingmachine/safe.git", + "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/a8ab0876305a4cdaef31b2350fcb9811b5608dbc", + "reference": "a8ab0876305a4cdaef31b2350fcb9811b5608dbc", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "require-dev": { + "phpstan/phpstan": "^0.12", + "squizlabs/php_codesniffer": "^3.2", + "thecodingmachine/phpstan-strict-rules": "^0.12" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.1-dev" + } + }, + "autoload": { + "psr-4": { + "Safe\\": [ + "lib/", + "deprecated/", + "generated/" + ] + }, + "files": [ + "deprecated/apc.php", + "deprecated/libevent.php", + "deprecated/mssql.php", + "deprecated/stats.php", + "lib/special_cases.php", + "generated/apache.php", + "generated/apcu.php", + "generated/array.php", + "generated/bzip2.php", + "generated/calendar.php", + "generated/classobj.php", + "generated/com.php", + "generated/cubrid.php", + "generated/curl.php", + "generated/datetime.php", + "generated/dir.php", + "generated/eio.php", + "generated/errorfunc.php", + "generated/exec.php", + "generated/fileinfo.php", + "generated/filesystem.php", + "generated/filter.php", + "generated/fpm.php", + "generated/ftp.php", + "generated/funchand.php", + "generated/gmp.php", + "generated/gnupg.php", + "generated/hash.php", + "generated/ibase.php", + "generated/ibmDb2.php", + "generated/iconv.php", + "generated/image.php", + "generated/imap.php", + "generated/info.php", + "generated/ingres-ii.php", + "generated/inotify.php", + "generated/json.php", + "generated/ldap.php", + "generated/libxml.php", + "generated/lzf.php", + "generated/mailparse.php", + "generated/mbstring.php", + "generated/misc.php", + "generated/msql.php", + "generated/mysql.php", + "generated/mysqli.php", + "generated/mysqlndMs.php", + "generated/mysqlndQc.php", + "generated/network.php", + "generated/oci8.php", + "generated/opcache.php", + "generated/openssl.php", + "generated/outcontrol.php", + "generated/password.php", + "generated/pcntl.php", + "generated/pcre.php", + "generated/pdf.php", + "generated/pgsql.php", + "generated/posix.php", + "generated/ps.php", + "generated/pspell.php", + "generated/readline.php", + "generated/rpminfo.php", + "generated/rrd.php", + "generated/sem.php", + "generated/session.php", + "generated/shmop.php", + "generated/simplexml.php", + "generated/sockets.php", + "generated/sodium.php", + "generated/solr.php", + "generated/spl.php", + "generated/sqlsrv.php", + "generated/ssdeep.php", + "generated/ssh2.php", + "generated/stream.php", + "generated/strings.php", + "generated/swoole.php", + "generated/uodbc.php", + "generated/uopz.php", + "generated/url.php", + "generated/var.php", + "generated/xdiff.php", + "generated/xml.php", + "generated/xmlrpc.php", + "generated/yaml.php", + "generated/yaz.php", + "generated/zip.php", + "generated/zlib.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP core functions that throw exceptions instead of returning FALSE on error", + "support": { + "issues": "https://github.com/thecodingmachine/safe/issues", + "source": "https://github.com/thecodingmachine/safe/tree/v1.3.3" + }, + "time": "2020-10-28T17:51:34+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.0", diff --git a/src/Change.php b/src/Change.php index 2f83d166..7e85bf80 100644 --- a/src/Change.php +++ b/src/Change.php @@ -5,9 +5,7 @@ namespace Roave\BackwardCompatibility; use Throwable; - -use function Safe\sprintf; -use function strtoupper; +use Psl\Str; /** * @todo this class probably needs subclassing or being turned into an interface @@ -75,10 +73,10 @@ public function isSkipped(): bool public function __toString(): string { - return sprintf( + return Str\format( '%s%s: %s', $this->isBcBreak ? '[BC] ' : ' ', - strtoupper($this->modificationType), + Str\uppercase($this->modificationType), $this->description ); } diff --git a/src/Command/AssertBackwardsCompatible.php b/src/Command/AssertBackwardsCompatible.php index 52ce638d..409c917f 100644 --- a/src/Command/AssertBackwardsCompatible.php +++ b/src/Command/AssertBackwardsCompatible.php @@ -25,14 +25,11 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\ConsoleOutputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Webmozart\Assert\Assert; - -use function assert; -use function count; -use function is_array; -use function is_string; -use function Safe\getcwd; -use function Safe\sprintf; +use Psl\Type; +use Psl\Env; +use Psl\Str; +use Psl\Iter; +use Psl; final class AssertBackwardsCompatible extends Command { @@ -131,23 +128,21 @@ protected function configure(): void */ public function execute(InputInterface $input, OutputInterface $output): int { - assert($output instanceof ConsoleOutputInterface, ''); + $output = Type\object(ConsoleOutputInterface::class)->assert($output); $stdErr = $output->getErrorOutput(); // @todo fix flaky assumption about the path of the source repo... - $sourceRepo = CheckedOutRepository::fromPath(getcwd()); + $sourceRepo = CheckedOutRepository::fromPath(Env\current_dir()); $fromRevision = $input->getOption('from') !== null ? $this->parseRevisionFromInput($input, $sourceRepo) : $this->determineFromRevisionFromRepository($sourceRepo, $stdErr); - $to = $input->getOption('to'); - - assert(is_string($to)); + $to = Type\string()->coerce($input->getOption('to')); $toRevision = $this->parseRevision->fromStringForRepository($to, $sourceRepo); - $stdErr->writeln(sprintf('Comparing from %s to %s...', $fromRevision, $toRevision)); + $stdErr->writeln(Str\format('Comparing from %s to %s...', $fromRevision, $toRevision)); $fromPath = $this->git->checkout($sourceRepo, $fromRevision); $toPath = $this->git->checkout($sourceRepo, $toRevision); @@ -170,11 +165,9 @@ public function execute(InputInterface $input, OutputInterface $output): int (new SymfonyConsoleTextFormatter($stdErr))->write($changes); - $outputFormats = $input->getOption('format') ?: []; + $outputFormats = Type\vec(Type\string())->coerce($input->getOption('format') ?: []); - assert(is_array($outputFormats)); - - if (ArrayHelpers::stringArrayContainsString('markdown', $outputFormats)) { + if (Iter\contains($outputFormats, 'markdown')) { (new MarkdownPipedToSymfonyConsoleFormatter($output))->write($changes); } } finally { @@ -187,10 +180,10 @@ public function execute(InputInterface $input, OutputInterface $output): int private function printOutcomeAndExit(Changes $changes, OutputInterface $stdErr): int { - $hasBcBreaks = count($changes); + $hasBcBreaks = Iter\count($changes); if ($hasBcBreaks) { - $stdErr->writeln(sprintf('%s backwards-incompatible changes detected', $hasBcBreaks)); + $stdErr->writeln(Str\format('%s backwards-incompatible changes detected', $hasBcBreaks)); } else { $stdErr->writeln('No backwards-incompatible changes detected', $hasBcBreaks); } @@ -203,9 +196,7 @@ private function printOutcomeAndExit(Changes $changes, OutputInterface $stdErr): */ private function parseRevisionFromInput(InputInterface $input, CheckedOutRepository $repository): Revision { - $from = $input->getOption('from'); - - assert(is_string($from)); + $from = Type\string()->coerce($input->getOption('from')); return $this->parseRevision->fromStringForRepository($from, $repository); } @@ -216,11 +207,11 @@ private function determineFromRevisionFromRepository( ): Revision { $versions = $this->getVersions->fromRepository($repository); - Assert::minCount($versions, 1, 'Could not detect any released versions for the given repository'); + Psl\invariant(Iter\count($versions) >= 1, 'Could not detect any released versions for the given repository'); $versionString = $this->pickFromVersion->forVersions($versions)->toString(); - $output->writeln(sprintf('Detected last minor version: %s', $versionString)); + $output->writeln(Str\format('Detected last minor version: %s', $versionString)); return $this->parseRevision->fromStringForRepository( $versionString, diff --git a/src/CompareClasses.php b/src/CompareClasses.php index 2b3c5945..0d112c33 100644 --- a/src/CompareClasses.php +++ b/src/CompareClasses.php @@ -12,10 +12,9 @@ use Roave\BetterReflection\Reflector\ClassReflector; use Roave\BetterReflection\Reflector\Exception\IdentifierNotFound; -use function array_filter; -use function array_map; -use function Safe\preg_match; -use function Safe\sprintf; +use Psl\Str; +use Psl\Regex; +use Psl\Dict; final class CompareClasses implements CompareApi { @@ -40,16 +39,16 @@ public function __invoke( ClassReflector $pastSourcesWithDependencies, ClassReflector $newSourcesWithDependencies ): Changes { - $definedApiClassNames = array_map( - static function (ReflectionClass $class): string { - return $class->getName(); - }, - array_filter( + $definedApiClassNames = Dict\map( + Dict\filter( $definedSymbols->getAllClasses(), function (ReflectionClass $class): bool { return ! ($class->isAnonymous() || $this->isInternalDocComment($class->getDocComment())); } - ) + ), + static function (ReflectionClass $class): string { + return $class->getName(); + } ); return Changes::fromIterator($this->makeSymbolsIterator( @@ -83,7 +82,7 @@ private function examineSymbol( try { $newClass = $newSourcesWithDependencies->reflect($oldSymbol->getName()); } catch (IdentifierNotFound $exception) { - yield Change::removed(sprintf('Class %s has been deleted', $oldSymbol->getName()), true); + yield Change::removed(Str\format('Class %s has been deleted', $oldSymbol->getName()), true); return; } @@ -105,6 +104,6 @@ private function examineSymbol( private function isInternalDocComment(string $comment): bool { - return preg_match('/\s+@internal\s+/', $comment) === 1; + return Regex\matches($comment, '/\s+@internal\s+/'); } } diff --git a/src/DetectChanges/BCBreak/ClassBased/AncestorRemoved.php b/src/DetectChanges/BCBreak/ClassBased/AncestorRemoved.php index eb3b93f6..520ca9d4 100644 --- a/src/DetectChanges/BCBreak/ClassBased/AncestorRemoved.php +++ b/src/DetectChanges/BCBreak/ClassBased/AncestorRemoved.php @@ -7,11 +7,10 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; - -use function array_diff; -use function array_merge; -use function Safe\json_encode; -use function Safe\sprintf; +use Psl\Json; +use Psl\Str; +use Psl\Dict; +use Psl\Vec; /** * A class ancestor (interface or class) cannot be removed, as that breaks type @@ -21,9 +20,9 @@ final class AncestorRemoved implements ClassBased { public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): Changes { - $removedAncestors = array_merge( - array_diff($fromClass->getParentClassNames(), $toClass->getParentClassNames()), - array_diff($fromClass->getInterfaceNames(), $toClass->getInterfaceNames()) + $removedAncestors = Vec\concat( + Dict\diff($fromClass->getParentClassNames(), $toClass->getParentClassNames()), + Dict\diff($fromClass->getInterfaceNames(), $toClass->getInterfaceNames()) ); if (! $removedAncestors) { @@ -31,10 +30,10 @@ public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): } return Changes::fromList(Change::removed( - sprintf( + Str\format( 'These ancestors of %s have been removed: %s', $fromClass->getName(), - json_encode($removedAncestors) + Json\encode($removedAncestors) ), true )); diff --git a/src/DetectChanges/BCBreak/ClassBased/ClassBecameAbstract.php b/src/DetectChanges/BCBreak/ClassBased/ClassBecameAbstract.php index 45be94ab..f7230bed 100644 --- a/src/DetectChanges/BCBreak/ClassBased/ClassBecameAbstract.php +++ b/src/DetectChanges/BCBreak/ClassBased/ClassBecameAbstract.php @@ -7,8 +7,7 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; - -use function Safe\sprintf; +use Psl\Str; /** * A class cannot become abstract without introducing an explicit BC break, since @@ -29,7 +28,7 @@ public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): } return Changes::fromList(Change::changed( - sprintf('Class %s became abstract', $fromClass->getName()), + Str\format('Class %s became abstract', $fromClass->getName()), true )); } diff --git a/src/DetectChanges/BCBreak/ClassBased/ClassBecameFinal.php b/src/DetectChanges/BCBreak/ClassBased/ClassBecameFinal.php index 168ed925..74e825f2 100644 --- a/src/DetectChanges/BCBreak/ClassBased/ClassBecameFinal.php +++ b/src/DetectChanges/BCBreak/ClassBased/ClassBecameFinal.php @@ -7,8 +7,7 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; - -use function Safe\sprintf; +use Psl\Str; final class ClassBecameFinal implements ClassBased { @@ -23,7 +22,7 @@ public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): } return Changes::fromList(Change::changed( - sprintf('Class %s became final', $fromClass->getName()), + Str\format('Class %s became final', $fromClass->getName()), true )); } diff --git a/src/DetectChanges/BCBreak/ClassBased/ClassBecameInterface.php b/src/DetectChanges/BCBreak/ClassBased/ClassBecameInterface.php index 0148a3db..0510d904 100644 --- a/src/DetectChanges/BCBreak/ClassBased/ClassBecameInterface.php +++ b/src/DetectChanges/BCBreak/ClassBased/ClassBecameInterface.php @@ -7,8 +7,7 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; - -use function Safe\sprintf; +use Psl\Str; /** * A class cannot become an interface without introducing an explicit BC break, since @@ -25,7 +24,7 @@ public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): } return Changes::fromList(Change::changed( - sprintf('Class %s became an interface', $fromClass->getName()), + Str\format('Class %s became an interface', $fromClass->getName()), true )); } diff --git a/src/DetectChanges/BCBreak/ClassBased/ClassBecameInternal.php b/src/DetectChanges/BCBreak/ClassBased/ClassBecameInternal.php index 2174fa8b..171581f9 100644 --- a/src/DetectChanges/BCBreak/ClassBased/ClassBecameInternal.php +++ b/src/DetectChanges/BCBreak/ClassBased/ClassBecameInternal.php @@ -7,9 +7,8 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; - -use function Safe\preg_match; -use function Safe\sprintf; +use Psl\Regex; +use Psl\Str; /** * A class that is marked internal is no available to downstream consumers. @@ -23,7 +22,7 @@ public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): && $this->isInternalDocComment($toClass->getDocComment()) ) { return Changes::fromList(Change::changed( - sprintf( + Str\format( '%s was marked "@internal"', $fromClass->getName() ), @@ -36,6 +35,6 @@ public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): private function isInternalDocComment(string $comment): bool { - return preg_match('/\s+@internal\s+/', $comment) === 1; + return Regex\matches($comment, '/\s+@internal\s+/'); } } diff --git a/src/DetectChanges/BCBreak/ClassBased/ClassBecameTrait.php b/src/DetectChanges/BCBreak/ClassBased/ClassBecameTrait.php index 417ceee1..73f93330 100644 --- a/src/DetectChanges/BCBreak/ClassBased/ClassBecameTrait.php +++ b/src/DetectChanges/BCBreak/ClassBased/ClassBecameTrait.php @@ -7,8 +7,7 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; - -use function Safe\sprintf; +use Psl\Str; /** * A class cannot become a trait without introducing an explicit BC break, since @@ -24,7 +23,7 @@ public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): } return Changes::fromList(Change::changed( - sprintf('Class %s became a trait', $fromClass->getName()), + Str\format('Class %s became a trait', $fromClass->getName()), true )); } diff --git a/src/DetectChanges/BCBreak/ClassBased/ConstantRemoved.php b/src/DetectChanges/BCBreak/ClassBased/ConstantRemoved.php index b2f60b10..40bdea73 100644 --- a/src/DetectChanges/BCBreak/ClassBased/ConstantRemoved.php +++ b/src/DetectChanges/BCBreak/ClassBased/ConstantRemoved.php @@ -8,34 +8,31 @@ use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; use Roave\BetterReflection\Reflection\ReflectionClassConstant; - -use function array_diff_key; -use function array_filter; -use function array_map; -use function array_values; -use function Safe\sprintf; +use Psl\Dict; +use Psl\Vec; +use Psl\Str; final class ConstantRemoved implements ClassBased { public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): Changes { - $removedConstants = array_diff_key( + $removedConstants = Dict\diff_by_key( $this->accessibleConstants($fromClass), $this->accessibleConstants($toClass) ); - return Changes::fromList(...array_values(array_map(static function (ReflectionClassConstant $constant) use ($fromClass): Change { + return Changes::fromList(...Vec\map($removedConstants, static function (ReflectionClassConstant $constant) use ($fromClass): Change { return Change::removed( - sprintf('Constant %s::%s was removed', $fromClass->getName(), $constant->getName()), + Str\format('Constant %s::%s was removed', $fromClass->getName(), $constant->getName()), true ); - }, $removedConstants))); + })); } /** @return ReflectionClassConstant[] */ private function accessibleConstants(ReflectionClass $class): array { - return array_filter($class->getReflectionConstants(), static function (ReflectionClassConstant $constant): bool { + return Dict\filter($class->getReflectionConstants(), static function (ReflectionClassConstant $constant): bool { return $constant->isPublic() || $constant->isProtected(); }); } diff --git a/src/DetectChanges/BCBreak/ClassBased/ExcludeInternalClass.php b/src/DetectChanges/BCBreak/ClassBased/ExcludeInternalClass.php index 93856f8f..a2ef3004 100644 --- a/src/DetectChanges/BCBreak/ClassBased/ExcludeInternalClass.php +++ b/src/DetectChanges/BCBreak/ClassBased/ExcludeInternalClass.php @@ -6,8 +6,7 @@ use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; - -use function Safe\preg_match; +use Psl\Regex; /** * Classes marked "internal" (docblock) are not affected by BC checks. @@ -32,6 +31,6 @@ public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): private function isInternalDocComment(string $comment): bool { - return preg_match('/\s+@internal\s+/', $comment) === 1; + return Regex\matches($comment, '/\s+@internal\s+/'); } } diff --git a/src/DetectChanges/BCBreak/ClassBased/MethodChanged.php b/src/DetectChanges/BCBreak/ClassBased/MethodChanged.php index 092a35c7..8bc1afe9 100644 --- a/src/DetectChanges/BCBreak/ClassBased/MethodChanged.php +++ b/src/DetectChanges/BCBreak/ClassBased/MethodChanged.php @@ -9,12 +9,9 @@ use Roave\BackwardCompatibility\DetectChanges\BCBreak\MethodBased\MethodBased; use Roave\BetterReflection\Reflection\ReflectionClass; use Roave\BetterReflection\Reflection\ReflectionMethod; - -use function array_intersect_key; -use function array_keys; -use function array_map; -use function Safe\array_combine; -use function strtolower; +use Psl\Dict; +use Psl\Str; +use Psl\Vec; final class MethodChanged implements ClassBased { @@ -38,7 +35,7 @@ public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): */ private function checkSymbols(array $from, array $to): iterable { - foreach (array_keys(array_intersect_key($from, $to)) as $name) { + foreach (Vec\keys(Dict\intersect_by_key($from, $to)) as $name) { yield from $this->checkMethod->__invoke($from[$name], $to[$name]); } } @@ -48,10 +45,10 @@ private function methods(ReflectionClass $class): array { $methods = $class->getMethods(); - return array_combine( - array_map(static function (ReflectionMethod $method): string { - return strtolower($method->getName()); - }, $methods), + return Dict\associate( + Vec\map($methods, static function (ReflectionMethod $method): string { + return Str\lowercase($method->getName()); + }), $methods ); } diff --git a/src/DetectChanges/BCBreak/ClassBased/MethodRemoved.php b/src/DetectChanges/BCBreak/ClassBased/MethodRemoved.php index 983b8789..32b0dd5e 100644 --- a/src/DetectChanges/BCBreak/ClassBased/MethodRemoved.php +++ b/src/DetectChanges/BCBreak/ClassBased/MethodRemoved.php @@ -9,17 +9,10 @@ use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionClass; use Roave\BetterReflection\Reflection\ReflectionMethod; - -use function array_change_key_case; -use function array_diff_key; -use function array_filter; -use function array_map; -use function array_values; -use function Safe\array_combine; -use function Safe\preg_match; -use function Safe\sprintf; - -use const CASE_UPPER; +use Psl\Dict; +use Psl\Vec; +use Psl\Str; +use Psl\Regex; final class MethodRemoved implements ClassBased { @@ -32,38 +25,42 @@ public function __construct() public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): Changes { - $removedMethods = array_diff_key( - array_change_key_case($this->accessibleMethods($fromClass), CASE_UPPER), - array_change_key_case($this->accessibleMethods($toClass), CASE_UPPER) + $removedMethods = Dict\diff_by_key( + Dict\map_keys($this->accessibleMethods($fromClass), function(string $key): string { + return Str\uppercase($key); + }), + Dict\map_keys($this->accessibleMethods($toClass), function(string $key): string { + return Str\uppercase($key); + }), ); - return Changes::fromList(...array_values(array_map(function (ReflectionMethod $method): Change { + return Changes::fromList(...Vec\map($removedMethods, function (ReflectionMethod $method): Change { return Change::removed( - sprintf('Method %s was removed', $this->formatFunction->__invoke($method)), + Str\format('Method %s was removed', $this->formatFunction->__invoke($method)), true ); - }, $removedMethods))); + })); } /** @return ReflectionMethod[] */ private function accessibleMethods(ReflectionClass $class): array { - $methods = array_filter($class->getMethods(), function (ReflectionMethod $method): bool { + $methods = Vec\filter($class->getMethods(), function (ReflectionMethod $method): bool { return ($method->isPublic() || $method->isProtected()) && ! $this->isInternalDocComment($method->getDocComment()); }); - return array_combine( - array_map(static function (ReflectionMethod $method): string { + return Dict\associate( + Vec\map($methods, static function (ReflectionMethod $method): string { return $method->getName(); - }, $methods), + }), $methods ); } private function isInternalDocComment(string $comment): bool { - return preg_match('/\s+@internal\s+/', $comment) === 1; + return Regex\matches($comment, '/\s+@internal\s+/'); } } diff --git a/src/DetectChanges/BCBreak/ClassBased/PropertyRemoved.php b/src/DetectChanges/BCBreak/ClassBased/PropertyRemoved.php index 06953c94..b3b608c6 100644 --- a/src/DetectChanges/BCBreak/ClassBased/PropertyRemoved.php +++ b/src/DetectChanges/BCBreak/ClassBased/PropertyRemoved.php @@ -9,13 +9,10 @@ use Roave\BackwardCompatibility\Formatter\ReflectionPropertyName; use Roave\BetterReflection\Reflection\ReflectionClass; use Roave\BetterReflection\Reflection\ReflectionProperty; - -use function array_diff; -use function array_filter; -use function array_keys; -use function array_map; -use function Safe\preg_match; -use function Safe\sprintf; +use Psl\Str; +use Psl\Regex; +use Psl\Dict; +use Psl\Vec; final class PropertyRemoved implements ClassBased { @@ -29,25 +26,27 @@ public function __construct() public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): Changes { $fromProperties = $this->accessibleProperties($fromClass); - $removedProperties = array_diff( - array_keys($fromProperties), - array_keys($this->accessibleProperties($toClass)) + $removedProperties = Dict\diff( + Vec\keys($fromProperties), + Vec\keys($this->accessibleProperties($toClass)) ); - return Changes::fromList(...array_map(function (string $property) use ($fromProperties): Change { + return Changes::fromList(...Vec\map($removedProperties, function (string $property) use ($fromProperties): Change { return Change::removed( - sprintf('Property %s was removed', $this->formatProperty->__invoke($fromProperties[$property])), + Str\format('Property %s was removed', $this->formatProperty->__invoke($fromProperties[$property])), true ); - }, $removedProperties)); + })); } - /** @return ReflectionProperty[] */ + /** + * @return array + */ private function accessibleProperties(ReflectionClass $class): array { $classIsOpen = ! $class->isFinal(); - return array_filter($class->getProperties(), function (ReflectionProperty $property) use ($classIsOpen): bool { + return Dict\filter($class->getProperties(), function (ReflectionProperty $property) use ($classIsOpen): bool { return ($property->isPublic() || ($classIsOpen && $property->isProtected())) && ! $this->isInternalDocComment($property->getDocComment()); @@ -56,6 +55,6 @@ private function accessibleProperties(ReflectionClass $class): array private function isInternalDocComment(string $comment): bool { - return preg_match('/\s+@internal\s+/', $comment) === 1; + return Regex\matches($comment, '/\s+@internal\s+/'); } } diff --git a/src/DetectChanges/BCBreak/ClassConstantBased/ClassConstantValueChanged.php b/src/DetectChanges/BCBreak/ClassConstantBased/ClassConstantValueChanged.php index 322633e1..df592dc8 100644 --- a/src/DetectChanges/BCBreak/ClassConstantBased/ClassConstantValueChanged.php +++ b/src/DetectChanges/BCBreak/ClassConstantBased/ClassConstantValueChanged.php @@ -7,8 +7,8 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClassConstant; +use Psl\Str; -use function Safe\sprintf; use function var_export; final class ClassConstantValueChanged implements ClassConstantBased @@ -27,7 +27,7 @@ public function __invoke(ReflectionClassConstant $fromConstant, ReflectionClassC } return Changes::fromList(Change::changed( - sprintf( + Str\format( 'Value of constant %s::%s changed from %s to %s', $fromConstant->getDeclaringClass()->getName(), $fromConstant->getName(), diff --git a/src/DetectChanges/BCBreak/ClassConstantBased/ClassConstantVisibilityReduced.php b/src/DetectChanges/BCBreak/ClassConstantBased/ClassConstantVisibilityReduced.php index 53444725..09b7c379 100644 --- a/src/DetectChanges/BCBreak/ClassConstantBased/ClassConstantVisibilityReduced.php +++ b/src/DetectChanges/BCBreak/ClassConstantBased/ClassConstantVisibilityReduced.php @@ -7,8 +7,7 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClassConstant; - -use function Safe\sprintf; +use Psl\Str; final class ClassConstantVisibilityReduced implements ClassConstantBased { @@ -29,7 +28,7 @@ public function __invoke(ReflectionClassConstant $fromConstant, ReflectionClassC } return Changes::fromList(Change::changed( - sprintf( + Str\format( 'Constant %s::%s visibility reduced from %s to %s', $fromConstant->getDeclaringClass()->getName(), $fromConstant->getName(), diff --git a/src/DetectChanges/BCBreak/FunctionBased/ExcludeInternalFunction.php b/src/DetectChanges/BCBreak/FunctionBased/ExcludeInternalFunction.php index 522cf4b2..47d932ae 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ExcludeInternalFunction.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ExcludeInternalFunction.php @@ -6,8 +6,7 @@ use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; - -use function Safe\preg_match; +use Psl\Regex; /** * Functions marked "internal" (docblock) are not affected by BC checks. @@ -32,6 +31,6 @@ public function __invoke(ReflectionFunctionAbstract $fromFunction, ReflectionFun private function isInternalDocComment(string $comment): bool { - return preg_match('/\s+@internal\s+/', $comment) === 1; + return Regex\matches($comment, '/\s+@internal\s+/'); } } diff --git a/src/DetectChanges/BCBreak/FunctionBased/FunctionBecameInternal.php b/src/DetectChanges/BCBreak/FunctionBased/FunctionBecameInternal.php index f249fb51..cc308cdb 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/FunctionBecameInternal.php +++ b/src/DetectChanges/BCBreak/FunctionBased/FunctionBecameInternal.php @@ -8,9 +8,8 @@ use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; - -use function Safe\preg_match; -use function Safe\sprintf; +use Psl\Str; +use Psl\Regex; /** * A function that is marked internal is no available to downstream consumers. @@ -31,7 +30,7 @@ public function __invoke(ReflectionFunctionAbstract $fromFunction, ReflectionFun && ! $this->isInternalDocComment($fromFunction->getDocComment()) ) { return Changes::fromList(Change::changed( - sprintf( + Str\format( '%s was marked "@internal"', $this->formatFunction->__invoke($fromFunction), ), @@ -44,6 +43,6 @@ public function __invoke(ReflectionFunctionAbstract $fromFunction, ReflectionFun private function isInternalDocComment(string $comment): bool { - return preg_match('/\s+@internal\s+/', $comment) === 1; + return Regex\matches($comment, '/\s+@internal\s+/'); } } diff --git a/src/DetectChanges/BCBreak/FunctionBased/ParameterByReferenceChanged.php b/src/DetectChanges/BCBreak/FunctionBased/ParameterByReferenceChanged.php index 75e3d00f..6f4e6af1 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ParameterByReferenceChanged.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ParameterByReferenceChanged.php @@ -9,9 +9,8 @@ use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; use Roave\BetterReflection\Reflection\ReflectionParameter; - -use function array_intersect_key; -use function Safe\sprintf; +use Psl\Dict; +use Psl\Str; /** * A parameter passed by-value and a parameter passed by-reference are wildly different, so changing @@ -33,7 +32,7 @@ public function __invoke(ReflectionFunctionAbstract $fromFunction, ReflectionFun $toParameters = $toFunction->getParameters(); $changes = Changes::empty(); - foreach (array_intersect_key($fromParameters, $toParameters) as $parameterIndex => $commonParameter) { + foreach (Dict\intersect_by_key($fromParameters, $toParameters) as $parameterIndex => $commonParameter) { $changes = $changes->mergeWith($this->compareParameter($commonParameter, $toParameters[$parameterIndex])); } @@ -50,7 +49,7 @@ private function compareParameter(ReflectionParameter $fromParameter, Reflection } return Changes::fromList(Change::changed( - sprintf( + Str\format( 'The parameter $%s of %s changed from %s to %s', $fromParameter->getName(), $this->formatFunction->__invoke($fromParameter->getDeclaringFunction()), diff --git a/src/DetectChanges/BCBreak/FunctionBased/ParameterDefaultValueChanged.php b/src/DetectChanges/BCBreak/FunctionBased/ParameterDefaultValueChanged.php index 51b32303..b9a0a4f4 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ParameterDefaultValueChanged.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ParameterDefaultValueChanged.php @@ -9,10 +9,9 @@ use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; use Roave\BetterReflection\Reflection\ReflectionParameter; +use Psl\Dict; +use Psl\Str; -use function array_filter; -use function array_intersect_key; -use function Safe\sprintf; use function var_export; /** @@ -35,7 +34,7 @@ public function __invoke(ReflectionFunctionAbstract $fromFunction, ReflectionFun $changes = Changes::empty(); - foreach (array_intersect_key($fromParametersWithDefaults, $toParametersWithDefaults) as $parameterIndex => $parameter) { + foreach (Dict\intersect_by_key($fromParametersWithDefaults, $toParametersWithDefaults) as $parameterIndex => $parameter) { $defaultValueFrom = $parameter->getDefaultValue(); $defaultValueTo = $toParametersWithDefaults[$parameterIndex]->getDefaultValue(); @@ -44,7 +43,7 @@ public function __invoke(ReflectionFunctionAbstract $fromFunction, ReflectionFun } $changes = $changes->mergeWith(Changes::fromList(Change::changed( - sprintf( + Str\format( 'Default parameter value for parameter $%s of %s changed from %s to %s', $parameter->getName(), $this->formatFunction->__invoke($fromFunction), @@ -61,7 +60,7 @@ public function __invoke(ReflectionFunctionAbstract $fromFunction, ReflectionFun /** @return ReflectionParameter[] indexed by parameter index */ private function defaultParameterValues(ReflectionFunctionAbstract $function): array { - return array_filter( + return Dict\filter( $function->getParameters(), static function (ReflectionParameter $parameter): bool { return $parameter->isDefaultValueAvailable(); diff --git a/src/DetectChanges/BCBreak/FunctionBased/ParameterTypeChanged.php b/src/DetectChanges/BCBreak/FunctionBased/ParameterTypeChanged.php index 3b325819..b58f272e 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ParameterTypeChanged.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ParameterTypeChanged.php @@ -10,9 +10,8 @@ use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; use Roave\BetterReflection\Reflection\ReflectionParameter; use Roave\BetterReflection\Reflection\ReflectionType; - -use function array_intersect_key; -use function Safe\sprintf; +use Psl\Dict; +use Psl\Str; /** * Detects a change in a parameter type @@ -38,14 +37,14 @@ public function __invoke(ReflectionFunctionAbstract $fromFunction, ReflectionFun } /** - * @param ReflectionParameter[] $from - * @param ReflectionParameter[] $to + * @param list $from + * @param list $to * - * @return iterable|Change[] + * @return iterable */ private function checkSymbols(array $from, array $to): iterable { - foreach (array_intersect_key($from, $to) as $index => $commonParameter) { + foreach (Dict\intersect_by_key($from, $to) as $index => $commonParameter) { yield from $this->compareParameter($commonParameter, $to[$index]); } } @@ -63,7 +62,7 @@ private function compareParameter(ReflectionParameter $fromParameter, Reflection } yield Change::changed( - sprintf( + Str\format( 'The parameter $%s of %s changed from %s to %s', $fromParameter->getName(), $this->formatFunction->__invoke($fromParameter->getDeclaringFunction()), diff --git a/src/DetectChanges/BCBreak/FunctionBased/ParameterTypeContravarianceChanged.php b/src/DetectChanges/BCBreak/FunctionBased/ParameterTypeContravarianceChanged.php index 91c320b4..dd08484a 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ParameterTypeContravarianceChanged.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ParameterTypeContravarianceChanged.php @@ -11,9 +11,8 @@ use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; use Roave\BetterReflection\Reflection\ReflectionParameter; use Roave\BetterReflection\Reflection\ReflectionType; - -use function array_intersect_key; -use function Safe\sprintf; +use Psl\Dict; +use Psl\Str; /** * When a parameter type changes, the new type should be wider than the previous type, or else @@ -37,7 +36,7 @@ public function __invoke(ReflectionFunctionAbstract $fromFunction, ReflectionFun $toParameters = $toFunction->getParameters(); $changes = Changes::empty(); - foreach (array_intersect_key($fromParameters, $toParameters) as $parameterIndex => $commonParameter) { + foreach (Dict\intersect_by_key($fromParameters, $toParameters) as $parameterIndex => $commonParameter) { $changes = $changes->mergeWith($this->compareParameter($commonParameter, $toParameters[$parameterIndex])); } @@ -54,7 +53,7 @@ private function compareParameter(ReflectionParameter $fromParameter, Reflection } return Changes::fromList(Change::changed( - sprintf( + Str\format( 'The parameter $%s of %s changed from %s to a non-contravariant %s', $fromParameter->getName(), $this->formatFunction->__invoke($fromParameter->getDeclaringFunction()), diff --git a/src/DetectChanges/BCBreak/FunctionBased/RequiredParameterAmountIncreased.php b/src/DetectChanges/BCBreak/FunctionBased/RequiredParameterAmountIncreased.php index b092ebf1..200bb648 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/RequiredParameterAmountIncreased.php +++ b/src/DetectChanges/BCBreak/FunctionBased/RequiredParameterAmountIncreased.php @@ -8,8 +8,7 @@ use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; - -use function Safe\sprintf; +use Psl\Str; /** * When new parameters are added, they must be optional, or else the callers will provide an insufficient @@ -34,7 +33,7 @@ public function __invoke(ReflectionFunctionAbstract $fromFunction, ReflectionFun } return Changes::fromList(Change::changed( - sprintf( + Str\format( 'The number of required arguments for %s increased from %d to %d', $this->formatFunction->__invoke($fromFunction), $fromRequiredParameters, diff --git a/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeByReferenceChanged.php b/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeByReferenceChanged.php index edc91348..d0dd0071 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeByReferenceChanged.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeByReferenceChanged.php @@ -8,8 +8,7 @@ use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; - -use function Safe\sprintf; +use Psl\Str; /** * PHP still (sadly) supports by-ref return types, so the type is wildly different between by-ref and by-val, and @@ -34,7 +33,7 @@ public function __invoke(ReflectionFunctionAbstract $fromFunction, ReflectionFun } return Changes::fromList(Change::changed( - sprintf( + Str\format( 'The return value of %s changed from %s to %s', $this->formatFunction->__invoke($fromFunction), $this->referenceToString($fromReturnsReference), diff --git a/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeChanged.php b/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeChanged.php index 7a5255c3..3c93abb0 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeChanged.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeChanged.php @@ -9,8 +9,7 @@ use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; use Roave\BetterReflection\Reflection\ReflectionType; - -use function Safe\sprintf; +use Psl\Str; /** * Verifies if the return type of a function changed at all @@ -36,7 +35,7 @@ public function __invoke(ReflectionFunctionAbstract $fromFunction, ReflectionFun } return Changes::fromList(Change::changed( - sprintf( + Str\format( 'The return type of %s changed from %s to %s', $this->formatFunction->__invoke($fromFunction), $fromReturnType, diff --git a/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeCovarianceChanged.php b/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeCovarianceChanged.php index 90b19018..1bdb5ba1 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeCovarianceChanged.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeCovarianceChanged.php @@ -10,8 +10,7 @@ use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; use Roave\BetterReflection\Reflection\ReflectionType; - -use function Safe\sprintf; +use Psl\Str; /** * When the return type of a function changes, the new return type must be covariant to the current type. @@ -40,7 +39,7 @@ public function __invoke(ReflectionFunctionAbstract $fromFunction, ReflectionFun } return Changes::fromList(Change::changed( - sprintf( + Str\format( 'The return type of %s changed from %s to the non-covariant %s', $this->formatFunction->__invoke($fromFunction), $this->typeToString($fromReturnType), diff --git a/src/DetectChanges/BCBreak/InterfaceBased/AncestorRemoved.php b/src/DetectChanges/BCBreak/InterfaceBased/AncestorRemoved.php index 29f3b1e6..cc54c351 100644 --- a/src/DetectChanges/BCBreak/InterfaceBased/AncestorRemoved.php +++ b/src/DetectChanges/BCBreak/InterfaceBased/AncestorRemoved.php @@ -7,11 +7,10 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; - -use function array_diff; -use function array_merge; -use function Safe\json_encode; -use function Safe\sprintf; +use Psl\Vec; +use Psl\Dict; +use Psl\Str; +use Psl\Json; /** * An interface ancestor cannot be removed, as that breaks type checking in consumers. @@ -20,8 +19,8 @@ final class AncestorRemoved implements InterfaceBased { public function __invoke(ReflectionClass $fromInterface, ReflectionClass $toInterface): Changes { - $removedAncestors = array_merge( - array_diff($fromInterface->getInterfaceNames(), $toInterface->getInterfaceNames()) + $removedAncestors = Vec\values( + Dict\diff($fromInterface->getInterfaceNames(), $toInterface->getInterfaceNames()) ); if (! $removedAncestors) { @@ -29,10 +28,10 @@ public function __invoke(ReflectionClass $fromInterface, ReflectionClass $toInte } return Changes::fromList(Change::removed( - sprintf( + Str\format( 'These ancestors of %s have been removed: %s', $fromInterface->getName(), - json_encode($removedAncestors) + Json\encode($removedAncestors) ), true )); diff --git a/src/DetectChanges/BCBreak/InterfaceBased/ExcludeInternalInterface.php b/src/DetectChanges/BCBreak/InterfaceBased/ExcludeInternalInterface.php index 61e17032..30423814 100644 --- a/src/DetectChanges/BCBreak/InterfaceBased/ExcludeInternalInterface.php +++ b/src/DetectChanges/BCBreak/InterfaceBased/ExcludeInternalInterface.php @@ -6,8 +6,7 @@ use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; - -use function Safe\preg_match; +use Psl\Regex; /** * Interfaces marked "internal" (docblock) are not affected by BC checks. @@ -32,6 +31,6 @@ public function __invoke(ReflectionClass $fromInterface, ReflectionClass $toInte private function isInternalDocComment(string $comment): bool { - return preg_match('/\s+@internal\s+/', $comment) === 1; + return Regex\matches($comment, '/\s+@internal\s+/'); } } diff --git a/src/DetectChanges/BCBreak/InterfaceBased/InterfaceBecameClass.php b/src/DetectChanges/BCBreak/InterfaceBased/InterfaceBecameClass.php index 3ae2e407..8df3f65a 100644 --- a/src/DetectChanges/BCBreak/InterfaceBased/InterfaceBecameClass.php +++ b/src/DetectChanges/BCBreak/InterfaceBased/InterfaceBecameClass.php @@ -7,8 +7,7 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; - -use function Safe\sprintf; +use Psl\Str; /** * An interface cannot become concrete without introducing an explicit BC break, since @@ -24,7 +23,7 @@ public function __invoke(ReflectionClass $fromInterface, ReflectionClass $toInte } return Changes::fromList(Change::changed( - sprintf('Interface %s became a class', $fromInterface->getName()), + Str\format('Interface %s became a class', $fromInterface->getName()), true )); } diff --git a/src/DetectChanges/BCBreak/InterfaceBased/InterfaceBecameTrait.php b/src/DetectChanges/BCBreak/InterfaceBased/InterfaceBecameTrait.php index 194dfde2..3ac2dbc9 100644 --- a/src/DetectChanges/BCBreak/InterfaceBased/InterfaceBecameTrait.php +++ b/src/DetectChanges/BCBreak/InterfaceBased/InterfaceBecameTrait.php @@ -7,8 +7,7 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; - -use function Safe\sprintf; +use Psl\Str; /** * An interface cannot become a trait without introducing an explicit BC break, since @@ -24,7 +23,7 @@ public function __invoke(ReflectionClass $fromInterface, ReflectionClass $toInte } return Changes::fromList(Change::changed( - sprintf('Interface %s became a trait', $fromInterface->getName()), + Str\format('Interface %s became a trait', $fromInterface->getName()), true )); } diff --git a/src/DetectChanges/BCBreak/InterfaceBased/MethodAdded.php b/src/DetectChanges/BCBreak/InterfaceBased/MethodAdded.php index 6fbb72ae..f5048d8c 100644 --- a/src/DetectChanges/BCBreak/InterfaceBased/MethodAdded.php +++ b/src/DetectChanges/BCBreak/InterfaceBased/MethodAdded.php @@ -8,13 +8,9 @@ use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; use Roave\BetterReflection\Reflection\ReflectionMethod; - -use function array_diff_key; -use function array_map; -use function array_values; -use function Safe\array_combine; -use function Safe\sprintf; -use function strtolower; +use Psl\Dict; +use Psl\Vec; +use Psl\Str; final class MethodAdded implements InterfaceBased { @@ -22,24 +18,24 @@ public function __invoke(ReflectionClass $fromInterface, ReflectionClass $toInte { $fromMethods = $this->methods($fromInterface); $toMethods = $this->methods($toInterface); - $newMethods = array_diff_key($toMethods, $fromMethods); + $newMethods = Dict\diff_by_key($toMethods, $fromMethods); if (! $newMethods) { return Changes::empty(); } - return Changes::fromList(...array_values(array_map(static function (ReflectionMethod $method) use ( + return Changes::fromList(...Vec\map($newMethods, static function (ReflectionMethod $method) use ( $fromInterface ): Change { return Change::added( - sprintf( + Str\format( 'Method %s() was added to interface %s', $method->getName(), $fromInterface->getName() ), true ); - }, $newMethods))); + })); } /** @return ReflectionMethod[] indexed by lowercase method name */ @@ -47,10 +43,10 @@ private function methods(ReflectionClass $interface): array { $methods = $interface->getMethods(); - return array_combine( - array_map(static function (ReflectionMethod $method): string { - return strtolower($method->getName()); - }, $methods), + return Dict\associate( + Vec\map($methods, static function (ReflectionMethod $method): string { + return Str\lowercase($method->getName()); + }), $methods ); } diff --git a/src/DetectChanges/BCBreak/MethodBased/ExcludeInternalMethod.php b/src/DetectChanges/BCBreak/MethodBased/ExcludeInternalMethod.php index eb8db9e2..bf101278 100644 --- a/src/DetectChanges/BCBreak/MethodBased/ExcludeInternalMethod.php +++ b/src/DetectChanges/BCBreak/MethodBased/ExcludeInternalMethod.php @@ -6,8 +6,7 @@ use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionMethod; - -use function Safe\preg_match; +use Psl\Regex; /** * Methods marked "internal" (docblock) are not affected by BC checks. @@ -32,6 +31,6 @@ public function __invoke(ReflectionMethod $fromMethod, ReflectionMethod $toMetho private function isInternalDocComment(string $comment): bool { - return preg_match('/\s+@internal\s+/', $comment) === 1; + return Regex\matches($comment, '/\s+@internal\s+/'); } } diff --git a/src/DetectChanges/BCBreak/MethodBased/MethodBecameFinal.php b/src/DetectChanges/BCBreak/MethodBased/MethodBecameFinal.php index 0324c060..2d329445 100644 --- a/src/DetectChanges/BCBreak/MethodBased/MethodBecameFinal.php +++ b/src/DetectChanges/BCBreak/MethodBased/MethodBecameFinal.php @@ -7,8 +7,7 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionMethod; - -use function Safe\sprintf; +use Psl\Str; /** * A method that changes from non-final to final breaks all child classes that @@ -23,7 +22,7 @@ public function __invoke(ReflectionMethod $fromMethod, ReflectionMethod $toMetho } return Changes::fromList(Change::changed( - sprintf( + Str\format( 'Method %s() of class %s became final', $fromMethod->getName(), $fromMethod->getDeclaringClass()->getName() diff --git a/src/DetectChanges/BCBreak/MethodBased/MethodConcretenessChanged.php b/src/DetectChanges/BCBreak/MethodBased/MethodConcretenessChanged.php index a42aaa93..c42942c8 100644 --- a/src/DetectChanges/BCBreak/MethodBased/MethodConcretenessChanged.php +++ b/src/DetectChanges/BCBreak/MethodBased/MethodConcretenessChanged.php @@ -7,8 +7,7 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionMethod; - -use function Safe\sprintf; +use Psl\Str; /** * A method that changes from concrete to abstract forces all child class @@ -23,7 +22,7 @@ public function __invoke(ReflectionMethod $fromMethod, ReflectionMethod $toMetho } return Changes::fromList(Change::changed( - sprintf( + Str\format( 'Method %s() of class %s changed from concrete to abstract', $fromMethod->getName(), $fromMethod->getDeclaringClass()->getName() diff --git a/src/DetectChanges/BCBreak/MethodBased/MethodScopeChanged.php b/src/DetectChanges/BCBreak/MethodBased/MethodScopeChanged.php index 4ecf8c31..d9720fd6 100644 --- a/src/DetectChanges/BCBreak/MethodBased/MethodScopeChanged.php +++ b/src/DetectChanges/BCBreak/MethodBased/MethodScopeChanged.php @@ -7,8 +7,7 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionMethod; - -use function Safe\sprintf; +use Psl\Str; /** * A method that changes from instance to static or the opposite has to be called differently, @@ -26,7 +25,7 @@ public function __invoke(ReflectionMethod $fromMethod, ReflectionMethod $toMetho } return Changes::fromList(Change::changed( - sprintf( + Str\format( 'Method %s() of class %s changed scope from %s to %s', $fromMethod->getName(), $fromMethod->getDeclaringClass()->getName(), diff --git a/src/DetectChanges/BCBreak/MethodBased/MethodVisibilityReduced.php b/src/DetectChanges/BCBreak/MethodBased/MethodVisibilityReduced.php index 195ed71a..a88af931 100644 --- a/src/DetectChanges/BCBreak/MethodBased/MethodVisibilityReduced.php +++ b/src/DetectChanges/BCBreak/MethodBased/MethodVisibilityReduced.php @@ -7,8 +7,7 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionMethod; - -use function Safe\sprintf; +use Psl\Str; final class MethodVisibilityReduced implements MethodBased { @@ -29,7 +28,7 @@ public function __invoke(ReflectionMethod $fromMethod, ReflectionMethod $toMetho } return Changes::fromList(Change::changed( - sprintf( + Str\format( 'Method %s() of class %s visibility reduced from %s to %s', $fromMethod->getName(), $fromMethod->getDeclaringClass()->getName(), diff --git a/src/DetectChanges/BCBreak/PropertyBased/ExcludeInternalProperty.php b/src/DetectChanges/BCBreak/PropertyBased/ExcludeInternalProperty.php index 534a04d3..b3bf56cb 100644 --- a/src/DetectChanges/BCBreak/PropertyBased/ExcludeInternalProperty.php +++ b/src/DetectChanges/BCBreak/PropertyBased/ExcludeInternalProperty.php @@ -6,8 +6,7 @@ use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionProperty; - -use function Safe\preg_match; +use Psl\Regex; final class ExcludeInternalProperty implements PropertyBased { @@ -29,6 +28,6 @@ public function __invoke(ReflectionProperty $fromProperty, ReflectionProperty $t private function isInternalDocComment(string $comment): bool { - return preg_match('/\s+@internal\s+/', $comment) === 1; + return Regex\matches($comment, '/\s+@internal\s+/'); } } diff --git a/src/DetectChanges/BCBreak/PropertyBased/PropertyBecameInternal.php b/src/DetectChanges/BCBreak/PropertyBased/PropertyBecameInternal.php index acd432cc..7cb0d864 100644 --- a/src/DetectChanges/BCBreak/PropertyBased/PropertyBecameInternal.php +++ b/src/DetectChanges/BCBreak/PropertyBased/PropertyBecameInternal.php @@ -8,9 +8,8 @@ use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionPropertyName; use Roave\BetterReflection\Reflection\ReflectionProperty; - -use function Safe\preg_match; -use function Safe\sprintf; +use Psl\Str; +use Psl\Regex; /** * A property that is marked internal is no available to downstream consumers. @@ -31,7 +30,7 @@ public function __invoke(ReflectionProperty $fromProperty, ReflectionProperty $t && ! $this->isInternalDocComment($fromProperty->getDocComment()) ) { return Changes::fromList(Change::changed( - sprintf( + Str\format( 'Property %s was marked "@internal"', $this->formatProperty->__invoke($fromProperty), ), @@ -44,6 +43,6 @@ public function __invoke(ReflectionProperty $fromProperty, ReflectionProperty $t private function isInternalDocComment(string $comment): bool { - return preg_match('/\s+@internal\s+/', $comment) === 1; + return Regex\matches($comment, '/\s+@internal\s+/'); } } diff --git a/src/DetectChanges/BCBreak/PropertyBased/PropertyDefaultValueChanged.php b/src/DetectChanges/BCBreak/PropertyBased/PropertyDefaultValueChanged.php index f1aee733..c7f80d29 100644 --- a/src/DetectChanges/BCBreak/PropertyBased/PropertyDefaultValueChanged.php +++ b/src/DetectChanges/BCBreak/PropertyBased/PropertyDefaultValueChanged.php @@ -8,8 +8,7 @@ use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionPropertyName; use Roave\BetterReflection\Reflection\ReflectionProperty; - -use function Safe\sprintf; +use Psl\Str; use function var_export; final class PropertyDefaultValueChanged implements PropertyBased @@ -31,7 +30,7 @@ public function __invoke(ReflectionProperty $fromProperty, ReflectionProperty $t } return Changes::fromList(Change::changed( - sprintf( + Str\format( 'Property %s changed default value from %s to %s', $this->formatProperty->__invoke($fromProperty), var_export($fromPropertyDefaultValue, true), diff --git a/src/DetectChanges/BCBreak/PropertyBased/PropertyDocumentedTypeChanged.php b/src/DetectChanges/BCBreak/PropertyBased/PropertyDocumentedTypeChanged.php index 1128e297..f4561c7a 100644 --- a/src/DetectChanges/BCBreak/PropertyBased/PropertyDocumentedTypeChanged.php +++ b/src/DetectChanges/BCBreak/PropertyBased/PropertyDocumentedTypeChanged.php @@ -8,10 +8,8 @@ use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionPropertyName; use Roave\BetterReflection\Reflection\ReflectionProperty; - -use function implode; -use function Safe\sort; -use function Safe\sprintf; +use Psl\Str; +use Psl\Vec; /** * Type declarations for properties are invariant: you can't restrict the type because the consumer may @@ -33,22 +31,19 @@ public function __invoke(ReflectionProperty $fromProperty, ReflectionProperty $t return Changes::empty(); } - $fromTypes = $fromProperty->getDocBlockTypeStrings(); - $toTypes = $toProperty->getDocBlockTypeStrings(); - - sort($fromTypes); - sort($toTypes); + $fromTypes = Vec\sort($fromProperty->getDocBlockTypeStrings()); + $toTypes = Vec\sort($toProperty->getDocBlockTypeStrings()); if ($fromTypes === $toTypes) { return Changes::empty(); } return Changes::fromList(Change::changed( - sprintf( + Str\format( 'Type documentation for property %s changed from %s to %s', $this->formatProperty->__invoke($fromProperty), - implode('|', $fromTypes) ?: 'having no type', - implode('|', $toTypes) ?: 'having no type' + Str\join($fromTypes, '|') ?: 'having no type', + Str\join($toTypes, '|') ?: 'having no type' ), true )); diff --git a/src/DetectChanges/BCBreak/PropertyBased/PropertyScopeChanged.php b/src/DetectChanges/BCBreak/PropertyBased/PropertyScopeChanged.php index 9d0dc98c..c7699d43 100644 --- a/src/DetectChanges/BCBreak/PropertyBased/PropertyScopeChanged.php +++ b/src/DetectChanges/BCBreak/PropertyBased/PropertyScopeChanged.php @@ -7,8 +7,7 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionProperty; - -use function Safe\sprintf; +use Psl\Str; /** * A property that changes from instance to static or the opposite has to be accessed differently, @@ -26,7 +25,7 @@ public function __invoke(ReflectionProperty $fromProperty, ReflectionProperty $t } return Changes::fromList(Change::changed( - sprintf( + Str\format( 'Property $%s of %s changed scope from %s to %s', $fromProperty->getName(), $fromProperty->getDeclaringClass()->getName(), diff --git a/src/DetectChanges/BCBreak/PropertyBased/PropertyVisibilityReduced.php b/src/DetectChanges/BCBreak/PropertyBased/PropertyVisibilityReduced.php index 32619f10..b2af72be 100644 --- a/src/DetectChanges/BCBreak/PropertyBased/PropertyVisibilityReduced.php +++ b/src/DetectChanges/BCBreak/PropertyBased/PropertyVisibilityReduced.php @@ -8,8 +8,7 @@ use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionPropertyName; use Roave\BetterReflection\Reflection\ReflectionProperty; - -use function Safe\sprintf; +use Psl\Str; final class PropertyVisibilityReduced implements PropertyBased { @@ -37,7 +36,7 @@ public function __invoke(ReflectionProperty $fromProperty, ReflectionProperty $t } return Changes::fromList(Change::changed( - sprintf( + Str\format( 'Property %s visibility reduced from %s to %s', $this->formatProperty->__invoke($fromProperty), $visibilityFrom, diff --git a/src/DetectChanges/BCBreak/TraitBased/ExcludeInternalTrait.php b/src/DetectChanges/BCBreak/TraitBased/ExcludeInternalTrait.php index 4a32e38c..777d5953 100644 --- a/src/DetectChanges/BCBreak/TraitBased/ExcludeInternalTrait.php +++ b/src/DetectChanges/BCBreak/TraitBased/ExcludeInternalTrait.php @@ -6,8 +6,7 @@ use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; - -use function Safe\preg_match; +use Psl\Regex; /** * Traits marked "internal" (docblock) are not affected by BC checks. @@ -21,17 +20,17 @@ public function __construct(TraitBased $check) $this->check = $check; } - public function __invoke(ReflectionClass $fromInterface, ReflectionClass $toInterface): Changes + public function __invoke(ReflectionClass $fromTrait, ReflectionClass $toTrait): Changes { - if ($this->isInternalDocComment($fromInterface->getDocComment())) { + if ($this->isInternalDocComment($fromTrait->getDocComment())) { return Changes::empty(); } - return $this->check->__invoke($fromInterface, $toInterface); + return $this->check->__invoke($fromTrait, $toTrait); } private function isInternalDocComment(string $comment): bool { - return preg_match('/\s+@internal\s+/', $comment) === 1; + return Regex\matches( $comment, '/\s+@internal\s+/'); } } diff --git a/src/DetectChanges/BCBreak/TraitBased/TraitBecameClass.php b/src/DetectChanges/BCBreak/TraitBased/TraitBecameClass.php index e2e64f8d..32c5112f 100644 --- a/src/DetectChanges/BCBreak/TraitBased/TraitBecameClass.php +++ b/src/DetectChanges/BCBreak/TraitBased/TraitBecameClass.php @@ -7,8 +7,7 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; - -use function Safe\sprintf; +use Psl\Str; /** * A trait cannot change to become a class, as that forces all implementations @@ -23,7 +22,7 @@ public function __invoke(ReflectionClass $fromTrait, ReflectionClass $toTrait): } return Changes::fromList(Change::changed( - sprintf('Trait %s became a class', $fromTrait->getName()), + Str\format('Trait %s became a class', $fromTrait->getName()), true )); } diff --git a/src/DetectChanges/BCBreak/TraitBased/TraitBecameInterface.php b/src/DetectChanges/BCBreak/TraitBased/TraitBecameInterface.php index 7b783487..8fc857ce 100644 --- a/src/DetectChanges/BCBreak/TraitBased/TraitBecameInterface.php +++ b/src/DetectChanges/BCBreak/TraitBased/TraitBecameInterface.php @@ -7,8 +7,7 @@ use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; - -use function Safe\sprintf; +use Psl\Str; /** * A trait cannot change to become a interface, as that forces all implementations @@ -23,7 +22,7 @@ public function __invoke(ReflectionClass $fromTrait, ReflectionClass $toTrait): } return Changes::fromList(Change::changed( - sprintf('Interface %s became an interface', $fromTrait->getName()), + Str\format('Interface %s became an interface', $fromTrait->getName()), true )); } diff --git a/src/Git/GitCheckoutRevisionToTemporaryPath.php b/src/Git/GitCheckoutRevisionToTemporaryPath.php index 42fb60f7..dcfbe8c1 100644 --- a/src/Git/GitCheckoutRevisionToTemporaryPath.php +++ b/src/Git/GitCheckoutRevisionToTemporaryPath.php @@ -7,10 +7,9 @@ use RuntimeException; use Symfony\Component\Process\Exception\RuntimeException as ProcessRuntimeException; use Symfony\Component\Process\Process; - -use function file_exists; -use function Safe\sprintf; -use function sys_get_temp_dir; +use Psl\Filesystem; +use Psl\Env; +use Psl\Str; final class GitCheckoutRevisionToTemporaryPath implements PerformCheckoutOfRevision { @@ -23,8 +22,6 @@ public function __construct(?callable $uniquenessFunction = null) } /** - * {@inheritDoc} - * * @throws ProcessRuntimeException */ public function checkout(CheckedOutRepository $sourceRepository, Revision $revision): CheckedOutRepository @@ -38,8 +35,6 @@ public function checkout(CheckedOutRepository $sourceRepository, Revision $revis } /** - * {@inheritDoc} - * * @throws ProcessRuntimeException */ public function remove(CheckedOutRepository $checkedOutRepository): void @@ -53,10 +48,10 @@ public function remove(CheckedOutRepository $checkedOutRepository): void private function generateTemporaryPathFor(Revision $revision): string { $uniquePathGenerator = $this->uniquenessFunction; - $checkoutDirectory = sys_get_temp_dir() . '/api-compare-' . $uniquePathGenerator($revision . '_'); + $checkoutDirectory = Env\temp_dir() . '/api-compare-' . $uniquePathGenerator($revision . '_'); - if (file_exists($checkoutDirectory)) { - throw new RuntimeException(sprintf( + if (Filesystem\exists($checkoutDirectory)) { + throw new RuntimeException(Str\format( 'Tried to check out revision "%s" to directory "%s" which already exists', $revision->__toString(), $checkoutDirectory diff --git a/src/LocateDependencies/LocateDependenciesViaComposer.php b/src/LocateDependencies/LocateDependenciesViaComposer.php index a5a1ce0a..e6a71b73 100644 --- a/src/LocateDependencies/LocateDependenciesViaComposer.php +++ b/src/LocateDependencies/LocateDependenciesViaComposer.php @@ -11,11 +11,10 @@ use Roave\BetterReflection\SourceLocator\Type\Composer\Factory\MakeLocatorForInstalledJson; use Roave\BetterReflection\SourceLocator\Type\PhpInternalSourceLocator; use Roave\BetterReflection\SourceLocator\Type\SourceLocator; -use Webmozart\Assert\Assert; - -use function assert; -use function Safe\chdir; -use function Safe\getcwd; +use Psl\Filesystem; +use Psl; +use Psl\Env; +use Psl\Type; final class LocateDependenciesViaComposer implements LocateDependencies { @@ -38,12 +37,10 @@ public function __construct( public function __invoke(string $installationPath): SourceLocator { - Assert::file($installationPath . '/composer.json'); + Psl\invariant(Filesystem\is_file($installationPath . '/composer.json'), 'Could not locate composer.json within installation path.'); $this->runInDirectory(function () use ($installationPath): void { - $installer = ($this->makeComposerInstaller)($installationPath); - - assert($installer instanceof Installer); + $installer = Type\object(Installer::class)->assert(($this->makeComposerInstaller)($installationPath)); // Some defaults needed for this specific implementation: $installer->setDevMode(false); @@ -62,13 +59,13 @@ public function __invoke(string $installationPath): SourceLocator private function runInDirectory(callable $callable, string $directoryOfExecution): void { - $originalDirectory = getcwd(); + $originalDirectory = Env\current_dir(); try { - chdir($directoryOfExecution); + Env\set_current_dir($directoryOfExecution); $callable(); } finally { - chdir($originalDirectory); + Env\set_current_dir($originalDirectory); } } } diff --git a/src/SourceLocator/StaticClassMapSourceLocator.php b/src/SourceLocator/StaticClassMapSourceLocator.php index 8701a54e..e0353522 100644 --- a/src/SourceLocator/StaticClassMapSourceLocator.php +++ b/src/SourceLocator/StaticClassMapSourceLocator.php @@ -9,14 +9,13 @@ use Roave\BetterReflection\SourceLocator\Located\LocatedSource; use Roave\BetterReflection\SourceLocator\Type\AbstractSourceLocator; use Webmozart\Assert\Assert; - -use function array_keys; -use function array_map; -use function Safe\file_get_contents; +use Psl\Type; +use Psl\Dict; +use Psl\Filesystem; final class StaticClassMapSourceLocator extends AbstractSourceLocator { - /** @var string[] */ + /** @var array */ private array $classMap; /** @@ -29,13 +28,13 @@ public function __construct( ) { parent::__construct($astLocator); - /** @var string[] $realPaths */ - $realPaths = array_map('realpath', $classMap); - + $realPaths = Dict\map($classMap, static function(string $file): string { + return Filesystem\canonicalize($file); + }); + Assert::allFile($realPaths); - Assert::allStringNotEmpty(array_keys($classMap)); - $this->classMap = $realPaths; + $this->classMap = Type\dict(Type\non_empty_string(), Type\string())->coerce($realPaths); } protected function createLocatedSource(Identifier $identifier): ?LocatedSource @@ -50,6 +49,6 @@ protected function createLocatedSource(Identifier $identifier): ?LocatedSource return null; } - return new LocatedSource(file_get_contents($classFile), $classFile); + return new LocatedSource(Filesystem\read_file($classFile), $classFile); } } diff --git a/test/unit/Command/AssertBackwardsCompatibleTest.php b/test/unit/Command/AssertBackwardsCompatibleTest.php index 86812164..3746fdea 100644 --- a/test/unit/Command/AssertBackwardsCompatibleTest.php +++ b/test/unit/Command/AssertBackwardsCompatibleTest.php @@ -4,9 +4,9 @@ namespace RoaveTest\BackwardCompatibility\Command; -use InvalidArgumentException; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Psl\Exception\InvariantViolationException; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Command\AssertBackwardsCompatible; @@ -27,11 +27,10 @@ use Symfony\Component\Console\Output\OutputInterface; use Version\Version; use Version\VersionCollection; - -use function Safe\chdir; -use function Safe\realpath; -use function sha1; -use function uniqid; +use Psl\SecureRandom; +use Psl\Filesystem; +use Psl\Env; +use Psl\Hash; /** * @covers \Roave\BackwardCompatibility\Command\AssertBackwardsCompatible @@ -73,11 +72,12 @@ final class AssertBackwardsCompatibleTest extends TestCase public function setUp(): void { - $repositoryPath = realpath(__DIR__ . '/../../../'); + /** @var string $repositoryPath */ + $repositoryPath = Filesystem\canonicalize(__DIR__ . '/../../../'); $this->sourceRepository = CheckedOutRepository::fromPath($repositoryPath); - chdir($this->sourceRepository->__toString()); + Env\set_current_dir($this->sourceRepository->__toString()); $this->input = $this->createMock(InputInterface::class); $this->output = $this->createMock(ConsoleOutputInterface::class); @@ -133,8 +133,8 @@ public function testDefinition(): void public function testExecuteWhenRevisionsAreProvidedAsOptions(): void { - $fromSha = sha1('fromRevision', false); - $toSha = sha1('toRevision', false); + $fromSha = Hash\Context::forAlgorithm('sha1')->update('fromRevision')->finalize(); + $toSha = Hash\Context::forAlgorithm('sha1')->update('toRevision')->finalize(); $this->input->expects(self::any())->method('getOption')->willReturnMap([ ['from', $fromSha], @@ -182,8 +182,8 @@ public function testExecuteWhenRevisionsAreProvidedAsOptions(): void public function testExecuteReturnsNonZeroExitCodeWhenChangesAreDetected(): void { - $fromSha = sha1('fromRevision', false); - $toSha = sha1('toRevision', false); + $fromSha = Hash\Context::forAlgorithm('sha1')->update('fromRevision')->finalize(); + $toSha = Hash\Context::forAlgorithm('sha1')->update('toRevision')->finalize(); $this->input->expects(self::any())->method('getOption')->willReturnMap([ ['from', $fromSha], @@ -225,7 +225,7 @@ public function testExecuteReturnsNonZeroExitCodeWhenChangesAreDetected(): void ->willReturn($this->dependencies); $this->compareApi->expects(self::once())->method('__invoke')->willReturn(Changes::fromList( - Change::added(uniqid('added', true), true) + Change::added('added'.SecureRandom\string(8), true) )); $this @@ -243,8 +243,8 @@ public function testExecuteReturnsNonZeroExitCodeWhenChangesAreDetected(): void public function testProvidingMarkdownOptionWritesMarkdownOutput(): void { - $fromSha = sha1('fromRevision', false); - $toSha = sha1('toRevision', false); + $fromSha = Hash\Context::forAlgorithm('sha1')->update('fromRevision')->finalize(); + $toSha = Hash\Context::forAlgorithm('sha1')->update('toRevision')->finalize(); $this->input->expects(self::any())->method('getOption')->willReturnMap([ ['from', $fromSha], @@ -285,7 +285,7 @@ public function testProvidingMarkdownOptionWritesMarkdownOutput(): void ->with((string) $this->sourceRepository) ->willReturn($this->dependencies); - $changeToExpect = uniqid('changeToExpect', true); + $changeToExpect = SecureRandom\string(8); $this->compareApi->expects(self::once())->method('__invoke')->willReturn(Changes::fromList( Change::removed($changeToExpect, true) )); @@ -333,7 +333,7 @@ public function testExecuteWithDefaultRevisionsNotProvidedAndNoDetectedTags(): v ->expects(self::never()) ->method('__invoke'); - $this->expectException(InvalidArgumentException::class); + $this->expectException(InvariantViolationException::class); $this->compare->execute($this->input, $this->output); } @@ -343,8 +343,8 @@ public function testExecuteWithDefaultRevisionsNotProvidedAndNoDetectedTags(): v */ public function testExecuteWithDefaultRevisionsNotProvided(VersionCollection $versions): void { - $fromSha = sha1('fromRevision', false); - $toSha = sha1('toRevision', false); + $fromSha = Hash\Context::forAlgorithm('sha1')->update('fromRevision')->finalize(); + $toSha = Hash\Context::forAlgorithm('sha1')->update('toRevision')->finalize(); $pickedVersion = Version::fromString('1.0.0'); $this->input->expects(self::any())->method('getOption')->willReturnMap([ diff --git a/test/unit/Formatter/SymfonyConsoleTextFormatterTest.php b/test/unit/Formatter/SymfonyConsoleTextFormatterTest.php index f09c6511..ca7e978b 100644 --- a/test/unit/Formatter/SymfonyConsoleTextFormatterTest.php +++ b/test/unit/Formatter/SymfonyConsoleTextFormatterTest.php @@ -10,9 +10,8 @@ use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\SymfonyConsoleTextFormatter; use Symfony\Component\Console\Output\OutputInterface; - -use function Safe\sprintf; -use function uniqid; +use Psl\Str; +use Psl\SecureRandom; /** * @covers \Roave\BackwardCompatibility\Formatter\SymfonyConsoleTextFormatter @@ -24,16 +23,16 @@ final class SymfonyConsoleTextFormatterTest extends TestCase */ public function testWrite(): void { - $change1Text = uniqid('change1', true); - $change2Text = uniqid('change2', true); + $change1Text = SecureRandom\string(8); + $change2Text = SecureRandom\string(8); $output = $this->createMock(OutputInterface::class); $output->expects(self::at(0)) ->method('writeln') - ->with(sprintf('[BC] REMOVED: %s', $change1Text)); + ->with(Str\format('[BC] REMOVED: %s', $change1Text)); $output->expects(self::at(1)) ->method('writeln') - ->with(sprintf(' ADDED: %s', $change2Text)); + ->with(Str\format(' ADDED: %s', $change2Text)); (new SymfonyConsoleTextFormatter($output))->write(Changes::fromList( Change::removed($change1Text, true), diff --git a/test/unit/Git/CheckedOutRepositoryTest.php b/test/unit/Git/CheckedOutRepositoryTest.php index 55fb23a0..8cccecc6 100644 --- a/test/unit/Git/CheckedOutRepositoryTest.php +++ b/test/unit/Git/CheckedOutRepositoryTest.php @@ -7,11 +7,9 @@ use InvalidArgumentException; use PHPUnit\Framework\TestCase; use Roave\BackwardCompatibility\Git\CheckedOutRepository; - -use function Safe\mkdir; -use function Safe\rmdir; -use function sys_get_temp_dir; -use function uniqid; +use Psl\Filesystem; +use Psl\SecureRandom; +use Psl\Env; /** * @covers \Roave\BackwardCompatibility\Git\CheckedOutRepository @@ -20,15 +18,15 @@ final class CheckedOutRepositoryTest extends TestCase { public function testFromPath(): void { - $path = sys_get_temp_dir() . '/' . uniqid('testPath', true); - mkdir($path, 0777, true); - mkdir($path . '/.git'); + $path = Env\temp_dir() . '/' . SecureRandom\string(8); + Filesystem\create_directory($path); + Filesystem\create_directory($path . '/.git'); $checkedOutRepository = CheckedOutRepository::fromPath($path); self::assertSame($path, (string) $checkedOutRepository); - rmdir($path . '/.git'); - rmdir($path); + Filesystem\delete_directory($path . '/.git', true); + Filesystem\delete_directory($path, true); } public function testFromPathRejectsNonGitDirectory(): void diff --git a/test/unit/Git/GetVersionCollectionFromGitRepositoryTest.php b/test/unit/Git/GetVersionCollectionFromGitRepositoryTest.php index 83a3026b..77825788 100644 --- a/test/unit/Git/GetVersionCollectionFromGitRepositoryTest.php +++ b/test/unit/Git/GetVersionCollectionFromGitRepositoryTest.php @@ -7,15 +7,12 @@ use PHPUnit\Framework\TestCase; use Roave\BackwardCompatibility\Git\CheckedOutRepository; use Roave\BackwardCompatibility\Git\GetVersionCollectionFromGitRepository; -use Symfony\Component\Process\Process; use Version\Version; - -use function array_map; -use function iterator_to_array; -use function Safe\file_put_contents; -use function Safe\mkdir; -use function sys_get_temp_dir; -use function uniqid; +use Psl\Filesystem; +use Psl\Dict; +use Psl\Env; +use Psl\SecureRandom; +use Psl\Shell; /** * @covers \Roave\BackwardCompatibility\Git\GetVersionCollectionFromGitRepository @@ -26,36 +23,36 @@ final class GetVersionCollectionFromGitRepositoryTest extends TestCase public function setUp(): void { - $tmpGitRepo = sys_get_temp_dir() . '/api-compare-' . uniqid('tmpGitRepo', true); - mkdir($tmpGitRepo, 0777, true); - (new Process(['git', 'init'], $tmpGitRepo))->mustRun(); - (new Process(['git', 'config', 'user.email', 'me@example.com'], $tmpGitRepo))->mustRun(); - (new Process(['git', 'config', 'user.name', 'Me Again'], $tmpGitRepo))->mustRun(); - file_put_contents($tmpGitRepo . '/test', uniqid('testContent', true)); - (new Process(['git', 'add', '.'], $tmpGitRepo))->mustRun(); - (new Process(['git', 'commit', '-m', '"whatever"'], $tmpGitRepo))->mustRun(); + $tmpGitRepo = Env\temp_dir() . '/api-compare-' . SecureRandom\string(8); + Filesystem\create_directory($tmpGitRepo); + Shell\execute('git', ['init'], $tmpGitRepo); + Shell\execute('git', ['config', 'user.email', 'me@example.com'], $tmpGitRepo); + Shell\execute('git', ['config', 'user.name', 'Me Again'], $tmpGitRepo); + Filesystem\write_file($tmpGitRepo . '/test', SecureRandom\string(8)); + Shell\execute('git', ['add', '.'], $tmpGitRepo); + Shell\execute('git', ['commit', '-m', '"whatever"'], $tmpGitRepo); $this->repoPath = CheckedOutRepository::fromPath($tmpGitRepo); } public function tearDown(): void { - (new Process(['rm', '-Rf', (string) $this->repoPath]))->mustRun(); + Shell\execute('rm', ['-Rf', (string) $this->repoPath]); } private function makeTag(string $tagName): void { - (new Process(['git', 'tag', $tagName], $this->repoPath->__toString()))->mustRun(); + Shell\execute('git', ['tag', $tagName], (string) $this->repoPath); } /** @return string[] */ private function getTags(): array { - return array_map( + return Dict\map( + (new GetVersionCollectionFromGitRepository())->fromRepository($this->repoPath), static function (Version $version): string { return $version->toString(); }, - iterator_to_array((new GetVersionCollectionFromGitRepository())->fromRepository($this->repoPath)) ); } diff --git a/test/unit/Git/GitCheckoutRevisionToTemporaryPathTest.php b/test/unit/Git/GitCheckoutRevisionToTemporaryPathTest.php index f25cd8ae..c3e426d8 100644 --- a/test/unit/Git/GitCheckoutRevisionToTemporaryPathTest.php +++ b/test/unit/Git/GitCheckoutRevisionToTemporaryPathTest.php @@ -10,13 +10,9 @@ use Roave\BackwardCompatibility\Git\Revision; use RuntimeException; use Symfony\Component\Process\Process; - -use function Safe\file_put_contents; -use function Safe\mkdir; -use function Safe\realpath; -use function Safe\tempnam; -use function Safe\unlink; -use function sys_get_temp_dir; +use Psl\Shell; +use Psl\Filesystem; +use Psl\Env; /** * @covers \Roave\BackwardCompatibility\Git\GitCheckoutRevisionToTemporaryPath @@ -60,36 +56,24 @@ public function testCanCheckOutSameRevisionTwice(): void public function testCheckedOutRevisionIsAtExpectedRevisionState(): void { - $repoPath = tempnam(sys_get_temp_dir(), 'test-git-repo-'); - - unlink($repoPath); - mkdir($repoPath); - - (new Process(['git', 'init'], $repoPath)) - ->mustRun(); - - (new Process(['git', 'config', 'user.email', 'me@example.com'], $repoPath)) - ->mustRun(); + $repoPath = Filesystem\create_temporary_file(Env\temp_dir(), 'test-git-repo-'); - (new Process(['git', 'config', 'user.name', 'Mr Magoo'], $repoPath)) - ->mustRun(); + Filesystem\delete_file($repoPath); + Filesystem\create_directory($repoPath); - (new Process(['git', 'commit', '-m', 'initial commit', '--allow-empty'], $repoPath)) - ->mustRun(); + Shell\execute('git', ['init'], $repoPath); + Shell\execute('git', ['config', 'user.email', 'me@example.com'], $repoPath); + Shell\execute('git', ['config', 'user.name', 'Mr Magoo'], $repoPath); + Shell\execute('git', ['commit', '-m', 'initial commit', '--allow-empty'], $repoPath); $firstCommit = Revision::fromSha1( - (new Process(['git', 'rev-parse', 'HEAD'], $repoPath)) - ->mustRun() - ->getOutput() + Shell\execute('git', ['rev-parse', 'HEAD'], $repoPath) ); - file_put_contents($repoPath . '/a-file.txt', 'file contents'); - - (new Process(['git', 'add', 'a-file.txt'], $repoPath)) - ->mustRun(); + Filesystem\write_file($repoPath . '/a-file.txt', 'file contents'); - (new Process(['git', 'commit', '-m', 'second commit', '--allow-empty'], $repoPath)) - ->mustRun(); + Shell\execute('git', ['add', 'a-file.txt'], $repoPath); + Shell\execute('git', ['commit', '-m', 'second commit', '--allow-empty'], $repoPath); $secondCommit = Revision::fromSha1( (new Process(['git', 'rev-parse', 'HEAD'], $repoPath)) @@ -109,7 +93,7 @@ public function testCheckedOutRevisionIsAtExpectedRevisionState(): void $git->remove($first); $git->remove($second); - (new Process(['rm', '-rf', $repoPath]))->mustRun(); + Shell\execute('rm', ['-rf', $repoPath]); } public function testExceptionIsThrownWhenTwoPathsCollide(): void @@ -142,6 +126,6 @@ public function testExceptionIsThrownWhenTwoPathsCollide(): void private function sourceRepository(): CheckedOutRepository { - return CheckedOutRepository::fromPath(realpath(__DIR__ . '/../../..')); + return CheckedOutRepository::fromPath((string) Filesystem\canonicalize(__DIR__ . '/../../..')); } } diff --git a/test/unit/LocateDependencies/LocateDependenciesViaComposerTest.php b/test/unit/LocateDependencies/LocateDependenciesViaComposerTest.php index 1565da78..334f1943 100644 --- a/test/unit/LocateDependencies/LocateDependenciesViaComposerTest.php +++ b/test/unit/LocateDependencies/LocateDependenciesViaComposerTest.php @@ -5,18 +5,17 @@ namespace RoaveTest\BackwardCompatibility\LocateDependencies; use Composer\Installer; -use InvalidArgumentException; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Psl\Exception\InvariantViolationException; use ReflectionProperty; use Roave\BackwardCompatibility\LocateDependencies\LocateDependenciesViaComposer; use Roave\BetterReflection\BetterReflection; use Roave\BetterReflection\SourceLocator\Ast\Locator; use Roave\BetterReflection\SourceLocator\Type\AggregateSourceLocator; use Roave\BetterReflection\SourceLocator\Type\PhpInternalSourceLocator; - -use function Safe\getcwd; -use function Safe\realpath; +use Psl\Env; +use Psl\Filesystem; /** * @covers \Roave\BackwardCompatibility\LocateDependencies\LocateDependenciesViaComposer @@ -44,7 +43,7 @@ protected function setUp(): void { parent::setUp(); - $this->originalCwd = getcwd(); + $this->originalCwd = Env\current_dir(); $this->composerInstaller = $this->createMock(Installer::class); $this->astLocator = (new BetterReflection())->astLocator(); $this->makeInstaller = function (string $installationPath): Installer { @@ -58,7 +57,7 @@ protected function setUp(): void protected function tearDown(): void { - self::assertSame($this->originalCwd, getcwd()); + self::assertSame($this->originalCwd, Env\current_dir()); parent::tearDown(); } @@ -70,7 +69,8 @@ public function testWillNotLocateDependenciesForANonExistingPath(): void ->expects(self::never()) ->method('run'); - $this->expectException(InvalidArgumentException::class); + $this->expectException(InvariantViolationException::class); + $this->expectExceptionMessage('Could not locate composer.json within installation path.'); $this ->locateDependencies @@ -79,7 +79,7 @@ public function testWillNotLocateDependenciesForANonExistingPath(): void public function testWillLocateDependencies(): void { - $this->expectedInstallatonPath = realpath(__DIR__ . '/../../asset/composer-installation-structure'); + $this->expectedInstallatonPath = Filesystem\canonicalize(__DIR__ . '/../../asset/composer-installation-structure'); $this ->composerInstaller @@ -107,7 +107,7 @@ public function testWillLocateDependencies(): void ->expects(self::once()) ->method('run') ->willReturnCallback(function (): void { - self::assertSame($this->expectedInstallatonPath, getcwd()); + self::assertSame($this->expectedInstallatonPath, Env\current_dir()); }); $locator = $this diff --git a/test/unit/SourceLocator/StaticClassMapSourceLocatorTest.php b/test/unit/SourceLocator/StaticClassMapSourceLocatorTest.php index 4cd20506..c3857741 100644 --- a/test/unit/SourceLocator/StaticClassMapSourceLocatorTest.php +++ b/test/unit/SourceLocator/StaticClassMapSourceLocatorTest.php @@ -7,6 +7,7 @@ use InvalidArgumentException; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Psl\Type\Exception\CoercionException; use Roave\BackwardCompatibility\SourceLocator\StaticClassMapSourceLocator; use Roave\BetterReflection\Identifier\Identifier; use Roave\BetterReflection\Identifier\IdentifierType; @@ -14,8 +15,7 @@ use Roave\BetterReflection\Reflector\Reflector; use Roave\BetterReflection\SourceLocator\Ast\Locator; use Roave\BetterReflection\SourceLocator\Located\LocatedSource; - -use function Safe\file_get_contents; +use Psl\Filesystem; /** * @covers \Roave\BackwardCompatibility\SourceLocator\StaticClassMapSourceLocator @@ -38,7 +38,8 @@ protected function setUp(): void public function testRejectsEmptyKeys(): void { - $this->expectException(InvalidArgumentException::class); + $this->expectException(CoercionException::class); + $this->expectExceptionMessage('Could not coerce "string" to type "non-empty-string".'); new StaticClassMapSourceLocator( ['' => __FILE__], @@ -79,7 +80,7 @@ public function testWillLocateThisClass(string $thisClassFilePath): void ->expects(self::once()) ->method('findReflection') ->with($this->reflector, self::callback(static function (LocatedSource $source): bool { - self::assertSame(file_get_contents(__FILE__), $source->getSource()); + self::assertSame(Filesystem\read_file(__FILE__), $source->getSource()); self::assertSame(__FILE__, $source->getFileName()); self::assertNull($source->getExtensionName()); From c33636edadf64ee742891d9330a2bc5a1805f483 Mon Sep 17 00:00:00 2001 From: azjezz Date: Wed, 19 May 2021 02:57:02 +0100 Subject: [PATCH 02/12] upgrade to psalm 4 --- composer.json | 1 + composer.lock | 1674 ++++++++++------- psalm.xml | 19 +- src/Command/AssertBackwardsCompatible.php | 2 +- .../BCBreak/ClassBased/AncestorRemoved.php | 4 +- .../StaticClassMapSourceLocator.php | 4 +- .../LocateDependenciesViaComposerTest.php | 28 +- 7 files changed, 1000 insertions(+), 732 deletions(-) diff --git a/composer.json b/composer.json index bf7db623..42ebc096 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,7 @@ "require-dev": { "doctrine/coding-standard": "^8.2.0", "infection/infection": "^0.16.4", + "php-standard-library/psalm-plugin": "^1.1", "phpunit/phpunit": "^9.2.6", "roave/security-advisories": "dev-master", "squizlabs/php_codesniffer": "^3.6.0", diff --git a/composer.lock b/composer.lock index 2e7539e0..299033ea 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a0a4c1d24f49b11424e39225f86ddf6f", + "content-hash": "afef334a46c9ae58eb2b82b3fb663c5f", "packages": [ { "name": "azjezz/psl", @@ -65,21 +65,20 @@ }, { "name": "beberlei/assert", - "version": "v3.3.0", + "version": "v3.3.1", "source": { "type": "git", "url": "https://github.com/beberlei/assert.git", - "reference": "5367e3895976b49704ae671f75bc5f0ba1b986ab" + "reference": "5e721d7e937ca3ba2cdec1e1adf195f9e5188372" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/beberlei/assert/zipball/5367e3895976b49704ae671f75bc5f0ba1b986ab", - "reference": "5367e3895976b49704ae671f75bc5f0ba1b986ab", + "url": "https://api.github.com/repos/beberlei/assert/zipball/5e721d7e937ca3ba2cdec1e1adf195f9e5188372", + "reference": "5e721d7e937ca3ba2cdec1e1adf195f9e5188372", "shasum": "" }, "require": { "ext-ctype": "*", - "ext-intl": "*", "ext-json": "*", "ext-mbstring": "*", "ext-simplexml": "*", @@ -91,6 +90,9 @@ "phpunit/phpunit": ">=6.0.0", "yoast/phpunit-polyfills": "^0.1.0" }, + "suggest": { + "ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles" + }, "type": "library", "autoload": { "psr-4": { @@ -124,22 +126,22 @@ ], "support": { "issues": "https://github.com/beberlei/assert/issues", - "source": "https://github.com/beberlei/assert/tree/v3.3.0" + "source": "https://github.com/beberlei/assert/tree/v3.3.1" }, - "time": "2020-11-13T20:02:54+00:00" + "time": "2021-04-18T20:11:03+00:00" }, { "name": "composer/ca-bundle", - "version": "1.2.7", + "version": "1.2.9", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd" + "reference": "78a0e288fdcebf92aa2318a8d3656168da6ac1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/95c63ab2117a72f48f5a55da9740a3273d45b7fd", - "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/78a0e288fdcebf92aa2318a8d3656168da6ac1a5", + "reference": "78a0e288fdcebf92aa2318a8d3656168da6ac1a5", "shasum": "" }, "require": { @@ -148,14 +150,15 @@ "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", + "phpstan/phpstan": "^0.12.55", "psr/log": "^1.0", + "symfony/phpunit-bridge": "^4.2 || ^5", "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "1.x-dev" } }, "autoload": { @@ -185,19 +188,23 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.2.7" + "source": "https://github.com/composer/ca-bundle/tree/1.2.9" }, "funding": [ { "url": "https://packagist.com", "type": "custom" }, + { + "url": "https://github.com/composer", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/composer/composer", "type": "tidelift" } ], - "time": "2020-04-08T08:27:21+00:00" + "time": "2021-01-12T12:10:35+00:00" }, { "name": "composer/composer", @@ -366,31 +373,104 @@ ], "time": "2021-04-07T13:37:33+00:00" }, + { + "name": "composer/package-versions-deprecated", + "version": "1.11.99.1", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/7413f0b55a051e89485c5cb9f765fe24bb02a7b6", + "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7 || ^8" + }, + "replace": { + "ocramius/package-versions": "1.11.99" + }, + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "support": { + "issues": "https://github.com/composer/package-versions-deprecated/issues", + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.1" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-11-11T10:22:58+00:00" + }, { "name": "composer/semver", - "version": "3.0.0", + "version": "3.2.4", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "3426bd5efa8a12d230824536c42a8a4ad30b7940" + "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3426bd5efa8a12d230824536c42a8a4ad30b7940", - "reference": "3426bd5efa8a12d230824536c42a8a4ad30b7940", + "url": "https://api.github.com/repos/composer/semver/zipball/a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", + "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.19", + "phpstan/phpstan": "^0.12.54", "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { @@ -429,7 +509,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.0.0" + "source": "https://github.com/composer/semver/tree/3.2.4" }, "funding": [ { @@ -445,20 +525,20 @@ "type": "tidelift" } ], - "time": "2020-05-26T18:22:04+00:00" + "time": "2020-11-13T08:59:24+00:00" }, { "name": "composer/spdx-licenses", - "version": "1.5.4", + "version": "1.5.5", "source": { "type": "git", "url": "https://github.com/composer/spdx-licenses.git", - "reference": "6946f785871e2314c60b4524851f3702ea4f2223" + "reference": "de30328a7af8680efdc03e396aad24befd513200" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/6946f785871e2314c60b4524851f3702ea4f2223", - "reference": "6946f785871e2314c60b4524851f3702ea4f2223", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/de30328a7af8680efdc03e396aad24befd513200", + "reference": "de30328a7af8680efdc03e396aad24befd513200", "shasum": "" }, "require": { @@ -470,7 +550,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "1.x-dev" } }, "autoload": { @@ -508,7 +588,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/spdx-licenses/issues", - "source": "https://github.com/composer/spdx-licenses/tree/1.5.4" + "source": "https://github.com/composer/spdx-licenses/tree/1.5.5" }, "funding": [ { @@ -524,20 +604,20 @@ "type": "tidelift" } ], - "time": "2020-07-15T15:35:07+00:00" + "time": "2020-12-03T16:04:16+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.4.2", + "version": "1.4.6", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "fa2aaf99e2087f013a14f7432c1cd2dd7d8f1f51" + "reference": "f27e06cd9675801df441b3656569b328e04aa37c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/fa2aaf99e2087f013a14f7432c1cd2dd7d8f1f51", - "reference": "fa2aaf99e2087f013a14f7432c1cd2dd7d8f1f51", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f27e06cd9675801df441b3656569b328e04aa37c", + "reference": "f27e06cd9675801df441b3656569b328e04aa37c", "shasum": "" }, "require": { @@ -545,7 +625,8 @@ "psr/log": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "autoload": { @@ -571,7 +652,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/1.4.2" + "source": "https://github.com/composer/xdebug-handler/tree/1.4.6" }, "funding": [ { @@ -587,7 +668,7 @@ "type": "tidelift" } ], - "time": "2020-06-04T11:16:35+00:00" + "time": "2021-03-25T17:01:18+00:00" }, { "name": "jetbrains/phpstorm-stubs", @@ -708,16 +789,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.6.0", + "version": "v4.10.5", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "c346bbfafe2ff60680258b631afb730d186ed864" + "reference": "4432ba399e47c66624bc73c8c0f811e5c109576f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c346bbfafe2ff60680258b631afb730d186ed864", - "reference": "c346bbfafe2ff60680258b631afb730d186ed864", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4432ba399e47c66624bc73c8c0f811e5c109576f", + "reference": "4432ba399e47c66624bc73c8c0f811e5c109576f", "shasum": "" }, "require": { @@ -725,8 +806,8 @@ "php": ">=7.0" }, "require-dev": { - "ircmaxell/php-yacc": "0.0.5", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -734,7 +815,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.9-dev" } }, "autoload": { @@ -758,9 +839,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.6.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.5" }, - "time": "2020-07-02T17:12:47+00:00" + "time": "2021-05-03T19:11:20+00:00" }, { "name": "nikolaposa/version", @@ -823,72 +904,6 @@ }, "time": "2020-12-12T10:47:10+00:00" }, - { - "name": "ocramius/package-versions", - "version": "1.11.0", - "source": { - "type": "git", - "url": "https://github.com/Ocramius/PackageVersions.git", - "reference": "f51ff2b2b49baaa302d6bf71880e4d8b5acd7015" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/f51ff2b2b49baaa302d6bf71880e4d8b5acd7015", - "reference": "f51ff2b2b49baaa302d6bf71880e4d8b5acd7015", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^2.0.0", - "composer-runtime-api": "^2.0.0", - "php": "^7.4.7" - }, - "require-dev": { - "composer/composer": "^2.0.0@dev", - "doctrine/coding-standard": "^8.1.0", - "ext-zip": "^1.15.0", - "infection/infection": "^0.16.4", - "phpunit/phpunit": "^9.1.5", - "vimeo/psalm": "^3.12.2" - }, - "type": "composer-plugin", - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "1.99.x-dev" - } - }, - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "support": { - "issues": "https://github.com/Ocramius/PackageVersions/issues", - "source": "https://github.com/Ocramius/PackageVersions/tree/1.11.x" - }, - "funding": [ - { - "url": "https://github.com/Ocramius", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ocramius/package-versions", - "type": "tidelift" - } - ], - "time": "2020-08-21T12:16:47+00:00" - }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -944,28 +959,27 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.1.0", + "version": "5.2.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e" + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", - "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", "shasum": "" }, "require": { - "ext-filter": "^7.1", - "php": "^7.2", - "phpdocumentor/reflection-common": "^2.0", - "phpdocumentor/type-resolver": "^1.0", - "webmozart/assert": "^1" + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" }, "require-dev": { - "doctrine/instantiator": "^1", - "mockery/mockery": "^1" + "mockery/mockery": "~1.3.2" }, "type": "library", "extra": { @@ -995,22 +1009,22 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.1.0" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" }, - "time": "2020-02-22T12:28:44+00:00" + "time": "2020-09-03T19:13:55+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e878a14a65245fbe78f8080eba03b47c3b705651" + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e878a14a65245fbe78f8080eba03b47c3b705651", - "reference": "e878a14a65245fbe78f8080eba03b47c3b705651", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", "shasum": "" }, "require": { @@ -1044,9 +1058,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.x" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" }, - "time": "2020-06-27T10:12:23+00:00" + "time": "2020-09-17T18:55:26+00:00" }, { "name": "psr/container", @@ -1098,16 +1112,16 @@ }, { "name": "psr/log", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { @@ -1131,7 +1145,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for logging libraries", @@ -1142,9 +1156,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.3" + "source": "https://github.com/php-fig/log/tree/1.1.4" }, - "time": "2020-03-23T09:12:05+00:00" + "time": "2021-05-03T11:20:27+00:00" }, { "name": "react/promise", @@ -1198,33 +1212,34 @@ }, { "name": "roave/better-reflection", - "version": "4.9.0", + "version": "4.12.2", "source": { "type": "git", "url": "https://github.com/Roave/BetterReflection.git", - "reference": "6d1bd5746896996f165dc4ea47003167da965583" + "reference": "73c376c7245b2928837ed1e8bef446f57f1148a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/BetterReflection/zipball/6d1bd5746896996f165dc4ea47003167da965583", - "reference": "6d1bd5746896996f165dc4ea47003167da965583", + "url": "https://api.github.com/repos/Roave/BetterReflection/zipball/73c376c7245b2928837ed1e8bef446f57f1148a0", + "reference": "73c376c7245b2928837ed1e8bef446f57f1148a0", "shasum": "" }, "require": { "ext-json": "*", "jetbrains/phpstorm-stubs": "2019.3", - "nikic/php-parser": "^4.5.0", + "nikic/php-parser": "^4.6.0", "php": ">=7.4.1,<7.5.0", - "phpdocumentor/reflection-docblock": "^5.1.0", - "phpdocumentor/type-resolver": "^1.3.0", - "roave/signature": "^1.0" + "phpdocumentor/reflection-docblock": "^5.2.2", + "phpdocumentor/type-resolver": "^1.4.0", + "roave/signature": "^1.3" }, "require-dev": { - "doctrine/coding-standard": "^8.0.0", - "infection/infection": "^0.16.4", - "phpstan/phpstan": "^0.12.25", - "phpunit/phpunit": "^9.2.5", - "vimeo/psalm": "3.12.1" + "doctrine/coding-standard": "^8.2.0", + "infection/infection": "^0.20.0", + "phpstan/phpstan": "0.12.25", + "phpunit/phpunit": "^9.4.4", + "roave/infection-static-analysis-plugin": "^1.2", + "vimeo/psalm": "^4.2" }, "suggest": { "composer/composer": "Required to use the ComposerSourceLocator" @@ -1269,29 +1284,32 @@ "description": "Better Reflection - an improved code reflection API", "support": { "issues": "https://github.com/Roave/BetterReflection/issues", - "source": "https://github.com/Roave/BetterReflection/tree/4.9.0" + "source": "https://github.com/Roave/BetterReflection/tree/4.12.2" }, - "time": "2020-07-10T15:17:35+00:00" + "time": "2020-12-17T17:48:54+00:00" }, { "name": "roave/signature", - "version": "1.0.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/Roave/Signature.git", - "reference": "bed4ecbdd7f312ab6bb39561ac191f520bcee386" + "reference": "5b5bb9499cfbcc78d9f472e03af1e97e4341ec7c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/Signature/zipball/bed4ecbdd7f312ab6bb39561ac191f520bcee386", - "reference": "bed4ecbdd7f312ab6bb39561ac191f520bcee386", + "url": "https://api.github.com/repos/Roave/Signature/zipball/5b5bb9499cfbcc78d9f472e03af1e97e4341ec7c", + "reference": "5b5bb9499cfbcc78d9f472e03af1e97e4341ec7c", "shasum": "" }, "require": { - "php": "^7.0|^7.1" + "php": "7.4.*|8.0.*" }, "require-dev": { - "phpunit/phpunit": "^5.6" + "doctrine/coding-standard": "^8.2", + "infection/infection": "^0.20.2", + "phpunit/phpunit": "^9.5.1", + "vimeo/psalm": "^4.4" }, "type": "library", "autoload": { @@ -1306,22 +1324,22 @@ "description": "Sign and verify stuff", "support": { "issues": "https://github.com/Roave/Signature/issues", - "source": "https://github.com/Roave/Signature/tree/master" + "source": "https://github.com/Roave/Signature/tree/1.4.0" }, - "time": "2017-02-17T13:53:21+00:00" + "time": "2021-01-25T09:39:37+00:00" }, { "name": "seld/jsonlint", - "version": "1.8.0", + "version": "1.8.3", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "ff2aa5420bfbc296cf6a0bc785fa5b35736de7c1" + "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/ff2aa5420bfbc296cf6a0bc785fa5b35736de7c1", - "reference": "ff2aa5420bfbc296cf6a0bc785fa5b35736de7c1", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9ad6ce79c342fbd44df10ea95511a1b24dee5b57", + "reference": "9ad6ce79c342fbd44df10ea95511a1b24dee5b57", "shasum": "" }, "require": { @@ -1359,7 +1377,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/master" + "source": "https://github.com/Seldaek/jsonlint/tree/1.8.3" }, "funding": [ { @@ -1371,7 +1389,7 @@ "type": "tidelift" } ], - "time": "2020-04-30T19:05:18+00:00" + "time": "2020-11-11T09:19:24+00:00" }, { "name": "seld/phar-utils", @@ -1423,16 +1441,16 @@ }, { "name": "symfony/console", - "version": "v5.2.6", + "version": "v5.2.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "35f039df40a3b335ebf310f244cb242b3a83ac8d" + "reference": "864568fdc0208b3eba3638b6000b69d2386e6768" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/35f039df40a3b335ebf310f244cb242b3a83ac8d", - "reference": "35f039df40a3b335ebf310f244cb242b3a83ac8d", + "url": "https://api.github.com/repos/symfony/console/zipball/864568fdc0208b3eba3638b6000b69d2386e6768", + "reference": "864568fdc0208b3eba3638b6000b69d2386e6768", "shasum": "" }, "require": { @@ -1500,7 +1518,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.2.6" + "source": "https://github.com/symfony/console/tree/v5.2.8" }, "funding": [ { @@ -1516,20 +1534,20 @@ "type": "tidelift" } ], - "time": "2021-03-28T09:42:18+00:00" + "time": "2021-05-11T15:45:21+00:00" }, { "name": "symfony/filesystem", - "version": "v5.1.2", + "version": "v5.2.7", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "6e4320f06d5f2cce0d96530162491f4465179157" + "reference": "056e92acc21d977c37e6ea8e97374b2a6c8551b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/6e4320f06d5f2cce0d96530162491f4465179157", - "reference": "6e4320f06d5f2cce0d96530162491f4465179157", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/056e92acc21d977c37e6ea8e97374b2a6c8551b0", + "reference": "056e92acc21d977c37e6ea8e97374b2a6c8551b0", "shasum": "" }, "require": { @@ -1537,11 +1555,6 @@ "symfony/polyfill-ctype": "~1.8" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Filesystem\\": "" @@ -1564,10 +1577,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Filesystem Component", + "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.1.0" + "source": "https://github.com/symfony/filesystem/tree/v5.2.7" }, "funding": [ { @@ -1583,31 +1596,26 @@ "type": "tidelift" } ], - "time": "2020-05-30T20:35:19+00:00" + "time": "2021-04-01T10:42:13+00:00" }, { "name": "symfony/finder", - "version": "v5.1.2", + "version": "v5.2.8", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "4298870062bfc667cb78d2b379be4bf5dec5f187" + "reference": "eccb8be70d7a6a2230d05f6ecede40f3fdd9e252" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/4298870062bfc667cb78d2b379be4bf5dec5f187", - "reference": "4298870062bfc667cb78d2b379be4bf5dec5f187", + "url": "https://api.github.com/repos/symfony/finder/zipball/eccb8be70d7a6a2230d05f6ecede40f3fdd9e252", + "reference": "eccb8be70d7a6a2230d05f6ecede40f3fdd9e252", "shasum": "" }, "require": { "php": ">=7.2.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" @@ -1630,10 +1638,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", + "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/5.1" + "source": "https://github.com/symfony/finder/tree/v5.2.8" }, "funding": [ { @@ -1649,7 +1657,7 @@ "type": "tidelift" } ], - "time": "2020-05-20T17:43:50+00:00" + "time": "2021-05-10T14:39:23+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2139,16 +2147,16 @@ }, { "name": "symfony/process", - "version": "v5.2.4", + "version": "v5.2.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f" + "reference": "98cb8eeb72e55d4196dd1e36f1f16e7b3a9a088e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/313a38f09c77fbcdc1d223e57d368cea76a2fd2f", - "reference": "313a38f09c77fbcdc1d223e57d368cea76a2fd2f", + "url": "https://api.github.com/repos/symfony/process/zipball/98cb8eeb72e55d4196dd1e36f1f16e7b3a9a088e", + "reference": "98cb8eeb72e55d4196dd1e36f1f16e7b3a9a088e", "shasum": "" }, "require": { @@ -2181,7 +2189,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.2.4" + "source": "https://github.com/symfony/process/tree/v5.3.0-BETA1" }, "funding": [ { @@ -2197,7 +2205,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2021-04-08T10:27:02+00:00" }, { "name": "symfony/service-contracts", @@ -2280,16 +2288,16 @@ }, { "name": "symfony/string", - "version": "v5.2.6", + "version": "v5.2.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572" + "reference": "01b35eb64cac8467c3f94cd0ce2d0d376bb7d1db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572", - "reference": "ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572", + "url": "https://api.github.com/repos/symfony/string/zipball/01b35eb64cac8467c3f94cd0ce2d0d376bb7d1db", + "reference": "01b35eb64cac8467c3f94cd0ce2d0d376bb7d1db", "shasum": "" }, "require": { @@ -2343,7 +2351,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.2.6" + "source": "https://github.com/symfony/string/tree/v5.2.8" }, "funding": [ { @@ -2359,34 +2367,39 @@ "type": "tidelift" } ], - "time": "2021-03-17T17:12:15+00:00" + "time": "2021-05-10T14:56:10+00:00" }, { "name": "webmozart/assert", - "version": "1.9.1", + "version": "1.10.0", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", + "php": "^7.2 || ^8.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" + "vimeo/psalm": "<4.6.1 || 4.6.2" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" + "phpunit/phpunit": "^8.5.13" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -2409,25 +2422,25 @@ "validate" ], "support": { - "issues": "https://github.com/webmozart/assert/issues", - "source": "https://github.com/webmozart/assert/tree/master" + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" }, - "time": "2020-07-08T17:02:28+00:00" + "time": "2021-03-09T10:59:23+00:00" } ], "packages-dev": [ { "name": "amphp/amp", - "version": "v2.5.0", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/amphp/amp.git", - "reference": "f220a51458bf4dd0dedebb171ac3457813c72bbc" + "reference": "efca2b32a7580087adb8aabbff6be1dc1bb924a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/f220a51458bf4dd0dedebb171ac3457813c72bbc", - "reference": "f220a51458bf4dd0dedebb171ac3457813c72bbc", + "url": "https://api.github.com/repos/amphp/amp/zipball/efca2b32a7580087adb8aabbff6be1dc1bb924a9", + "reference": "efca2b32a7580087adb8aabbff6be1dc1bb924a9", "shasum": "" }, "require": { @@ -2495,7 +2508,7 @@ "support": { "irc": "irc://irc.freenode.org/amphp", "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/master" + "source": "https://github.com/amphp/amp/tree/v2.5.2" }, "funding": [ { @@ -2503,32 +2516,33 @@ "type": "github" } ], - "time": "2020-07-14T21:47:18+00:00" + "time": "2021-01-10T17:06:37+00:00" }, { "name": "amphp/byte-stream", - "version": "v1.7.3", + "version": "v1.8.1", "source": { "type": "git", "url": "https://github.com/amphp/byte-stream.git", - "reference": "b867505edb79dda8f253ca3c3a2bbadae4b16592" + "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/b867505edb79dda8f253ca3c3a2bbadae4b16592", - "reference": "b867505edb79dda8f253ca3c3a2bbadae4b16592", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", + "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd", "shasum": "" }, "require": { - "amphp/amp": "^2" + "amphp/amp": "^2", + "php": ">=7.1" }, "require-dev": { "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1", + "amphp/phpunit-util": "^1.4", "friendsofphp/php-cs-fixer": "^2.3", "jetbrains/phpstorm-stubs": "^2019.3", "phpunit/phpunit": "^6 || ^7 || ^8", - "vimeo/psalm": "^3.9@dev" + "psalm/phar": "^3.11.4" }, "type": "library", "extra": { @@ -2571,9 +2585,15 @@ "support": { "irc": "irc://irc.freenode.org/amphp", "issues": "https://github.com/amphp/byte-stream/issues", - "source": "https://github.com/amphp/byte-stream/tree/v1.7.3" + "source": "https://github.com/amphp/byte-stream/tree/v1.8.1" }, - "time": "2020-04-04T16:56:54+00:00" + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2021-03-30T17:13:30+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -2645,25 +2665,62 @@ }, "time": "2020-12-07T18:04:37+00:00" }, + { + "name": "dnoegel/php-xdg-base-dir", + "version": "v0.1.1", + "source": { + "type": "git", + "url": "https://github.com/dnoegel/php-xdg-base-dir.git", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "XdgBaseDir\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "implementation of xdg base directory specification for php", + "support": { + "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", + "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" + }, + "time": "2019-12-04T15:06:13+00:00" + }, { "name": "doctrine/coding-standard", - "version": "8.2.0", + "version": "8.2.1", "source": { "type": "git", "url": "https://github.com/doctrine/coding-standard.git", - "reference": "529d385bb3790431080493c0fe7adaec39df368a" + "reference": "f595b060799c1a0d76ead16981804eaa0bbcd8d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/coding-standard/zipball/529d385bb3790431080493c0fe7adaec39df368a", - "reference": "529d385bb3790431080493c0fe7adaec39df368a", + "url": "https://api.github.com/repos/doctrine/coding-standard/zipball/f595b060799c1a0d76ead16981804eaa0bbcd8d6", + "reference": "f595b060799c1a0d76ead16981804eaa0bbcd8d6", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7", "php": "^7.1 || ^8.0", - "slevomat/coding-standard": "^6.3.9", - "squizlabs/php_codesniffer": "^3.5.5" + "slevomat/coding-standard": "^6.4.1", + "squizlabs/php_codesniffer": "^3.5.8" }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -2696,42 +2753,37 @@ ], "support": { "issues": "https://github.com/doctrine/coding-standard/issues", - "source": "https://github.com/doctrine/coding-standard/tree/8.2.0" + "source": "https://github.com/doctrine/coding-standard/tree/8.2.1" }, - "time": "2020-10-25T14:56:19+00:00" + "time": "2021-04-03T10:54:55+00:00" }, { "name": "doctrine/instantiator", - "version": "1.3.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0", + "doctrine/coding-standard": "^8.0", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" @@ -2745,7 +2797,7 @@ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "homepage": "https://ocramius.github.io/" } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", @@ -2756,7 +2808,7 @@ ], "support": { "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.3.x" + "source": "https://github.com/doctrine/instantiator/tree/1.4.0" }, "funding": [ { @@ -2772,29 +2824,29 @@ "type": "tidelift" } ], - "time": "2020-05-29T17:27:14+00:00" + "time": "2020-11-10T18:47:58+00:00" }, { "name": "felixfbecker/advanced-json-rpc", - "version": "v3.1.1", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", - "reference": "0ed363f8de17d284d479ec813c9ad3f6834b5c40" + "reference": "06f0b06043c7438959dbdeed8bb3f699a19be22e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/0ed363f8de17d284d479ec813c9ad3f6834b5c40", - "reference": "0ed363f8de17d284d479ec813c9ad3f6834b5c40", + "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/06f0b06043c7438959dbdeed8bb3f699a19be22e", + "reference": "06f0b06043c7438959dbdeed8bb3f699a19be22e", "shasum": "" }, "require": { "netresearch/jsonmapper": "^1.0 || ^2.0", - "php": ">=7.0", - "phpdocumentor/reflection-docblock": "^4.0.0 || ^5.0.0" + "php": "^7.1 || ^8.0", + "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0" }, "require-dev": { - "phpunit/phpunit": "^6.0.0" + "phpunit/phpunit": "^7.0 || ^8.0" }, "type": "library", "autoload": { @@ -2815,33 +2867,38 @@ "description": "A more advanced JSONRPC implementation", "support": { "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", - "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/master" + "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.0" }, - "time": "2020-03-11T15:21:41+00:00" + "time": "2021-01-10T17:48:47+00:00" }, { "name": "felixfbecker/language-server-protocol", - "version": "v1.4.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "378801f6139bb74ac215d81cca1272af61df9a9f" + "reference": "9d846d1f5cf101deee7a61c8ba7caa0a975cd730" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/378801f6139bb74ac215d81cca1272af61df9a9f", - "reference": "378801f6139bb74ac215d81cca1272af61df9a9f", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/9d846d1f5cf101deee7a61c8ba7caa0a975cd730", + "reference": "9d846d1f5cf101deee7a61c8ba7caa0a975cd730", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=7.1" }, "require-dev": { "phpstan/phpstan": "*", - "phpunit/phpunit": "^6.3", - "squizlabs/php_codesniffer": "^3.1" + "squizlabs/php_codesniffer": "^3.1", + "vimeo/psalm": "^4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, "autoload": { "psr-4": { "LanguageServerProtocol\\": "src/" @@ -2866,28 +2923,30 @@ ], "support": { "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", - "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.4.0" + "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/1.5.1" }, - "time": "2019-06-23T21:03:50+00:00" + "time": "2021-02-22T14:02:09+00:00" }, { "name": "infection/abstract-testframework-adapter", - "version": "0.3.0", + "version": "0.3.1", "source": { "type": "git", "url": "https://github.com/infection/abstract-testframework-adapter.git", - "reference": "f3ec6fc4beb6377b72d8106f5ff329dffd51ca8a" + "reference": "c52539339f28d6b67625ff24496289b3e6d66025" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/infection/abstract-testframework-adapter/zipball/f3ec6fc4beb6377b72d8106f5ff329dffd51ca8a", - "reference": "f3ec6fc4beb6377b72d8106f5ff329dffd51ca8a", + "url": "https://api.github.com/repos/infection/abstract-testframework-adapter/zipball/c52539339f28d6b67625ff24496289b3e6d66025", + "reference": "c52539339f28d6b67625ff24496289b3e6d66025", "shasum": "" }, "require": { - "php": "^7.3" + "php": "^7.3 || ^8.0" }, "require-dev": { + "ergebnis/composer-normalize": "^2.8", + "friendsofphp/php-cs-fixer": "^2.16", "phpunit/phpunit": "^9.0" }, "type": "library", @@ -2909,9 +2968,9 @@ "description": "Abstract Test Framework Adapter for Infection", "support": { "issues": "https://github.com/infection/abstract-testframework-adapter/issues", - "source": "https://github.com/infection/abstract-testframework-adapter/tree/master" + "source": "https://github.com/infection/abstract-testframework-adapter/tree/0.3" }, - "time": "2020-03-14T07:20:06+00:00" + "time": "2020-08-30T13:50:12+00:00" }, { "name": "infection/extension-installer", @@ -2971,20 +3030,26 @@ }, { "name": "infection/include-interceptor", - "version": "0.2.3", + "version": "0.2.4", "source": { "type": "git", "url": "https://github.com/infection/include-interceptor.git", - "reference": "07d20c33a6c0624b8636adf25ddca7e9e19a5dc9" + "reference": "e3cf9317a7fd554ab60a5587f028b16418cc4264" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/infection/include-interceptor/zipball/07d20c33a6c0624b8636adf25ddca7e9e19a5dc9", - "reference": "07d20c33a6c0624b8636adf25ddca7e9e19a5dc9", + "url": "https://api.github.com/repos/infection/include-interceptor/zipball/e3cf9317a7fd554ab60a5587f028b16418cc4264", + "reference": "e3cf9317a7fd554ab60a5587f028b16418cc4264", "shasum": "" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "friendsofphp/php-cs-fixer": "^2.16", + "infection/infection": "^0.15.0", + "phan/phan": "^2.4 || ^3", + "php-coveralls/php-coveralls": "^2.2", + "phpstan/phpstan": "^0.12.8", + "phpunit/phpunit": "^8.5", + "vimeo/psalm": "^3.8" }, "type": "library", "autoload": { @@ -3005,22 +3070,22 @@ "description": "Stream Wrapper: Include Interceptor. Allows to replace included (autoloaded) file with another one.", "support": { "issues": "https://github.com/infection/include-interceptor/issues", - "source": "https://github.com/infection/include-interceptor/tree/0.2.3" + "source": "https://github.com/infection/include-interceptor/tree/0.2.4" }, - "time": "2020-01-27T10:28:21+00:00" + "time": "2020-08-07T22:40:37+00:00" }, { "name": "infection/infection", - "version": "0.16.4", + "version": "0.16.6", "source": { "type": "git", "url": "https://github.com/infection/infection.git", - "reference": "c1ef0b16b3e8d171f10ba8bfe8b6c93d482a68b4" + "reference": "d43267a15ae21d42fce2aed3f1c8a4a22de6698a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/infection/infection/zipball/c1ef0b16b3e8d171f10ba8bfe8b6c93d482a68b4", - "reference": "c1ef0b16b3e8d171f10ba8bfe8b6c93d482a68b4", + "url": "https://api.github.com/repos/infection/infection/zipball/d43267a15ae21d42fce2aed3f1c8a4a22de6698a", + "reference": "d43267a15ae21d42fce2aed3f1c8a4a22de6698a", "shasum": "" }, "require": { @@ -3048,6 +3113,7 @@ "webmozart/path-util": "^2.3" }, "conflict": { + "phpunit/php-code-coverage": ">9 <9.1.4", "symfony/console": "=4.1.5" }, "require-dev": { @@ -3116,22 +3182,22 @@ ], "support": { "issues": "https://github.com/infection/infection/issues", - "source": "https://github.com/infection/infection/tree/0.16" + "source": "https://github.com/infection/infection/tree/0.16.6" }, - "time": "2020-06-25T15:14:51+00:00" + "time": "2020-08-17T20:17:03+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.10.1", + "version": "1.10.2", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", "shasum": "" }, "require": { @@ -3168,7 +3234,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.x" + "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" }, "funding": [ { @@ -3176,7 +3242,7 @@ "type": "tidelift" } ], - "time": "2020-06-29T13:22:24+00:00" + "time": "2020-11-13T09:40:50+00:00" }, { "name": "netresearch/jsonmapper", @@ -3231,25 +3297,24 @@ }, { "name": "ondram/ci-detector", - "version": "3.4.0", + "version": "3.5.1", "source": { "type": "git", "url": "https://github.com/OndraM/ci-detector.git", - "reference": "0babf1cb71984f652498c6327a47d0081cd1e01b" + "reference": "594e61252843b68998bddd48078c5058fe9028bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/OndraM/ci-detector/zipball/0babf1cb71984f652498c6327a47d0081cd1e01b", - "reference": "0babf1cb71984f652498c6327a47d0081cd1e01b", + "url": "https://api.github.com/repos/OndraM/ci-detector/zipball/594e61252843b68998bddd48078c5058fe9028bd", + "reference": "594e61252843b68998bddd48078c5058fe9028bd", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "require-dev": { "ergebnis/composer-normalize": "^2.2", "lmc/coding-standard": "^1.3 || ^2.0", - "php-coveralls/php-coveralls": "^2.2", "php-parallel-lint/php-parallel-lint": "^1.1", "phpstan/extension-installer": "^1.0.3", "phpstan/phpstan": "^0.12.0", @@ -3276,6 +3341,7 @@ "keywords": [ "CircleCI", "Codeship", + "Wercker", "adapter", "appveyor", "aws", @@ -3283,6 +3349,7 @@ "bamboo", "bitbucket", "buddy", + "ci-info", "codebuild", "continuous integration", "continuousphp", @@ -3296,9 +3363,9 @@ ], "support": { "issues": "https://github.com/OndraM/ci-detector/issues", - "source": "https://github.com/OndraM/ci-detector/tree/3.4.0" + "source": "https://github.com/OndraM/ci-detector/tree/main" }, - "time": "2020-05-11T19:24:44+00:00" + "time": "2020-09-04T11:21:14+00:00" }, { "name": "openlss/lib-array2xml", @@ -3355,28 +3422,29 @@ }, { "name": "phar-io/manifest", - "version": "1.0.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", + "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^2.0", - "php": "^5.6 || ^7.0" + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -3410,24 +3478,24 @@ "issues": "https://github.com/phar-io/manifest/issues", "source": "https://github.com/phar-io/manifest/tree/master" }, - "time": "2018-07-08T19:23:20+00:00" + "time": "2020-06-27T14:33:11+00:00" }, { "name": "phar-io/version", - "version": "2.0.1", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + "reference": "bae7c545bef187884426f042434e561ab1ddb182" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -3459,34 +3527,85 @@ "description": "Library for handling version information and constraints", "support": { "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/master" + "source": "https://github.com/phar-io/version/tree/3.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" + }, + { + "name": "php-standard-library/psalm-plugin", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-standard-library/psalm-plugin.git", + "reference": "adab2a073c3d66384da7c700293d43f7f9d43e99" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-standard-library/psalm-plugin/zipball/adab2a073c3d66384da7c700293d43f7f9d43e99", + "reference": "adab2a073c3d66384da7c700293d43f7f9d43e99", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "vimeo/psalm": "^4.6" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.18", + "roave/security-advisories": "dev-master", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "psalm-plugin", + "extra": { + "psalm": { + "pluginClass": "Psl\\Psalm\\Plugin" + } + }, + "autoload": { + "psr-4": { + "Psl\\Psalm\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "azjezz", + "email": "azjezz@protonmail.com" + } + ], + "description": "Psalm plugin for the PHP Standard Library", + "support": { + "issues": "https://github.com/php-standard-library/psalm-plugin/issues", + "source": "https://github.com/php-standard-library/psalm-plugin/tree/1.1.1" }, - "time": "2018-07-08T19:19:57+00:00" + "time": "2021-04-11T12:56:19+00:00" }, { "name": "phpspec/prophecy", - "version": "1.11.1", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160" + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b20034be5efcdab4fb60ca3a29cba2949aead160", - "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea", + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2", - "phpdocumentor/reflection-docblock": "^5.0", + "php": "^7.2 || ~8.0, <8.1", + "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { "phpspec/phpspec": "^6.0", - "phpunit/phpunit": "^8.0" + "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "extra": { @@ -3526,9 +3645,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/master" + "source": "https://github.com/phpspec/prophecy/tree/1.13.0" }, - "time": "2020-07-08T12:44:21+00:00" + "time": "2021-03-17T13:42:18+00:00" }, { "name": "phpstan/phpdoc-parser", @@ -3585,32 +3704,35 @@ }, { "name": "phpunit/php-code-coverage", - "version": "8.0.2", + "version": "9.2.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ca6647ffddd2add025ab3f21644a441d7c146cdc" + "reference": "f6293e1b30a2354e8428e004689671b83871edde" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca6647ffddd2add025ab3f21644a441d7c146cdc", - "reference": "ca6647ffddd2add025ab3f21644a441d7c146cdc", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f6293e1b30a2354e8428e004689671b83871edde", + "reference": "f6293e1b30a2354e8428e004689671b83871edde", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-xmlwriter": "*", - "php": "^7.3", - "phpunit/php-file-iterator": "^3.0", - "phpunit/php-text-template": "^2.0", - "phpunit/php-token-stream": "^4.0", - "sebastian/code-unit-reverse-lookup": "^2.0", - "sebastian/environment": "^5.0", - "sebastian/version": "^3.0", - "theseer/tokenizer": "^1.1.3" + "nikic/php-parser": "^4.10.2", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-pcov": "*", @@ -3619,7 +3741,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "8.0-dev" + "dev-master": "9.2-dev" } }, "autoload": { @@ -3647,7 +3769,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/8.0.2" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6" }, "funding": [ { @@ -3655,27 +3777,27 @@ "type": "github" } ], - "time": "2020-05-23T08:02:54+00:00" + "time": "2021-03-28T07:26:59+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.4", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "25fefc5b19835ca653877fe081644a3f8c1d915e" + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/25fefc5b19835ca653877fe081644a3f8c1d915e", - "reference": "25fefc5b19835ca653877fe081644a3f8c1d915e", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -3707,7 +3829,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.4" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5" }, "funding": [ { @@ -3715,28 +3837,28 @@ "type": "github" } ], - "time": "2020-07-11T05:18:21+00:00" + "time": "2020-09-28T05:57:25+00:00" }, { "name": "phpunit/php-invoker", - "version": "3.0.2", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "f6eedfed1085dd1f4c599629459a0277d25f9a66" + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f6eedfed1085dd1f4c599629459a0277d25f9a66", - "reference": "f6eedfed1085dd1f4c599629459a0277d25f9a66", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { "ext-pcntl": "*", - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-pcntl": "*" @@ -3744,7 +3866,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -3770,7 +3892,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/master" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" }, "funding": [ { @@ -3778,27 +3900,27 @@ "type": "github" } ], - "time": "2020-06-26T11:53:53+00:00" + "time": "2020-09-28T05:58:55+00:00" }, { "name": "phpunit/php-text-template", - "version": "2.0.2", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "6ff9c8ea4d3212b88fcf74e25e516e2c51c99324" + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/6ff9c8ea4d3212b88fcf74e25e516e2c51c99324", - "reference": "6ff9c8ea4d3212b88fcf74e25e516e2c51c99324", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -3829,7 +3951,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/master" + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" }, "funding": [ { @@ -3837,27 +3959,27 @@ "type": "github" } ], - "time": "2020-06-26T11:55:37+00:00" + "time": "2020-10-26T05:33:50+00:00" }, { "name": "phpunit/php-timer", - "version": "5.0.1", + "version": "5.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "cc49734779cbb302bf51a44297dab8c4bbf941e7" + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/cc49734779cbb302bf51a44297dab8c4bbf941e7", - "reference": "cc49734779cbb302bf51a44297dab8c4bbf941e7", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.2" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -3888,7 +4010,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" }, "funding": [ { @@ -3896,79 +4018,20 @@ "type": "github" } ], - "time": "2020-06-26T11:58:13+00:00" + "time": "2020-10-26T13:16:10+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "4.0.3", + "name": "phpunit/phpunit", + "version": "9.5.4", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "5672711b6b07b14d5ab694e700c62eeb82fcf374" + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "c73c6737305e779771147af66c96ca6a7ed8a741" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/5672711b6b07b14d5ab694e700c62eeb82fcf374", - "reference": "5672711b6b07b14d5ab694e700c62eeb82fcf374", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.3 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-06-27T06:36:25+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "9.2.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "1c6a9e4312e209e659f1fce3ce88dd197c2448f6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1c6a9e4312e209e659f1fce3ce88dd197c2448f6", - "reference": "1c6a9e4312e209e659f1fce3ce88dd197c2448f6", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c73c6737305e779771147af66c96ca6a7ed8a741", + "reference": "c73c6737305e779771147af66c96ca6a7ed8a741", "shasum": "" }, "require": { @@ -3979,30 +4042,31 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.9.5", - "phar-io/manifest": "^1.0.3", - "phar-io/version": "^2.0.1", - "php": "^7.3", - "phpspec/prophecy": "^1.10.3", - "phpunit/php-code-coverage": "^8.0.2", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-invoker": "^3.0.2", - "phpunit/php-text-template": "^2.0.2", - "phpunit/php-timer": "^5.0.1", - "sebastian/code-unit": "^1.0.5", - "sebastian/comparator": "^4.0.3", - "sebastian/diff": "^4.0.1", - "sebastian/environment": "^5.1.2", - "sebastian/exporter": "^4.0.2", - "sebastian/global-state": "^4.0", - "sebastian/object-enumerator": "^4.0.2", - "sebastian/resource-operations": "^3.0.2", - "sebastian/type": "^2.1.1", - "sebastian/version": "^3.0.1" + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.1", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.3", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3", + "sebastian/version": "^3.0.2" }, "require-dev": { "ext-pdo": "*", - "phpspec/prophecy-phpunit": "^2.0" + "phpspec/prophecy-phpunit": "^2.0.1" }, "suggest": { "ext-soap": "*", @@ -4014,7 +4078,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-master": "9.5-dev" } }, "autoload": { @@ -4045,7 +4109,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.2.6" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.4" }, "funding": [ { @@ -4057,7 +4121,7 @@ "type": "github" } ], - "time": "2020-07-13T17:55:55+00:00" + "time": "2021-03-23T07:16:29+00:00" }, { "name": "roave/security-advisories", @@ -4065,12 +4129,12 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "9f386dba391018e90a5f1e51abeffc6bf27583db" + "reference": "42840dcc436945146d79a985240a99ddd3bc5dc7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/9f386dba391018e90a5f1e51abeffc6bf27583db", - "reference": "9f386dba391018e90a5f1e51abeffc6bf27583db", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/42840dcc436945146d79a985240a99ddd3bc5dc7", + "reference": "42840dcc436945146d79a985240a99ddd3bc5dc7", "shasum": "" }, "conflict": { @@ -4086,7 +4150,10 @@ "bagisto/bagisto": "<0.1.5", "barrelstrength/sprout-base-email": "<1.2.7", "barrelstrength/sprout-forms": "<3.9", - "bolt/bolt": "<3.7.1", + "baserproject/basercms": ">=4,<=4.3.6|>=4.4,<4.4.1", + "bk2k/bootstrap-package": ">=7.1,<7.1.2|>=8,<8.0.8|>=9,<9.0.4|>=9.1,<9.1.3|>=10,<10.0.10|>=11,<11.0.3", + "bolt/bolt": "<3.7.2", + "bolt/core": "<4.1.13", "brightlocal/phpwhois": "<=4.2.5", "buddypress/buddypress": "<5.1.2", "bugsnag/bugsnag-laravel": ">=2,<2.0.2", @@ -4096,13 +4163,14 @@ "centreon/centreon": "<18.10.8|>=19,<19.4.5", "cesnet/simplesamlphp-module-proxystatistics": "<3.1", "codeigniter/framework": "<=3.0.6", - "composer/composer": "<=1-alpha.11", + "composer/composer": "<1.10.22|>=2-alpha.1,<2.0.13", "contao-components/mediaelement": ">=2.14.2,<2.21.1", "contao/core": ">=2,<3.5.39", - "contao/core-bundle": ">=4,<4.4.46|>=4.5,<4.8.6", + "contao/core-bundle": ">=4,<4.4.52|>=4.5,<4.9.6|= 4.10.0", "contao/listing-bundle": ">=4,<4.4.8", "datadog/dd-trace": ">=0.30,<0.30.2", "david-garcia/phpwhois": "<=4.3.1", + "derhansen/sf_event_mgt": "<4.3.1|>=5,<5.1.1", "doctrine/annotations": ">=1,<1.2.7", "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", @@ -4111,97 +4179,146 @@ "doctrine/doctrine-module": "<=0.7.1", "doctrine/mongodb-odm": ">=1,<1.0.2", "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", - "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", + "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1|>=2.8.3,<2.8.4", "dolibarr/dolibarr": "<11.0.4", "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.72|>=8,<8.8.8|>=8.9,<8.9.1|>=9,<9.0.1", - "drupal/drupal": ">=7,<7.72|>=8,<8.8.8|>=8.9,<8.9.1|>=9,<9.0.1", + "drupal/core": ">=7,<7.80|>=8,<8.9.14|>=9,<9.0.12|>=9.1,<9.1.7", + "drupal/drupal": ">=7,<7.80|>=8,<8.9.14|>=9,<9.0.12|>=9.1,<9.1.7", + "dweeves/magmi": "<=0.7.24", "endroid/qr-code-bundle": "<3.4.2", "enshrined/svg-sanitize": "<0.13.1", "erusev/parsedown": "<1.7.2", "ezsystems/demobundle": ">=5.4,<5.4.6.1", + "ezsystems/ez-support-tools": ">=2.2,<2.2.3", "ezsystems/ezdemo-ls-extension": ">=5.4,<5.4.2.1", "ezsystems/ezfind-ls": ">=5.3,<5.3.6.1|>=5.4,<5.4.11.1|>=2017.12,<2017.12.0.1", "ezsystems/ezplatform": ">=1.7,<1.7.9.1|>=1.13,<1.13.5.1|>=2.5,<2.5.4", "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6", - "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2", - "ezsystems/ezplatform-kernel": ">=1,<1.0.2.1", + "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2.1|>=5,<5.0.1|>=5.1,<5.1.1", + "ezsystems/ezplatform-kernel": "<=1.2.5|>=1.3,<=1.3.1", + "ezsystems/ezplatform-rest": ">=1.2,<=1.2.2|>=1.3,<=1.3.1", "ezsystems/ezplatform-user": ">=1,<1.0.1", - "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.14.2|>=6,<6.7.9.1|>=6.8,<6.13.6.3|>=7,<7.2.4.1|>=7.3,<7.3.2.1|>=7.5,<7.5.7.1", - "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.14.1|>=2011,<2017.12.7.2|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3|>=2019.3,<2019.3.4.2", + "ezsystems/ezpublish-kernel": "<=6.13.8.1|>=7,<=7.5.15.1", + "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.14.2|>=2011,<2017.12.7.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3|>=2019.3,<2019.3.5.1", + "ezsystems/platform-ui-assets-bundle": ">=4.2,<4.2.3", "ezsystems/repository-forms": ">=2.3,<2.3.2.1", "ezyang/htmlpurifier": "<4.1.1", + "facade/ignition": "<1.16.14|>=2,<2.4.2|>=2.5,<2.5.2", "firebase/php-jwt": "<2", + "flarum/sticky": ">=0.1-beta.14,<=0.1-beta.15", + "flarum/tags": "<=0.1-beta.13", + "fluidtypo3/vhs": "<5.1.1", "fooman/tcpdf": "<6.2.22", + "forkcms/forkcms": "<5.8.3", "fossar/tcpdf-parser": "<6.2.22", + "francoisjacquet/rosariosis": "<6.5.1", "friendsofsymfony/oauth2-php": "<1.3", "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", + "friendsoftypo3/mediace": ">=7.6.2,<7.6.5", "fuel/core": "<1.8.1", - "getgrav/grav": "<1.7-beta.8", + "getgrav/grav": "<1.7.11", + "getkirby/cms": "<3.5.4", + "getkirby/panel": "<2.5.14", "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3", "gree/jose": "<=2.2", "gregwar/rst": "<1.0.3", "guzzlehttp/guzzle": ">=4-rc.2,<4.2.4|>=5,<5.3.1|>=6,<6.2.1", "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", - "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", - "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", + "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.99999|>=4.2,<=4.2.99999|>=5,<=5.0.99999|>=5.1,<=5.1.99999|>=5.2,<=5.2.99999|>=5.3,<=5.3.99999|>=5.4,<=5.4.99999|>=5.5,<=5.5.49|>=5.6,<=5.6.99999|>=5.7,<=5.7.99999|>=5.8,<=5.8.99999|>=6,<6.18.31|>=7,<7.22.4", + "illuminate/database": "<6.20.26|>=7,<8.40", "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", "illuminate/view": ">=7,<7.1.2", + "impresscms/impresscms": "<=1.4.2", "ivankristianto/phpwhois": "<=4.3", "james-heinrich/getid3": "<1.9.9", + "joomla/archive": "<1.1.10", "joomla/session": "<1.3.1", "jsmitty12/phpwhois": "<5.1", "kazist/phpwhois": "<=4.2.6", + "kitodo/presentation": "<3.1.2", "kreait/firebase-php": ">=3.2,<3.8.1", "la-haute-societe/tcpdf": "<6.2.22", - "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30|>=7,<7.1.2", + "laravel/framework": "<6.20.26|>=7,<8.40", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", "league/commonmark": "<0.18.3", - "librenms/librenms": "<1.53", + "lexik/jwt-authentication-bundle": "<2.10.7|>=2.11,<2.11.3", + "librenms/librenms": "<21.1", + "livewire/livewire": ">2.2.4,<2.2.6", "magento/community-edition": ">=2,<2.2.10|>=2.3,<2.3.3", "magento/magento1ce": "<1.9.4.3", "magento/magento1ee": ">=1,<1.14.4.3", "magento/product-community-edition": ">=2,<2.2.10|>=2.3,<2.3.2-p.2", + "marcwillmann/turn": "<0.3.3", + "mautic/core": "<3.3.2|= 2.13.1", + "mediawiki/core": ">=1.27,<1.27.6|>=1.29,<1.29.3|>=1.30,<1.30.2|>=1.31,<1.31.9|>=1.32,<1.32.6|>=1.32.99,<1.33.3|>=1.33.99,<1.34.3|>=1.34.99,<1.35", + "mittwald/typo3_forum": "<1.2.1", "monolog/monolog": ">=1.8,<1.12", + "moodle/moodle": "<3.5.17|>=3.7,<3.7.9|>=3.8,<3.8.8|>=3.9,<3.9.5|>=3.10,<3.10.2", "namshi/jose": "<2.2", + "neos/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6", + "neos/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<2.9.99|>=3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<3.3.23|>=4,<4.0.17|>=4.1,<4.1.16|>=4.2,<4.2.12|>=4.3,<4.3.3", + "neos/swiftmailer": ">=4.1,<4.1.99|>=5.4,<5.4.5", + "nette/application": ">=2,<2.0.19|>=2.1,<2.1.13|>=2.2,<2.2.10|>=2.3,<2.3.14|>=2.4,<2.4.16|>=3,<3.0.6", + "nette/nette": ">=2,<2.0.19|>=2.1,<2.1.13", "nystudio107/craft-seomatic": "<3.3", "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1", - "october/october": ">=1.0.319,<1.0.467", + "october/backend": "<1.1.2", + "october/cms": "= 1.1.1|= 1.0.471|= 1.0.469|>=1.0.319,<1.0.469", + "october/october": ">=1.0.319,<1.0.466", + "october/rain": "<1.0.472|>=1.1,<1.1.2", "onelogin/php-saml": "<2.10.4", "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5", + "opencart/opencart": "<=3.0.3.2", "openid/php-openid": "<2.3", + "openmage/magento-lts": "<=19.4.12|>=20,<=20.0.8", + "orchid/platform": ">=9,<9.4.4", "oro/crm": ">=1.7,<1.7.4", "oro/platform": ">=1.7,<1.7.4", "padraic/humbug_get_contents": "<1.1.2", "pagarme/pagarme-php": ">=0,<3", "paragonie/random_compat": "<2", + "passbolt/passbolt_api": "<2.11", "paypal/merchant-sdk-php": "<3.12", - "pear/archive_tar": "<1.4.4", + "pear/archive_tar": "<1.4.12", + "personnummer/personnummer": "<3.0.2", "phpfastcache/phpfastcache": ">=5,<5.0.13", - "phpmailer/phpmailer": "<6.1.6", + "phpmailer/phpmailer": "<6.1.6|>=6.1.8,<6.4.1", "phpmussel/phpmussel": ">=1,<1.6", - "phpmyadmin/phpmyadmin": "<4.9.2", + "phpmyadmin/phpmyadmin": "<4.9.6|>=5,<5.0.3", "phpoffice/phpexcel": "<1.8.2", - "phpoffice/phpspreadsheet": "<1.8", + "phpoffice/phpspreadsheet": "<1.16", + "phpseclib/phpseclib": "<2.0.31|>=3,<3.0.7", "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", "phpwhois/phpwhois": "<=4.2.5", "phpxmlrpc/extras": "<0.6.1", - "pimcore/pimcore": "<6.3", + "pimcore/pimcore": "<6.8.8", + "pocketmine/pocketmine-mp": "<3.15.4", + "pressbooks/pressbooks": "<5.18", "prestashop/autoupgrade": ">=4,<4.10.1", + "prestashop/contactform": ">1.0.1,<4.3", "prestashop/gamification": "<2.3.2", + "prestashop/productcomments": ">=4,<4.2.1", + "prestashop/ps_emailsubscription": "<2.6.1", "prestashop/ps_facetedsearch": "<3.4.1", "privatebin/privatebin": "<1.2.2|>=1.3,<1.3.2", "propel/propel": ">=2-alpha.1,<=2-alpha.7", "propel/propel1": ">=1,<=1.7.1", + "pterodactyl/panel": "<0.7.19|>=1-rc.0,<=1-rc.6", "pusher/pusher-php-server": "<2.2.1", + "pwweb/laravel-core": "<=0.3.6-beta", "rainlab/debugbar-plugin": "<3.1", + "rmccue/requests": ">=1.6,<1.8", "robrichards/xmlseclibs": "<3.0.4", + "sabberworm/php-css-parser": ">=1,<1.0.1|>=2,<2.0.1|>=3,<3.0.1|>=4,<4.0.1|>=5,<5.0.9|>=5.1,<5.1.3|>=5.2,<5.2.1|>=6,<6.0.2|>=7,<7.0.4|>=8,<8.0.1|>=8.1,<8.1.1|>=8.2,<8.2.1|>=8.3,<8.3.1", "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", "scheb/two-factor-bundle": ">=0,<3.26|>=4,<4.11", "sensiolabs/connect": "<4.2.3", "serluck/phpwhois": "<=4.2.6", - "shopware/shopware": "<5.3.7", + "shopware/core": "<=6.3.5.2", + "shopware/platform": "<=6.3.5.2", + "shopware/production": "<=6.3.5.2", + "shopware/shopware": "<5.6.9", "silverstripe/admin": ">=1.0.3,<1.0.4|>=1.1,<1.1.1", "silverstripe/assets": ">=1,<1.4.7|>=1.5,<1.5.2", "silverstripe/cms": "<4.3.6|>=4.4,<4.4.4", @@ -4220,20 +4337,23 @@ "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", "simplito/elliptic-php": "<1.0.6", "slim/slim": "<2.6", - "smarty/smarty": "<3.1.33", + "smarty/smarty": "<3.1.39", "socalnick/scn-social-auth": "<1.15.2", + "socialiteproviders/steam": "<1.1", "spoonity/tcpdf": "<6.2.22", "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", "ssddanbrown/bookstack": "<0.29.2", "stormpath/sdk": ">=0,<9.9.99", "studio-42/elfinder": "<2.1.49", + "sulu/sulu": "<1.6.34|>=2,<2.0.10|>=2.1,<2.1.1", "swiftmailer/swiftmailer": ">=4,<5.4.5", "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", "sylius/grid-bundle": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", - "sylius/resource-bundle": "<1.3.13|>=1.4,<1.4.6|>=1.5,<1.5.1|>=1.6,<1.6.3", - "sylius/sylius": "<1.3.16|>=1.4,<1.4.12|>=1.5,<1.5.9|>=1.6,<1.6.5", + "sylius/resource-bundle": "<1.3.14|>=1.4,<1.4.7|>=1.5,<1.5.2|>=1.6,<1.6.4", + "sylius/sylius": "<1.6.9|>=1.7,<1.7.9|>=1.8,<1.8.3", "symbiote/silverstripe-multivaluefield": ">=3,<3.0.99", + "symbiote/silverstripe-queuedjobs": ">=3,<3.0.2|>=3.1,<3.1.4|>=4,<4.0.7|>=4.1,<4.1.2|>=4.2,<4.2.4|>=4.3,<4.3.3|>=4.4,<4.4.3|>=4.5,<4.5.1|>=4.6,<4.6.4", "symbiote/silverstripe-versionedfiles": "<=2.0.3", "symfony/cache": ">=3.1,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", "symfony/dependency-injection": ">=2,<2.0.17|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", @@ -4241,22 +4361,23 @@ "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/http-kernel": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", + "symfony/http-kernel": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.4.13|>=5,<5.1.5", "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/maker-bundle": ">=1.27,<1.29.2|>=1.30,<1.31.1", "symfony/mime": ">=4.3,<4.3.8", "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/polyfill": ">=1,<1.10", "symfony/polyfill-php55": ">=1,<1.10", "symfony/proxy-manager-bridge": ">=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7|>=4.4,<4.4.7|>=5,<5.0.7", + "symfony/security": ">=2,<2.7.51|>=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7", + "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", + "symfony/security-guard": ">=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", + "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", + "symfony/symfony": ">=2,<3.4.48|>=4,<4.4.23|>=5,<5.2.8", "symfony/translation": ">=2,<2.0.17", "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8", @@ -4270,19 +4391,25 @@ "titon/framework": ">=0,<9.9.99", "truckersmp/phpwhois": "<=4.3.1", "twig/twig": "<1.38|>=2,<2.7", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.30|>=9,<9.5.17|>=10,<10.4.2", - "typo3/cms-core": ">=8,<8.7.30|>=9,<9.5.17|>=10,<10.4.2", - "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", - "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", + "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.38|>=9,<9.5.25|>=10,<10.4.14|>=11,<11.1.1", + "typo3/cms-backend": ">=7,<=7.6.50|>=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", + "typo3/cms-core": ">=6.2,<=6.2.56|>=7,<=7.6.50|>=8,<=8.7.39|>=9,<9.5.25|>=10,<10.4.14|>=11,<11.1.1", + "typo3/cms-form": ">=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.13|>=11,<=11.1", + "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.12|>=3.1,<3.1.10|>=3.2,<3.2.13|>=3.3,<3.3.13|>=4,<4.0.6", + "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4|>=2.3,<2.3.99|>=3,<3.0.20|>=3.1,<3.1.18|>=3.2,<3.2.14|>=3.3,<3.3.23|>=4,<4.0.17|>=4.1,<4.1.16|>=4.2,<4.2.12|>=4.3,<4.3.3", "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1", + "typo3/swiftmailer": ">=4.1,<4.1.99|>=5.4,<5.4.5", + "typo3fluid/fluid": ">=2,<2.0.8|>=2.1,<2.1.7|>=2.2,<2.2.4|>=2.3,<2.3.7|>=2.4,<2.4.4|>=2.5,<2.5.11|>=2.6,<2.6.10", "ua-parser/uap-php": "<3.8", "usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2", "verot/class.upload.php": "<=1.0.3|>=2,<=2.0.4", + "vrana/adminer": "<4.7.9", "wallabag/tcpdf": "<6.2.22", + "wikimedia/parsoid": "<0.12.2", "willdurand/js-translation-bundle": "<2.1.1", "yii2mod/yii2-cms": "<1.9.2", "yiisoft/yii": ">=1.1.14,<1.1.15", - "yiisoft/yii2": "<2.0.15", + "yiisoft/yii2": "<2.0.38", "yiisoft/yii2-bootstrap": "<2.0.4", "yiisoft/yii2-dev": "<2.0.15", "yiisoft/yii2-elasticsearch": "<2.0.5", @@ -4290,6 +4417,7 @@ "yiisoft/yii2-jui": "<2.0.4", "yiisoft/yii2-redis": "<2.0.8", "yourls/yourls": "<1.7.4", + "zendesk/zendesk_api_client_php": "<2.2.11", "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", @@ -4314,9 +4442,9 @@ "zetacomponents/mail": "<1.8.2", "zf-commons/zfc-user": "<1.2.2", "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", - "zfr/zfr-oauth2-server-module": "<0.1.2" + "zfr/zfr-oauth2-server-module": "<0.1.2", + "zoujingli/thinkadmin": "<6.0.22" }, - "default-branch": true, "type": "metapackage", "notification-url": "https://packagist.org/downloads/", "license": [ @@ -4337,7 +4465,7 @@ "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", "support": { "issues": "https://github.com/Roave/SecurityAdvisories/issues", - "source": "https://github.com/Roave/SecurityAdvisories/tree/master" + "source": "https://github.com/Roave/SecurityAdvisories/tree/latest" }, "funding": [ { @@ -4349,20 +4477,20 @@ "type": "tidelift" } ], - "time": "2020-07-16T05:17:29+00:00" + "time": "2021-05-18T18:23:15+00:00" }, { "name": "sanmai/pipeline", - "version": "v3.1.2", + "version": "v3.1.4", "source": { "type": "git", "url": "https://github.com/sanmai/pipeline.git", - "reference": "12a7402b97d945587a6a8c291a0040369a83fcf6" + "reference": "07a532743086cc01af9313d28eedacbaf77ea70e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sanmai/pipeline/zipball/12a7402b97d945587a6a8c291a0040369a83fcf6", - "reference": "12a7402b97d945587a6a8c291a0040369a83fcf6", + "url": "https://api.github.com/repos/sanmai/pipeline/zipball/07a532743086cc01af9313d28eedacbaf77ea70e", + "reference": "07a532743086cc01af9313d28eedacbaf77ea70e", "shasum": "" }, "require": { @@ -4381,11 +4509,6 @@ "vimeo/psalm": "^2.0 || ^3.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, "autoload": { "psr-4": { "Pipeline\\": "src/" @@ -4407,29 +4530,91 @@ "description": "General-purpose collections pipeline", "support": { "issues": "https://github.com/sanmai/pipeline/issues", - "source": "https://github.com/sanmai/pipeline/tree/v3.1.2" + "source": "https://github.com/sanmai/pipeline/tree/v3.1.4" + }, + "funding": [ + { + "url": "https://github.com/sanmai", + "type": "github" + } + ], + "time": "2020-10-21T01:57:59+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" }, - "time": "2020-01-26T21:22:49+00:00" + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" }, { "name": "sebastian/code-unit", - "version": "1.0.5", + "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "c1e2df332c905079980b119c4db103117e5e5c90" + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/c1e2df332c905079980b119c4db103117e5e5c90", - "reference": "c1e2df332c905079980b119c4db103117e5e5c90", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -4457,7 +4642,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit", "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/master" + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" }, "funding": [ { @@ -4465,27 +4650,27 @@ "type": "github" } ], - "time": "2020-06-26T12:50:45+00:00" + "time": "2020-10-26T13:08:54+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ee51f9bb0c6d8a43337055db3120829fa14da819" + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ee51f9bb0c6d8a43337055db3120829fa14da819", - "reference": "ee51f9bb0c6d8a43337055db3120829fa14da819", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -4512,7 +4697,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/master" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" }, "funding": [ { @@ -4520,29 +4705,29 @@ "type": "github" } ], - "time": "2020-06-26T12:04:00+00:00" + "time": "2020-09-28T05:30:19+00:00" }, { "name": "sebastian/comparator", - "version": "4.0.3", + "version": "4.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "dcc580eadfaa4e7f9d2cf9ae1922134ea962e14f" + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/dcc580eadfaa4e7f9d2cf9ae1922134ea962e14f", - "reference": "dcc580eadfaa4e7f9d2cf9ae1922134ea962e14f", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0", + "php": ">=7.3", "sebastian/diff": "^4.0", "sebastian/exporter": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -4586,7 +4771,64 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/master" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" }, "funding": [ { @@ -4594,27 +4836,27 @@ "type": "github" } ], - "time": "2020-06-26T12:05:46+00:00" + "time": "2020-10-26T15:52:27+00:00" }, { "name": "sebastian/diff", - "version": "4.0.2", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "1e90b4cf905a7d06c420b1d2e9d11a4dc8a13113" + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/1e90b4cf905a7d06c420b1d2e9d11a4dc8a13113", - "reference": "1e90b4cf905a7d06c420b1d2e9d11a4dc8a13113", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0", + "phpunit/phpunit": "^9.3", "symfony/process": "^4.2 || ^5" }, "type": "library", @@ -4652,7 +4894,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/master" + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" }, "funding": [ { @@ -4660,27 +4902,27 @@ "type": "github" } ], - "time": "2020-06-30T04:46:02+00:00" + "time": "2020-10-26T13:10:38+00:00" }, { "name": "sebastian/environment", - "version": "5.1.2", + "version": "5.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "0a757cab9d5b7ef49a619f1143e6c9c1bc0fe9d2" + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/0a757cab9d5b7ef49a619f1143e6c9c1bc0fe9d2", - "reference": "0a757cab9d5b7ef49a619f1143e6c9c1bc0fe9d2", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-posix": "*" @@ -4688,7 +4930,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.0-dev" + "dev-master": "5.1-dev" } }, "autoload": { @@ -4715,7 +4957,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/master" + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" }, "funding": [ { @@ -4723,29 +4965,29 @@ "type": "github" } ], - "time": "2020-06-26T12:07:24+00:00" + "time": "2020-09-28T05:52:38+00:00" }, { "name": "sebastian/exporter", - "version": "4.0.2", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "571d721db4aec847a0e59690b954af33ebf9f023" + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/571d721db4aec847a0e59690b954af33ebf9f023", - "reference": "571d721db4aec847a0e59690b954af33ebf9f023", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0", + "php": ">=7.3", "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "^9.2" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -4792,7 +5034,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.2" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3" }, "funding": [ { @@ -4800,30 +5042,30 @@ "type": "github" } ], - "time": "2020-06-26T12:08:55+00:00" + "time": "2020-09-28T05:24:23+00:00" }, { "name": "sebastian/global-state", - "version": "4.0.0", + "version": "5.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bdb1e7c79e592b8c82cb1699be3c8743119b8a72" + "reference": "a90ccbddffa067b51f574dea6eb25d5680839455" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bdb1e7c79e592b8c82cb1699be3c8743119b8a72", - "reference": "bdb1e7c79e592b8c82cb1699be3c8743119b8a72", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455", + "reference": "a90ccbddffa067b51f574dea6eb25d5680839455", "shasum": "" }, "require": { - "php": "^7.3", + "php": ">=7.3", "sebastian/object-reflector": "^2.0", "sebastian/recursion-context": "^4.0" }, "require-dev": { "ext-dom": "*", - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "suggest": { "ext-uopz": "*" @@ -4831,7 +5073,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -4856,31 +5098,94 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/master" + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:55:19+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" }, - "time": "2020-02-07T06:11:37+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" }, { "name": "sebastian/object-enumerator", - "version": "4.0.2", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "074fed2d0a6d08e1677dd8ce9d32aecb384917b8" + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/074fed2d0a6d08e1677dd8ce9d32aecb384917b8", - "reference": "074fed2d0a6d08e1677dd8ce9d32aecb384917b8", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0", + "php": ">=7.3", "sebastian/object-reflector": "^2.0", "sebastian/recursion-context": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -4907,7 +5212,7 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/master" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" }, "funding": [ { @@ -4915,27 +5220,27 @@ "type": "github" } ], - "time": "2020-06-26T12:11:32+00:00" + "time": "2020-10-26T13:12:34+00:00" }, { "name": "sebastian/object-reflector", - "version": "2.0.2", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "127a46f6b057441b201253526f81d5406d6c7840" + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/127a46f6b057441b201253526f81d5406d6c7840", - "reference": "127a46f6b057441b201253526f81d5406d6c7840", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -4962,7 +5267,7 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/master" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" }, "funding": [ { @@ -4970,27 +5275,27 @@ "type": "github" } ], - "time": "2020-06-26T12:12:55+00:00" + "time": "2020-10-26T13:14:26+00:00" }, { "name": "sebastian/recursion-context", - "version": "4.0.2", + "version": "4.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "062231bf61d2b9448c4fa5a7643b5e1829c11d63" + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/062231bf61d2b9448c4fa5a7643b5e1829c11d63", - "reference": "062231bf61d2b9448c4fa5a7643b5e1829c11d63", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.0" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { @@ -5025,7 +5330,7 @@ "homepage": "http://www.github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" }, "funding": [ { @@ -5033,24 +5338,24 @@ "type": "github" } ], - "time": "2020-06-26T12:14:17+00:00" + "time": "2020-10-26T13:17:30+00:00" }, { "name": "sebastian/resource-operations", - "version": "3.0.2", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0653718a5a629b065e91f774595267f8dc32e213" + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0653718a5a629b065e91f774595267f8dc32e213", - "reference": "0653718a5a629b065e91f774595267f8dc32e213", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { "phpunit/phpunit": "^9.0" @@ -5080,7 +5385,7 @@ "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.2" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" }, "funding": [ { @@ -5088,32 +5393,32 @@ "type": "github" } ], - "time": "2020-06-26T12:16:22+00:00" + "time": "2020-09-28T06:45:17+00:00" }, { "name": "sebastian/type", - "version": "2.2.1", + "version": "2.3.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "86991e2b33446cd96e648c18bcdb1e95afb2c05a" + "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/86991e2b33446cd96e648c18bcdb1e95afb2c05a", - "reference": "86991e2b33446cd96e648c18bcdb1e95afb2c05a", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2", + "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "^9.2" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.3-dev" } }, "autoload": { @@ -5136,7 +5441,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/2.2.1" + "source": "https://github.com/sebastianbergmann/type/tree/2.3.1" }, "funding": [ { @@ -5144,24 +5449,24 @@ "type": "github" } ], - "time": "2020-07-05T08:31:53+00:00" + "time": "2020-10-26T13:18:59+00:00" }, { "name": "sebastian/version", - "version": "3.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "626586115d0ed31cb71483be55beb759b5af5a3c" + "reference": "c6c1022351a901512170118436c764e473f6de8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/626586115d0ed31cb71483be55beb759b5af5a3c", - "reference": "626586115d0ed31cb71483be55beb759b5af5a3c", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", "shasum": "" }, "require": { - "php": "^7.3 || ^8.0" + "php": ">=7.3" }, "type": "library", "extra": { @@ -5189,7 +5494,7 @@ "homepage": "https://github.com/sebastianbergmann/version", "support": { "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.1" + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" }, "funding": [ { @@ -5197,7 +5502,7 @@ "type": "github" } ], - "time": "2020-06-26T12:18:43+00:00" + "time": "2020-09-28T06:39:44+00:00" }, { "name": "slevomat/coding-standard", @@ -5507,56 +5812,59 @@ }, { "name": "vimeo/psalm", - "version": "3.12.2", + "version": "4.7.2", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "7c7ebd068f8acaba211d4a2c707c4ba90874fa26" + "reference": "83a0325c0a95c0ab531d6b90c877068b464377b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/7c7ebd068f8acaba211d4a2c707c4ba90874fa26", - "reference": "7c7ebd068f8acaba211d4a2c707c4ba90874fa26", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/83a0325c0a95c0ab531d6b90c877068b464377b5", + "reference": "83a0325c0a95c0ab531d6b90c877068b464377b5", "shasum": "" }, "require": { - "amphp/amp": "^2.1", + "amphp/amp": "^2.4.2", "amphp/byte-stream": "^1.5", + "composer/package-versions-deprecated": "^1.8.0", "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.1", + "composer/xdebug-handler": "^1.1 || ^2.0", + "dnoegel/php-xdg-base-dir": "^0.1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", + "ext-mbstring": "*", "ext-simplexml": "*", "ext-tokenizer": "*", "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.4", - "netresearch/jsonmapper": "^1.0 || ^2.0", - "nikic/php-parser": "^4.3", - "ocramius/package-versions": "^1.2", + "felixfbecker/language-server-protocol": "^1.5", + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", + "nikic/php-parser": "^4.10.1", "openlss/lib-array2xml": "^1.0", - "php": "^7.1.3|^8", + "php": "^7.1|^8", "sebastian/diff": "^3.0 || ^4.0", "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0", - "webmozart/glob": "^4.1", "webmozart/path-util": "^2.3" }, "provide": { "psalm/psalm": "self.version" }, "require-dev": { - "amphp/amp": "^2.4.2", "bamarni/composer-bin-plugin": "^1.2", - "brianium/paratest": "^4.0.0", + "brianium/paratest": "^4.0||^6.0", "ext-curl": "*", - "php-coveralls/php-coveralls": "^2.2", - "phpmyadmin/sql-parser": "5.1.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpdocumentor/reflection-docblock": "^5", + "phpmyadmin/sql-parser": "5.1.0||dev-master", "phpspec/prophecy": ">=1.9.0", - "phpunit/phpunit": "^7.5.16 || ^8.5 || ^9.0", - "psalm/plugin-phpunit": "^0.10", - "slevomat/coding-standard": "^5.0", + "phpunit/phpunit": "^9.0", + "psalm/plugin-phpunit": "^0.13", + "slevomat/coding-standard": "^6.3.11", "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3" + "symfony/process": "^4.3", + "weirdan/phpunit-appveyor-reporter": "^1.0.0", + "weirdan/prophecy-shim": "^1.0 || ^2.0" }, "suggest": { "ext-igbinary": "^2.0.5" @@ -5571,7 +5879,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev", + "dev-master": "4.x-dev", + "dev-3.x": "3.x-dev", "dev-2.x": "2.x-dev", "dev-1.x": "1.x-dev" } @@ -5602,60 +5911,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/master" - }, - "time": "2020-07-03T16:59:07+00:00" - }, - { - "name": "webmozart/glob", - "version": "4.1.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/glob.git", - "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/glob/zipball/3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", - "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", - "shasum": "" - }, - "require": { - "php": "^5.3.3|^7.0", - "webmozart/path-util": "^2.2" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1", - "symfony/filesystem": "^2.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.1-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Glob\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A PHP implementation of Ant's glob.", - "support": { - "issues": "https://github.com/webmozart/glob/issues", - "source": "https://github.com/webmozart/glob/tree/master" + "source": "https://github.com/vimeo/psalm/tree/4.7.2" }, - "time": "2015-12-29T11:14:33+00:00" + "time": "2021-05-01T20:56:25+00:00" }, { "name": "webmozart/path-util", diff --git a/psalm.xml b/psalm.xml index ddb7c224..70d17938 100644 --- a/psalm.xml +++ b/psalm.xml @@ -4,8 +4,6 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" name="Example Psalm config with recommended defaults" - useDocblockTypes="true" - totallyTyped="false" allowPhpStormGenerics="true" > @@ -19,5 +17,22 @@ + + + + + + + + + + + + + + + + + diff --git a/src/Command/AssertBackwardsCompatible.php b/src/Command/AssertBackwardsCompatible.php index 409c917f..d7dd45d1 100644 --- a/src/Command/AssertBackwardsCompatible.php +++ b/src/Command/AssertBackwardsCompatible.php @@ -142,7 +142,7 @@ public function execute(InputInterface $input, OutputInterface $output): int $toRevision = $this->parseRevision->fromStringForRepository($to, $sourceRepo); - $stdErr->writeln(Str\format('Comparing from %s to %s...', $fromRevision, $toRevision)); + $stdErr->writeln(Str\format('Comparing from %s to %s...', (string) $fromRevision, (string) $toRevision)); $fromPath = $this->git->checkout($sourceRepo, $fromRevision); $toPath = $this->git->checkout($sourceRepo, $toRevision); diff --git a/src/DetectChanges/BCBreak/ClassBased/AncestorRemoved.php b/src/DetectChanges/BCBreak/ClassBased/AncestorRemoved.php index 520ca9d4..c8c63b1e 100644 --- a/src/DetectChanges/BCBreak/ClassBased/AncestorRemoved.php +++ b/src/DetectChanges/BCBreak/ClassBased/AncestorRemoved.php @@ -21,8 +21,8 @@ final class AncestorRemoved implements ClassBased public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): Changes { $removedAncestors = Vec\concat( - Dict\diff($fromClass->getParentClassNames(), $toClass->getParentClassNames()), - Dict\diff($fromClass->getInterfaceNames(), $toClass->getInterfaceNames()) + Vec\values(Dict\diff($fromClass->getParentClassNames(), $toClass->getParentClassNames())), + Vec\values(Dict\diff($fromClass->getInterfaceNames(), $toClass->getInterfaceNames())) ); if (! $removedAncestors) { diff --git a/src/SourceLocator/StaticClassMapSourceLocator.php b/src/SourceLocator/StaticClassMapSourceLocator.php index e0353522..6c837a37 100644 --- a/src/SourceLocator/StaticClassMapSourceLocator.php +++ b/src/SourceLocator/StaticClassMapSourceLocator.php @@ -15,7 +15,7 @@ final class StaticClassMapSourceLocator extends AbstractSourceLocator { - /** @var array */ + /** @var array */ private array $classMap; /** @@ -29,7 +29,7 @@ public function __construct( parent::__construct($astLocator); $realPaths = Dict\map($classMap, static function(string $file): string { - return Filesystem\canonicalize($file); + return Type\string()->assert(Filesystem\canonicalize($file)); }); Assert::allFile($realPaths); diff --git a/test/unit/LocateDependencies/LocateDependenciesViaComposerTest.php b/test/unit/LocateDependencies/LocateDependenciesViaComposerTest.php index 334f1943..6507fb43 100644 --- a/test/unit/LocateDependencies/LocateDependenciesViaComposerTest.php +++ b/test/unit/LocateDependencies/LocateDependenciesViaComposerTest.php @@ -11,10 +11,10 @@ use ReflectionProperty; use Roave\BackwardCompatibility\LocateDependencies\LocateDependenciesViaComposer; use Roave\BetterReflection\BetterReflection; -use Roave\BetterReflection\SourceLocator\Ast\Locator; use Roave\BetterReflection\SourceLocator\Type\AggregateSourceLocator; use Roave\BetterReflection\SourceLocator\Type\PhpInternalSourceLocator; use Psl\Env; +use Psl\Type; use Psl\Filesystem; /** @@ -24,18 +24,10 @@ final class LocateDependenciesViaComposerTest extends TestCase { private string $originalCwd; - /** - * @var callable - * @psalm-var callable(string) : Installer - */ - private $makeInstaller; - /** @var Installer&MockObject */ private Installer $composerInstaller; - private ?string $expectedInstallatonPath = null; - - private Locator $astLocator; + private string $expectedInstallationPath; private LocateDependenciesViaComposer $locateDependencies; @@ -45,14 +37,15 @@ protected function setUp(): void $this->originalCwd = Env\current_dir(); $this->composerInstaller = $this->createMock(Installer::class); - $this->astLocator = (new BetterReflection())->astLocator(); - $this->makeInstaller = function (string $installationPath): Installer { - self::assertSame($this->expectedInstallatonPath, $installationPath); + + $astLocator = (new BetterReflection())->astLocator(); + $makeInstaller = function (string $installationPath): Installer { + self::assertSame($this->expectedInstallationPath, $installationPath); return $this->composerInstaller; }; - $this->locateDependencies = new LocateDependenciesViaComposer($this->makeInstaller, $this->astLocator); + $this->locateDependencies = new LocateDependenciesViaComposer($makeInstaller, $astLocator); } protected function tearDown(): void @@ -79,7 +72,8 @@ public function testWillNotLocateDependenciesForANonExistingPath(): void public function testWillLocateDependencies(): void { - $this->expectedInstallatonPath = Filesystem\canonicalize(__DIR__ . '/../../asset/composer-installation-structure'); + $this->expectedInstallationPath = Type\string() + ->assert(Filesystem\canonicalize(__DIR__ . '/../../asset/composer-installation-structure')); $this ->composerInstaller @@ -107,12 +101,12 @@ public function testWillLocateDependencies(): void ->expects(self::once()) ->method('run') ->willReturnCallback(function (): void { - self::assertSame($this->expectedInstallatonPath, Env\current_dir()); + self::assertSame($this->expectedInstallationPath, Env\current_dir()); }); $locator = $this ->locateDependencies - ->__invoke($this->expectedInstallatonPath); + ->__invoke($this->expectedInstallationPath); self::assertInstanceOf(AggregateSourceLocator::class, $locator); From b410d68d62911f60188fabc5ee3a21c32f5858c8 Mon Sep 17 00:00:00 2001 From: azjezz Date: Wed, 19 May 2021 03:06:46 +0100 Subject: [PATCH 03/12] replace webmozart/assert by azjezz/psl --- composer.json | 3 +-- composer.lock | 2 +- src/Git/CheckedOutRepository.php | 5 +++-- src/Git/PickLastMinorVersionFromCollection.php | 8 ++++---- src/Git/Revision.php | 10 +++++----- src/SourceLocator/StaticClassMapSourceLocator.php | 7 +++++-- test/unit/Assertion.php | 5 ++--- 7 files changed, 21 insertions(+), 19 deletions(-) diff --git a/composer.json b/composer.json index 42ebc096..37db6c18 100644 --- a/composer.json +++ b/composer.json @@ -10,8 +10,7 @@ "ocramius/package-versions": "^1.11.0", "roave/better-reflection": "^4.9.0", "symfony/console": "^5.2.6", - "symfony/process": "^5.2.4", - "webmozart/assert": "^1.9.1" + "symfony/process": "^5.2.4" }, "license": "MIT", "authors": [ diff --git a/composer.lock b/composer.lock index 299033ea..0d473af1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "afef334a46c9ae58eb2b82b3fb663c5f", + "content-hash": "ced8583c3d15ba95832959eac12a368f", "packages": [ { "name": "azjezz/psl", diff --git a/src/Git/CheckedOutRepository.php b/src/Git/CheckedOutRepository.php index 29cc10fc..c00faf4d 100644 --- a/src/Git/CheckedOutRepository.php +++ b/src/Git/CheckedOutRepository.php @@ -4,7 +4,8 @@ namespace Roave\BackwardCompatibility\Git; -use Webmozart\Assert\Assert; +use Psl; +use Psl\Filesystem; final class CheckedOutRepository { @@ -16,7 +17,7 @@ private function __construct() public static function fromPath(string $path): self { - Assert::directory($path . '/.git'); + Psl\invariant(Filesystem\is_directory($path . '/.git'), 'Directory "%s" is not a GIT repository.', $path); $instance = new self(); $instance->path = $path; diff --git a/src/Git/PickLastMinorVersionFromCollection.php b/src/Git/PickLastMinorVersionFromCollection.php index 30af0af9..ea99b014 100644 --- a/src/Git/PickLastMinorVersionFromCollection.php +++ b/src/Git/PickLastMinorVersionFromCollection.php @@ -11,7 +11,7 @@ use Version\Comparison\Constraint\OperationConstraint; use Version\Version; use Version\VersionCollection; -use Webmozart\Assert\Assert; +use Psl; final class PickLastMinorVersionFromCollection implements PickVersionFromVersionCollection { @@ -21,11 +21,11 @@ final class PickLastMinorVersionFromCollection implements PickVersionFromVersion * @throws LogicException * @throws RuntimeException */ - public function forVersions(VersionCollection $versions): Version + public function forVersions(VersionCollection $versionsCollection): Version { - Assert::minCount($versions, 1, 'Cannot determine latest minor version from an empty collection'); + Psl\invariant(!$versionsCollection->isEmpty(), 'Cannot determine latest minor version from an empty collection'); - $stableVersions = $versions->matching(new class implements Constraint { + $stableVersions = $versionsCollection->matching(new class implements Constraint { public function assert(Version $version): bool { return ! $version->isPreRelease(); diff --git a/src/Git/Revision.php b/src/Git/Revision.php index 4a20fe65..c0aabe36 100644 --- a/src/Git/Revision.php +++ b/src/Git/Revision.php @@ -4,9 +4,9 @@ namespace Roave\BackwardCompatibility\Git; -use Webmozart\Assert\Assert; - -use function rtrim; +use Psl\Str; +use Psl\Regex; +use Psl; final class Revision { @@ -18,10 +18,10 @@ private function __construct() public static function fromSha1(string $sha1): self { - Assert::regex($sha1, '/^[a-zA-Z0-9]{40}$/'); + Psl\invariant(Regex\matches($sha1, '/^[a-zA-Z0-9]{40}$/'), 'Invalid SHA1 hash.'); $instance = new self(); - $instance->sha1 = rtrim($sha1); + $instance->sha1 = Str\trim_right($sha1); return $instance; } diff --git a/src/SourceLocator/StaticClassMapSourceLocator.php b/src/SourceLocator/StaticClassMapSourceLocator.php index 6c837a37..f1d42c98 100644 --- a/src/SourceLocator/StaticClassMapSourceLocator.php +++ b/src/SourceLocator/StaticClassMapSourceLocator.php @@ -8,10 +8,11 @@ use Roave\BetterReflection\SourceLocator\Ast\Locator; use Roave\BetterReflection\SourceLocator\Located\LocatedSource; use Roave\BetterReflection\SourceLocator\Type\AbstractSourceLocator; -use Webmozart\Assert\Assert; use Psl\Type; use Psl\Dict; use Psl\Filesystem; +use Psl\Iter; +use Psl; final class StaticClassMapSourceLocator extends AbstractSourceLocator { @@ -32,7 +33,9 @@ public function __construct( return Type\string()->assert(Filesystem\canonicalize($file)); }); - Assert::allFile($realPaths); + Psl\invariant(Iter\all($realPaths, static function(string $file): bool { + return Filesystem\is_file($file); + }), 'Invalid class-map.'); $this->classMap = Type\dict(Type\non_empty_string(), Type\string())->coerce($realPaths); } diff --git a/test/unit/Assertion.php b/test/unit/Assertion.php index 52e09720..3c178145 100644 --- a/test/unit/Assertion.php +++ b/test/unit/Assertion.php @@ -7,8 +7,7 @@ use PHPUnit\Framework\Assert; use ReflectionProperty; use Roave\BackwardCompatibility\Changes; - -use function count; +use Psl\Iter; abstract class Assertion { @@ -28,7 +27,7 @@ public static function assertChangesEqual( 'Buffer must NOT be exhausted' ); // Forces eager initialisation of the `Changes` instances, allowing us to compare them by value - Assert::assertCount(count($expected), $actual); + Assert::assertCount(Iter\count($expected), $actual); Assert::assertEquals($expected, $actual, $message); } From c1a2156dbe9f13fe14051c55d99c4bd621771a08 Mon Sep 17 00:00:00 2001 From: azjezz Date: Wed, 19 May 2021 03:38:04 +0100 Subject: [PATCH 04/12] replace symfony/process by azjezz/psl --- bin/roave-backward-compatibility-check.php | 5 +- composer.json | 3 +- composer.lock | 2 +- .../GetVersionCollectionFromGitRepository.php | 40 ++-- .../GitCheckoutRevisionToTemporaryPath.php | 13 +- src/Git/GitParseRevision.php | 9 +- .../PickLastMinorVersionFromCollection.php | 8 - .../Command/AssertBackwardsCompatibleTest.php | 180 +++++++----------- test/unit/Git/CheckedOutRepositoryTest.php | 6 +- ...GitCheckoutRevisionToTemporaryPathTest.php | 5 +- ...PickLastMinorVersionFromCollectionTest.php | 4 +- test/unit/Git/RevisionTest.php | 23 ++- .../StaticClassMapSourceLocatorTest.php | 4 +- 13 files changed, 120 insertions(+), 182 deletions(-) diff --git a/bin/roave-backward-compatibility-check.php b/bin/roave-backward-compatibility-check.php index 8909d198..bdca4021 100644 --- a/bin/roave-backward-compatibility-check.php +++ b/bin/roave-backward-compatibility-check.php @@ -31,8 +31,7 @@ use Symfony\Component\Console\Application; use Symfony\Component\Console\Input\ArgvInput; use Symfony\Component\Console\Output\ConsoleOutput; - -use function file_exists; +use Psl\Filesystem; (static function (): void { (static function (): void { @@ -42,7 +41,7 @@ ]; foreach ($autoloaderLocations as $autoload) { - if (file_exists($autoload)) { + if (Filesystem\exists($autoload)) { /** @noinspection PhpIncludeInspection */ require_once $autoload; diff --git a/composer.json b/composer.json index 37db6c18..6c4c31a6 100644 --- a/composer.json +++ b/composer.json @@ -9,8 +9,7 @@ "nikolaposa/version": "^4.1.0", "ocramius/package-versions": "^1.11.0", "roave/better-reflection": "^4.9.0", - "symfony/console": "^5.2.6", - "symfony/process": "^5.2.4" + "symfony/console": "^5.2.6" }, "license": "MIT", "authors": [ diff --git a/composer.lock b/composer.lock index 0d473af1..6cc8b883 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ced8583c3d15ba95832959eac12a368f", + "content-hash": "92c62d968f24dce0f4201786a22aa910", "packages": [ { "name": "azjezz/psl", diff --git a/src/Git/GetVersionCollectionFromGitRepository.php b/src/Git/GetVersionCollectionFromGitRepository.php index 45653cf4..5898d613 100644 --- a/src/Git/GetVersionCollectionFromGitRepository.php +++ b/src/Git/GetVersionCollectionFromGitRepository.php @@ -4,41 +4,29 @@ namespace Roave\BackwardCompatibility\Git; -use Symfony\Component\Process\Exception\LogicException; -use Symfony\Component\Process\Exception\ProcessFailedException; -use Symfony\Component\Process\Exception\RuntimeException; -use Symfony\Component\Process\Process; +use Psl\Shell; +use Psl\Str; +use Psl\Vec; use Version\Exception\InvalidVersionString; use Version\Version; use Version\VersionCollection; -use function array_filter; -use function array_map; -use function explode; - final class GetVersionCollectionFromGitRepository implements GetVersionCollection { /** - * {@inheritDoc} - * - * @throws ProcessFailedException - * @throws LogicException - * @throws RuntimeException + * @throws Shell\Exception\RuntimeException + * @throws Shell\Exception\FailedExecutionException */ - public function fromRepository(CheckedOutRepository $checkedOutRepository): VersionCollection + public function fromRepository(CheckedOutRepository $repository): VersionCollection { - $output = (new Process(['git', 'tag', '-l'], $checkedOutRepository->__toString())) - ->mustRun() - ->getOutput(); + $output = Shell\execute('git', ['tag', '-l'], $repository->__toString()); - return new VersionCollection(...array_filter( - array_map(static function (string $maybeVersion): ?Version { - try { - return Version::fromString($maybeVersion); - } catch (InvalidVersionString $e) { - return null; - } - }, explode("\n", $output)) - )); + return new VersionCollection(...Vec\filter(Vec\map(Str\split($output, "\n"), static function (string $maybeVersion): ?Version { + try { + return Version::fromString($maybeVersion); + } catch (InvalidVersionString $e) { + return null; + } + }))); } } diff --git a/src/Git/GitCheckoutRevisionToTemporaryPath.php b/src/Git/GitCheckoutRevisionToTemporaryPath.php index dcfbe8c1..2fc3126e 100644 --- a/src/Git/GitCheckoutRevisionToTemporaryPath.php +++ b/src/Git/GitCheckoutRevisionToTemporaryPath.php @@ -5,11 +5,10 @@ namespace Roave\BackwardCompatibility\Git; use RuntimeException; -use Symfony\Component\Process\Exception\RuntimeException as ProcessRuntimeException; -use Symfony\Component\Process\Process; use Psl\Filesystem; use Psl\Env; use Psl\Str; +use Psl\Shell; final class GitCheckoutRevisionToTemporaryPath implements PerformCheckoutOfRevision { @@ -22,24 +21,24 @@ public function __construct(?callable $uniquenessFunction = null) } /** - * @throws ProcessRuntimeException + * @throws Shell\Exception\RuntimeException */ public function checkout(CheckedOutRepository $sourceRepository, Revision $revision): CheckedOutRepository { $checkoutDirectory = $this->generateTemporaryPathFor($revision); - (new Process(['git', 'clone', $sourceRepository, $checkoutDirectory]))->mustRun(); - (new Process(['git', 'checkout', $revision], $checkoutDirectory))->mustRun(); + Shell\execute('git', ['clone', $sourceRepository->__toString(), $checkoutDirectory]); + Shell\execute('git', ['checkout', $revision->__toString()], $checkoutDirectory); return CheckedOutRepository::fromPath($checkoutDirectory); } /** - * @throws ProcessRuntimeException + * @throws Shell\Exception\RuntimeException */ public function remove(CheckedOutRepository $checkedOutRepository): void { - (new Process(['rm', '-rf', $checkedOutRepository]))->mustRun(); + Shell\execute('rm', ['-rf', $checkedOutRepository->__toString()]); } /** diff --git a/src/Git/GitParseRevision.php b/src/Git/GitParseRevision.php index f158e85d..63e21c9b 100644 --- a/src/Git/GitParseRevision.php +++ b/src/Git/GitParseRevision.php @@ -4,22 +4,19 @@ namespace Roave\BackwardCompatibility\Git; -use Symfony\Component\Process\Exception\RuntimeException; -use Symfony\Component\Process\Process; +use Psl\Shell; final class GitParseRevision implements ParseRevision { /** * {@inheritDoc} * - * @throws RuntimeException + * @throws Shell\Exception\RuntimeException */ public function fromStringForRepository(string $something, CheckedOutRepository $repository): Revision { return Revision::fromSha1( - (new Process(['git', 'rev-parse', $something], $repository->__toString())) - ->mustRun() - ->getOutput() + Shell\execute('git', ['rev-parse', $something], $repository->__toString()), ); } } diff --git a/src/Git/PickLastMinorVersionFromCollection.php b/src/Git/PickLastMinorVersionFromCollection.php index ea99b014..0e7fd945 100644 --- a/src/Git/PickLastMinorVersionFromCollection.php +++ b/src/Git/PickLastMinorVersionFromCollection.php @@ -4,8 +4,6 @@ namespace Roave\BackwardCompatibility\Git; -use Symfony\Component\Process\Exception\LogicException; -use Symfony\Component\Process\Exception\RuntimeException; use Version\Comparison\Constraint\CompositeConstraint; use Version\Comparison\Constraint\Constraint; use Version\Comparison\Constraint\OperationConstraint; @@ -15,12 +13,6 @@ final class PickLastMinorVersionFromCollection implements PickVersionFromVersionCollection { - /** - * {@inheritDoc} - * - * @throws LogicException - * @throws RuntimeException - */ public function forVersions(VersionCollection $versionsCollection): Version { Psl\invariant(!$versionsCollection->isEmpty(), 'Cannot determine latest minor version from an empty collection'); diff --git a/test/e2e/Command/AssertBackwardsCompatibleTest.php b/test/e2e/Command/AssertBackwardsCompatibleTest.php index 6a52dfd0..2c303459 100644 --- a/test/e2e/Command/AssertBackwardsCompatibleTest.php +++ b/test/e2e/Command/AssertBackwardsCompatibleTest.php @@ -5,7 +5,10 @@ namespace RoaveE2ETest\BackwardCompatibility\Command; use PHPUnit\Framework\TestCase; -use Symfony\Component\Process\Process; +use Psl\Shell; +use Psl\Filesystem; +use Psl\Env; +use Psl\Str; /** * @coversNothing @@ -113,37 +116,34 @@ protected function setUp() : void { parent::setUp(); - $this->sourcesRepository = tempnam(sys_get_temp_dir(), 'roave-backward-compatibility-e2e-test'); + $this->sourcesRepository = Filesystem\create_temporary_file(Env\temp_dir(), 'roave-backward-compatibility-e2e-test'); self::assertIsString($this->sourcesRepository); self::assertNotEmpty($this->sourcesRepository); self::assertFileExists($this->sourcesRepository); - unlink($this->sourcesRepository); - mkdir($this->sourcesRepository); - mkdir($this->sourcesRepository . '/src'); + Filesystem\delete_file($this->sourcesRepository); + Filesystem\create_directory($this->sourcesRepository); + Filesystem\create_directory($this->sourcesRepository . '/src'); self::assertDirectoryExists($this->sourcesRepository); self::assertDirectoryExists($this->sourcesRepository . '/src'); - (new Process(['git', 'init'], $this->sourcesRepository))->mustRun(); - (new Process(['git', 'config', 'user.email', 'me@example.com'], $this->sourcesRepository)) - ->mustRun(); - (new Process(['git', 'config', 'user.name', 'Just Me'], $this->sourcesRepository)) - ->mustRun(); + Shell\execute('git', ['init'], $this->sourcesRepository); + Shell\execute('git', ['config', 'user.email', 'me@example.com'], $this->sourcesRepository); + Shell\execute('git', ['config', 'user.name', 'Just Me'], $this->sourcesRepository); - file_put_contents($this->sourcesRepository . '/composer.json', self::COMPOSER_MANIFEST); + Filesystem\write_file($this->sourcesRepository . '/composer.json', self::COMPOSER_MANIFEST); - (new Process(['git', 'add', '-A'], $this->sourcesRepository))->mustRun(); - (new Process(['git', 'commit', '-am', 'Initial commit with composer manifest'], $this->sourcesRepository))->mustRun(); + Shell\execute('git', ['add', '-A'], $this->sourcesRepository); + Shell\execute('git', ['commit', '-am', 'Initial commit with composer manifest'], $this->sourcesRepository); foreach (self::CLASS_VERSIONS as $key => $classCode) { - file_put_contents($this->sourcesRepository . '/src/TheClass.php', $classCode); + Filesystem\write_file($this->sourcesRepository . '/src/TheClass.php', $classCode); - (new Process(['git', 'add', '-A'], $this->sourcesRepository))->mustRun(); - (new Process(['git', 'commit', '-am', sprintf('Class sources v%d', $key + 1)], $this->sourcesRepository))->mustRun(); - $this->versions[$key] = trim((new Process(['git', 'rev-parse', 'HEAD'], $this->sourcesRepository))->mustRun() - ->getOutput()); + Shell\execute('git', ['add', '-A'], $this->sourcesRepository); + Shell\execute('git', ['commit', '-am', Str\format('Class sources v%d', $key + 1)], $this->sourcesRepository); + $this->versions[$key] = Str\trim(Shell\execute('git', ['rev-parse', 'HEAD'], $this->sourcesRepository)); } } @@ -153,93 +153,80 @@ protected function tearDown() : void self::assertDirectoryExists($this->sourcesRepository); // Need to be extremely careful with this stuff - skipping it for now - (new Process(['rm', '-r', $this->sourcesRepository]))->mustRun(); + Shell\execute('rm', ['-r', $this->sourcesRepository]); parent::tearDown(); } public function testWillAllowSpecifyingGitRevision() : void { - $check = new Process( - [ - __DIR__ . '/../../../bin/roave-backward-compatibility-check', + try { + Shell\execute(__DIR__ . '/../../../bin/roave-backward-compatibility-check', [ '--from=' . $this->versions[0], '--to=' . $this->versions[1], - ], - $this->sourcesRepository - ); - - self::assertSame(3, $check->run()); - self::assertStringEndsWith( - <<<'EXPECTED' + ], $this->sourcesRepository); + } catch (Shell\Exception\FailedExecutionException $exception) { + self::assertSame(3, $exception->getCode()); + self::assertStringEndsWith( + <<<'EXPECTED' [BC] CHANGED: The parameter $a of TestArtifact\TheClass#method() changed from TestArtifact\A to a non-contravariant TestArtifact\B 1 backwards-incompatible changes detected EXPECTED - , - $check->getErrorOutput() // @TODO https://github.com/Roave/BackwardCompatibilityCheck/issues/79 this looks like a symfony bug - we shouldn't check STDERR, but STDOUT - ); + , + $exception->getOutput() // @TODO https://github.com/Roave/BackwardCompatibilityCheck/issues/79 this looks like a symfony bug - we shouldn't check STDERR, but STDOUT + ); + } } public function testWillNotRunWithoutTagsNorSpecifiedVersions() : void { - $check = new Process( - [__DIR__ . '/../../../bin/roave-backward-compatibility-check'], - $this->sourcesRepository - ); - - self::assertSame(1, $check->run()); - self::assertStringContainsString( - 'Could not detect any released versions for the given repository', - $check->getErrorOutput() - ); + try { + Shell\execute(__DIR__ . '/../../../bin/roave-backward-compatibility-check', [], $this->sourcesRepository); + } catch (Shell\Exception\FailedExecutionException $exception) { + self::assertSame(1, $exception->getCode()); + self::assertStringContainsString( + 'Could not detect any released versions for the given repository', + $exception->getErrorOutput() + ); + } } public function testWillRunSuccessfullyOnNoBcBreaks() : void { - $check = new Process( - [ - __DIR__ . '/../../../bin/roave-backward-compatibility-check', - '--from=' . $this->versions[0], - '--to=' . $this->versions[3], - '-vvv', - ], - $this->sourcesRepository - ); - - self::assertSame(0, $check->run()); - self::assertStringContainsString( - 'No backwards-incompatible changes detected', - $check->getErrorOutput() - ); + $output = Shell\execute(__DIR__ . '/../../../bin/roave-backward-compatibility-check', [ + '--from=' . $this->versions[0], + '--to=' . $this->versions[3], + '-vvv', + ], $this->sourcesRepository); + + self::assertStringContainsString('No backwards-incompatible changes detected', $output); } public function testWillPickTaggedVersionOnNoGivenFrom() : void { $this->tagOnVersion('1.2.3', 1); - $check = new Process( - [ - __DIR__ . '/../../../bin/roave-backward-compatibility-check', + try { + Shell\execute(__DIR__ . '/../../../bin/roave-backward-compatibility-check', [ '--to=' . $this->versions[2], - ], - $this->sourcesRepository - ); + ], $this->sourcesRepository); + } catch (Shell\Exception\FailedExecutionException $exception) { + self::assertSame(3, $exception->getCode()); - self::assertSame(3, $check->run()); + $errorOutput = $exception->getErrorOutput(); - $errorOutput = $check->getErrorOutput(); - - self::assertStringContainsString('Detected last minor version: 1.2.3', $errorOutput); - self::assertStringEndsWith( - <<<'EXPECTED' + self::assertStringContainsString('Detected last minor version: 1.2.3', $errorOutput); + self::assertStringEndsWith( + <<<'EXPECTED' [BC] CHANGED: The parameter $a of TestArtifact\TheClass#method() changed from TestArtifact\B to a non-contravariant TestArtifact\C 1 backwards-incompatible changes detected EXPECTED - , - $errorOutput // @TODO https://github.com/Roave/BackwardCompatibilityCheck/issues/79 this looks like a symfony bug - we shouldn't check STDERR, but STDOUT - ); + , + $errorOutput // @TODO https://github.com/Roave/BackwardCompatibilityCheck/issues/79 this looks like a symfony bug - we shouldn't check STDERR, but STDOUT + ); + } } public function testWillPickLatestTaggedVersionOnNoGivenFrom() : void @@ -247,50 +234,31 @@ public function testWillPickLatestTaggedVersionOnNoGivenFrom() : void $this->tagOnVersion('2.2.3', 1); $this->tagOnVersion('1.2.3', 3); - $check = new Process( - [ - __DIR__ . '/../../../bin/roave-backward-compatibility-check', + try { + Shell\execute(__DIR__ . '/../../../bin/roave-backward-compatibility-check', [ '--to=' . $this->versions[2], - ], - $this->sourcesRepository - ); + ], $this->sourcesRepository); + } catch (Shell\Exception\FailedExecutionException $exception) { + self::assertSame(3, $exception->getCode()); - self::assertSame(3, $check->run()); + $errorOutput = $exception->getErrorOutput(); - $errorOutput = $check->getErrorOutput(); - - self::assertStringContainsString('Detected last minor version: 2.2.3', $errorOutput); - self::assertStringEndsWith( - <<<'EXPECTED' + self::assertStringContainsString('Detected last minor version: 2.2.3', $errorOutput); + self::assertStringEndsWith( + <<<'EXPECTED' [BC] CHANGED: The parameter $a of TestArtifact\TheClass#method() changed from TestArtifact\B to a non-contravariant TestArtifact\C 1 backwards-incompatible changes detected EXPECTED - , - $errorOutput // @TODO https://github.com/Roave/BackwardCompatibilityCheck/issues/79 this looks like a symfony bug - we shouldn't check STDERR, but STDOUT - ); + , + $errorOutput // @TODO https://github.com/Roave/BackwardCompatibilityCheck/issues/79 this looks like a symfony bug - we shouldn't check STDERR, but STDOUT + ); + } } private function tagOnVersion(string $tagName, int $version) : void { - (new Process( - [ - 'git', - 'checkout', - $this->versions[$version], - ], - $this->sourcesRepository - ))->mustRun(); - - (new Process( - [ - 'git', - 'tag', - $tagName, - '-m', - 'A tag for version ' . $version, - ], - $this->sourcesRepository - ))->mustRun(); + Shell\execute('git', ['checkout', $this->versions[$version]], $this->sourcesRepository); + Shell\execute('git', ['tag', $tagName, '-m', 'A tag for version ' . $version,], $this->sourcesRepository); } } diff --git a/test/unit/Git/CheckedOutRepositoryTest.php b/test/unit/Git/CheckedOutRepositoryTest.php index 8cccecc6..2a77e870 100644 --- a/test/unit/Git/CheckedOutRepositoryTest.php +++ b/test/unit/Git/CheckedOutRepositoryTest.php @@ -4,8 +4,8 @@ namespace RoaveTest\BackwardCompatibility\Git; -use InvalidArgumentException; use PHPUnit\Framework\TestCase; +use Psl\Exception\InvariantViolationException; use Roave\BackwardCompatibility\Git\CheckedOutRepository; use Psl\Filesystem; use Psl\SecureRandom; @@ -31,14 +31,14 @@ public function testFromPath(): void public function testFromPathRejectsNonGitDirectory(): void { - $this->expectException(InvalidArgumentException::class); + $this->expectException(InvariantViolationException::class); CheckedOutRepository::fromPath(__DIR__); } public function testFromPathRejectsNonExistingDirectory(): void { - $this->expectException(InvalidArgumentException::class); + $this->expectException(InvariantViolationException::class); CheckedOutRepository::fromPath(__DIR__ . '/non-existing'); } diff --git a/test/unit/Git/GitCheckoutRevisionToTemporaryPathTest.php b/test/unit/Git/GitCheckoutRevisionToTemporaryPathTest.php index c3e426d8..c9f88033 100644 --- a/test/unit/Git/GitCheckoutRevisionToTemporaryPathTest.php +++ b/test/unit/Git/GitCheckoutRevisionToTemporaryPathTest.php @@ -9,7 +9,6 @@ use Roave\BackwardCompatibility\Git\GitCheckoutRevisionToTemporaryPath; use Roave\BackwardCompatibility\Git\Revision; use RuntimeException; -use Symfony\Component\Process\Process; use Psl\Shell; use Psl\Filesystem; use Psl\Env; @@ -76,9 +75,7 @@ public function testCheckedOutRevisionIsAtExpectedRevisionState(): void Shell\execute('git', ['commit', '-m', 'second commit', '--allow-empty'], $repoPath); $secondCommit = Revision::fromSha1( - (new Process(['git', 'rev-parse', 'HEAD'], $repoPath)) - ->mustRun() - ->getOutput() + Shell\execute('git', ['rev-parse', 'HEAD'], $repoPath) ); $git = new GitCheckoutRevisionToTemporaryPath(); diff --git a/test/unit/Git/PickLastMinorVersionFromCollectionTest.php b/test/unit/Git/PickLastMinorVersionFromCollectionTest.php index 11644003..fb8a14e8 100644 --- a/test/unit/Git/PickLastMinorVersionFromCollectionTest.php +++ b/test/unit/Git/PickLastMinorVersionFromCollectionTest.php @@ -4,8 +4,8 @@ namespace RoaveTest\BackwardCompatibility\Git; -use InvalidArgumentException; use PHPUnit\Framework\TestCase; +use Psl\Exception\InvariantViolationException; use Roave\BackwardCompatibility\Git\PickLastMinorVersionFromCollection; use Version\Version; use Version\VersionCollection; @@ -60,7 +60,7 @@ public function testWillRejectEmptyCollection(): void { $pick = new PickLastMinorVersionFromCollection(); - $this->expectException(InvalidArgumentException::class); + $this->expectException(InvariantViolationException::class); $pick->forVersions(new VersionCollection()); } diff --git a/test/unit/Git/RevisionTest.php b/test/unit/Git/RevisionTest.php index c3254b02..0cc9068e 100644 --- a/test/unit/Git/RevisionTest.php +++ b/test/unit/Git/RevisionTest.php @@ -4,13 +4,12 @@ namespace RoaveTest\BackwardCompatibility\Git; -use InvalidArgumentException; use PHPUnit\Framework\TestCase; +use Psl\Exception\InvariantViolationException; use Roave\BackwardCompatibility\Git\Revision; - -use function sha1; -use function str_repeat; -use function uniqid; +use Psl\Str; +use Psl\SecureRandom; +use Psl\Hash; /** * @covers \Roave\BackwardCompatibility\Git\Revision @@ -19,14 +18,14 @@ final class RevisionTest extends TestCase { public function testFromSha1WithValidSha1(): void { - $sha1 = sha1(uniqid('sha1', true)); + $sha1 = Hash\Context::forAlgorithm('sha1')->update(SecureRandom\string(8))->finalize(); self::assertSame($sha1, (string) Revision::fromSha1($sha1)); } public function testFromSha1WithNewlinesStillProvidesValidSha1(): void { - $sha1 = sha1(uniqid('sha1', true)); + $sha1 = Hash\Context::forAlgorithm('sha1')->update(SecureRandom\string(8))->finalize(); self::assertSame($sha1, (string) Revision::fromSha1($sha1 . "\n")); } @@ -39,10 +38,10 @@ public function invalidRevisionProvider(): array return [ [''], ['a'], - [str_repeat('a', 39)], - [str_repeat('a', 41)], - [' ' . str_repeat('a', 42)], - [str_repeat('a', 42) . ' '], + [Str\repeat('a', 39)], + [Str\repeat('a', 41)], + [' ' . Str\repeat('a', 42)], + [Str\repeat('a', 42) . ' '], ]; } @@ -51,7 +50,7 @@ public function invalidRevisionProvider(): array */ public function testInvalidSha1Rejected(string $invalidRevision): void { - $this->expectException(InvalidArgumentException::class); + $this->expectException(InvariantViolationException::class); Revision::fromSha1($invalidRevision); } } diff --git a/test/unit/SourceLocator/StaticClassMapSourceLocatorTest.php b/test/unit/SourceLocator/StaticClassMapSourceLocatorTest.php index c3857741..ee34f32a 100644 --- a/test/unit/SourceLocator/StaticClassMapSourceLocatorTest.php +++ b/test/unit/SourceLocator/StaticClassMapSourceLocatorTest.php @@ -4,9 +4,9 @@ namespace RoaveTest\BackwardCompatibility\SourceLocator; -use InvalidArgumentException; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Psl\Exception\InvariantViolationException; use Psl\Type\Exception\CoercionException; use Roave\BackwardCompatibility\SourceLocator\StaticClassMapSourceLocator; use Roave\BetterReflection\Identifier\Identifier; @@ -49,7 +49,7 @@ public function testRejectsEmptyKeys(): void public function testRejectsEmptyStringFiles(): void { - $this->expectException(InvalidArgumentException::class); + $this->expectException(InvariantViolationException::class); new StaticClassMapSourceLocator( ['foo' => ''], From 8494f07a84c2eb93f0140db29e7ae26e92401386 Mon Sep 17 00:00:00 2001 From: azjezz Date: Wed, 19 May 2021 03:39:55 +0100 Subject: [PATCH 05/12] fix coding standards --- bin/roave-backward-compatibility-check.php | 2 +- src/Change.php | 2 +- src/Command/AssertBackwardsCompatible.php | 11 +++++------ src/CompareClasses.php | 7 +++---- .../BCBreak/ClassBased/AncestorRemoved.php | 8 ++++---- .../BCBreak/ClassBased/ClassBecameAbstract.php | 2 +- .../BCBreak/ClassBased/ClassBecameFinal.php | 2 +- .../BCBreak/ClassBased/ClassBecameInterface.php | 2 +- .../BCBreak/ClassBased/ClassBecameInternal.php | 4 ++-- .../BCBreak/ClassBased/ClassBecameTrait.php | 2 +- .../BCBreak/ClassBased/ConstantRemoved.php | 6 +++--- .../BCBreak/ClassBased/ExcludeInternalClass.php | 2 +- .../BCBreak/ClassBased/MethodChanged.php | 6 +++--- .../BCBreak/ClassBased/MethodRemoved.php | 12 ++++++------ .../BCBreak/ClassBased/PropertyRemoved.php | 10 +++++----- .../ClassConstantValueChanged.php | 2 +- .../ClassConstantVisibilityReduced.php | 2 +- .../FunctionBased/ExcludeInternalFunction.php | 2 +- .../FunctionBased/FunctionBecameInternal.php | 4 ++-- .../FunctionBased/ParameterByReferenceChanged.php | 4 ++-- .../ParameterDefaultValueChanged.php | 4 ++-- .../FunctionBased/ParameterTypeChanged.php | 4 ++-- .../ParameterTypeContravarianceChanged.php | 4 ++-- .../RequiredParameterAmountIncreased.php | 2 +- .../ReturnTypeByReferenceChanged.php | 2 +- .../BCBreak/FunctionBased/ReturnTypeChanged.php | 2 +- .../FunctionBased/ReturnTypeCovarianceChanged.php | 2 +- .../BCBreak/InterfaceBased/AncestorRemoved.php | 8 ++++---- .../InterfaceBased/ExcludeInternalInterface.php | 2 +- .../InterfaceBased/InterfaceBecameClass.php | 2 +- .../InterfaceBased/InterfaceBecameTrait.php | 2 +- .../BCBreak/InterfaceBased/MethodAdded.php | 6 +++--- .../BCBreak/MethodBased/ExcludeInternalMethod.php | 2 +- .../BCBreak/MethodBased/MethodBecameFinal.php | 2 +- .../MethodBased/MethodConcretenessChanged.php | 2 +- .../BCBreak/MethodBased/MethodScopeChanged.php | 2 +- .../MethodBased/MethodVisibilityReduced.php | 2 +- .../PropertyBased/ExcludeInternalProperty.php | 2 +- .../PropertyBased/PropertyBecameInternal.php | 4 ++-- .../PropertyBased/PropertyDefaultValueChanged.php | 3 ++- .../PropertyDocumentedTypeChanged.php | 4 ++-- .../PropertyBased/PropertyScopeChanged.php | 2 +- .../PropertyBased/PropertyVisibilityReduced.php | 2 +- .../BCBreak/TraitBased/ExcludeInternalTrait.php | 4 ++-- .../BCBreak/TraitBased/TraitBecameClass.php | 2 +- .../BCBreak/TraitBased/TraitBecameInterface.php | 2 +- src/Git/GitCheckoutRevisionToTemporaryPath.php | 6 +++--- src/Git/PickLastMinorVersionFromCollection.php | 4 ++-- src/Git/Revision.php | 4 ++-- .../LocateDependenciesViaComposer.php | 8 ++++---- src/SourceLocator/StaticClassMapSourceLocator.php | 14 +++++++------- test/unit/Assertion.php | 2 +- .../Command/AssertBackwardsCompatibleTest.php | 15 +++++++++------ .../Formatter/SymfonyConsoleTextFormatterTest.php | 4 ++-- test/unit/Git/CheckedOutRepositoryTest.php | 4 ++-- .../GetVersionCollectionFromGitRepositoryTest.php | 10 +++++----- .../GitCheckoutRevisionToTemporaryPathTest.php | 6 +++--- test/unit/Git/RevisionTest.php | 6 +++--- .../LocateDependenciesViaComposerTest.php | 8 ++++---- .../StaticClassMapSourceLocatorTest.php | 2 +- 60 files changed, 131 insertions(+), 129 deletions(-) diff --git a/bin/roave-backward-compatibility-check.php b/bin/roave-backward-compatibility-check.php index bdca4021..601f6a73 100644 --- a/bin/roave-backward-compatibility-check.php +++ b/bin/roave-backward-compatibility-check.php @@ -8,6 +8,7 @@ use Composer\Installer; use Composer\IO\ConsoleIO; use PackageVersions\Versions; +use Psl\Filesystem; use Roave\BackwardCompatibility\Command; use Roave\BackwardCompatibility\CompareClasses; use Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassBased; @@ -31,7 +32,6 @@ use Symfony\Component\Console\Application; use Symfony\Component\Console\Input\ArgvInput; use Symfony\Component\Console\Output\ConsoleOutput; -use Psl\Filesystem; (static function (): void { (static function (): void { diff --git a/src/Change.php b/src/Change.php index 7e85bf80..a18fab3a 100644 --- a/src/Change.php +++ b/src/Change.php @@ -4,8 +4,8 @@ namespace Roave\BackwardCompatibility; -use Throwable; use Psl\Str; +use Throwable; /** * @todo this class probably needs subclassing or being turned into an interface diff --git a/src/Command/AssertBackwardsCompatible.php b/src/Command/AssertBackwardsCompatible.php index d7dd45d1..92bae300 100644 --- a/src/Command/AssertBackwardsCompatible.php +++ b/src/Command/AssertBackwardsCompatible.php @@ -4,6 +4,11 @@ namespace Roave\BackwardCompatibility\Command; +use Psl; +use Psl\Env; +use Psl\Iter; +use Psl\Str; +use Psl\Type; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\CompareApi; use Roave\BackwardCompatibility\Factory\ComposerInstallationReflectorFactory; @@ -16,7 +21,6 @@ use Roave\BackwardCompatibility\Git\PickVersionFromVersionCollection; use Roave\BackwardCompatibility\Git\Revision; use Roave\BackwardCompatibility\LocateDependencies\LocateDependencies; -use Roave\BackwardCompatibility\Support\ArrayHelpers; use Roave\BetterReflection\SourceLocator\Type\AggregateSourceLocator; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Exception\InvalidArgumentException; @@ -25,11 +29,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\ConsoleOutputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Psl\Type; -use Psl\Env; -use Psl\Str; -use Psl\Iter; -use Psl; final class AssertBackwardsCompatible extends Command { diff --git a/src/CompareClasses.php b/src/CompareClasses.php index 0d112c33..990c192d 100644 --- a/src/CompareClasses.php +++ b/src/CompareClasses.php @@ -5,6 +5,9 @@ namespace Roave\BackwardCompatibility; use Generator; +use Psl\Dict; +use Psl\Regex; +use Psl\Str; use Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassBased\ClassBased; use Roave\BackwardCompatibility\DetectChanges\BCBreak\InterfaceBased\InterfaceBased; use Roave\BackwardCompatibility\DetectChanges\BCBreak\TraitBased\TraitBased; @@ -12,10 +15,6 @@ use Roave\BetterReflection\Reflector\ClassReflector; use Roave\BetterReflection\Reflector\Exception\IdentifierNotFound; -use Psl\Str; -use Psl\Regex; -use Psl\Dict; - final class CompareClasses implements CompareApi { private ClassBased $classBasedComparisons; diff --git a/src/DetectChanges/BCBreak/ClassBased/AncestorRemoved.php b/src/DetectChanges/BCBreak/ClassBased/AncestorRemoved.php index c8c63b1e..2a6fe5ff 100644 --- a/src/DetectChanges/BCBreak/ClassBased/AncestorRemoved.php +++ b/src/DetectChanges/BCBreak/ClassBased/AncestorRemoved.php @@ -4,13 +4,13 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassBased; -use Roave\BackwardCompatibility\Change; -use Roave\BackwardCompatibility\Changes; -use Roave\BetterReflection\Reflection\ReflectionClass; +use Psl\Dict; use Psl\Json; use Psl\Str; -use Psl\Dict; use Psl\Vec; +use Roave\BackwardCompatibility\Change; +use Roave\BackwardCompatibility\Changes; +use Roave\BetterReflection\Reflection\ReflectionClass; /** * A class ancestor (interface or class) cannot be removed, as that breaks type diff --git a/src/DetectChanges/BCBreak/ClassBased/ClassBecameAbstract.php b/src/DetectChanges/BCBreak/ClassBased/ClassBecameAbstract.php index f7230bed..c81ea111 100644 --- a/src/DetectChanges/BCBreak/ClassBased/ClassBecameAbstract.php +++ b/src/DetectChanges/BCBreak/ClassBased/ClassBecameAbstract.php @@ -4,10 +4,10 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; -use Psl\Str; /** * A class cannot become abstract without introducing an explicit BC break, since diff --git a/src/DetectChanges/BCBreak/ClassBased/ClassBecameFinal.php b/src/DetectChanges/BCBreak/ClassBased/ClassBecameFinal.php index 74e825f2..bd3d4d60 100644 --- a/src/DetectChanges/BCBreak/ClassBased/ClassBecameFinal.php +++ b/src/DetectChanges/BCBreak/ClassBased/ClassBecameFinal.php @@ -4,10 +4,10 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; -use Psl\Str; final class ClassBecameFinal implements ClassBased { diff --git a/src/DetectChanges/BCBreak/ClassBased/ClassBecameInterface.php b/src/DetectChanges/BCBreak/ClassBased/ClassBecameInterface.php index 0510d904..14643ddc 100644 --- a/src/DetectChanges/BCBreak/ClassBased/ClassBecameInterface.php +++ b/src/DetectChanges/BCBreak/ClassBased/ClassBecameInterface.php @@ -4,10 +4,10 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; -use Psl\Str; /** * A class cannot become an interface without introducing an explicit BC break, since diff --git a/src/DetectChanges/BCBreak/ClassBased/ClassBecameInternal.php b/src/DetectChanges/BCBreak/ClassBased/ClassBecameInternal.php index 171581f9..0d6193e2 100644 --- a/src/DetectChanges/BCBreak/ClassBased/ClassBecameInternal.php +++ b/src/DetectChanges/BCBreak/ClassBased/ClassBecameInternal.php @@ -4,11 +4,11 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassBased; +use Psl\Regex; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; -use Psl\Regex; -use Psl\Str; /** * A class that is marked internal is no available to downstream consumers. diff --git a/src/DetectChanges/BCBreak/ClassBased/ClassBecameTrait.php b/src/DetectChanges/BCBreak/ClassBased/ClassBecameTrait.php index 73f93330..cd7c3b68 100644 --- a/src/DetectChanges/BCBreak/ClassBased/ClassBecameTrait.php +++ b/src/DetectChanges/BCBreak/ClassBased/ClassBecameTrait.php @@ -4,10 +4,10 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; -use Psl\Str; /** * A class cannot become a trait without introducing an explicit BC break, since diff --git a/src/DetectChanges/BCBreak/ClassBased/ConstantRemoved.php b/src/DetectChanges/BCBreak/ClassBased/ConstantRemoved.php index 40bdea73..56cff53c 100644 --- a/src/DetectChanges/BCBreak/ClassBased/ConstantRemoved.php +++ b/src/DetectChanges/BCBreak/ClassBased/ConstantRemoved.php @@ -4,13 +4,13 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassBased; +use Psl\Dict; +use Psl\Str; +use Psl\Vec; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; use Roave\BetterReflection\Reflection\ReflectionClassConstant; -use Psl\Dict; -use Psl\Vec; -use Psl\Str; final class ConstantRemoved implements ClassBased { diff --git a/src/DetectChanges/BCBreak/ClassBased/ExcludeInternalClass.php b/src/DetectChanges/BCBreak/ClassBased/ExcludeInternalClass.php index a2ef3004..e3b20e21 100644 --- a/src/DetectChanges/BCBreak/ClassBased/ExcludeInternalClass.php +++ b/src/DetectChanges/BCBreak/ClassBased/ExcludeInternalClass.php @@ -4,9 +4,9 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassBased; +use Psl\Regex; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; -use Psl\Regex; /** * Classes marked "internal" (docblock) are not affected by BC checks. diff --git a/src/DetectChanges/BCBreak/ClassBased/MethodChanged.php b/src/DetectChanges/BCBreak/ClassBased/MethodChanged.php index 8bc1afe9..6af710b9 100644 --- a/src/DetectChanges/BCBreak/ClassBased/MethodChanged.php +++ b/src/DetectChanges/BCBreak/ClassBased/MethodChanged.php @@ -4,14 +4,14 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassBased; +use Psl\Dict; +use Psl\Str; +use Psl\Vec; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\DetectChanges\BCBreak\MethodBased\MethodBased; use Roave\BetterReflection\Reflection\ReflectionClass; use Roave\BetterReflection\Reflection\ReflectionMethod; -use Psl\Dict; -use Psl\Str; -use Psl\Vec; final class MethodChanged implements ClassBased { diff --git a/src/DetectChanges/BCBreak/ClassBased/MethodRemoved.php b/src/DetectChanges/BCBreak/ClassBased/MethodRemoved.php index 32b0dd5e..3c11e9fb 100644 --- a/src/DetectChanges/BCBreak/ClassBased/MethodRemoved.php +++ b/src/DetectChanges/BCBreak/ClassBased/MethodRemoved.php @@ -4,15 +4,15 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassBased; +use Psl\Dict; +use Psl\Regex; +use Psl\Str; +use Psl\Vec; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionClass; use Roave\BetterReflection\Reflection\ReflectionMethod; -use Psl\Dict; -use Psl\Vec; -use Psl\Str; -use Psl\Regex; final class MethodRemoved implements ClassBased { @@ -26,10 +26,10 @@ public function __construct() public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): Changes { $removedMethods = Dict\diff_by_key( - Dict\map_keys($this->accessibleMethods($fromClass), function(string $key): string { + Dict\map_keys($this->accessibleMethods($fromClass), static function (string $key): string { return Str\uppercase($key); }), - Dict\map_keys($this->accessibleMethods($toClass), function(string $key): string { + Dict\map_keys($this->accessibleMethods($toClass), static function (string $key): string { return Str\uppercase($key); }), ); diff --git a/src/DetectChanges/BCBreak/ClassBased/PropertyRemoved.php b/src/DetectChanges/BCBreak/ClassBased/PropertyRemoved.php index b3b608c6..d06f8391 100644 --- a/src/DetectChanges/BCBreak/ClassBased/PropertyRemoved.php +++ b/src/DetectChanges/BCBreak/ClassBased/PropertyRemoved.php @@ -4,15 +4,15 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassBased; +use Psl\Dict; +use Psl\Regex; +use Psl\Str; +use Psl\Vec; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionPropertyName; use Roave\BetterReflection\Reflection\ReflectionClass; use Roave\BetterReflection\Reflection\ReflectionProperty; -use Psl\Str; -use Psl\Regex; -use Psl\Dict; -use Psl\Vec; final class PropertyRemoved implements ClassBased { @@ -39,7 +39,7 @@ public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): })); } - /** + /** * @return array */ private function accessibleProperties(ReflectionClass $class): array diff --git a/src/DetectChanges/BCBreak/ClassConstantBased/ClassConstantValueChanged.php b/src/DetectChanges/BCBreak/ClassConstantBased/ClassConstantValueChanged.php index df592dc8..721c9570 100644 --- a/src/DetectChanges/BCBreak/ClassConstantBased/ClassConstantValueChanged.php +++ b/src/DetectChanges/BCBreak/ClassConstantBased/ClassConstantValueChanged.php @@ -4,10 +4,10 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassConstantBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClassConstant; -use Psl\Str; use function var_export; diff --git a/src/DetectChanges/BCBreak/ClassConstantBased/ClassConstantVisibilityReduced.php b/src/DetectChanges/BCBreak/ClassConstantBased/ClassConstantVisibilityReduced.php index 09b7c379..1d4a87ec 100644 --- a/src/DetectChanges/BCBreak/ClassConstantBased/ClassConstantVisibilityReduced.php +++ b/src/DetectChanges/BCBreak/ClassConstantBased/ClassConstantVisibilityReduced.php @@ -4,10 +4,10 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassConstantBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClassConstant; -use Psl\Str; final class ClassConstantVisibilityReduced implements ClassConstantBased { diff --git a/src/DetectChanges/BCBreak/FunctionBased/ExcludeInternalFunction.php b/src/DetectChanges/BCBreak/FunctionBased/ExcludeInternalFunction.php index 47d932ae..5b4b41ba 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ExcludeInternalFunction.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ExcludeInternalFunction.php @@ -4,9 +4,9 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\FunctionBased; +use Psl\Regex; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; -use Psl\Regex; /** * Functions marked "internal" (docblock) are not affected by BC checks. diff --git a/src/DetectChanges/BCBreak/FunctionBased/FunctionBecameInternal.php b/src/DetectChanges/BCBreak/FunctionBased/FunctionBecameInternal.php index cc308cdb..c6744aa9 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/FunctionBecameInternal.php +++ b/src/DetectChanges/BCBreak/FunctionBased/FunctionBecameInternal.php @@ -4,12 +4,12 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\FunctionBased; +use Psl\Regex; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; -use Psl\Str; -use Psl\Regex; /** * A function that is marked internal is no available to downstream consumers. diff --git a/src/DetectChanges/BCBreak/FunctionBased/ParameterByReferenceChanged.php b/src/DetectChanges/BCBreak/FunctionBased/ParameterByReferenceChanged.php index 6f4e6af1..92d03b94 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ParameterByReferenceChanged.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ParameterByReferenceChanged.php @@ -4,13 +4,13 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\FunctionBased; +use Psl\Dict; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; use Roave\BetterReflection\Reflection\ReflectionParameter; -use Psl\Dict; -use Psl\Str; /** * A parameter passed by-value and a parameter passed by-reference are wildly different, so changing diff --git a/src/DetectChanges/BCBreak/FunctionBased/ParameterDefaultValueChanged.php b/src/DetectChanges/BCBreak/FunctionBased/ParameterDefaultValueChanged.php index b9a0a4f4..b4f67509 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ParameterDefaultValueChanged.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ParameterDefaultValueChanged.php @@ -4,13 +4,13 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\FunctionBased; +use Psl\Dict; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; use Roave\BetterReflection\Reflection\ReflectionParameter; -use Psl\Dict; -use Psl\Str; use function var_export; diff --git a/src/DetectChanges/BCBreak/FunctionBased/ParameterTypeChanged.php b/src/DetectChanges/BCBreak/FunctionBased/ParameterTypeChanged.php index b58f272e..e3edb6db 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ParameterTypeChanged.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ParameterTypeChanged.php @@ -4,14 +4,14 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\FunctionBased; +use Psl\Dict; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; use Roave\BetterReflection\Reflection\ReflectionParameter; use Roave\BetterReflection\Reflection\ReflectionType; -use Psl\Dict; -use Psl\Str; /** * Detects a change in a parameter type diff --git a/src/DetectChanges/BCBreak/FunctionBased/ParameterTypeContravarianceChanged.php b/src/DetectChanges/BCBreak/FunctionBased/ParameterTypeContravarianceChanged.php index dd08484a..03840890 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ParameterTypeContravarianceChanged.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ParameterTypeContravarianceChanged.php @@ -4,6 +4,8 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\FunctionBased; +use Psl\Dict; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\DetectChanges\Variance\TypeIsContravariant; @@ -11,8 +13,6 @@ use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; use Roave\BetterReflection\Reflection\ReflectionParameter; use Roave\BetterReflection\Reflection\ReflectionType; -use Psl\Dict; -use Psl\Str; /** * When a parameter type changes, the new type should be wider than the previous type, or else diff --git a/src/DetectChanges/BCBreak/FunctionBased/RequiredParameterAmountIncreased.php b/src/DetectChanges/BCBreak/FunctionBased/RequiredParameterAmountIncreased.php index 200bb648..f4aab3fb 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/RequiredParameterAmountIncreased.php +++ b/src/DetectChanges/BCBreak/FunctionBased/RequiredParameterAmountIncreased.php @@ -4,11 +4,11 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\FunctionBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; -use Psl\Str; /** * When new parameters are added, they must be optional, or else the callers will provide an insufficient diff --git a/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeByReferenceChanged.php b/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeByReferenceChanged.php index d0dd0071..f5b100c5 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeByReferenceChanged.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeByReferenceChanged.php @@ -4,11 +4,11 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\FunctionBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; -use Psl\Str; /** * PHP still (sadly) supports by-ref return types, so the type is wildly different between by-ref and by-val, and diff --git a/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeChanged.php b/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeChanged.php index 3c93abb0..1532963e 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeChanged.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeChanged.php @@ -4,12 +4,12 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\FunctionBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; use Roave\BetterReflection\Reflection\ReflectionType; -use Psl\Str; /** * Verifies if the return type of a function changed at all diff --git a/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeCovarianceChanged.php b/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeCovarianceChanged.php index 1bdb5ba1..47dddb2a 100644 --- a/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeCovarianceChanged.php +++ b/src/DetectChanges/BCBreak/FunctionBased/ReturnTypeCovarianceChanged.php @@ -4,13 +4,13 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\FunctionBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\DetectChanges\Variance\TypeIsCovariant; use Roave\BackwardCompatibility\Formatter\ReflectionFunctionAbstractName; use Roave\BetterReflection\Reflection\ReflectionFunctionAbstract; use Roave\BetterReflection\Reflection\ReflectionType; -use Psl\Str; /** * When the return type of a function changes, the new return type must be covariant to the current type. diff --git a/src/DetectChanges/BCBreak/InterfaceBased/AncestorRemoved.php b/src/DetectChanges/BCBreak/InterfaceBased/AncestorRemoved.php index cc54c351..e5be9520 100644 --- a/src/DetectChanges/BCBreak/InterfaceBased/AncestorRemoved.php +++ b/src/DetectChanges/BCBreak/InterfaceBased/AncestorRemoved.php @@ -4,13 +4,13 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\InterfaceBased; +use Psl\Dict; +use Psl\Json; +use Psl\Str; +use Psl\Vec; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; -use Psl\Vec; -use Psl\Dict; -use Psl\Str; -use Psl\Json; /** * An interface ancestor cannot be removed, as that breaks type checking in consumers. diff --git a/src/DetectChanges/BCBreak/InterfaceBased/ExcludeInternalInterface.php b/src/DetectChanges/BCBreak/InterfaceBased/ExcludeInternalInterface.php index 30423814..cd66e1e3 100644 --- a/src/DetectChanges/BCBreak/InterfaceBased/ExcludeInternalInterface.php +++ b/src/DetectChanges/BCBreak/InterfaceBased/ExcludeInternalInterface.php @@ -4,9 +4,9 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\InterfaceBased; +use Psl\Regex; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; -use Psl\Regex; /** * Interfaces marked "internal" (docblock) are not affected by BC checks. diff --git a/src/DetectChanges/BCBreak/InterfaceBased/InterfaceBecameClass.php b/src/DetectChanges/BCBreak/InterfaceBased/InterfaceBecameClass.php index 8df3f65a..5459af2f 100644 --- a/src/DetectChanges/BCBreak/InterfaceBased/InterfaceBecameClass.php +++ b/src/DetectChanges/BCBreak/InterfaceBased/InterfaceBecameClass.php @@ -4,10 +4,10 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\InterfaceBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; -use Psl\Str; /** * An interface cannot become concrete without introducing an explicit BC break, since diff --git a/src/DetectChanges/BCBreak/InterfaceBased/InterfaceBecameTrait.php b/src/DetectChanges/BCBreak/InterfaceBased/InterfaceBecameTrait.php index 3ac2dbc9..0390938a 100644 --- a/src/DetectChanges/BCBreak/InterfaceBased/InterfaceBecameTrait.php +++ b/src/DetectChanges/BCBreak/InterfaceBased/InterfaceBecameTrait.php @@ -4,10 +4,10 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\InterfaceBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; -use Psl\Str; /** * An interface cannot become a trait without introducing an explicit BC break, since diff --git a/src/DetectChanges/BCBreak/InterfaceBased/MethodAdded.php b/src/DetectChanges/BCBreak/InterfaceBased/MethodAdded.php index f5048d8c..89c606bf 100644 --- a/src/DetectChanges/BCBreak/InterfaceBased/MethodAdded.php +++ b/src/DetectChanges/BCBreak/InterfaceBased/MethodAdded.php @@ -4,13 +4,13 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\InterfaceBased; +use Psl\Dict; +use Psl\Str; +use Psl\Vec; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; use Roave\BetterReflection\Reflection\ReflectionMethod; -use Psl\Dict; -use Psl\Vec; -use Psl\Str; final class MethodAdded implements InterfaceBased { diff --git a/src/DetectChanges/BCBreak/MethodBased/ExcludeInternalMethod.php b/src/DetectChanges/BCBreak/MethodBased/ExcludeInternalMethod.php index bf101278..003e9613 100644 --- a/src/DetectChanges/BCBreak/MethodBased/ExcludeInternalMethod.php +++ b/src/DetectChanges/BCBreak/MethodBased/ExcludeInternalMethod.php @@ -4,9 +4,9 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\MethodBased; +use Psl\Regex; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionMethod; -use Psl\Regex; /** * Methods marked "internal" (docblock) are not affected by BC checks. diff --git a/src/DetectChanges/BCBreak/MethodBased/MethodBecameFinal.php b/src/DetectChanges/BCBreak/MethodBased/MethodBecameFinal.php index 2d329445..e4fd0355 100644 --- a/src/DetectChanges/BCBreak/MethodBased/MethodBecameFinal.php +++ b/src/DetectChanges/BCBreak/MethodBased/MethodBecameFinal.php @@ -4,10 +4,10 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\MethodBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionMethod; -use Psl\Str; /** * A method that changes from non-final to final breaks all child classes that diff --git a/src/DetectChanges/BCBreak/MethodBased/MethodConcretenessChanged.php b/src/DetectChanges/BCBreak/MethodBased/MethodConcretenessChanged.php index c42942c8..2552ceba 100644 --- a/src/DetectChanges/BCBreak/MethodBased/MethodConcretenessChanged.php +++ b/src/DetectChanges/BCBreak/MethodBased/MethodConcretenessChanged.php @@ -4,10 +4,10 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\MethodBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionMethod; -use Psl\Str; /** * A method that changes from concrete to abstract forces all child class diff --git a/src/DetectChanges/BCBreak/MethodBased/MethodScopeChanged.php b/src/DetectChanges/BCBreak/MethodBased/MethodScopeChanged.php index d9720fd6..9d0bfad7 100644 --- a/src/DetectChanges/BCBreak/MethodBased/MethodScopeChanged.php +++ b/src/DetectChanges/BCBreak/MethodBased/MethodScopeChanged.php @@ -4,10 +4,10 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\MethodBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionMethod; -use Psl\Str; /** * A method that changes from instance to static or the opposite has to be called differently, diff --git a/src/DetectChanges/BCBreak/MethodBased/MethodVisibilityReduced.php b/src/DetectChanges/BCBreak/MethodBased/MethodVisibilityReduced.php index a88af931..316515d1 100644 --- a/src/DetectChanges/BCBreak/MethodBased/MethodVisibilityReduced.php +++ b/src/DetectChanges/BCBreak/MethodBased/MethodVisibilityReduced.php @@ -4,10 +4,10 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\MethodBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionMethod; -use Psl\Str; final class MethodVisibilityReduced implements MethodBased { diff --git a/src/DetectChanges/BCBreak/PropertyBased/ExcludeInternalProperty.php b/src/DetectChanges/BCBreak/PropertyBased/ExcludeInternalProperty.php index b3bf56cb..b7118ece 100644 --- a/src/DetectChanges/BCBreak/PropertyBased/ExcludeInternalProperty.php +++ b/src/DetectChanges/BCBreak/PropertyBased/ExcludeInternalProperty.php @@ -4,9 +4,9 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\PropertyBased; +use Psl\Regex; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionProperty; -use Psl\Regex; final class ExcludeInternalProperty implements PropertyBased { diff --git a/src/DetectChanges/BCBreak/PropertyBased/PropertyBecameInternal.php b/src/DetectChanges/BCBreak/PropertyBased/PropertyBecameInternal.php index 7cb0d864..a92cc201 100644 --- a/src/DetectChanges/BCBreak/PropertyBased/PropertyBecameInternal.php +++ b/src/DetectChanges/BCBreak/PropertyBased/PropertyBecameInternal.php @@ -4,12 +4,12 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\PropertyBased; +use Psl\Regex; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionPropertyName; use Roave\BetterReflection\Reflection\ReflectionProperty; -use Psl\Str; -use Psl\Regex; /** * A property that is marked internal is no available to downstream consumers. diff --git a/src/DetectChanges/BCBreak/PropertyBased/PropertyDefaultValueChanged.php b/src/DetectChanges/BCBreak/PropertyBased/PropertyDefaultValueChanged.php index c7f80d29..3ca1b878 100644 --- a/src/DetectChanges/BCBreak/PropertyBased/PropertyDefaultValueChanged.php +++ b/src/DetectChanges/BCBreak/PropertyBased/PropertyDefaultValueChanged.php @@ -4,11 +4,12 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\PropertyBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionPropertyName; use Roave\BetterReflection\Reflection\ReflectionProperty; -use Psl\Str; + use function var_export; final class PropertyDefaultValueChanged implements PropertyBased diff --git a/src/DetectChanges/BCBreak/PropertyBased/PropertyDocumentedTypeChanged.php b/src/DetectChanges/BCBreak/PropertyBased/PropertyDocumentedTypeChanged.php index f4561c7a..c764b3c1 100644 --- a/src/DetectChanges/BCBreak/PropertyBased/PropertyDocumentedTypeChanged.php +++ b/src/DetectChanges/BCBreak/PropertyBased/PropertyDocumentedTypeChanged.php @@ -4,12 +4,12 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\PropertyBased; +use Psl\Str; +use Psl\Vec; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionPropertyName; use Roave\BetterReflection\Reflection\ReflectionProperty; -use Psl\Str; -use Psl\Vec; /** * Type declarations for properties are invariant: you can't restrict the type because the consumer may diff --git a/src/DetectChanges/BCBreak/PropertyBased/PropertyScopeChanged.php b/src/DetectChanges/BCBreak/PropertyBased/PropertyScopeChanged.php index c7699d43..fe6b2bcc 100644 --- a/src/DetectChanges/BCBreak/PropertyBased/PropertyScopeChanged.php +++ b/src/DetectChanges/BCBreak/PropertyBased/PropertyScopeChanged.php @@ -4,10 +4,10 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\PropertyBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionProperty; -use Psl\Str; /** * A property that changes from instance to static or the opposite has to be accessed differently, diff --git a/src/DetectChanges/BCBreak/PropertyBased/PropertyVisibilityReduced.php b/src/DetectChanges/BCBreak/PropertyBased/PropertyVisibilityReduced.php index b2af72be..6fd9f34c 100644 --- a/src/DetectChanges/BCBreak/PropertyBased/PropertyVisibilityReduced.php +++ b/src/DetectChanges/BCBreak/PropertyBased/PropertyVisibilityReduced.php @@ -4,11 +4,11 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\PropertyBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\ReflectionPropertyName; use Roave\BetterReflection\Reflection\ReflectionProperty; -use Psl\Str; final class PropertyVisibilityReduced implements PropertyBased { diff --git a/src/DetectChanges/BCBreak/TraitBased/ExcludeInternalTrait.php b/src/DetectChanges/BCBreak/TraitBased/ExcludeInternalTrait.php index 777d5953..1d9a5908 100644 --- a/src/DetectChanges/BCBreak/TraitBased/ExcludeInternalTrait.php +++ b/src/DetectChanges/BCBreak/TraitBased/ExcludeInternalTrait.php @@ -4,9 +4,9 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\TraitBased; +use Psl\Regex; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; -use Psl\Regex; /** * Traits marked "internal" (docblock) are not affected by BC checks. @@ -31,6 +31,6 @@ public function __invoke(ReflectionClass $fromTrait, ReflectionClass $toTrait): private function isInternalDocComment(string $comment): bool { - return Regex\matches( $comment, '/\s+@internal\s+/'); + return Regex\matches($comment, '/\s+@internal\s+/'); } } diff --git a/src/DetectChanges/BCBreak/TraitBased/TraitBecameClass.php b/src/DetectChanges/BCBreak/TraitBased/TraitBecameClass.php index 32c5112f..eee0afb7 100644 --- a/src/DetectChanges/BCBreak/TraitBased/TraitBecameClass.php +++ b/src/DetectChanges/BCBreak/TraitBased/TraitBecameClass.php @@ -4,10 +4,10 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\TraitBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; -use Psl\Str; /** * A trait cannot change to become a class, as that forces all implementations diff --git a/src/DetectChanges/BCBreak/TraitBased/TraitBecameInterface.php b/src/DetectChanges/BCBreak/TraitBased/TraitBecameInterface.php index 8fc857ce..90c6ea0f 100644 --- a/src/DetectChanges/BCBreak/TraitBased/TraitBecameInterface.php +++ b/src/DetectChanges/BCBreak/TraitBased/TraitBecameInterface.php @@ -4,10 +4,10 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\TraitBased; +use Psl\Str; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BetterReflection\Reflection\ReflectionClass; -use Psl\Str; /** * A trait cannot change to become a interface, as that forces all implementations diff --git a/src/Git/GitCheckoutRevisionToTemporaryPath.php b/src/Git/GitCheckoutRevisionToTemporaryPath.php index 2fc3126e..7d9cc375 100644 --- a/src/Git/GitCheckoutRevisionToTemporaryPath.php +++ b/src/Git/GitCheckoutRevisionToTemporaryPath.php @@ -4,11 +4,11 @@ namespace Roave\BackwardCompatibility\Git; -use RuntimeException; -use Psl\Filesystem; use Psl\Env; -use Psl\Str; +use Psl\Filesystem; use Psl\Shell; +use Psl\Str; +use RuntimeException; final class GitCheckoutRevisionToTemporaryPath implements PerformCheckoutOfRevision { diff --git a/src/Git/PickLastMinorVersionFromCollection.php b/src/Git/PickLastMinorVersionFromCollection.php index 0e7fd945..6b47bc59 100644 --- a/src/Git/PickLastMinorVersionFromCollection.php +++ b/src/Git/PickLastMinorVersionFromCollection.php @@ -4,18 +4,18 @@ namespace Roave\BackwardCompatibility\Git; +use Psl; use Version\Comparison\Constraint\CompositeConstraint; use Version\Comparison\Constraint\Constraint; use Version\Comparison\Constraint\OperationConstraint; use Version\Version; use Version\VersionCollection; -use Psl; final class PickLastMinorVersionFromCollection implements PickVersionFromVersionCollection { public function forVersions(VersionCollection $versionsCollection): Version { - Psl\invariant(!$versionsCollection->isEmpty(), 'Cannot determine latest minor version from an empty collection'); + Psl\invariant(! $versionsCollection->isEmpty(), 'Cannot determine latest minor version from an empty collection'); $stableVersions = $versionsCollection->matching(new class implements Constraint { public function assert(Version $version): bool diff --git a/src/Git/Revision.php b/src/Git/Revision.php index c0aabe36..0f340c89 100644 --- a/src/Git/Revision.php +++ b/src/Git/Revision.php @@ -4,9 +4,9 @@ namespace Roave\BackwardCompatibility\Git; -use Psl\Str; -use Psl\Regex; use Psl; +use Psl\Regex; +use Psl\Str; final class Revision { diff --git a/src/LocateDependencies/LocateDependenciesViaComposer.php b/src/LocateDependencies/LocateDependenciesViaComposer.php index e6a71b73..96dabef4 100644 --- a/src/LocateDependencies/LocateDependenciesViaComposer.php +++ b/src/LocateDependencies/LocateDependenciesViaComposer.php @@ -5,16 +5,16 @@ namespace Roave\BackwardCompatibility\LocateDependencies; use Composer\Installer; +use Psl; +use Psl\Env; +use Psl\Filesystem; +use Psl\Type; use Roave\BetterReflection\SourceLocator\Ast\Locator; use Roave\BetterReflection\SourceLocator\SourceStubber\ReflectionSourceStubber; use Roave\BetterReflection\SourceLocator\Type\AggregateSourceLocator; use Roave\BetterReflection\SourceLocator\Type\Composer\Factory\MakeLocatorForInstalledJson; use Roave\BetterReflection\SourceLocator\Type\PhpInternalSourceLocator; use Roave\BetterReflection\SourceLocator\Type\SourceLocator; -use Psl\Filesystem; -use Psl; -use Psl\Env; -use Psl\Type; final class LocateDependenciesViaComposer implements LocateDependencies { diff --git a/src/SourceLocator/StaticClassMapSourceLocator.php b/src/SourceLocator/StaticClassMapSourceLocator.php index f1d42c98..0c91ae62 100644 --- a/src/SourceLocator/StaticClassMapSourceLocator.php +++ b/src/SourceLocator/StaticClassMapSourceLocator.php @@ -4,15 +4,15 @@ namespace Roave\BackwardCompatibility\SourceLocator; +use Psl; +use Psl\Dict; +use Psl\Filesystem; +use Psl\Iter; +use Psl\Type; use Roave\BetterReflection\Identifier\Identifier; use Roave\BetterReflection\SourceLocator\Ast\Locator; use Roave\BetterReflection\SourceLocator\Located\LocatedSource; use Roave\BetterReflection\SourceLocator\Type\AbstractSourceLocator; -use Psl\Type; -use Psl\Dict; -use Psl\Filesystem; -use Psl\Iter; -use Psl; final class StaticClassMapSourceLocator extends AbstractSourceLocator { @@ -29,11 +29,11 @@ public function __construct( ) { parent::__construct($astLocator); - $realPaths = Dict\map($classMap, static function(string $file): string { + $realPaths = Dict\map($classMap, static function (string $file): string { return Type\string()->assert(Filesystem\canonicalize($file)); }); - Psl\invariant(Iter\all($realPaths, static function(string $file): bool { + Psl\invariant(Iter\all($realPaths, static function (string $file): bool { return Filesystem\is_file($file); }), 'Invalid class-map.'); diff --git a/test/unit/Assertion.php b/test/unit/Assertion.php index 3c178145..db31681f 100644 --- a/test/unit/Assertion.php +++ b/test/unit/Assertion.php @@ -5,9 +5,9 @@ namespace RoaveTest\BackwardCompatibility; use PHPUnit\Framework\Assert; +use Psl\Iter; use ReflectionProperty; use Roave\BackwardCompatibility\Changes; -use Psl\Iter; abstract class Assertion { diff --git a/test/unit/Command/AssertBackwardsCompatibleTest.php b/test/unit/Command/AssertBackwardsCompatibleTest.php index 3746fdea..6bd5159f 100644 --- a/test/unit/Command/AssertBackwardsCompatibleTest.php +++ b/test/unit/Command/AssertBackwardsCompatibleTest.php @@ -6,7 +6,11 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Psl\Env; use Psl\Exception\InvariantViolationException; +use Psl\Filesystem; +use Psl\Hash; +use Psl\SecureRandom; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Command\AssertBackwardsCompatible; @@ -27,10 +31,9 @@ use Symfony\Component\Console\Output\OutputInterface; use Version\Version; use Version\VersionCollection; -use Psl\SecureRandom; -use Psl\Filesystem; -use Psl\Env; -use Psl\Hash; + +use function assert; +use function is_string; /** * @covers \Roave\BackwardCompatibility\Command\AssertBackwardsCompatible @@ -72,8 +75,8 @@ final class AssertBackwardsCompatibleTest extends TestCase public function setUp(): void { - /** @var string $repositoryPath */ $repositoryPath = Filesystem\canonicalize(__DIR__ . '/../../../'); + assert(is_string($repositoryPath)); $this->sourceRepository = CheckedOutRepository::fromPath($repositoryPath); @@ -225,7 +228,7 @@ public function testExecuteReturnsNonZeroExitCodeWhenChangesAreDetected(): void ->willReturn($this->dependencies); $this->compareApi->expects(self::once())->method('__invoke')->willReturn(Changes::fromList( - Change::added('added'.SecureRandom\string(8), true) + Change::added('added' . SecureRandom\string(8), true) )); $this diff --git a/test/unit/Formatter/SymfonyConsoleTextFormatterTest.php b/test/unit/Formatter/SymfonyConsoleTextFormatterTest.php index ca7e978b..3c5f3042 100644 --- a/test/unit/Formatter/SymfonyConsoleTextFormatterTest.php +++ b/test/unit/Formatter/SymfonyConsoleTextFormatterTest.php @@ -5,13 +5,13 @@ namespace RoaveTest\BackwardCompatibility\Formatter; use PHPUnit\Framework\TestCase; +use Psl\SecureRandom; +use Psl\Str; use ReflectionException; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\Formatter\SymfonyConsoleTextFormatter; use Symfony\Component\Console\Output\OutputInterface; -use Psl\Str; -use Psl\SecureRandom; /** * @covers \Roave\BackwardCompatibility\Formatter\SymfonyConsoleTextFormatter diff --git a/test/unit/Git/CheckedOutRepositoryTest.php b/test/unit/Git/CheckedOutRepositoryTest.php index 2a77e870..cfea7ea1 100644 --- a/test/unit/Git/CheckedOutRepositoryTest.php +++ b/test/unit/Git/CheckedOutRepositoryTest.php @@ -5,11 +5,11 @@ namespace RoaveTest\BackwardCompatibility\Git; use PHPUnit\Framework\TestCase; +use Psl\Env; use Psl\Exception\InvariantViolationException; -use Roave\BackwardCompatibility\Git\CheckedOutRepository; use Psl\Filesystem; use Psl\SecureRandom; -use Psl\Env; +use Roave\BackwardCompatibility\Git\CheckedOutRepository; /** * @covers \Roave\BackwardCompatibility\Git\CheckedOutRepository diff --git a/test/unit/Git/GetVersionCollectionFromGitRepositoryTest.php b/test/unit/Git/GetVersionCollectionFromGitRepositoryTest.php index 77825788..503c4e9e 100644 --- a/test/unit/Git/GetVersionCollectionFromGitRepositoryTest.php +++ b/test/unit/Git/GetVersionCollectionFromGitRepositoryTest.php @@ -5,14 +5,14 @@ namespace RoaveTest\BackwardCompatibility\Git; use PHPUnit\Framework\TestCase; -use Roave\BackwardCompatibility\Git\CheckedOutRepository; -use Roave\BackwardCompatibility\Git\GetVersionCollectionFromGitRepository; -use Version\Version; -use Psl\Filesystem; use Psl\Dict; use Psl\Env; +use Psl\Filesystem; use Psl\SecureRandom; use Psl\Shell; +use Roave\BackwardCompatibility\Git\CheckedOutRepository; +use Roave\BackwardCompatibility\Git\GetVersionCollectionFromGitRepository; +use Version\Version; /** * @covers \Roave\BackwardCompatibility\Git\GetVersionCollectionFromGitRepository @@ -30,7 +30,7 @@ public function setUp(): void Shell\execute('git', ['config', 'user.name', 'Me Again'], $tmpGitRepo); Filesystem\write_file($tmpGitRepo . '/test', SecureRandom\string(8)); Shell\execute('git', ['add', '.'], $tmpGitRepo); - Shell\execute('git', ['commit', '-m', '"whatever"'], $tmpGitRepo); + Shell\execute('git', ['commit', '-m', '"whatever"'], $tmpGitRepo); $this->repoPath = CheckedOutRepository::fromPath($tmpGitRepo); } diff --git a/test/unit/Git/GitCheckoutRevisionToTemporaryPathTest.php b/test/unit/Git/GitCheckoutRevisionToTemporaryPathTest.php index c9f88033..402864a8 100644 --- a/test/unit/Git/GitCheckoutRevisionToTemporaryPathTest.php +++ b/test/unit/Git/GitCheckoutRevisionToTemporaryPathTest.php @@ -5,13 +5,13 @@ namespace RoaveTest\BackwardCompatibility\Git; use PHPUnit\Framework\TestCase; +use Psl\Env; +use Psl\Filesystem; +use Psl\Shell; use Roave\BackwardCompatibility\Git\CheckedOutRepository; use Roave\BackwardCompatibility\Git\GitCheckoutRevisionToTemporaryPath; use Roave\BackwardCompatibility\Git\Revision; use RuntimeException; -use Psl\Shell; -use Psl\Filesystem; -use Psl\Env; /** * @covers \Roave\BackwardCompatibility\Git\GitCheckoutRevisionToTemporaryPath diff --git a/test/unit/Git/RevisionTest.php b/test/unit/Git/RevisionTest.php index 0cc9068e..a8ad1abb 100644 --- a/test/unit/Git/RevisionTest.php +++ b/test/unit/Git/RevisionTest.php @@ -6,10 +6,10 @@ use PHPUnit\Framework\TestCase; use Psl\Exception\InvariantViolationException; -use Roave\BackwardCompatibility\Git\Revision; -use Psl\Str; -use Psl\SecureRandom; use Psl\Hash; +use Psl\SecureRandom; +use Psl\Str; +use Roave\BackwardCompatibility\Git\Revision; /** * @covers \Roave\BackwardCompatibility\Git\Revision diff --git a/test/unit/LocateDependencies/LocateDependenciesViaComposerTest.php b/test/unit/LocateDependencies/LocateDependenciesViaComposerTest.php index 6507fb43..deb23783 100644 --- a/test/unit/LocateDependencies/LocateDependenciesViaComposerTest.php +++ b/test/unit/LocateDependencies/LocateDependenciesViaComposerTest.php @@ -7,15 +7,15 @@ use Composer\Installer; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; +use Psl\Env; use Psl\Exception\InvariantViolationException; +use Psl\Filesystem; +use Psl\Type; use ReflectionProperty; use Roave\BackwardCompatibility\LocateDependencies\LocateDependenciesViaComposer; use Roave\BetterReflection\BetterReflection; use Roave\BetterReflection\SourceLocator\Type\AggregateSourceLocator; use Roave\BetterReflection\SourceLocator\Type\PhpInternalSourceLocator; -use Psl\Env; -use Psl\Type; -use Psl\Filesystem; /** * @covers \Roave\BackwardCompatibility\LocateDependencies\LocateDependenciesViaComposer @@ -38,7 +38,7 @@ protected function setUp(): void $this->originalCwd = Env\current_dir(); $this->composerInstaller = $this->createMock(Installer::class); - $astLocator = (new BetterReflection())->astLocator(); + $astLocator = (new BetterReflection())->astLocator(); $makeInstaller = function (string $installationPath): Installer { self::assertSame($this->expectedInstallationPath, $installationPath); diff --git a/test/unit/SourceLocator/StaticClassMapSourceLocatorTest.php b/test/unit/SourceLocator/StaticClassMapSourceLocatorTest.php index ee34f32a..2c002c27 100644 --- a/test/unit/SourceLocator/StaticClassMapSourceLocatorTest.php +++ b/test/unit/SourceLocator/StaticClassMapSourceLocatorTest.php @@ -7,6 +7,7 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psl\Exception\InvariantViolationException; +use Psl\Filesystem; use Psl\Type\Exception\CoercionException; use Roave\BackwardCompatibility\SourceLocator\StaticClassMapSourceLocator; use Roave\BetterReflection\Identifier\Identifier; @@ -15,7 +16,6 @@ use Roave\BetterReflection\Reflector\Reflector; use Roave\BetterReflection\SourceLocator\Ast\Locator; use Roave\BetterReflection\SourceLocator\Located\LocatedSource; -use Psl\Filesystem; /** * @covers \Roave\BackwardCompatibility\SourceLocator\StaticClassMapSourceLocator From 0bb5acbf588e2708f84e20c2d83d6770ace9f475 Mon Sep 17 00:00:00 2001 From: azjezz Date: Wed, 19 May 2021 03:45:48 +0100 Subject: [PATCH 06/12] fix type issues --- bin/roave-backward-compatibility-check.php | 5 ++++- src/Git/GetVersionCollectionFromGitRepository.php | 2 +- test/e2e/Command/AssertBackwardsCompatibleTest.php | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/roave-backward-compatibility-check.php b/bin/roave-backward-compatibility-check.php index 601f6a73..2e0a987e 100644 --- a/bin/roave-backward-compatibility-check.php +++ b/bin/roave-backward-compatibility-check.php @@ -42,7 +42,10 @@ foreach ($autoloaderLocations as $autoload) { if (Filesystem\exists($autoload)) { - /** @noinspection PhpIncludeInspection */ + /** + * @noinspection PhpIncludeInspection + * @psalm-suppress UnresolvableInclude + */ require_once $autoload; return; diff --git a/src/Git/GetVersionCollectionFromGitRepository.php b/src/Git/GetVersionCollectionFromGitRepository.php index 5898d613..5c683c04 100644 --- a/src/Git/GetVersionCollectionFromGitRepository.php +++ b/src/Git/GetVersionCollectionFromGitRepository.php @@ -21,7 +21,7 @@ public function fromRepository(CheckedOutRepository $repository): VersionCollect { $output = Shell\execute('git', ['tag', '-l'], $repository->__toString()); - return new VersionCollection(...Vec\filter(Vec\map(Str\split($output, "\n"), static function (string $maybeVersion): ?Version { + return new VersionCollection(...Vec\filter_nulls(Vec\map(Str\split($output, "\n"), static function (string $maybeVersion): ?Version { try { return Version::fromString($maybeVersion); } catch (InvalidVersionString $e) { diff --git a/test/e2e/Command/AssertBackwardsCompatibleTest.php b/test/e2e/Command/AssertBackwardsCompatibleTest.php index 2c303459..35c54d0e 100644 --- a/test/e2e/Command/AssertBackwardsCompatibleTest.php +++ b/test/e2e/Command/AssertBackwardsCompatibleTest.php @@ -118,7 +118,6 @@ protected function setUp() : void $this->sourcesRepository = Filesystem\create_temporary_file(Env\temp_dir(), 'roave-backward-compatibility-e2e-test'); - self::assertIsString($this->sourcesRepository); self::assertNotEmpty($this->sourcesRepository); self::assertFileExists($this->sourcesRepository); From 064cc913b87640387c9feab53be00d794ad5460f Mon Sep 17 00:00:00 2001 From: azjezz Date: Wed, 19 May 2021 04:01:34 +0100 Subject: [PATCH 07/12] replace remaining builtin functions calls by PSL --- bin/roave-backward-compatibility-check.php | 6 +- src/Changes.php | 10 +-- .../BCBreak/ClassBased/ConstantChanged.php | 7 +- .../BCBreak/ClassBased/PropertyChanged.php | 7 +- .../Variance/TypeIsContravariant.php | 12 ++-- .../Variance/TypeIsCovariant.php | 12 ++-- ...MarkdownPipedToSymfonyConsoleFormatter.php | 37 +++++----- src/Support/ArrayHelpers.php | 28 -------- test/unit/Support/ArrayHelpersTest.php | 70 ------------------- 9 files changed, 41 insertions(+), 148 deletions(-) delete mode 100644 src/Support/ArrayHelpers.php delete mode 100644 test/unit/Support/ArrayHelpersTest.php diff --git a/bin/roave-backward-compatibility-check.php b/bin/roave-backward-compatibility-check.php index 2e0a987e..77f64583 100644 --- a/bin/roave-backward-compatibility-check.php +++ b/bin/roave-backward-compatibility-check.php @@ -8,7 +8,6 @@ use Composer\Installer; use Composer\IO\ConsoleIO; use PackageVersions\Versions; -use Psl\Filesystem; use Roave\BackwardCompatibility\Command; use Roave\BackwardCompatibility\CompareClasses; use Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassBased; @@ -33,6 +32,8 @@ use Symfony\Component\Console\Input\ArgvInput; use Symfony\Component\Console\Output\ConsoleOutput; +use function file_exists; + (static function (): void { (static function (): void { $autoloaderLocations = [ @@ -41,10 +42,9 @@ ]; foreach ($autoloaderLocations as $autoload) { - if (Filesystem\exists($autoload)) { + if (file_exists($autoload)) { /** * @noinspection PhpIncludeInspection - * @psalm-suppress UnresolvableInclude */ require_once $autoload; diff --git a/src/Changes.php b/src/Changes.php index f4f41cdd..23bd5bc5 100644 --- a/src/Changes.php +++ b/src/Changes.php @@ -7,11 +7,13 @@ use Countable; use Generator; use IteratorAggregate; +use Psl\Dict; +use Psl\Iter; use Traversable; -use function count; -use function iterator_to_array; - +/** + * @implements IteratorAggregate + */ final class Changes implements IteratorAggregate, Countable { /** @var Change[] */ @@ -99,6 +101,6 @@ public function getIterator(): iterable public function count(): int { - return count(iterator_to_array($this)); + return Iter\count(Dict\from_iterable($this)); } } diff --git a/src/DetectChanges/BCBreak/ClassBased/ConstantChanged.php b/src/DetectChanges/BCBreak/ClassBased/ConstantChanged.php index 76c083c8..5f5e2e21 100644 --- a/src/DetectChanges/BCBreak/ClassBased/ConstantChanged.php +++ b/src/DetectChanges/BCBreak/ClassBased/ConstantChanged.php @@ -4,15 +4,14 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassBased; +use Psl\Dict; +use Psl\Vec; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassConstantBased\ClassConstantBased; use Roave\BetterReflection\Reflection\ReflectionClass; use Roave\BetterReflection\Reflection\ReflectionClassConstant; -use function array_intersect_key; -use function array_keys; - final class ConstantChanged implements ClassBased { private ClassConstantBased $checkConstant; @@ -38,7 +37,7 @@ public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): */ private function checkSymbols(array $from, array $to): iterable { - foreach (array_keys(array_intersect_key($from, $to)) as $name) { + foreach (Vec\keys(Dict\intersect_by_key($from, $to)) as $name) { yield from $this->checkConstant->__invoke($from[$name], $to[$name]); } } diff --git a/src/DetectChanges/BCBreak/ClassBased/PropertyChanged.php b/src/DetectChanges/BCBreak/ClassBased/PropertyChanged.php index 7893add4..410e2138 100644 --- a/src/DetectChanges/BCBreak/ClassBased/PropertyChanged.php +++ b/src/DetectChanges/BCBreak/ClassBased/PropertyChanged.php @@ -4,15 +4,14 @@ namespace Roave\BackwardCompatibility\DetectChanges\BCBreak\ClassBased; +use Psl\Dict; +use Psl\Vec; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Roave\BackwardCompatibility\DetectChanges\BCBreak\PropertyBased\PropertyBased; use Roave\BetterReflection\Reflection\ReflectionClass; use Roave\BetterReflection\Reflection\ReflectionProperty; -use function array_intersect_key; -use function array_keys; - final class PropertyChanged implements ClassBased { private PropertyBased $checkProperty; @@ -38,7 +37,7 @@ public function __invoke(ReflectionClass $fromClass, ReflectionClass $toClass): */ private function checkSymbols(array $from, array $to): iterable { - foreach (array_keys(array_intersect_key($from, $to)) as $name) { + foreach (Vec\keys(Dict\intersect_by_key($from, $to)) as $name) { yield from $this->checkProperty->__invoke($from[$name], $to[$name]); } } diff --git a/src/DetectChanges/Variance/TypeIsContravariant.php b/src/DetectChanges/Variance/TypeIsContravariant.php index 185e74b5..31ba0dff 100644 --- a/src/DetectChanges/Variance/TypeIsContravariant.php +++ b/src/DetectChanges/Variance/TypeIsContravariant.php @@ -4,11 +4,10 @@ namespace Roave\BackwardCompatibility\DetectChanges\Variance; -use Roave\BackwardCompatibility\Support\ArrayHelpers; +use Psl\Iter; +use Psl\Str; use Roave\BetterReflection\Reflection\ReflectionType; -use function strtolower; - /** * This is a simplistic contravariant type check. A more appropriate approach would be to * have a `$type->includes($otherType)` check with actual types represented as value objects, @@ -37,7 +36,7 @@ public function __invoke( $typeAsString = $type->__toString(); $comparedTypeAsString = $comparedType->__toString(); - if (strtolower($typeAsString) === strtolower($comparedTypeAsString)) { + if (Str\lowercase($typeAsString) === Str\lowercase($comparedTypeAsString)) { return true; } @@ -70,9 +69,6 @@ public function __invoke( return $typeReflectionClass->implementsInterface($comparedTypeAsString); } - return ArrayHelpers::stringArrayContainsString( - $comparedTypeAsString, - $typeReflectionClass->getParentClassNames() - ); + return Iter\contains($typeReflectionClass->getParentClassNames(), $comparedTypeAsString); } } diff --git a/src/DetectChanges/Variance/TypeIsCovariant.php b/src/DetectChanges/Variance/TypeIsCovariant.php index c2f0eea3..4c819c44 100644 --- a/src/DetectChanges/Variance/TypeIsCovariant.php +++ b/src/DetectChanges/Variance/TypeIsCovariant.php @@ -4,12 +4,11 @@ namespace Roave\BackwardCompatibility\DetectChanges\Variance; -use Roave\BackwardCompatibility\Support\ArrayHelpers; +use Psl\Iter; +use Psl\Str; use Roave\BetterReflection\Reflection\ReflectionType; use Traversable; -use function strtolower; - /** * This is a simplistic covariant type check. A more appropriate approach would be to * have a `$type->includes($otherType)` check with actual types represented as value objects, @@ -39,7 +38,7 @@ public function __invoke( $typeAsString = $type->__toString(); $comparedTypeAsString = $comparedType->__toString(); - if (strtolower($typeAsString) === strtolower($comparedTypeAsString)) { + if (Str\lowercase($typeAsString) === Str\lowercase($comparedTypeAsString)) { return true; } @@ -81,9 +80,6 @@ public function __invoke( return $comparedTypeReflectionClass->implementsInterface($typeAsString); } - return ArrayHelpers::stringArrayContainsString( - $typeAsString, - $comparedTypeReflectionClass->getParentClassNames() - ); + return Iter\contains($comparedTypeReflectionClass->getParentClassNames(), $typeAsString); } } diff --git a/src/Formatter/MarkdownPipedToSymfonyConsoleFormatter.php b/src/Formatter/MarkdownPipedToSymfonyConsoleFormatter.php index 85e9d95f..2932c555 100644 --- a/src/Formatter/MarkdownPipedToSymfonyConsoleFormatter.php +++ b/src/Formatter/MarkdownPipedToSymfonyConsoleFormatter.php @@ -4,17 +4,12 @@ namespace Roave\BackwardCompatibility\Formatter; +use Psl\Str; +use Psl\Vec; use Roave\BackwardCompatibility\Change; use Roave\BackwardCompatibility\Changes; use Symfony\Component\Console\Output\OutputInterface; -use function array_filter; -use function array_map; -use function implode; -use function iterator_to_array; -use function str_replace; -use function trim; - final class MarkdownPipedToSymfonyConsoleFormatter implements OutputFormatter { private OutputInterface $output; @@ -26,41 +21,45 @@ public function __construct(OutputInterface $output) public function write(Changes $changes): void { - $arrayOfChanges = iterator_to_array($changes); + $arrayOfChanges = Vec\values($changes); $this->output->writeln( "# Added\n" - . implode('', $this->convertFilteredChangesToMarkdownBulletList( + . Str\join($this->convertFilteredChangesToMarkdownBulletList( static function (Change $change): bool { return $change->isAdded(); }, ...$arrayOfChanges - )) + ), '') . "\n# Changed\n" - . implode('', $this->convertFilteredChangesToMarkdownBulletList( + . Str\join($this->convertFilteredChangesToMarkdownBulletList( static function (Change $change): bool { return $change->isChanged(); }, ...$arrayOfChanges - )) + ), '') . "\n# Removed\n" - . implode('', $this->convertFilteredChangesToMarkdownBulletList( + . Str\join($this->convertFilteredChangesToMarkdownBulletList( static function (Change $change): bool { return $change->isRemoved(); }, ...$arrayOfChanges - )) + ), '') ); } - /** @return string[] */ + /** + * @param callable(Change): bool $filterFunction + * + * @return list + */ private function convertFilteredChangesToMarkdownBulletList(callable $filterFunction, Change ...$changes): array { - return array_map( + return Vec\map( + Vec\filter($changes, $filterFunction), static function (Change $change): string { - return ' - ' . str_replace(['ADDED: ', 'CHANGED: ', 'REMOVED: '], '', trim($change->__toString())) . "\n"; - }, - array_filter($changes, $filterFunction) + return ' - ' . Str\replace_every(Str\trim($change->__toString()), ['ADDED: ' => '', 'CHANGED: ' => '', 'REMOVED: ' => '']) . "\n"; + } ); } } diff --git a/src/Support/ArrayHelpers.php b/src/Support/ArrayHelpers.php deleted file mode 100644 index f11dc9fe..00000000 --- a/src/Support/ArrayHelpers.php +++ /dev/null @@ -1,28 +0,0 @@ -|bool>> - * - * @psalm-return array, 2: bool}> - */ - public function stringArrayContainsStringValidValues(): array - { - return [ - [ - '', - [], - false, - ], - [ - '', - [''], - true, - ], - [ - '0', - [''], - false, - ], - [ - '', - ['0'], - false, - ], - [ - 'foo', - ['foo', 'bar', 'baz'], - true, - ], - [ - 'foo', - ['bar', 'baz'], - false, - ], - [ - 'foo', - ['foo', 'foo', 'foo'], - true, - ], - ]; - } -} From d2156d0f551961b8dc67f583b3e6257e103d9f4e Mon Sep 17 00:00:00 2001 From: azjezz Date: Wed, 19 May 2021 04:11:29 +0100 Subject: [PATCH 08/12] fix build --- composer.json | 2 +- composer.lock | 2 +- phpunit.xml.dist | 20 ++++++++++--------- src/Command/AssertBackwardsCompatible.php | 6 +++++- .../Command/AssertBackwardsCompatibleTest.php | 4 ++-- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 6c4c31a6..1a210510 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "doctrine/coding-standard": "^8.2.0", "infection/infection": "^0.16.4", "php-standard-library/psalm-plugin": "^1.1", - "phpunit/phpunit": "^9.2.6", + "phpunit/phpunit": "^9.5", "roave/security-advisories": "dev-master", "squizlabs/php_codesniffer": "^3.6.0", "vimeo/psalm": "^4.7" diff --git a/composer.lock b/composer.lock index 6cc8b883..56540c5d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "92c62d968f24dce0f4201786a22aa910", + "content-hash": "c294b928d0fcb3386b49039ba25a00f5", "packages": [ { "name": "azjezz/psl", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b4acd2c7..fae9d95a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,9 +1,9 @@ @@ -13,12 +13,14 @@ ./test/e2e - - + + + ./src - - + + + - + diff --git a/src/Command/AssertBackwardsCompatible.php b/src/Command/AssertBackwardsCompatible.php index 92bae300..45e56d14 100644 --- a/src/Command/AssertBackwardsCompatible.php +++ b/src/Command/AssertBackwardsCompatible.php @@ -141,7 +141,11 @@ public function execute(InputInterface $input, OutputInterface $output): int $toRevision = $this->parseRevision->fromStringForRepository($to, $sourceRepo); - $stdErr->writeln(Str\format('Comparing from %s to %s...', (string) $fromRevision, (string) $toRevision)); + $stdErr->writeln(Str\format( + 'Comparing from %s to %s...', + Type\string()->coerce($fromRevision), + Type\string()->coerce($toRevision) + )); $fromPath = $this->git->checkout($sourceRepo, $fromRevision); $toPath = $this->git->checkout($sourceRepo, $toRevision); diff --git a/test/e2e/Command/AssertBackwardsCompatibleTest.php b/test/e2e/Command/AssertBackwardsCompatibleTest.php index 35c54d0e..20a907fc 100644 --- a/test/e2e/Command/AssertBackwardsCompatibleTest.php +++ b/test/e2e/Command/AssertBackwardsCompatibleTest.php @@ -173,7 +173,7 @@ public function testWillAllowSpecifyingGitRevision() : void EXPECTED , - $exception->getOutput() // @TODO https://github.com/Roave/BackwardCompatibilityCheck/issues/79 this looks like a symfony bug - we shouldn't check STDERR, but STDOUT + $exception->getErrorOutput() // @TODO https://github.com/Roave/BackwardCompatibilityCheck/issues/79 this looks like a symfony bug - we shouldn't check STDERR, but STDOUT ); } } @@ -199,7 +199,7 @@ public function testWillRunSuccessfullyOnNoBcBreaks() : void '-vvv', ], $this->sourcesRepository); - self::assertStringContainsString('No backwards-incompatible changes detected', $output); + self::assertEmpty($output); } public function testWillPickTaggedVersionOnNoGivenFrom() : void From eec07002be381c6fe27517d9794fdcfe7de99390 Mon Sep 17 00:00:00 2001 From: azjezz Date: Wed, 19 May 2021 06:56:45 +0100 Subject: [PATCH 09/12] - --- phpunit.xml.dist | 10 +++++----- src/Changes.php | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index fae9d95a..7c4b5b37 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,9 +1,9 @@ @@ -21,6 +21,6 @@ - + diff --git a/src/Changes.php b/src/Changes.php index 23bd5bc5..1000ae19 100644 --- a/src/Changes.php +++ b/src/Changes.php @@ -7,7 +7,6 @@ use Countable; use Generator; use IteratorAggregate; -use Psl\Dict; use Psl\Iter; use Traversable; @@ -101,6 +100,6 @@ public function getIterator(): iterable public function count(): int { - return Iter\count(Dict\from_iterable($this)); + return Iter\count($this->getIterator()); } } From 95c07430f312b45d26b80278b9cb819aa245dfb0 Mon Sep 17 00:00:00 2001 From: azjezz Date: Wed, 19 May 2021 13:19:08 +0100 Subject: [PATCH 10/12] update dependencies constraints --- composer.json | 4 ++-- composer.lock | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 1a210510..ec83a491 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "require": { "php": "^7.4.7", "ext-json": "*", - "azjezz/psl": "^1.6", + "azjezz/psl": "^1.6.1", "composer/composer": "^2.0", "nikolaposa/version": "^4.1.0", "ocramius/package-versions": "^1.11.0", @@ -29,7 +29,7 @@ "phpunit/phpunit": "^9.5", "roave/security-advisories": "dev-master", "squizlabs/php_codesniffer": "^3.6.0", - "vimeo/psalm": "^4.7" + "vimeo/psalm": "^4.7.2" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 56540c5d..fdb8b662 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c294b928d0fcb3386b49039ba25a00f5", + "content-hash": "f8fb2bd1010dce301656e05a97e14a6d", "packages": [ { "name": "azjezz/psl", - "version": "1.6.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/azjezz/psl.git", - "reference": "963a0bb6fd333146469fc064be6977b959a07854" + "reference": "60683bf0f79efc8deaeb1069f0c25c3212427411" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/azjezz/psl/zipball/963a0bb6fd333146469fc064be6977b959a07854", - "reference": "963a0bb6fd333146469fc064be6977b959a07854", + "url": "https://api.github.com/repos/azjezz/psl/zipball/60683bf0f79efc8deaeb1069f0c25c3212427411", + "reference": "60683bf0f79efc8deaeb1069f0c25c3212427411", "shasum": "" }, "require": { @@ -59,9 +59,9 @@ "description": "PHP Standard Library", "support": { "issues": "https://github.com/azjezz/psl/issues", - "source": "https://github.com/azjezz/psl/tree/1.6.0" + "source": "https://github.com/azjezz/psl/tree/1.6.1" }, - "time": "2021-04-07T08:13:18+00:00" + "time": "2021-05-19T11:49:49+00:00" }, { "name": "beberlei/assert", From 4db6db01b76e83d7d2722d3455e0267099b8caf0 Mon Sep 17 00:00:00 2001 From: azjezz Date: Wed, 19 May 2021 13:20:06 +0100 Subject: [PATCH 11/12] update path to phpunit xsd file --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7c4b5b37..54040c73 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,7 @@ From 3dad6d36c003792bc1d375cb5eb93d544065173f Mon Sep 17 00:00:00 2001 From: azjezz Date: Wed, 19 May 2021 13:21:14 +0100 Subject: [PATCH 12/12] remove redundant phpcs annotation --- bin/roave-backward-compatibility-check.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/bin/roave-backward-compatibility-check.php b/bin/roave-backward-compatibility-check.php index 77f64583..27f43ccb 100644 --- a/bin/roave-backward-compatibility-check.php +++ b/bin/roave-backward-compatibility-check.php @@ -43,9 +43,6 @@ foreach ($autoloaderLocations as $autoload) { if (file_exists($autoload)) { - /** - * @noinspection PhpIncludeInspection - */ require_once $autoload; return;