From c040d2ae74e70ce72f1d9e08d35283312542fc1e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 01:06:29 +0000 Subject: [PATCH 1/2] build(deps): bump gapple/structured-fields from 2.3.2 to 2.3.3 Bumps [gapple/structured-fields](https://github.com/gapple/structured-fields) from 2.3.2 to 2.3.3. - [Release notes](https://github.com/gapple/structured-fields/releases) - [Commits](https://github.com/gapple/structured-fields/compare/v2.3.2...v2.3.3) --- updated-dependencies: - dependency-name: gapple/structured-fields dependency-version: 2.3.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- composer.lock | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/composer.lock b/composer.lock index 218ad28ff..99e99bc47 100644 --- a/composer.lock +++ b/composer.lock @@ -958,16 +958,16 @@ }, { "name": "gapple/structured-fields", - "version": "v2.3.2", + "version": "v2.3.3", "source": { "type": "git", "url": "https://github.com/gapple/structured-fields.git", - "reference": "f753bf49ffccc44a1287706c4fab973ddf6e2f5f" + "reference": "4c6936249482d100cc56732aed8c163a76c10dd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/gapple/structured-fields/zipball/f753bf49ffccc44a1287706c4fab973ddf6e2f5f", - "reference": "f753bf49ffccc44a1287706c4fab973ddf6e2f5f", + "url": "https://api.github.com/repos/gapple/structured-fields/zipball/4c6936249482d100cc56732aed8c163a76c10dd3", + "reference": "4c6936249482d100cc56732aed8c163a76c10dd3", "shasum": "" }, "require": { @@ -976,12 +976,13 @@ "require-dev": { "httpwg/structured-field-tests": "*@dev", "paragonie/constant_time_encoding": "^3.0.0", + "phpcompatibility/php-compatibility": "^10@dev", "phpmd/phpmd": "^2.15", - "phpstan/phpstan": "^1.12", - "phpstan/phpstan-phpunit": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", "phpunit/phpunit": "^10.5", "slevomat/coding-standard": "^8.15", - "squizlabs/php_codesniffer": "^3.11" + "squizlabs/php_codesniffer": "^4.0" }, "type": "library", "extra": { @@ -1025,7 +1026,7 @@ "type": "ko_fi" } ], - "time": "2025-04-14T03:43:17+00:00" + "time": "2026-06-12T23:47:46+00:00" }, { "name": "giggsey/libphonenumber-for-php-lite", From 476cf9fa2d89e16b4719cd92b9afe2ec096f8463 Mon Sep 17 00:00:00 2001 From: nextcloud-command Date: Fri, 7 Aug 2026 13:12:03 +0000 Subject: [PATCH 2/2] chore(autoloader): Dump autoloader Signed-off-by: nextcloud-command --- composer/installed.json | 19 +++++++++--------- composer/installed.php | 6 +++--- gapple/structured-fields/src/InnerList.php | 3 +++ gapple/structured-fields/src/Item.php | 3 +++ gapple/structured-fields/src/Parser.php | 8 +++++++- gapple/structured-fields/src/Serializer.php | 22 ++++++++++++--------- 6 files changed, 39 insertions(+), 22 deletions(-) diff --git a/composer/installed.json b/composer/installed.json index 00439f648..c6dcb8f1a 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -994,17 +994,17 @@ }, { "name": "gapple/structured-fields", - "version": "v2.3.2", - "version_normalized": "2.3.2.0", + "version": "v2.3.3", + "version_normalized": "2.3.3.0", "source": { "type": "git", "url": "https://github.com/gapple/structured-fields.git", - "reference": "f753bf49ffccc44a1287706c4fab973ddf6e2f5f" + "reference": "4c6936249482d100cc56732aed8c163a76c10dd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/gapple/structured-fields/zipball/f753bf49ffccc44a1287706c4fab973ddf6e2f5f", - "reference": "f753bf49ffccc44a1287706c4fab973ddf6e2f5f", + "url": "https://api.github.com/repos/gapple/structured-fields/zipball/4c6936249482d100cc56732aed8c163a76c10dd3", + "reference": "4c6936249482d100cc56732aed8c163a76c10dd3", "shasum": "" }, "require": { @@ -1013,14 +1013,15 @@ "require-dev": { "httpwg/structured-field-tests": "*@dev", "paragonie/constant_time_encoding": "^3.0.0", + "phpcompatibility/php-compatibility": "^10@dev", "phpmd/phpmd": "^2.15", - "phpstan/phpstan": "^1.12", - "phpstan/phpstan-phpunit": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", "phpunit/phpunit": "^10.5", "slevomat/coding-standard": "^8.15", - "squizlabs/php_codesniffer": "^3.11" + "squizlabs/php_codesniffer": "^4.0" }, - "time": "2025-04-14T03:43:17+00:00", + "time": "2026-06-12T23:47:46+00:00", "type": "library", "extra": { "branch-alias": { diff --git a/composer/installed.php b/composer/installed.php index c0b1a2807..496d6373d 100644 --- a/composer/installed.php +++ b/composer/installed.php @@ -137,9 +137,9 @@ 'dev_requirement' => false, ), 'gapple/structured-fields' => array( - 'pretty_version' => 'v2.3.2', - 'version' => '2.3.2.0', - 'reference' => 'f753bf49ffccc44a1287706c4fab973ddf6e2f5f', + 'pretty_version' => 'v2.3.3', + 'version' => '2.3.3.0', + 'reference' => '4c6936249482d100cc56732aed8c163a76c10dd3', 'type' => 'library', 'install_path' => __DIR__ . '/../gapple/structured-fields', 'aliases' => array(), diff --git a/gapple/structured-fields/src/InnerList.php b/gapple/structured-fields/src/InnerList.php index 11a316024..7d713cc97 100644 --- a/gapple/structured-fields/src/InnerList.php +++ b/gapple/structured-fields/src/InnerList.php @@ -4,6 +4,9 @@ namespace gapple\StructuredFields; +/** + * @method array getValue() + */ class InnerList implements TupleInterface { use TupleTrait; diff --git a/gapple/structured-fields/src/Item.php b/gapple/structured-fields/src/Item.php index 6f11f7ac9..26d9df4e7 100644 --- a/gapple/structured-fields/src/Item.php +++ b/gapple/structured-fields/src/Item.php @@ -4,6 +4,9 @@ namespace gapple\StructuredFields; +/** + * @method mixed getValue() + */ class Item implements TupleInterface { use TupleTrait; diff --git a/gapple/structured-fields/src/Parser.php b/gapple/structured-fields/src/Parser.php index e678b57c9..d5390e717 100644 --- a/gapple/structured-fields/src/Parser.php +++ b/gapple/structured-fields/src/Parser.php @@ -219,7 +219,13 @@ private static function parseKey(ParsingInput $input): string private static function parseBoolean(ParsingInput $input): bool { $input->consumeChar('?'); - return match ($input->consumeChar()) { + $value = ''; + try { + $value = $input->consumeChar(); + } catch (\RuntimeException) { + // Consume may throw if value character is missing at end of string. Fall through to default error. + } + return match ($value) { '0' => false, '1' => true, default => throw new ParseException('Invalid boolean at position ' . $input->position()), diff --git a/gapple/structured-fields/src/Serializer.php b/gapple/structured-fields/src/Serializer.php index 35bce358e..de7d9d542 100644 --- a/gapple/structured-fields/src/Serializer.php +++ b/gapple/structured-fields/src/Serializer.php @@ -39,27 +39,27 @@ public static function serializeItem(mixed $value, ?object $parameters = null): } /** - * @param iterable $value + * @param iterable $value */ public static function serializeList(iterable $value): string { if ($value instanceof \Traversable) { - // @todo Checking for Traversable is not required for PHP ^8.2.0. $value = iterator_to_array($value); } $returnValue = array_map(function ($item) { - if ($item instanceof TupleInterface) { - $itemValue = $item->getValue(); - $itemParameters = $item->getParameters(); - } elseif (is_array($item) && count($item) === 2) { + if (is_array($item) && count($item) === 2) { $itemValue = $item[0]; $itemParameters = $item[1]; + } elseif ($item instanceof TupleInterface) { + $itemValue = $item->getValue(); + $itemParameters = $item->getParameters(); } else { throw new SerializeException("Invalid item in list"); } if (is_array($itemValue)) { + /** @var array $itemValue */ return self::serializeInnerList($itemValue, $itemParameters); } else { return self::serializeItem($itemValue, $itemParameters); @@ -73,8 +73,6 @@ public static function serializeList(iterable $value): string * Serialize an object as a dictionary. * * Either a Traversable object can be provided, or the public properties of the object will be extracted. - * - * @param Dictionary|object $value */ public static function serializeDictionary(object $value): string { @@ -84,6 +82,10 @@ public static function serializeDictionary(object $value): string $value = get_object_vars($value); } + /** + * @var string $key + * @var TupleInterface|list{TupleInterface|list{mixed,object}, object} $item + */ foreach ($value as $key => $item) { if (!empty($returnValue)) { $returnValue .= ', '; @@ -102,6 +104,7 @@ public static function serializeDictionary(object $value): string if ($itemValue === true) { $returnValue .= self::serializeParameters($itemParameters); } elseif (is_array($itemValue)) { + /** @var array $itemValue */ $returnValue .= '=' . self::serializeInnerList($itemValue, $itemParameters); } else { $returnValue .= '=' . self::serializeItem($itemValue, $itemParameters); @@ -189,7 +192,7 @@ private static function serializeDecimal(float $value): string // Casting to a string loses a digit on long numbers, but is preserved // by json_encode (e.g. 111111111111.111). - /** @var string $result */ + /** @var non-empty-string $result */ $result = json_encode(round($value, 3, PHP_ROUND_HALF_EVEN)); if (!str_contains($result, '.')) { @@ -250,6 +253,7 @@ private static function serializeParameters(object $value): string $value = get_object_vars($value); } + /** @var string $key */ foreach ($value as $key => $item) { $returnValue .= ';' . self::serializeKey($key);