Update the composer dependencies
authorAlexander Ebert <ebert@woltlab.com>
Thu, 9 Jan 2025 12:37:01 +0000 (13:37 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 9 Jan 2025 12:37:01 +0000 (13:37 +0100)
38 files changed:
wcfsetup/install/files/lib/system/api/composer.json
wcfsetup/install/files/lib/system/api/composer.lock
wcfsetup/install/files/lib/system/api/composer/InstalledVersions.php
wcfsetup/install/files/lib/system/api/composer/installed.json
wcfsetup/install/files/lib/system/api/composer/installed.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/composer.json
wcfsetup/install/files/lib/system/api/cuyz/valinor/qa/PHPStan/Extension/ApiAndInternalAnnotationCheck.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/qa/PHPStan/Extension/ArgumentsMapperPHPStanExtension.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/qa/PHPStan/Extension/TreeMapperPHPStanExtension.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/qa/Psalm/ValinorPsalmPlugin.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Definition/Repository/Cache/Compiler/AttributesCompiler.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Definition/Repository/Reflection/ReflectionAttributesRepository.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Definition/Repository/Reflection/ReflectionMethodDefinitionBuilder.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Definition/Repository/Reflection/TypeResolver/ClassImportedTypeAliasResolver.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Definition/Repository/Reflection/TypeResolver/ClassLocalTypeAliasResolver.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Library/Settings.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Mapper/ArgumentsMapper.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Mapper/Object/DateTimeFormatConstructor.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Mapper/Object/Factory/DateTimeObjectBuilderFactory.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Mapper/Object/FunctionObjectBuilder.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Mapper/Source/Modifier/PathMapping.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Mapper/Tree/Message/Formatter/MessageMapFormatter.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Mapper/Tree/Message/Formatter/TranslationMessageFormatter.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Mapper/Tree/Message/MessageBuilder.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Mapper/Tree/Message/Messages.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Mapper/Tree/Node.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Mapper/TreeMapper.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Mapper/TypeArgumentsMapper.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Mapper/TypeTreeMapper.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/MapperBuilder.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Normalizer/Formatter/JsonFormatter.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Normalizer/JsonNormalizer.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Normalizer/Transformer/KeyTransformersHandler.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Normalizer/Transformer/ValueTransformersHandler.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Type/Parser/Lexer/Annotations.php
wcfsetup/install/files/lib/system/api/cuyz/valinor/src/Type/Parser/Lexer/TokenStream.php
wcfsetup/install/files/lib/system/api/laminas/laminas-progressbar/README.md
wcfsetup/install/files/lib/system/api/laminas/laminas-progressbar/composer.json

index 09716bc72fbe61004f1282ffcf167c041660edec..6ddedcf74f2e161ed52c043bd8c2c5980e32fb6c 100644 (file)
@@ -10,7 +10,7 @@
     }
   },
   "require": {
-    "cuyz/valinor": "^1.14.1",
+    "cuyz/valinor": "^1.14.2",
     "dragonmantank/cron-expression": "^3.4.0",
     "erusev/parsedown": "^1.7.4",
     "ezyang/htmlpurifier": "^4.18",
@@ -18,7 +18,7 @@
     "guzzlehttp/psr7": "^2.7.0",
     "laminas/laminas-diactoros": "^3.5.0",
     "laminas/laminas-httphandlerrunner": "^2.11.0",
-    "laminas/laminas-progressbar": "^2.14",
+    "laminas/laminas-progressbar": "^2.14.1",
     "minishlink/web-push": "^v9.0.1",
     "nikic/fast-route": "2.0.0-beta1",
     "paragonie/constant_time_encoding": "^3.0",
index d4febfe5a4cff678d8d1ff4b746f8dd6dd9b0f91..d2831968736af3aa71264084a40be0f31e0f8296 100644 (file)
@@ -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": "c6d3e68e563d4b2ddb31505fc2d3b478",
+    "content-hash": "e28f08e0dd80e8d2c529f7e098d220ba",
     "packages": [
         {
             "name": "brick/math",
         },
         {
             "name": "cuyz/valinor",
-            "version": "1.14.1",
+            "version": "1.14.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/CuyZ/Valinor.git",
-                "reference": "12033fccdcc6afa7e73b3e234e4d6656530f2bcb"
+                "reference": "1881c77d555b00c2f969dfbbc2c7dbd939ae97ea"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/CuyZ/Valinor/zipball/12033fccdcc6afa7e73b3e234e4d6656530f2bcb",
-                "reference": "12033fccdcc6afa7e73b3e234e4d6656530f2bcb",
+                "url": "https://api.github.com/repos/CuyZ/Valinor/zipball/1881c77d555b00c2f969dfbbc2c7dbd939ae97ea",
+                "reference": "1881c77d555b00c2f969dfbbc2c7dbd939ae97ea",
                 "shasum": ""
             },
             "require": {
                 "infection/infection": "^0.27",
                 "marcocesarato/php-conventional-changelog": "^1.12",
                 "mikey179/vfsstream": "^1.6.10",
-                "phpstan/phpstan": "^1.3",
-                "phpstan/phpstan-phpunit": "^1.0",
-                "phpstan/phpstan-strict-rules": "^1.0",
+                "phpstan/phpstan": "^2.0",
+                "phpstan/phpstan-phpunit": "^2.0",
+                "phpstan/phpstan-strict-rules": "^2.0",
                 "phpunit/phpunit": "^10.5",
-                "rector/rector": "^1.0",
+                "rector/rector": "^2.0",
                 "vimeo/psalm": "^5.0"
             },
             "type": "library",
             ],
             "support": {
                 "issues": "https://github.com/CuyZ/Valinor/issues",
-                "source": "https://github.com/CuyZ/Valinor/tree/1.14.1"
+                "source": "https://github.com/CuyZ/Valinor/tree/1.14.2"
             },
             "funding": [
                 {
                     "type": "github"
                 }
             ],
-            "time": "2024-11-06T07:46:46+00:00"
+            "time": "2025-01-09T09:48:05+00:00"
         },
         {
             "name": "dragonmantank/cron-expression",
         },
         {
             "name": "laminas/laminas-progressbar",
-            "version": "2.14.0",
+            "version": "2.14.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/laminas/laminas-progressbar.git",
-                "reference": "cb87f8d9a252e9944a4a924b3a7ce1c6687c7007"
+                "reference": "f5180549455495dc10f4a5f34bfeef2013b141a4"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/laminas/laminas-progressbar/zipball/cb87f8d9a252e9944a4a924b3a7ce1c6687c7007",
-                "reference": "cb87f8d9a252e9944a4a924b3a7ce1c6687c7007",
+                "url": "https://api.github.com/repos/laminas/laminas-progressbar/zipball/f5180549455495dc10f4a5f34bfeef2013b141a4",
+                "reference": "f5180549455495dc10f4a5f34bfeef2013b141a4",
                 "shasum": ""
             },
             "require": {
                     "type": "community_bridge"
                 }
             ],
