Skip to content

Conversation

@priyadi
Copy link
Member

@priyadi priyadi commented Sep 18, 2025

No description provided.

Copilot AI review requested due to automatic review settings September 18, 2025 17:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds PHPStan annotations to suppress static analysis warnings related to array offset access operations. The changes focus on satisfying PHPStan's type checking requirements without modifying the actual code logic.

  • Added @phpstan-ignore offsetAccess.invalidOffset annotations to suppress PHPStan warnings
  • Updated existing doc blocks to include PHPStan suppressions alongside existing Psalm suppressions
  • Applied suppressions to array access operations that PHPStan cannot statically verify as safe

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Transformer/Trait/ArrayLikeTransformerTrait.php Added PHPStan suppression to existing doc block for array offset access
src/Transformer/Implementation/TraversableToArrayAccessTransformer.php Added inline PHPStan suppressions for array assignment and unset operations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +202 to 203
// @phpstan-ignore offsetAccess.invalidOffset
$target[$key] = $value;
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PHPStan suppression comment should use the standard doc block format /** @phpstan-ignore offsetAccess.invalidOffset */ instead of inline comment style to maintain consistency with the existing suppression in ArrayLikeTransformerTrait.php.

Copilot uses AI. Check for mistakes.
} else {
foreach ($target as $key => $value) {
if (!\in_array($value, $values, true)) {
// @phpstan-ignore offsetAccess.invalidOffset
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PHPStan suppression comment should use the standard doc block format /** @phpstan-ignore offsetAccess.invalidOffset */ instead of inline comment style to maintain consistency with the existing suppression in ArrayLikeTransformerTrait.php.

Suggested change
// @phpstan-ignore offsetAccess.invalidOffset
/** @phpstan-ignore offsetAccess.invalidOffset */

Copilot uses AI. Check for mistakes.
@priyadi priyadi merged commit 5aff2ab into main Sep 18, 2025
12 checks passed
@priyadi priyadi deleted the test/phpstan branch September 18, 2025 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants