Slamdunk / phpstan-laminas-framework

Laminas Framework 3 extensions for PHPStan
MIT License
16 stars 10 forks source link

Helpers are not loaded #44

Open juizmill opened 1 year ago

juizmill commented 1 year ago

I don't know why but it's not loading some helpers.

Is there something I should configure?

image

.neon

image

service-manager.php

image

Slamdunk commented 1 year ago

I can't tell without the access on the whole project, and I don't want it.

Run PHPStan in debug mode with no parallel processing and try to figure it out. If you find any big in this repo, any PR is welcome.

juizmill commented 1 year ago

I noticed that it is correctly loading the helpers of Laminas but the ones I did are not being loaded for phpstan

I'm following the Laminas documentation https://docs.laminas.dev/laminas-view/helpers/advanced-usage/

Does anyone have any tips?

earthiverse commented 8 months ago

I had a similar problem.

I had code that had something like this in the config (which works fine in production):

[
    'factories' => [
        'SchemeInputManager' => SchemeInputManagerFactory::class,
    ],
];

Using the class string in factories, and adding the previous string to aliases fixed it.

[
    'aliases' => [
        'SchemeInputManager' => SchemeInputManager::class,
    ],
    'factories' => [
        SchemeInputManager::class => SchemeInputManagerFactory::class,
    ],
];