-            "time": "2024-10-11T10:58:38+00:00"
+            "abandoned": true,
+            "time": "2024-12-05T16:32:56+00:00"
         },
         {
             "name": "laminas/laminas-stdlib",
index 51e734a774b3ed9ca110a921cb40a74f8c7905c2..07b32ed6ef785f9e45e35a147183678dcbd788a8 100644 (file)
@@ -322,6 +322,7 @@ class InstalledVersions
         }
 
         $installed = array();
+        $copiedLocalDir = false;
 
         if (self::$canGetVendors) {
             foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
@@ -330,9 +331,11 @@ class InstalledVersions
                 } elseif (is_file($vendorDir.'/composer/installed.php')) {
                     /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
                     $required = require $vendorDir.'/composer/installed.php';
-                    $installed[] = self::$installedByVendor[$vendorDir] = $required;
-                    if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
-                        self::$installed = $installed[count($installed) - 1];
+                    self::$installedByVendor[$vendorDir] = $required;
+                    $installed[] = $required;
+                    if (strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
+                        self::$installed = $required;
+                        $copiedLocalDir = true;
                     }
                 }
             }
@@ -350,7 +353,7 @@ class InstalledVersions
             }
         }
 
-        if (self::$installed !== array()) {
+        if (self::$installed !== array() && !$copiedLocalDir) {
             $installed[] = self::$installed;
         }
 
index 3e00c77fa1a3d9800059053c2535c1f469796fec..0ab45fc931e4120163c96f24d7c806c43c1a25ff 100644 (file)
         },
         {
             "name": "cuyz/valinor",
-            "version": "1.14.1",
-            "version_normalized": "1.14.1.0",
+            "version": "1.14.2",
+            "version_normalized": "1.14.2.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/CuyZ/Valinor.git",
-                "reference": "12033fccdcc6afa7e73b3e234e4d6656530f2bcb"
+                "reference": "1881c77d555b00c2f969dfbbc2c7dbd939ae97ea"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/CuyZ/Valinor/zipball/12033fccdcc6afa7e73b3e234e4d6656530f2bcb",
-                "reference": "12033fccdcc6afa7e73b3e234e4d6656530f2bcb",
+                "url": "https://api.github.com/repos/CuyZ/Valinor/zipball/1881c77d555b00c2f969dfbbc2c7dbd939ae97ea",
+                "reference": "1881c77d555b00c2f969dfbbc2c7dbd939ae97ea",
                 "shasum": ""
             },
             "require": {
                 "infection/infection": "^0.27",
                 "marcocesarato/php-conventional-changelog": "^1.12",
                 "mikey179/vfsstream": "^1.6.10",
-                "phpstan/phpstan": "^1.3",
-                "phpstan/phpstan-phpunit": "^1.0",
-                "phpstan/phpstan-strict-rules": "^1.0",
+                "phpstan/phpstan": "^2.0",
+                "phpstan/phpstan-phpunit": "^2.0",
+                "phpstan/phpstan-strict-rules": "^2.0",
                 "phpunit/phpunit": "^10.5",
-                "rector/rector": "^1.0",
+                "rector/rector": "^2.0",
                 "vimeo/psalm": "^5.0"
             },
-            "time": "2024-11-06T07:46:46+00:00",
+            "time": "2025-01-09T09:48:05+00:00",
             "type": "library",
             "installation-source": "dist",
             "autoload": {
             ],
             "support": {
                 "issues": "https://github.com/CuyZ/Valinor/issues",
-                "source": "https://github.com/CuyZ/Valinor/tree/1.14.1"
+                "source": "https://github.com/CuyZ/Valinor/tree/1.14.2"
             },
             "funding": [
                 {
         },
         {
             "name": "laminas/laminas-progressbar",
-            "version": "2.14.0",
-            "version_normalized": "2.14.0.0",
+            "version": "2.14.1",
+            "version_normalized": "2.14.1.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/laminas/laminas-progressbar.git",
-                "reference": "cb87f8d9a252e9944a4a924b3a7ce1c6687c7007"
+                "reference": "f5180549455495dc10f4a5f34bfeef2013b141a4"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/laminas/laminas-progressbar/zipball/cb87f8d9a252e9944a4a924b3a7ce1c6687c7007",
-                "reference": "cb87f8d9a252e9944a4a924b3a7ce1c6687c7007",
+                "url": "https://api.github.com/repos/laminas/laminas-progressbar/zipball/f5180549455495dc10f4a5f34bfeef2013b141a4",
+                "reference": "f5180549455495dc10f4a5f34bfeef2013b141a4",
                 "shasum": ""
             },
             "require": {
             "suggest": {
                 "laminas/laminas-session": "To support progressbar persistent"
             },
-            "time": "2024-10-11T10:58:38+00:00",
+            "time": "2024-12-05T16:32:56+00:00",
             "type": "library",
             "installation-source": "dist",
             "autoload": {
                     "type": "community_bridge"
                 }
             ],
+            "abandoned": true,
             "install-path": "../laminas/laminas-progressbar"
         },
         {
             "install-path": "../willdurand/negotiation"
         }
     ],
