Skip to content

Wrong namespace resolution with 0.12.38 #3776

@sirbaconjr

Description

@sirbaconjr

Bug report

I'm using nunomaduro/larastan, my phpstan/phpstan version was 0.12.38 and I got the following bug with namespace resolution.

------ ------------------------------------------------------------------ 
  Line   Domains/Mongo/MongoManager.php                                    
 ------ ------------------------------------------------------------------ 
  139    Method App\Domains\Mongo\MongoManager::executeBulkWrite() should  
         return MongoDB\Driver\WriteResult but returns                     
         _HumbugBoxadd759dbc574\MongoDB\Driver\WriteResult.                
  139    Parameter #2 $bulk of method                                      
         MongoDB\Driver\Manager::executeBulkWrite() expects                
         _HumbugBoxadd759dbc574\MongoDB\Driver\BulkWrite,                  
         MongoDB\Driver\BulkWrite given.                                   
 ------ ------------------------------------------------------------------

Solution for me was to rollback to version 0.12.37.

Code snippet that reproduces the problem

I managed to get a similar bug inside phpstan.org

https://phpstan.org/r/e1dde1d7-a8bb-4568-93d2-3cddcb814172

Expected output

No Errors!

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