Skip to content

Conversation

@xabbuh
Copy link
Member

@xabbuh xabbuh commented Nov 17, 2025

Q A
Branch? 7.4
Bug fix? yes
New feature? no
Deprecations? no
Issues
License MIT

tackling these issues reported by PHPStan:

 ------ --------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   config/reference.php                                                                                                                         
 ------ --------------------------------------------------------------------------------------------------------------------------------------------- 
  1339   Parameter #1 $config (array{'when@dev'?: array<string, array{alias: string, deprecated?: array{package: string, version: string, message?:   
         string}}|array{path: array<string, string>|string, controller?: string, methods?: list<string>|string, requirements?: array<string, string>  
         , defaults?: array<string, mixed>, options?: array<string, mixed>, host?: array<string, string>|string, schemes?: list<string>|string, ...}  
         |array{resource: string, type?: string, exclude?: list<string>|string, prefix?: array<string, string>|string, name_prefix?: string, trailin  
         g_slash_on_root?: bool, controller?: string, methods?: list<string>|string, ...}>, 'when@prod'?: array<string, array{alias: string, depreca  
         ted?: array{package: string, version: string, message?: string}}|array{path: array<string, string>|string, controller?: string, methods?: l  
         ist<string>|string, requirements?: array<string, string>, defaults?: array<string, mixed>, options?: array<string, mixed>, host?: array<str  
         ing, string>|string, schemes?: list<string>|string, ...}|array{resource: string, type?: string, exclude?: list<string>|string, prefix?: arr  
         ay<string, string>|string, name_prefix?: string, trailing_slash_on_root?: bool, controller?: string, methods?: list<string>|string, ...}>,   
         'when@test'?: array<string, array{alias: string, deprecated?: array{package: string, version: string, message?: string}}|array{path: array<  
         string, string>|string, controller?: string, methods?: list<string>|string, requirements?: array<string, string>, defaults?: array<string,   
         mixed>, options?: array<string, mixed>, host?: array<string, string>|string, schemes?: list<string>|string, ...}|array{resource: string, ty  
         pe?: string, exclude?: list<string>|string, prefix?: array<string, string>|string, name_prefix?: string, trailing_slash_on_root?: bool, con  
         troller?: string, methods?: list<string>|string, ...}>}) of method Symfony\Component\Routing\Loader\Configurator\Routes::config() should be  
          contravariant with parameter $config (array<string, array<string, array<int<0, max>|string, mixed>|bool|string>>) of method                 
         Symfony\Component\Routing\Loader\Configurator\RoutesReference::config()                                                                      
         🪪  method.childParameterType                                                                                                                
  1341   Method Symfony\Component\Routing\Loader\Configurator\Routes::config() should return array{'when@dev'?: array<string, array{alias: string,    
         deprecated?: array{package: string, version: string, message?: string}}|array{path: array<string, string>|string, controller?: string, meth  
         ods?: list<string>|string, requirements?: array<string, string>, defaults?: array<string, mixed>, options?: array<string, mixed>, host?: ar  
         ray<string, string>|string, schemes?: list<string>|string, ...}|array{resource: string, type?: string, exclude?: list<string>|string, prefi  
         x?: array<string, string>|string, name_prefix?: string, trailing_slash_on_root?: bool, controller?: string, methods?: list<string>|string,   
         ...}>, 'when@prod'?: array<string, array{alias: string, deprecated?: array{package: string, version: string, message?: string}}|array{path:  
         array<string, string>|string, controller?: string, methods?: list<string>|string, requirements?: array<string, string>, defaults?: array<st  
         ring, mixed>, options?: array<string, mixed>, host?: array<string, string>|string, schemes?: list<string>|string, ...}|array{resource: stri  
         ng, type?: string, exclude?: list<string>|string, prefix?: array<string, string>|string, name_prefix?: string, trailing_slash_on_root?: boo  
         l, controller?: string, methods?: list<string>|string, ...}>, 'when@test'?: array<string, array{alias: string, deprecated?: array{package:   
         string, version: string, message?: string}}|array{path: array<string, string>|string, controller?: string, methods?: list<string>|string, r  
         equirements?: array<string, string>, defaults?: array<string, mixed>, options?: array<string, mixed>, host?: array<string, string>|string,   
         schemes?: list<string>|string, ...}|array{resource: string, type?: string, exclude?: list<string>|string, prefix?: array<string, string>|st  
         ring, name_prefix?: string, trailing_slash_on_root?: bool, controller?: string, methods?: list<string>|string, ...}>} but returns array<str  
         ing, array<string, array<int<0, max>|string, mixed>|bool|string>>.                                                                           
         🪪  return.type                                                                                                                              
 ------ ---------------------------------------------------------------------------------------------------------------------------------------------

@nicolas-grekas
Copy link
Member

Isn't the cause of this phpstan not supporting ...<etc> shapes?

{ROUTES_TYPES}
final class Routes extends RoutesReference
final class Routes
Copy link
Member

Choose a reason for hiding this comment

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

I suggest removing the extends for AppReference also

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@nicolas-grekas
Copy link
Member

Thank you @xabbuh.

@nicolas-grekas nicolas-grekas merged commit 6f3c124 into symfony:7.4 Nov 20, 2025
13 of 14 checks passed
@xabbuh xabbuh deleted the pr-62129 branch November 20, 2025 12:54
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.

3 participants