-    "dev": false,
+    "dev": true,
     "dev-package-names": []
 }
index 9be4a878262ba7dad54a90431f43bf2e67d342fe..8985adda91f9c395ac34943a9997bb2793edba81 100644 (file)
@@ -3,17 +3,17 @@
         'name' => '__root__',
         'pretty_version' => '6.1.x-dev',
         'version' => '6.1.9999999.9999999-dev',
-        'reference' => 'd0f21942f2a92fa397acea1b42b2e552338c4f9a',
+        'reference' => '7e305277c70cb69c4d566d99c44eef497f6614a1',
         'type' => 'project',
         'install_path' => __DIR__ . '/../',
         'aliases' => array(),
-        'dev' => false,
+        'dev' => true,
     ),
     'versions' => array(
         '__root__' => array(
             'pretty_version' => '6.1.x-dev',
             'version' => '6.1.9999999.9999999-dev',
-            'reference' => 'd0f21942f2a92fa397acea1b42b2e552338c4f9a',
+            'reference' => '7e305277c70cb69c4d566d99c44eef497f6614a1',
             'type' => 'project',
             'install_path' => __DIR__ . '/../',
             'aliases' => array(),
@@ -29,9 +29,9 @@
             'dev_requirement' => false,
         ),
         'cuyz/valinor' => array(
-            'pretty_version' => '1.14.1',
-            'version' => '1.14.1.0',
-            'reference' => '12033fccdcc6afa7e73b3e234e4d6656530f2bcb',
+            'pretty_version' => '1.14.2',
+            'version' => '1.14.2.0',
+            'reference' => '1881c77d555b00c2f969dfbbc2c7dbd939ae97ea',
             'type' => 'library',
             'install_path' => __DIR__ . '/../cuyz/valinor',
             'aliases' => array(),
             'dev_requirement' => false,
         ),
         'laminas/laminas-progressbar' => array(
-            'pretty_version' => '2.14.0',
-            'version' => '2.14.0.0',
-            'reference' => 'cb87f8d9a252e9944a4a924b3a7ce1c6687c7007',
+            'pretty_version' => '2.14.1',
+            'version' => '2.14.1.0',
+            'reference' => 'f5180549455495dc10f4a5f34bfeef2013b141a4',
             'type' => 'library',
             'install_path' => __DIR__ . '/../laminas/laminas-progressbar',
             'aliases' => array(),
index 3113cb2f616609372998dda2ccdec90bb39ca401..f4181fe50157e7cb0490868ea654a89f8b5907f0 100644 (file)
     "require-dev": {
         "phpunit/phpunit": "^10.5",
         "infection/infection": "^0.27",
-        "phpstan/phpstan": "^1.3",
-        "phpstan/phpstan-strict-rules": "^1.0",
-        "phpstan/phpstan-phpunit": "^1.0",
+        "phpstan/phpstan": "^2.0",
+        "phpstan/phpstan-strict-rules": "^2.0",
+        "phpstan/phpstan-phpunit": "^2.0",
         "friendsofphp/php-cs-fixer": "^3.4",
         "marcocesarato/php-conventional-changelog": "^1.12",
         "vimeo/psalm": "^5.0",
         "mikey179/vfsstream": "^1.6.10",
-        "rector/rector": "^1.0"
+        "rector/rector": "^2.0"
     },
     "autoload": {
         "psr-4": {
index 632cb4bc6301160746788cf76e35eeafeaaed6b7..07d783a2c32fe9c092f28ee4ae809da2aa3dd6c9 100644 (file)
@@ -47,7 +47,7 @@ final class ApiAndInternalAnnotationCheck implements Rule
             return [
                 RuleErrorBuilder::message(
                     'Missing annotation `@api` or `@internal`.'
-                )->build(),
+                )->identifier('valinor.api_or_internal_annotation')->build(),
             ];
         }
 
index bfb6db151d7ee21da8c4069614346cda0b829311..1c028fb568ef9aa334f3dd4e9fc12c295bd7a2e4 100644 (file)
@@ -8,8 +8,6 @@ use CuyZ\Valinor\Mapper\ArgumentsMapper;
 use PhpParser\Node\Expr\MethodCall;
 use PHPStan\Analyser\Scope;
 use PHPStan\Reflection\MethodReflection;
-use PHPStan\Type\ClosureType;
-use PHPStan\Type\Constant\ConstantArrayType;
 use PHPStan\Type\Constant\ConstantArrayTypeBuilder;
 use PHPStan\Type\Constant\ConstantStringType;
 use PHPStan\Type\DynamicMethodReturnTypeExtension;
@@ -40,20 +38,18 @@ final class ArgumentsMapperPHPStanExtension implements DynamicMethodReturnTypeEx
 
         $type = $scope->getType($arguments[0]->value);
 
-        if ($type instanceof ClosureType) {
-            $parameters = $type->getParameters();
-        } elseif ($type instanceof ConstantArrayType) {
-            $acceptors = $type->getCallableParametersAcceptors($scope);
+        if (! $type->isCallable()->yes()) {
+            return new MixedType();
+        }
 
-            if (count($acceptors) !== 1) {
-                return new MixedType();
-            }
+        $acceptors = $type->getCallableParametersAcceptors($scope);
 
-            $parameters = $acceptors[0]->getParameters();
-        } else {
+        if (count($acceptors) !== 1) {
             return new MixedType();
         }
 
+        $parameters = $acceptors[0]->getParameters();
+
         $builder = ConstantArrayTypeBuilder::createEmpty();
 
         foreach ($parameters as $parameter) {
index 2b2f73431bda8a2f0b26b4b738c7d5421cfccd7e..2059a951458aaff8754536d491f317c494122738 100644 (file)
@@ -10,15 +10,13 @@ use PHPStan\Analyser\Scope;
 use PHPStan\PhpDoc\TypeStringResolver;
 use PHPStan\PhpDocParser\Parser\ParserException;
 use PHPStan\Reflection\MethodReflection;
-use PHPStan\Type\ClassStringType;
-use PHPStan\Type\Constant\ConstantStringType;
 use PHPStan\Type\DynamicMethodReturnTypeExtension;
-use PHPStan\Type\Generic\GenericClassStringType;
 use PHPStan\Type\MixedType;
-use PHPStan\Type\ObjectWithoutClassType;
 use PHPStan\Type\Type;
 use PHPStan\Type\UnionType;
 
+use function implode;
+
 final class TreeMapperPHPStanExtension implements DynamicMethodReturnTypeExtension
 {
     public function __construct(private TypeStringResolver $resolver) {}
@@ -60,16 +58,14 @@ final class TreeMapperPHPStanExtension implements DynamicMethodReturnTypeExtensi
 
     private function type(Type $type): Type
     {
-        if ($type instanceof GenericClassStringType) {
-            return $type->getGenericType();
+        if ($type->isClassString()->yes()) {
+            return $type->getClassStringObjectType();
         }
 
-        if ($type instanceof ConstantStringType) {
-            return $this->resolver->resolve($type->getValue());
-        }
+        if ($type->isConstantValue()->yes()) {
+            $value = implode('', $type->getConstantScalarValues());
 
-        if ($type instanceof ClassStringType) {
-            return new ObjectWithoutClassType();
+            return $this->resolver->resolve($value);
         }
 
         return new MixedType();
index 3eb2b1ceed142e79d35aeafd8e384213374c4f46..48cf225c59c3ba115f6120623fd4f44181bc629e 100644 (file)
@@ -10,7 +10,7 @@ use SimpleXMLElement;
 
 class ValinorPsalmPlugin implements PluginEntryPointInterface
 {
-    public function __invoke(RegistrationInterface $api, SimpleXMLElement $config = null): void
+    public function __invoke(RegistrationInterface $api, ?SimpleXMLElement $config = null): void
     {
         require_once __DIR__ . '/Plugin/TreeMapperPsalmPlugin.php';
         require_once __DIR__ . '/Plugin/ArgumentsMapperPsalmPlugin.php';
index 990c26203644722698b117c1913d1aa2055e65ab..9a7b44988c587650032c8febe5ff31794a6b4c78 100644 (file)
@@ -6,6 +6,7 @@ namespace CuyZ\Valinor\Definition\Repository\Cache\Compiler;
 
 use CuyZ\Valinor\Definition\Attributes;
 
+use function array_map;
 use function count;
 use function implode;
 use function is_array;
@@ -36,7 +37,15 @@ final class AttributesCompiler
 
         foreach ($attributes as $attribute) {
             $class = $this->classDefinitionCompiler->compile($attribute->class);
-            $arguments = $this->compileAttributeArguments($attribute->arguments);
+
+            if ($attribute->arguments === []) {
+                $arguments = '';
+            } else {
+                $arguments = implode(', ', array_map(
+                    fn (mixed $argument) => $this->compileAttributeArguments($argument),
+                    $attribute->arguments,
+                ));
+            }
 
             $attributesListCode[] = <<<PHP
             new \CuyZ\Valinor\Definition\AttributeDefinition(
@@ -49,27 +58,22 @@ final class AttributesCompiler
         return implode(', ', $attributesListCode);
     }
 
-    /**
-     * @param array<mixed> $arguments
-     */
-    private function compileAttributeArguments(array $arguments): string
+    private function compileAttributeArguments(mixed $value): string
     {
-        if (count($arguments) === 0) {
-            return '';
+        if (is_object($value)) {
+            return 'unserialize(' . var_export(serialize($value), true) . ')';
         }
 
-        $argumentsCode = [];
+        if (is_array($value)) {
+            $parts = [];
 
-        foreach ($arguments as $argument) {
-            if (is_object($argument)) {
-                $argumentsCode[] = 'unserialize(' . var_export(serialize($argument), true) . ')';
-            } elseif (is_array($argument)) {
-                $argumentsCode[] = '[' . $this->compileAttributeArguments($argument) . ']';
-            } else {
-                $argumentsCode[] = var_export($argument, true);
+            foreach ($value as $key => $subValue) {
+                $parts[] = var_export($key, true) . ' => ' . $this->compileAttributeArguments($subValue);
             }
+
+            return '[' . implode(', ', $parts) . ']';
         }
 
-        return implode(', ', $argumentsCode);
+        return var_export($value, true);
     }
 }
index 883d68f1f85e0070c3ae5b0c275b25ce57f6fd88..a56d6d59eff4de25238c664546c8d2358a347e6e 100644 (file)
@@ -46,7 +46,7 @@ final class ReflectionAttributesRepository implements AttributesRepository
         return array_values(array_map(
             fn (ReflectionAttribute $attribute) => new AttributeDefinition(
                 $this->classDefinitionRepository->for(new NativeClassType($attribute->getName())),
-                $attribute->getArguments(),
+                array_values($attribute->getArguments()),
             ),
             $attributes,
         ));
index 4749c708cba99f81247d47f50b889e1ec5e1af9c..ea4b5664e25e7c8d997082e8b10066d278b18d76 100644 (file)
@@ -31,7 +31,6 @@ final class ReflectionMethodDefinitionBuilder
 
     public function for(ReflectionMethod $reflection, ReflectionTypeResolver $typeResolver): MethodDefinition
     {
-        /** @var non-empty-string $name */
         $name = $reflection->name;
         $signature = $reflection->getDeclaringClass()->name . '::' . $reflection->name . '()';
 
index 84ae4212043e60f8171dd3fda30c817a67bd07b2..91de88c34052a0885c2e11abd14bc68ce78f356a 100644 (file)
@@ -94,9 +94,9 @@ final class ClassImportedTypeAliasResolver
 
             next($tokens);
 
-            /** @var int|null $key / Somehow PHPStan does not properly infer the key */
             $key = key($tokens);
 
+            // @phpstan-ignore identical.alwaysFalse (Somehow PHPStan does not properly infer the key)
             if ($key === null) {
                 continue;
             }
index dd57537f73a90061cb5b71576d9732905efd7003..973d0ef437f9070158e2158c8515550fa317ff08 100644 (file)
@@ -76,9 +76,9 @@ final class ClassLocalTypeAliasResolver
                 next($tokens);
             }
 
-            /** @var int|null $key / Somehow PHPStan does not properly infer the key */
             $key = key($tokens);
 
+            // @phpstan-ignore notIdentical.alwaysTrue (Somehow PHPStan does not properly infer the key)
             if ($key !== null) {
                 $aliases[$name] = $annotation->allAfter($key);
             }
index 028556c26abf6c0d31c4854db0b99cee0ca78f31..3196ff8d7148f7d81e2d28990e5e5a8c389d273b 100644 (file)
@@ -41,7 +41,7 @@ final class Settings
     /** @var CacheInterface<mixed> */
     public CacheInterface $cache;
 
-    /** @var non-empty-array<non-empty-string> */
+    /** @var non-empty-list<non-empty-string> */
     public array $supportedDateFormats = self::DEFAULT_SUPPORTED_DATETIME_FORMATS;
 
     public bool $enableFlexibleCasting = false;
index e12011bb38eb6a004c0d3bd34f192d17b228584e..8e1bde6f7d532123d23b6d756d5b7b9ea4fea8c4 100644 (file)
@@ -8,8 +8,6 @@ namespace CuyZ\Valinor\Mapper;
 interface ArgumentsMapper
 {
     /**
-     * @pure
-     *
      * @return array<string, mixed>
      *
      * @throws MappingError
index a9df7758acae7fb73b6f051a217ce30d3bd6eeea..d0026792afb4d29499876224862f07c2ab800791 100644 (file)
@@ -30,10 +30,11 @@ use DateTimeInterface;
  */
 final class DateTimeFormatConstructor
 {
-    /** @var non-empty-array<non-empty-string> */
+    /** @var non-empty-list<non-empty-string> */
     private array $formats;
 
     /**
+     * @no-named-arguments
      * @param non-empty-string $format
      * @param non-empty-string ...$formats
      */
index 862692868969a952db5f602c2e0f7ba68e911f78..7ab26dcae1bef0b148256334d24726414df3e149 100644 (file)
@@ -24,7 +24,7 @@ final class DateTimeObjectBuilderFactory implements ObjectBuilderFactory
 {
     public function __construct(
         private ObjectBuilderFactory $delegate,
-        /** @var non-empty-array<non-empty-string> */
+        /** @var non-empty-list<non-empty-string> */
         private array $supportedDateFormats,
         private FunctionDefinitionRepository $functionDefinitionRepository
     ) {}
index db1cc19dae3bcc6dc2210ab4303fbecfba666e63..1d36058e48bedfbf56d026a025516c21b14a5e20 100644 (file)
@@ -60,6 +60,7 @@ final class FunctionObjectBuilder implements ObjectBuilder
         $arguments = new MethodArguments($parameters, $arguments);
 
         try {
+            /** @var object */
             return ($this->function->callback)(...$arguments);
         } catch (Exception $exception) {
             throw UserlandError::from($exception);
index 71eb36d962fbb038245d432e1b0c3676c5c28d65..7a694ae7d04a9ac8156c4ce612ac7df985bd4179 100644 (file)
@@ -17,7 +17,7 @@ use function is_array;
  */
 final class PathMapping implements IteratorAggregate
 {
-    /** @var array<string, mixed> */
+    /** @var array<mixed> */
     private array $source;
 
     /**
index 9ca30d56ddc8ca694536650b08629a33ed6d8f3e..4495a10c6b34fe1016055785b28b7d904349e2c6 100644 (file)
@@ -6,7 +6,7 @@ namespace CuyZ\Valinor\Mapper\Tree\Message\Formatter;
 
 use CuyZ\Valinor\Mapper\Tree\Message\NodeMessage;
 
-use function is_callable;
+use function is_string;
 
 /**
  * Can be used to customize the content of messages added during a mapping.
@@ -74,7 +74,7 @@ final class MessageMapFormatter implements MessageFormatter
         $target = $this->target($message);
 
         if ($target) {
-            return $message->withBody(is_callable($target) ? $target($message) : $target);
+            return $message->withBody(is_string($target) ? $target : $target($message));
         }
 
         return $message;
index 2ad3ca934fbf68230f78159c9079fafca15a0add..060ff641aa11a63239f66cb5214a990e10f10a44 100644 (file)
@@ -69,6 +69,7 @@ final class TranslationMessageFormatter implements MessageFormatter
     public function withTranslations(array $translations): self
     {
         $clone = clone $this;
+        // @phpstan-ignore assign.propertyType (PHPStan does not properly infer the return type of the function)
         $clone->translations = array_replace_recursive($this->translations, $translations);
 
         return $clone;
index 943e1ed26d03bb29bc457b71a06095edfd15aa6e..e668aede69afc70e03786c4353d08612ebdba803 100644 (file)
@@ -46,16 +46,13 @@ final class MessageBuilder
      */
     public static function newError(string $body): self
     {
+        /** @var self<ErrorMessage> $instance */
         $instance = new self($body);
         $instance->isError = true;
 
-        /** @var self<ErrorMessage> */
         return $instance;
     }
 
-    /**
-     * @psalm-pure
-     */
     public static function from(Throwable $error): ErrorMessage
     {
         if ($error instanceof ErrorMessage) {
@@ -119,8 +116,6 @@ final class MessageBuilder
     }
 
     /**
-     * @psalm-pure
-     *
      * @return MessageType&HasCode&HasParameters
      */
     public function build(): Message&HasCode&HasParameters
@@ -175,11 +170,13 @@ final class MessageBuilder
 
             public function body(): string
             {
+                /** @var string */
                 return $this->message;
             }
 
             public function code(): string
             {
+                /** @var string */
                 return $this->code;
             }
 
index 05766eee7a2e577e50cfd0e5e6fa64f386e5c60a..33fa2addff846cb471a384c240e241d0f5bf8f28 100644 (file)
@@ -12,6 +12,7 @@ use Iterator;
 use IteratorAggregate;
 
 use function array_filter;
+use function array_values;
 use function count;
 
 /**
@@ -89,7 +90,9 @@ final class Messages implements IteratorAggregate, Countable
     public function errors(): self
     {
         $clone = clone $this;
-        $clone->messages = array_filter($clone->messages, fn (NodeMessage $message) => $message->isError());
+        $clone->messages = array_values(
+            array_filter($clone->messages, fn (NodeMessage $message) => $message->isError())
+        );
 
         return $clone;
     }
index fc76666cbaf06814ae587c74c8d2347a17eeff37..d66c081866f900d3a8a84813bc6a1769aa9f8f0b 100644 (file)
@@ -28,7 +28,7 @@ final class Node
 
     private bool $isValid = true;
 
-    /** @var array<NodeMessage> */
+    /** @var list<NodeMessage> */
     private array $messages = [];
 
     /** @var array<self> */
@@ -119,7 +119,7 @@ final class Node
     }
 
     /**
-     * @return array<NodeMessage>
+     * @return list<NodeMessage>
      */
     public function messages(): array
     {
index 8da44254844ea140695c752c076a057ad137dae1..503de2d4dddb9d5f7ca816f760f684b17c75afe3 100644 (file)
@@ -8,8 +8,6 @@ namespace CuyZ\Valinor\Mapper;
 interface TreeMapper
 {
     /**
-     * @pure
-     *
      * @template T of object
      *
      * @param string|class-string<T> $signature
index 465ec6249b6e7c94a64db5ac2dff8a94e0776403..d5b476467f4fdbfbb89afc7e8ec1b853f4bb0c8c 100644 (file)
@@ -24,7 +24,6 @@ final class TypeArgumentsMapper implements ArgumentsMapper
         private Settings $settings,
     ) {}
 
-    /** @pure */
     public function mapArguments(callable $callable, mixed $source): array
     {
         $function = $this->functionDefinitionRepository->for($callable);
index 6c0734ca90b428692875b7ed52647dbd30c68602..eb997694f46f99b5cce49cae3b8f55c8a4dc0a2d 100644 (file)
@@ -23,7 +23,6 @@ final class TypeTreeMapper implements TreeMapper
         private Settings $settings,
     ) {}
 
-    /** @pure */
     public function map(string $signature, mixed $source): mixed
     {
         $node = $this->node($signature, $source);
index 48ffecc21a08b0165237e0ac4deefc2d4b5174f4..9cc47e2ef4f173f52e48bb1007352ad1747f52ca 100644 (file)
@@ -15,6 +15,7 @@ use Psr\SimpleCache\CacheInterface;
 use Throwable;
 
 use function array_unique;
+use function array_values;
 use function is_callable;
 
 /** @api */
@@ -36,9 +37,6 @@ final class MapperBuilder
      * using the given source. These arguments can then be used to decide which
      * implementation should be used.
      *
-     * The callback *must* be pure, its output must be deterministic.
-     * @see https://en.wikipedia.org/wiki/Pure_function
-     *
      * Example:
      *
      * ```php
@@ -57,7 +55,6 @@ final class MapperBuilder
      * ```
      *
      * @param interface-string|class-string $name
-     * @psalm-param pure-callable $callback
      */
     public function infer(string $name, callable $callback): self
     {
@@ -86,9 +83,6 @@ final class MapperBuilder
      * needs to be handled as well, the name of the class must be given to this
      * method.
      *
-     * A constructor *must* be pure, its output must be deterministic.
-     * @see https://en.wikipedia.org/wiki/Pure_function
-     *
      * ```php
      * final class SomeClass
      * {
@@ -200,7 +194,6 @@ final class MapperBuilder
      *     ]);
      * ```
      *
-     * @psalm-param pure-callable|class-string ...$constructors
      * @param callable|class-string ...$constructors
      */
     public function registerConstructor(callable|string ...$constructors): self
@@ -238,7 +231,7 @@ final class MapperBuilder
     public function supportDateFormats(string $format, string ...$formats): self
     {
         $clone = clone $this;
-        $clone->settings->supportedDateFormats = array_unique([$format, ...$formats]);
+        $clone->settings->supportedDateFormats = array_values(array_unique([$format, ...$formats]));
 
         return $clone;
     }
@@ -298,7 +291,6 @@ final class MapperBuilder
 
     /**
      * @template T
-     * @psalm-param pure-callable(T): T $callback
      * @param callable(T): T $callback
      */
     public function alter(callable $callback): self
@@ -418,9 +410,6 @@ final class MapperBuilder
      * part of a query should never be allowed. Therefore, only an exhaustive
      * list of carefully chosen exceptions should be filtered.
      *
-     * The filter callback *must* be pure, its output must be deterministic.
-     * @see https://en.wikipedia.org/wiki/Pure_function
-     *
      * ```php
      * final class SomeClass
      * {
@@ -446,7 +435,6 @@ final class MapperBuilder
      *     ]);
      * ```
      *
-     * @psalm-param pure-callable(Throwable): ErrorMessage $filter
      * @param callable(Throwable): ErrorMessage $filter
      */
     public function filterExceptions(callable $filter): self
@@ -514,7 +502,6 @@ final class MapperBuilder
      *     ->normalize('Hello world'); // HELLO WORLD?!
      * ```
      *
-     * @psalm-param pure-callable|class-string $transformer
      * @param callable|class-string $transformer
      */
     public function registerTransformer(callable|string $transformer, int $priority = 0): self
index 33c591b1cf03a06ae341a4e3e580c36aeb2f9801..6a543f141c952ea79b46f34285c2f6c3aa619b84 100644 (file)
@@ -9,6 +9,7 @@ use CuyZ\Valinor\Normalizer\Transformer\EmptyObject;
 use Generator;
 
 use function array_is_list;
+use function assert;
 use function fwrite;
 use function is_array;
 use function is_bool;
@@ -83,6 +84,8 @@ final class JsonFormatter implements StreamFormatter
                 $isFirst = false;
 
                 if (! $isList) {
+                    assert(is_scalar($key));
+
                     $key = json_encode((string)$key, $this->jsonEncodingOptions);
 
                     $chunk .= $key . ':';
index 2525bd240e77a061e9e0e14329cc396cf17a0d96..a7280242a8b9d3b2806d1d4b037f8efb558736e6 100644 (file)
@@ -36,19 +36,19 @@ use const JSON_UNESCAPED_UNICODE;
 final class JsonNormalizer implements Normalizer
 {
     private const ACCEPTABLE_JSON_OPTIONS = JSON_FORCE_OBJECT
-    | JSON_HEX_QUOT
-    | JSON_HEX_TAG
-    | JSON_HEX_AMP
-    | JSON_HEX_APOS
-    | JSON_INVALID_UTF8_IGNORE
-    | JSON_INVALID_UTF8_SUBSTITUTE
-    | JSON_NUMERIC_CHECK
-    | JSON_PRETTY_PRINT
-    | JSON_PRESERVE_ZERO_FRACTION
-    | JSON_UNESCAPED_LINE_TERMINATORS
-    | JSON_UNESCAPED_SLASHES
-    | JSON_UNESCAPED_UNICODE
-    | JSON_THROW_ON_ERROR;
+        | JSON_HEX_QUOT
+        | JSON_HEX_TAG
+        | JSON_HEX_AMP
+        | JSON_HEX_APOS
+        | JSON_INVALID_UTF8_IGNORE
+        | JSON_INVALID_UTF8_SUBSTITUTE
+        | JSON_NUMERIC_CHECK
+        | JSON_PRETTY_PRINT
+        | JSON_PRESERVE_ZERO_FRACTION
+        | JSON_UNESCAPED_LINE_TERMINATORS
+        | JSON_UNESCAPED_SLASHES
+        | JSON_UNESCAPED_UNICODE
+        | JSON_THROW_ON_ERROR;
 
     private RecursiveTransformer $transformer;
 
@@ -152,7 +152,6 @@ final class JsonNormalizer implements Normalizer
     public function streamTo(mixed $resource): StreamNormalizer
     {
         // This check is there to help people that do not use static analyzers.
-        // @phpstan-ignore-next-line
         if (! is_resource($resource)) {
             throw new RuntimeException('Expected a valid resource, got ' . get_debug_type($resource));
         }
index 8f86c89f0399397c70150057faedab3d4413dfe2..9fcd87adacfbee7fddf98b194d48084ddd04070e 100644 (file)
@@ -35,6 +35,7 @@ final class KeyTransformersHandler
             }
         }
 
+        /** @var array-key */
         return $key;
     }
 
index ef42b56c388d58643dd5f14249dd9f7ceae5ad34..2b218271e02c315c1bfe413a318b85b3fe41e6cc 100644 (file)
@@ -33,6 +33,7 @@ final class ValueTransformersHandler
      */
     public function transform(mixed $value, array $attributes, array $transformers, callable $defaultTransformer): mixed
     {
+        /** @var array<mixed>|scalar|null */
         return call_user_func(
             $this->next($transformers, $value, $attributes, $defaultTransformer),
         );
index 8cc7fa659c3d1e2404c2ad42921fc571ead77b02..ca1b1d700cfff21c787d1974ebe8b7c89ceea2be 100644 (file)
@@ -90,8 +90,8 @@ final class Annotations
     }
 
     /**
-     * @param array<string> $array
-     * @return array<string>
+     * @param list<string> $array
+     * @return list<string>
      */
     private function trimArrayTips(array $array): array
     {
index 1199b3ef04a20a109327de490359e7db10f87a49..eb53a734e099d10ae263727c1bc76fbf5c468a15 100644 (file)
@@ -50,7 +50,6 @@ final class TokenStream
         return $type;
     }
 
-    /** @phpstan-impure */
     public function next(): Token
     {
         return $this->tokens[$this->peek + 1];
index a6971ae371b4563c78a1af544bb0f967c750a569..d164ec8fdea57a1a2bf4c613fac980ae1246f76e 100644 (file)
@@ -1,5 +1,10 @@
 # laminas-progressbar
 
+> [!CAUTION]
+> This package is **abandoned** and will receive no further development.
+>
+> See the Technical Steering Committee [meeting minutes](https://github.com/laminas/technical-steering-committee/blob/main/meetings/minutes/2024-11-04-TSC-Minutes.md#archive--abandon-various-legacy-libraries).
+
 > ## πŸ‡·πŸ‡Ί Π ΡƒΡΡΠΊΠΈΠΌ Π³Ρ€Π°ΠΆΠ΄Π°Π½Π°ΠΌ
 >
 > ΠœΡ‹, ΡƒΡ‡Π°ΡΡ‚Π½ΠΈΠΊΠΈ Laminas, Ρ€ΠΎΠ΄ΠΈΠ»ΠΈΡΡŒ ΠΈ ΠΆΠΈΠ²Π΅ΠΌ Π² Ρ€Π°Π·Π½Ρ‹Ρ… ΡΡ‚Ρ€Π°Π½Π°Ρ…. Π£ ΠΌΠ½ΠΎΠ³ΠΈΡ… ΠΈΠ· Π½Π°Ρ Π΅ΡΡ‚ΡŒ Π΄Ρ€ΡƒΠ·ΡŒΡ, Ρ€ΠΎΠ΄ΡΡ‚Π²Π΅Π½Π½ΠΈΠΊΠΈ ΠΈ ΠΊΠΎΠ»Π»Π΅Π³ΠΈ ΠΊΠ°ΠΊ Π² Π ΠΎΡΡΠΈΠΈ, Ρ‚Π°ΠΊ ΠΈ Π² Π£ΠΊΡ€Π°ΠΈΠ½Π΅. ΠΠ΅ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ ΠΈΠ· Π½Π°Ρ Ρ€ΠΎΠ΄ΠΈΠ»ΠΈΡΡŒ Π² Π ΠΎΡΡΠΈΠΈ. ΠΠ΅ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ ΠΈΠ· Π½Π°Ρ ΠΆΠΈΠ²ΡƒΡ‚ Π² Π ΠΎΡΡΠΈΠΈ. Π£ Π½Π΅ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Ρ… Π±Π°Π±ΡƒΡˆΠΊΠΈ ΠΈ Π΄Π΅Π΄ΡƒΡˆΠΊΠΈ ΡΡ€Π°ΠΆΠ°Π»ΠΈΡΡŒ Ρ Ρ„Π°ΡˆΠΈΡΡ‚Π°ΠΌΠΈ Π²ΠΎ Π’Ρ‚ΠΎΡ€ΠΎΠΉ ΠΌΠΈΡ€ΠΎΠ²ΠΎΠΉ Π²ΠΎΠΉΠ½Π΅. Π—Π΄Π΅ΡΡŒ Π½ΠΈΠΊΡ‚ΠΎ Π½Π΅ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΈΠ²Π°Π΅Ρ‚ Ρ„Π°ΡˆΠΈΠ·ΠΌ.
 >
 > You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!"
 
-> This package is considered feature-complete, and is now in **security-only** maintenance mode, following a [decision by the Technical Steering Committee](https://github.com/laminas/technical-steering-committee/blob/2b55453e172a1b8c9c4c212be7cf7e7a58b9352c/meetings/minutes/2020-08-03-TSC-Minutes.md#vote-on-components-to-mark-as-security-only).
-> If you have a security issue, please [follow our security reporting guidelines](https://getlaminas.org/security/).
-> If you wish to take on the role of maintainer, please [nominate yourself](https://github.com/laminas/technical-steering-committee/issues/new?assignees=&labels=Nomination&template=Maintainer_Nomination.md&title=%5BNOMINATION%5D%5BMAINTAINER%5D%3A+%7Bname+of+person+being+nominated%7D)
-
-[![Build Status](https://github.com/laminas/laminas-progressbar/workflows/Continuous%20Integration/badge.svg)](https://github.com/laminas/laminas-progressbar/actions?query=workflow%3A"Continuous+Integration")
-
 laminas-progressbar is a component to create and update progress bars in different
 environments. It consists of a single backend, which outputs the progress through
 one of the multiple adapters. On every update, it takes an absolute value and
@@ -39,9 +38,3 @@ $ composer require laminas/laminas-progressbar
 ## Documentation
 
 Browse the documentation online at https://docs.laminas.dev/laminas-progressbar/
-
-## Support
-
-- [Issues](https://github.com/laminas/laminas-progressbar/issues/)
-- [Chat](https://laminas.dev/chat/)
-- [Forum](https://discourse.laminas.dev/)
index 35a00367d1e9e2b3e4e0547e5471c3280e1f5a5f..9bfa5fdd963d74fd2c5156e952b10f53d5142fe1 100644 (file)
@@ -15,6 +15,7 @@
         "chat": "https://laminas.dev/chat",
         "forum": "https://discourse.laminas.dev"
     },
+    "abandoned": true,
     "config": {
         "sort-packages": true,
         "platform": {