From 3df02552eebd8254f6ca17886beb5b083280cd86 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Chitgarha Date: Wed, 13 Jul 2022 18:06:52 +0430 Subject: [PATCH 01/14] Upgrade PHPStan from ^0.12 to ^1.0 along with its dependencies --- composer.json | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index f0658f17..ea374c0d 100644 --- a/composer.json +++ b/composer.json @@ -37,12 +37,12 @@ }, "require-dev": { "brianium/paratest": "^6.2", - "pepakriz/phpstan-exception-rules": "^0.11", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-doctrine": "^0.12", - "phpstan/phpstan-php-parser": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", + "pepakriz/phpstan-exception-rules": "^0.12", + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-doctrine": "^1.0", + "phpstan/phpstan-php-parser": "^1.0", + "phpstan/phpstan-phpunit": "^1.0", + "phpstan/phpstan-strict-rules": "^1.0", "phpunit/phpunit": "^9.0", "slevomat/coding-standard": "^6.3", "symfony/process": "^5.1", @@ -60,7 +60,10 @@ }, "config": { "sort-packages": true, - "preferred-install": "dist" + "preferred-install": "dist", + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } }, "bin": [ "src/Main.php" -- GitLab From f6f656852fec2f7c805563421dd4f69a25f22ea7 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Chitgarha Date: Wed, 13 Jul 2022 18:32:02 +0430 Subject: [PATCH 02/14] Fix some return type mismatches (deprecated in PHP 8.1) Fix a docblock type also. --- src/Autocompletion/CompletionItem.php | 6 +++--- src/Indexing/Iterating/AbsolutePathFilterIterator.php | 2 +- src/Indexing/SchemaInitializer.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Autocompletion/CompletionItem.php b/src/Autocompletion/CompletionItem.php index 87c7983e..d0226af0 100644 --- a/src/Autocompletion/CompletionItem.php +++ b/src/Autocompletion/CompletionItem.php @@ -245,7 +245,7 @@ final class CompletionItem implements JsonSerializable, ArrayAccess /** * @inheritDoc */ - public function offsetSet($offset, $value) + public function offsetSet($offset, $value): void { throw new LogicException('Setting properties directly is not allowed, use setters instead'); } @@ -253,7 +253,7 @@ final class CompletionItem implements JsonSerializable, ArrayAccess /** * @inheritDoc */ - public function offsetExists($offset) + public function offsetExists($offset): bool { $array = $this->jsonSerialize(); @@ -263,7 +263,7 @@ final class CompletionItem implements JsonSerializable, ArrayAccess /** * @inheritDoc */ - public function offsetUnset($offset) + public function offsetUnset($offset): void { throw new LogicException('Unsetting properties is not allowed'); } diff --git a/src/Indexing/Iterating/AbsolutePathFilterIterator.php b/src/Indexing/Iterating/AbsolutePathFilterIterator.php index ead4bc46..c17faddb 100644 --- a/src/Indexing/Iterating/AbsolutePathFilterIterator.php +++ b/src/Indexing/Iterating/AbsolutePathFilterIterator.php @@ -14,7 +14,7 @@ final class AbsolutePathFilterIterator extends PathFilterIterator /** * @inheritDoc */ - public function accept() + public function accept(): bool { $filename = $this->current()->getPathname(); diff --git a/src/Indexing/SchemaInitializer.php b/src/Indexing/SchemaInitializer.php index 7a33edc1..04ae4e6a 100644 --- a/src/Indexing/SchemaInitializer.php +++ b/src/Indexing/SchemaInitializer.php @@ -21,7 +21,7 @@ final class SchemaInitializer public const SCHEMA_VERSION = 30; /** - * @var int + * @var string */ public const VERSION_SETTING_NAME = 'version'; -- GitLab From c41a8c86188fbf7c3a210d2abc1422afe64179cf Mon Sep 17 00:00:00 2001 From: Mohammad Amin Chitgarha Date: Wed, 13 Jul 2022 18:39:17 +0430 Subject: [PATCH 03/14] Remove some not-reported PHPStan error ignore items in phpstan.neon --- phpstan.neon | 7 ------- 1 file changed, 7 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 7087e4d1..e13d912f 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -32,14 +32,7 @@ parameters: # able to use inheritDoc here. - '#Method [A-Za-z\\_]+::jsonSerialize\(\) return type has no value type specified in iterable type array.#' - '#Method [A-Za-z\\_]+::getSubNodeNames\(\) return type has no value type specified in iterable type array.#' - - '#no value type specified in iterable type Symfony\\Component\\Process\\Process.#' - message: '#Variable property access on#' path: 'src/Analysis/Visiting/ScopeLimitingVisitor.php' - - # I think this one is a bug in PHPStan's stubs. - - - message: "#^Call to an undefined method Ds\\\\PriorityQueue\\\\:\\:pop\\(\\)\\.$#" - count: 1 - path: src/Sockets/JsonRpcQueue.php -- GitLab From a4b4ad13ea0bb30248395fd1b579e36f5d78dab9 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Chitgarha Date: Wed, 13 Jul 2022 21:22:01 +0430 Subject: [PATCH 04/14] Fix TextToUtf8Converter making the passed code empty Using PHP 8.1.7, passing null as the second argument of mb_detect_ encoding() detects it as strange "UUENCODE" encoding, and converting it to UTF-8 gives an empty string. Pass mb_detect_order() instead, although it should do the same (but it does not). It might be an internal PHP bug. --- src/Analysis/SourceCodeReading/TextToUtf8Converter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Analysis/SourceCodeReading/TextToUtf8Converter.php b/src/Analysis/SourceCodeReading/TextToUtf8Converter.php index 00fee900..25c69874 100644 --- a/src/Analysis/SourceCodeReading/TextToUtf8Converter.php +++ b/src/Analysis/SourceCodeReading/TextToUtf8Converter.php @@ -12,7 +12,9 @@ final class TextToUtf8Converter implements TextEncodingConverterInterface */ public function convert(string $code): string { - $encoding = mb_detect_encoding($code, null, true); + // Passing null does NOT work with 8.1(.7), although based on PHP docs, it must do the same + // thing as calling mb_detect_order(). It might be an internal bug, but not totally sure. + $encoding = mb_detect_encoding($code, mb_detect_order(), true); if ($encoding === false) { $encoding = 'ASCII'; -- GitLab From b5967e00250db1da2e35949719ccd6459d310b85 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Chitgarha Date: Wed, 13 Jul 2022 23:40:54 +0430 Subject: [PATCH 05/14] Use indexing with brackets instead of removed curly braces Support for indexing like $version{0} is removed as of PHP 8.0. --- .../GlobalConstantsJsonRpcQueueItemHandlerTest.php | 2 +- .../DefineWithExpression.phpt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Integration/UserInterface/JsonRpcQueueItemHandler/GlobalConstantsJsonRpcQueueItemHandlerTest.php b/tests/Integration/UserInterface/JsonRpcQueueItemHandler/GlobalConstantsJsonRpcQueueItemHandlerTest.php index 23110039..c4b9588a 100644 --- a/tests/Integration/UserInterface/JsonRpcQueueItemHandler/GlobalConstantsJsonRpcQueueItemHandlerTest.php +++ b/tests/Integration/UserInterface/JsonRpcQueueItemHandler/GlobalConstantsJsonRpcQueueItemHandlerTest.php @@ -39,7 +39,7 @@ final class GlobalConstantsJsonRpcQueueItemHandlerTest extends AbstractIntegrati { $output = $this->getGlobalConstants('DefineWithExpression.phpt'); - self::assertSame('(($version{0} * 10000) + ($version{2} * 100) + $version{4})', $output['\TEST_CONSTANT']['defaultValue']); + self::assertSame('(($version[0] * 10000) + ($version[2] * 100) + $version[4])', $output['\TEST_CONSTANT']['defaultValue']); } /** diff --git a/tests/Integration/UserInterface/JsonRpcQueueItemHandler/GlobalConstantsJsonRpcQueueItemHandlerTest/DefineWithExpression.phpt b/tests/Integration/UserInterface/JsonRpcQueueItemHandler/GlobalConstantsJsonRpcQueueItemHandlerTest/DefineWithExpression.phpt index b6c5b722..4a04851a 100644 --- a/tests/Integration/UserInterface/JsonRpcQueueItemHandler/GlobalConstantsJsonRpcQueueItemHandlerTest/DefineWithExpression.phpt +++ b/tests/Integration/UserInterface/JsonRpcQueueItemHandler/GlobalConstantsJsonRpcQueueItemHandlerTest/DefineWithExpression.phpt @@ -1,3 +1,3 @@ Date: Thu, 14 Jul 2022 06:09:23 +0430 Subject: [PATCH 06/14] Workaround wrong encoding detection by mb_detect_encoding() on PHP 8.1 See https://github.com/php/php-src/issues/9008 and code comments for more information. --- .../SourceCodeReading/TextToUtf8Converter.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Analysis/SourceCodeReading/TextToUtf8Converter.php b/src/Analysis/SourceCodeReading/TextToUtf8Converter.php index 25c69874..1daeed49 100644 --- a/src/Analysis/SourceCodeReading/TextToUtf8Converter.php +++ b/src/Analysis/SourceCodeReading/TextToUtf8Converter.php @@ -12,8 +12,16 @@ final class TextToUtf8Converter implements TextEncodingConverterInterface */ public function convert(string $code): string { - // Passing null does NOT work with 8.1(.7), although based on PHP docs, it must do the same - // thing as calling mb_detect_order(). It might be an internal bug, but not totally sure. + // BUG: https://github.com/php/php-src/issues/9008 + // The workaround is, we suppose the encoding is UTF-8 by default. If it is already, no + // action will be done, otherwise, it tries to detect and convert the encoding. Notice that + // the latter case would be a rare situation, so no worries. + $utf8 = mb_detect_encoding($code, ['UTF-8'], true); + + if ($utf8 !== false) { + return $code; + } + $encoding = mb_detect_encoding($code, mb_detect_order(), true); if ($encoding === false) { -- GitLab From 988a13006a0a4d6ce1e2d4f603acad7cd1c79d58 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Chitgarha Date: Thu, 14 Jul 2022 06:49:19 +0430 Subject: [PATCH 07/14] Remove unnecessary branches from TextToUtf8Converter::convert() --- .../SourceCodeReading/TextToUtf8Converter.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/Analysis/SourceCodeReading/TextToUtf8Converter.php b/src/Analysis/SourceCodeReading/TextToUtf8Converter.php index 1daeed49..08483356 100644 --- a/src/Analysis/SourceCodeReading/TextToUtf8Converter.php +++ b/src/Analysis/SourceCodeReading/TextToUtf8Converter.php @@ -16,22 +16,16 @@ final class TextToUtf8Converter implements TextEncodingConverterInterface // The workaround is, we suppose the encoding is UTF-8 by default. If it is already, no // action will be done, otherwise, it tries to detect and convert the encoding. Notice that // the latter case would be a rare situation, so no worries. - $utf8 = mb_detect_encoding($code, ['UTF-8'], true); + $utf8 = \mb_detect_encoding($code, ['UTF-8'], true); if ($utf8 !== false) { return $code; } - $encoding = mb_detect_encoding($code, mb_detect_order(), true); + $encoding = \mb_detect_encoding($code, mb_detect_order()); - if ($encoding === false) { - $encoding = 'ASCII'; - } - - if (!in_array($encoding, ['UTF-8', 'ASCII'], true)) { - $code = mb_convert_encoding($code, 'UTF-8', $encoding); - } - - return $code; + // Safe assumption: $encoding is neither equal to UTF-8 nor ASCII + // (as every ASCII encoding is also a UTF-8 one) + return \mb_convert_encoding($code, 'UTF-8', $encoding); } } -- GitLab From 3c8f99f643b0824ee90ed31f2ca64e5c418bc701 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Chitgarha Date: Thu, 14 Jul 2022 07:28:36 +0430 Subject: [PATCH 08/14] Update ComposerRequireChecker from 2.1.0 to 4.1.0 --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6a902cc1..c5f36d66 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -48,8 +48,8 @@ test:run-composer-require-checker: image: php:7.4-cli-alpine stage: test script: - - curl -sSL https://github.com/maglnet/ComposerRequireChecker/releases/download/2.1.0/composer-require-checker.phar --output composer-require-checker.phar - - echo "f5b57c8f4305eb3d5ec605943b5250b10aacb939778be005360f815860474495 composer-require-checker.phar" > checksums + - curl -sSL https://github.com/maglnet/ComposerRequireChecker/releases/download/4.1.0/composer-require-checker.phar --output composer-require-checker.phar + - echo "2a4c652de474e5dbbda1662ff82f207be7aa86b44912093cf5fb135345506e66 composer-require-checker.phar" > checksums - sha256sum -c checksums - php ./composer-require-checker.phar check ./composer.json -- GitLab From 59ddcb01fe69ec8de58fdbc2010f0e8ad34f95f0 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Chitgarha Date: Thu, 14 Jul 2022 07:47:03 +0430 Subject: [PATCH 09/14] Upgrade PHP version of composer-require-checker run to 8.0 --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c5f36d66..6f2a50e0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,7 +45,7 @@ build:php-8.0: # ----- Test stage test:run-composer-require-checker: - image: php:7.4-cli-alpine + image: php:8.0-cli-alpine stage: test script: - curl -sSL https://github.com/maglnet/ComposerRequireChecker/releases/download/4.1.0/composer-require-checker.phar --output composer-require-checker.phar -- GitLab From 72a091bae2cea9bda46d68f02e69b75573c5b217 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Chitgarha Date: Thu, 14 Jul 2022 07:50:27 +0430 Subject: [PATCH 10/14] Use 'use function' instead of fully-qualified function name Reported and complained by PHPCS. --- src/Analysis/SourceCodeReading/TextToUtf8Converter.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Analysis/SourceCodeReading/TextToUtf8Converter.php b/src/Analysis/SourceCodeReading/TextToUtf8Converter.php index 08483356..f9e31222 100644 --- a/src/Analysis/SourceCodeReading/TextToUtf8Converter.php +++ b/src/Analysis/SourceCodeReading/TextToUtf8Converter.php @@ -2,6 +2,10 @@ namespace Serenata\Analysis\SourceCodeReading; +use function mb_detect_encoding; +use function mb_detect_order; +use function mb_convert_encoding; + /** * Converts text to UTF-8. */ @@ -16,16 +20,16 @@ final class TextToUtf8Converter implements TextEncodingConverterInterface // The workaround is, we suppose the encoding is UTF-8 by default. If it is already, no // action will be done, otherwise, it tries to detect and convert the encoding. Notice that // the latter case would be a rare situation, so no worries. - $utf8 = \mb_detect_encoding($code, ['UTF-8'], true); + $utf8 = mb_detect_encoding($code, ['UTF-8'], true); if ($utf8 !== false) { return $code; } - $encoding = \mb_detect_encoding($code, mb_detect_order()); + $encoding = mb_detect_encoding($code, mb_detect_order()); // Safe assumption: $encoding is neither equal to UTF-8 nor ASCII // (as every ASCII encoding is also a UTF-8 one) - return \mb_convert_encoding($code, 'UTF-8', $encoding); + return mb_convert_encoding($code, 'UTF-8', $encoding); } } -- GitLab From c30738428767e3232c7c69743cfb426efc3d8893 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Chitgarha Date: Thu, 14 Jul 2022 07:58:11 +0430 Subject: [PATCH 11/14] Support building, testing and finalizing with PHP 8.1 on Gitlab CI --- .gitlab-ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6f2a50e0..b16eb06c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,6 +43,10 @@ build:php-8.0: image: php:8.0-cli-alpine <<: *build-job-shared +build:php-8.1: + image: php:8.1-cli-alpine + <<: *build-job-shared + # ----- Test stage test:run-composer-require-checker: image: php:8.0-cli-alpine @@ -117,6 +121,13 @@ test:php-8.0: - job: build:php-8.0 artifacts: true +test:php-8.1: + image: php:8.1-cli-alpine + <<: *test-job-shared + needs: + - job: build:php-8.1 + artifacts: true + # ----- Finalization stage, which contains finishing steps such as metrics and packaging. .finalization-package-job-shared: &finalization-package-job-shared stage: finalization @@ -153,6 +164,10 @@ finalization:package-php-8.0: image: php:8.0-cli-alpine <<: *finalization-package-job-shared +finalization:package-php-8.1: + image: php:8.1-cli-alpine + <<: *finalization-package-job-shared + finalization:code-coverage: image: php:8.0-cli-alpine stage: finalization -- GitLab From 3e9d690c7bba8af49aaf206bb46671a43d11b6c6 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Chitgarha Date: Thu, 14 Jul 2022 08:26:08 +0430 Subject: [PATCH 12/14] Make doc-block types more complete --- src/Analysis/ClasslikeListProviderInterface.php | 2 +- src/Analysis/Conversion/AbstractConverter.php | 2 +- src/Analysis/FunctionListProviderInterface.php | 2 +- src/Analysis/Node/MethodCallMethodInfoRetriever.php | 2 +- src/Analysis/Visiting/UseStatementFetchingVisitor.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Analysis/ClasslikeListProviderInterface.php b/src/Analysis/ClasslikeListProviderInterface.php index 3dd3cc1c..a2080eae 100644 --- a/src/Analysis/ClasslikeListProviderInterface.php +++ b/src/Analysis/ClasslikeListProviderInterface.php @@ -8,7 +8,7 @@ namespace Serenata\Analysis; interface ClasslikeListProviderInterface { /** - * @return array mapping FQCN's to classlikes. + * @return array> mapping FQCN's to classlikes. */ public function getAll(): array; } diff --git a/src/Analysis/Conversion/AbstractConverter.php b/src/Analysis/Conversion/AbstractConverter.php index 90402a52..b271d34a 100644 --- a/src/Analysis/Conversion/AbstractConverter.php +++ b/src/Analysis/Conversion/AbstractConverter.php @@ -14,7 +14,7 @@ abstract class AbstractConverter /** * @param TypeNode $type * - * @return array[] + * @return array */ protected function convertDocblockType(TypeNode $type): array { diff --git a/src/Analysis/FunctionListProviderInterface.php b/src/Analysis/FunctionListProviderInterface.php index 5bd50687..d7ca7dae 100644 --- a/src/Analysis/FunctionListProviderInterface.php +++ b/src/Analysis/FunctionListProviderInterface.php @@ -8,7 +8,7 @@ namespace Serenata\Analysis; interface FunctionListProviderInterface { /** - * @return array> mapping FQCN's to functions. + * @return array>> mapping FQCN's to functions. */ public function getAll(): array; } diff --git a/src/Analysis/Node/MethodCallMethodInfoRetriever.php b/src/Analysis/Node/MethodCallMethodInfoRetriever.php index b763e48f..62d2e987 100644 --- a/src/Analysis/Node/MethodCallMethodInfoRetriever.php +++ b/src/Analysis/Node/MethodCallMethodInfoRetriever.php @@ -62,7 +62,7 @@ final class MethodCallMethodInfoRetriever * @param TextDocumentItem $textDocumentItem * @param Position $position * - * @return array[] + * @return array> */ public function retrieve(Node\Expr $node, TextDocumentItem $textDocumentItem, Position $position): array { diff --git a/src/Analysis/Visiting/UseStatementFetchingVisitor.php b/src/Analysis/Visiting/UseStatementFetchingVisitor.php index 3dda4c2d..2a77d83d 100644 --- a/src/Analysis/Visiting/UseStatementFetchingVisitor.php +++ b/src/Analysis/Visiting/UseStatementFetchingVisitor.php @@ -92,7 +92,7 @@ final class UseStatementFetchingVisitor extends NodeVisitorAbstract /** * Retrieves a list of namespaces. * - * @return array[] + * @return array> */ public function getNamespaces(): array { -- GitLab From accf2bd5c0a4e61167fa3e976e720adb7424cca0 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Chitgarha Date: Thu, 14 Jul 2022 08:44:55 +0430 Subject: [PATCH 13/14] Remove some not-reported ignoreErrors from PHPStan baseline --- phpstan-baseline.neon | 41 ----------------------------------------- 1 file changed, 41 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 15b54244..100f6d70 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -65,11 +65,6 @@ parameters: count: 1 path: src/Indexing/Indexer.php - - - message: "#^Missing @throws Doctrine\\\\ORM\\\\ORMException annotation$#" - count: 1 - path: src/Indexing/ManagerRegistry.php - - message: "#^Missing @throws Doctrine\\\\ORM\\\\Tools\\\\ToolsException annotation$#" count: 1 @@ -130,11 +125,6 @@ parameters: count: 1 path: src/Parsing/PhpstanDocblockTypeParser.php - - - message: "#^Unused @throws UnderflowException annotation$#" - count: 1 - path: src/Sockets/JsonRpcQueue.php - - message: "#^Useless @throws Serenata\\\\Sockets\\\\RequestParsingException annotation$#" count: 1 @@ -310,16 +300,6 @@ parameters: count: 1 path: tests/Integration/AbstractIntegrationTest.php - - - message: "#^Cannot call method clear\\(\\) on object\\|null\\.$#" - count: 1 - path: tests/Integration/AbstractIntegrationTest.php - - - - message: "#^Cannot call method run\\(\\) on object\\|null\\.$#" - count: 1 - path: tests/Integration/AbstractIntegrationTest.php - - message: "#^Cannot call method getManager\\(\\) on object\\|null\\.$#" count: 3 @@ -515,11 +495,6 @@ parameters: count: 1 path: tests/Integration/Analysis/Typing/Deduction/ExpressionTypeDeducerTest.php - - - message: "#^Method Serenata\\\\Tests\\\\Integration\\\\Analysis\\\\Typing\\\\Deduction\\\\ExpressionTypeDeducerTest\\:\\:getMarkerOffset\\(\\) should return int but returns int\\|false\\.$#" - count: 1 - path: tests/Integration/Analysis/Typing/Deduction/ExpressionTypeDeducerTest.php - - message: "#^Cannot call method getFileByUri\\(\\) on object\\|null\\.$#" count: 1 @@ -570,11 +545,6 @@ parameters: count: 1 path: tests/Integration/Autocompletion/Providers/AbstractAutocompletionProviderTest.php - - - message: "#^Method Serenata\\\\Tests\\\\Integration\\\\Autocompletion\\\\Providers\\\\AbstractAutocompletionProviderTest\\:\\:getMarkerOffset\\(\\) should return int but returns int\\|false\\.$#" - count: 1 - path: tests/Integration/Autocompletion/Providers/AbstractAutocompletionProviderTest.php - - message: "#^Cannot call method create\\(\\) on object\\|null\\.$#" count: 2 @@ -905,11 +875,6 @@ parameters: count: 1 path: tests/Unit/Analysis/Visiting/ScopeLimitingVisitorTest.php - - - message: "#^Unable to resolve the template type T in call to method Serenata\\\\Autocompletion\\\\ApproximateStringMatching\\\\ApproximateStringMatchingBestStringApproximationDeterminer\\:\\:determine\\(\\)$#" - count: 1 - path: tests/Unit/Autocompletion/ApproximateStringMatching/ApproximateStringMatchingBestStringApproximationDeterminerTest.php - - message: "#^Property Serenata\\\\Tests\\\\Unit\\\\Autocompletion\\\\AutocompletionPrefixDeterminerTest\\:\\:\\$boundaryTokenRetrieverMock has unknown class PHPUnit_Framework_MockObject_MockObject as its type\\.$#" count: 1 @@ -969,9 +934,3 @@ parameters: message: "#^Access to an undefined property PhpParser\\\\Node\\\\Expr\\:\\:\\$value\\.$#" count: 2 path: tests/Unit/Parsing/PartialParserTest.php - - - - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) with 'PhpParser\\\\\\\\Node\\\\\\\\Arg' and PhpParser\\\\Node\\\\Arg will always evaluate to true\\.$#" - count: 12 - path: tests/Unit/Parsing/PartialParserTest.php - -- GitLab From e51c29d075dcde3fa3ef7c7282871b8586bdf728 Mon Sep 17 00:00:00 2001 From: Mohammad Amin Chitgarha Date: Thu, 14 Jul 2022 09:59:17 +0430 Subject: [PATCH 14/14] Update Composer from 2.0.1 to 2.3.5 for PHP 8.1 support --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b16eb06c..dc54673a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,8 +13,8 @@ include: # ----- Build stage .build-setup-composer: &build-setup-composer script: - - curl -sSL https://getcomposer.org/download/2.0.1/composer.phar --output composer.phar - - echo "4b4b118cc54662e4813ba86efb215fdb19c5b29944c5919b4f2803c915aa2234 composer.phar" > checksums + - curl -sSL https://getcomposer.org/download/2.3.5/composer.phar --output composer.phar + - echo "3b3b5a899c06a46aec280727bdf50aad14334f6bc40436ea76b07b650870d8f4 composer.phar" > checksums - sha256sum -c checksums - php composer.phar update --prefer-dist --optimize-autoloader --no-interaction --no-progress @@ -132,8 +132,8 @@ test:php-8.1: .finalization-package-job-shared: &finalization-package-job-shared stage: finalization script: - - curl -sSL https://getcomposer.org/download/2.0.1/composer.phar --output composer.phar - - echo "4b4b118cc54662e4813ba86efb215fdb19c5b29944c5919b4f2803c915aa2234 composer.phar" > checksums + - curl -sSL https://getcomposer.org/download/2.3.5/composer.phar --output composer.phar + - echo "3b3b5a899c06a46aec280727bdf50aad14334f6bc40436ea76b07b650870d8f4 composer.phar" > checksums - sha256sum -c checksums # Do a clean install so we can avoid including dev dependencies. -- GitLab