Issue #3326371 by Spokje: [10.0.x backport] Fix PHPStan L1 error "Anonymous function has an unused use $foo."