Skip to content

Conversation

@shakaran
Copy link

@shakaran shakaran commented Dec 9, 2025

Q A
Type improvement

Summary

Related #7248

This small PR fixes only this 2 warnings in this file:

vendor/bin/phpstan analyse --level=9 src/Cache/ArrayResult.php
Note: Using configuration file /home/shakaran/Documentos/ProjectsSSD/dbal/phpstan.neon.dist.
 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ---------------------------------------------------------------------------------------------- 
  Line   ArrayResult.php                                                                               
 ------ ---------------------------------------------------------------------------------------------- 
  124    Property Doctrine\DBAL\Cache\ArrayResult::$columnNames (list<string>) does not accept mixed.  
         🪪  assign.propertyType                                                                       
         💡  mixed is not a list.                                                                      
  124    Property Doctrine\DBAL\Cache\ArrayResult::$rows (list<list<mixed>>) does not accept mixed.    
         🪪  assign.propertyType                                                                       
         💡  mixed is not a list.                                                                      
 ------ ---------------------------------------------------------------------------------------------- 

This pull request makes a minor improvement to the type annotation in the docblock for the $data parameter of the __unserialize method in src/Cache/ArrayResult.php, providing a more precise description of the expected array structure.

}

/** @param mixed[] $data */
/** @param array{0: list<string>, 1: list<list<mixed>>} $data */
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/** @param array{0: list<string>, 1: list<list<mixed>>} $data */
/** @param array{list<string>, list<list<mixed>>} $data */

The keys are not necessary. Let's match the style we used in line 104.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed at 604bca2

@derrabus derrabus changed the title feat: resolve phpstan level 9 for array result Document array shape for ArrayResult::__unserialize() Dec 9, 2025
@derrabus derrabus added this to the 4.4.2 milestone Dec 9, 2025
@derrabus derrabus changed the base branch from 4.4.x to 4.5.x December 10, 2025 06:57
@derrabus derrabus modified the milestones: 4.4.2, 4.5.0 Dec 10, 2025
@derrabus derrabus merged commit e00a82e into doctrine:4.5.x Dec 10, 2025
128 checks passed
derrabus added a commit that referenced this pull request Dec 10, 2025
* 4.5.x:
  Document array shape for `ArrayResult::__unserialize()` (#7251)
  chore: show parameters in name of CI jobs
@shakaran shakaran deleted the feat/resolve-phpstan-level-9-array-result branch December 10, 2025 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants