Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpstan/extension-installer missing ? #421

Closed
dgoosens opened this issue Feb 8, 2022 · 3 comments
Closed

phpstan/extension-installer missing ? #421

dgoosens opened this issue Feb 8, 2022 · 3 comments

Comments

@dgoosens
Copy link
Contributor

dgoosens commented Feb 8, 2022

hi

I must be missing something...
but it appears to me the phpstan/extension-installer is missing...

I added symfony & doctrine params in the phpstan.neon

parameters:
    level: 6
    checkGenericClassInNonGenericObjectType: false
    paths:
        - src
        - tests
    symfony:
        containerXmlPath: var/cache/dev/Common_Infra_Symfony_KernelDevDebugContainer.xml
        consoleApplicationLoader: tests/phpstan/console-loader.php
    scanDirectories:
        - var/cache/dev/Symfony/Config
    doctrine:
        objectManagerLoader: tests/phpstan/doctrine-object-manager.php

(as you see, nothing fancy)

but if I invoke

docker run --init -it --rm -v "$(pwd):/project" -v "$(pwd)/tmp-phpqa:/tmp" -w /project jakzal/phpqa phpstan analyse -c phpstan.neon

I get

Invalid configuration:
Unexpected item 'parameters › symfony'.
Invalid configuration:
Unexpected item 'parameters › doctrine'.

I encounter the same problem if I install phpstan/phpstan, phpstan/phpstan-symfony & phpstan/phpstan-doctrine
It only works as expected when I also install phpstan/extension-installer

I'm pretty sure I'm the one who is doing something wrong...
But was not able yet to figure out what

Thanks a lot in advance
dGo

@dgoosens
Copy link
Contributor Author

dgoosens commented Feb 8, 2022

as I said... I was missing something

the procedure was indicated here: https://github.com/jakzal/phpqa#adding-phpstan-extensions

Just created a custom Dockerfile

FROM jakzal/phpqa:alpine

RUN composer global bin phpstan require phpstan/extension-installer

yet...
I'd argue that this extension should be shipped by default as the container does include the phpstan-symfony & phpstan-doctrine extensions and they both require the phpstant/extension-installer

@jakzal
Copy link
Owner

jakzal commented Feb 16, 2022

@dgoosens do you mind to send a pull request to include the extension installer?

@dgoosens
Copy link
Contributor Author

sure....
no problem

will do so asap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants