Skip to content

Loadable classes not recognized since 2.1.34 release #14036

@mvorisek

Description

@mvorisek

Bug report

repro code: https://github.com/atk4/data + revert atk4/data@c9e180e workaround

broken since: Jan 19, 9:03 PM GMT+1 (Jan 19, 7:04 PM GMT+1 was still passing), so I guess it is caused by 2.1.34 release (Jan 19, 2026, 8:53 PM GMT+1)

I guess it is caused by https://github.com/atk4/data/blob/54c8a5e4a9/bootstrap-types.php file loaded using https://github.com/atk4/data/blob/6.0.0/composer.json#L71 .

This behaviour is wrong as the point of the boostrap code is to make autoload working for 2.x DBAL, but the class name (with different case) in the try block must not restrict the real loadable classes in actual case.

False positive phpstan output:

 ------ ---------------------------------------------------------------------- 
  Line   src/Persistence/Sql/DbalSchemaManagerFactory.php                      
 ------ ---------------------------------------------------------------------- 
  30     Class Doctrine\DBAL\Platforms\SQLitePlatform not found.               
         🪪  class.notFound                                                    
         💡  Learn more at https://phpstan.org/user-guide/discovering-symbols  
  31     Anonymous class extends unknown class                                 
         Doctrine\DBAL\Schema\SQLiteSchemaManager.                             
         💡  Learn more at https://phpstan.org/user-guide/discovering-symbols  
 ------ ---------------------------------------------------------------------- 
...

Code snippet that reproduces the problem

Not applicable, composer repro required.

Expected output

No phpstan error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions