Skip to content

Commit

Permalink
Support for unsealed array shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
kukulich committed Jan 9, 2023
1 parent c51edb8 commit ff6072c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion SlevomatCodingStandard/Helpers/AnnotationTypeHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ public static function change(TypeNode $masterTypeNode, TypeNode $typeNodeToChan
$arrayShapeItemNodes[] = self::change($arrayShapeItemNode, $typeNodeToChange, $changedTypeNode);
}

return new ArrayShapeNode($arrayShapeItemNodes);
return new ArrayShapeNode($arrayShapeItemNodes, $masterTypeNode->sealed);
}

if ($masterTypeNode instanceof ArrayShapeItemNode) {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require": {
"php": "^7.2 || ^8.0",
"dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7",
"phpstan/phpdoc-parser": ">=1.15.0 <1.16.0",
"phpstan/phpdoc-parser": ">=1.15.2 <1.16.0",
"squizlabs/php_codesniffer": "^3.7.1"
},
"require-dev": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function returnsCallable()
/** @var array{int, DateTime} $arrayShape1 */
$arrayShape1 = [];

/** @var array{int: DateTime} $arrayShape2 */
/** @var array{int: DateTime, ...} $arrayShape2 */
$arrayShape2 = [];

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function returnsCallable()
/** @var array{int, \Foo\DateTime} $arrayShape1 */
$arrayShape1 = [];

/** @var array{int: \Foo\DateTime} $arrayShape2 */
/** @var array{int: \Foo\DateTime, ...} $arrayShape2 */
$arrayShape2 = [];

/**
Expand Down

0 comments on commit ff6072c

Please sign in to comment.