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

"Missing parameter 'value'" #3705

Closed
clxmstaab opened this issue Aug 4, 2020 · 8 comments
Closed

"Missing parameter 'value'" #3705

clxmstaab opened this issue Aug 4, 2020 · 8 comments

Comments

@clxmstaab
Copy link
Contributor

Bug report

starting the phpstan analysis I am running into a Missing parameter 'value' error which seems to be a phpstan internal problem.

$ vendor/bin/phpstan analyse -c application/rocket/phpstan.neon.dist --debug
PHP Fatal error:  Uncaught _HumbugBoxc7aa196c4c1e\Nette\InvalidArgumentException: Missing parameter 'value'. in phar://C:/Users/mstaab/Documents/GitHub/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan/vendor/nette/di/src/DI/Helpers.php:61
Stack trace:
#0 phar://C:/Users/mstaab/Documents/GitHub/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan/vendor/nette/di/src/DI/Helpers.php(33): _HumbugBoxc7aa196c4c1e\Nette\DI\Helpers::expand('#^Array has 3 d...', Array, true)
#1 phar://C:/Users/mstaab/Documents/GitHub/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan/vendor/nette/di/src/DI/Helpers.php(33): _HumbugBoxc7aa196c4c1e\Nette\DI\Helpers::expand(Array, Array, true)
#2 phar://C:/Users/mstaab/Documents/GitHub/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan/vendor/nette/di/src/DI/Helpers.php(33): _HumbugBoxc7aa196c4c1e\Nette\DI\Helpers::expand(Array, Array, true)
#3 phar://C:/Users/mstaab/Documents/GitHub/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan/vendor/nette/di/src/DI/Extensions/Parameter in phar://C:/Users/mstaab/Documents/GitHub/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan/vendor/nette/di/src/DI/Helpers.php on line 61
Fatal error: Uncaught _HumbugBoxc7aa196c4c1e\Nette\InvalidArgumentException: Missing parameter 'value'. in phar://C:/Users/mstaab/Documents/GitHub/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan/vendor/nette/di/src/DI/Helpers.php:61
Stack trace:
#0 phar://C:/Users/mstaab/Documents/GitHub/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan/vendor/nette/di/src/DI/Helpers.php(33): _HumbugBoxc7aa196c4c1e\Nette\DI\Helpers::expand('#^Array has 3 d...', Array, true)
#1 phar://C:/Users/mstaab/Documents/GitHub/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan/vendor/nette/di/src/DI/Helpers.php(33): _HumbugBoxc7aa196c4c1e\Nette\DI\Helpers::expand(Array, Array, true)
#2 phar://C:/Users/mstaab/Documents/GitHub/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan/vendor/nette/di/src/DI/Helpers.php(33): _HumbugBoxc7aa196c4c1e\Nette\DI\Helpers::expand(Array, Array, true)
#3 phar://C:/Users/mstaab/Documents/GitHub/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan/vendor/nette/di/src/DI/Extensions/Parameter in phar://C:/Users/mstaab/Documents/GitHub/daiber/vendor-bin/phpstan/vendor/phpstan/phpstan/phpstan/vendor/nette/di/src/DI/Helpers.php on line 61

my config is

includes:
    - phpstan-baseline.neon

parameters:
    level: 5
    paths:
        - .
        - ../../library/
        - ../../public/rocket/
    bootstrapFiles:
        - phpstan-bootstrap.php
    excludes_analyse:
        # ignore files which executed code when beeing included, instead of only defining logic
        - */config/*
        - */scripts/*

my env

vendor/bin/phpstan --version
PHPStan - PHP Static Analysis Tool 0.12.34


php -v
PHP 7.4.5 (cli) (built: Apr 14 2020 16:17:19) ( NTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
@mergeable
Copy link

mergeable bot commented Aug 4, 2020

This bug report is missing a link to reproduction on phpstan.org.
It will most likely be closed after manual review.

@ondrejmirtes
Copy link
Member

Hi, can you share your whole config including phpstan-baseline.neon? Looks like the problem is in line that starts with #^Array has 3 d.

@clxmstaab
Copy link
Contributor Author

thx for the feedback. above is already my whole config.

the baseline can be found here: https://gist.github.com/clxmstaab/79d88a8af61c4c07120de860f1051ba7

@clxmstaab
Copy link
Contributor Author

the file which the baseline errors relate to is part of the zend framework 1: https://github.com/zendframework/zf1/blob/master/resources/languages/de/Zend_Validate.php

@ondrejmirtes
Copy link
Member

ondrejmirtes commented Aug 4, 2020

You shouldn't analyse 3rd party source code you don't own: https://phpstan.org/user-guide/getting-started

You should only analyse files with the code you've written yourself. There's no need to analyse the vendor directory with 3rd party dependencies because it's not in your power to fix all the mistakes made by the developers you don't work with directly.
 Yes, PHPStan needs to know about all the classes, interfaces, traits, and functions your code uses, but that's achieved through discovering symbols, not by including the files in the analysis.

Looks like this is badly escaped, I'll look into it:

'\\\\'%value%\\\\'

@ondrejmirtes
Copy link
Member

Will be possible to fix this when this is released nette/di@6f1109c ❤️

@ondrejmirtes
Copy link
Member

Fixed: phpstan/phpstan-src@7336df1

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants