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

psalm 4.4.0 gives undefined variable errors inside psalm code #5010

Closed
thbley opened this issue Jan 14, 2021 · 2 comments
Closed

psalm 4.4.0 gives undefined variable errors inside psalm code #5010

thbley opened this issue Jan 14, 2021 · 2 comments

Comments

@thbley
Copy link
Contributor

thbley commented Jan 14, 2021

Psalm 4.4.0 gives these errors when running, 4.3.2 and 4.3.1 did not give these errors:

PHP Notice:  Undefined variable: result in phar:///usr/local/sbin/psalm_4400.phar/src/Psalm/Internal/ExecutionEnvironment/SystemCommandExecutor.php on line 25
Notice: Undefined variable: result in phar:///usr/local/sbin/psalm_4400.phar/src/Psalm/Internal/ExecutionEnvironment/SystemCommandExecutor.php on line 25
PHP Notice:  Undefined variable: returnValue in phar:///usr/local/sbin/psalm_4400.phar/src/Psalm/Internal/ExecutionEnvironment/SystemCommandExecutor.php on line 25
Notice: Undefined variable: returnValue in phar:///usr/local/sbin/psalm_4400.phar/src/Psalm/Internal/ExecutionEnvironment/SystemCommandExecutor.php on line 25
PHP Warning:  exec() has been disabled for security reasons in phar:///usr/local/sbin/psalm_4400.phar/src/Psalm/Internal/ExecutionEnvironment/SystemCommandExecutor.php on line 25
Warning: exec() has been disabled for security reasons in phar:///usr/local/sbin/psalm_4400.phar/src/Psalm/Internal/ExecutionEnvironment/SystemCommandExecutor.php on line 25
PHP Notice:  Undefined variable: returnValue in phar:///usr/local/sbin/psalm_4400.phar/src/Psalm/Internal/ExecutionEnvironment/SystemCommandExecutor.php on line 26
Notice: Undefined variable: returnValue in phar:///usr/local/sbin/psalm_4400.phar/src/Psalm/Internal/ExecutionEnvironment/SystemCommandExecutor.php on line 26
PHP Notice:  Undefined variable: returnValue in phar:///usr/local/sbin/psalm_4400.phar/src/Psalm/Internal/ExecutionEnvironment/SystemCommandExecutor.php on line 30
Notice: Undefined variable: returnValue in phar:///usr/local/sbin/psalm_4400.phar/src/Psalm/Internal/ExecutionEnvironment/SystemCommandExecutor.php on line 30

I'm using PHP 7.4.13 with disable_functions = "shell_exec,proc_open,passthru,highlight_file,system,popen,exec" in php.ini.

@thbley thbley changed the title psalm 4.4.0 gives psalm 4.4.0 gives undefined variable errors inside psalm code Jan 14, 2021
@thbley
Copy link
Contributor Author

thbley commented Jan 14, 2021

The code is trying to execute "git branch" from GitInfoCollector.php.

#0 src/Psalm/Internal/ExecutionEnvironment/GitInfoCollector.php(58): Psalm\Internal\ExecutionEnvironment\SystemCommandExecutor->execute()
#1 src/Psalm/Internal/ExecutionEnvironment/GitInfoCollector.php(44): Psalm\Internal\ExecutionEnvironment\GitInfoCollector->collectBranch()
#2 src/Psalm/IssueBuffer.php(548): Psalm\Internal\ExecutionEnvironment\GitInfoCollector->collect()
#3 src/psalm.php(807): Psalm\IssueBuffer::finish()

@muglug muglug closed this as completed in 080cf61 Jan 14, 2021
@muglug
Copy link
Collaborator

muglug commented Jan 14, 2021

Thanks! Psalm 4.4.1 is now released with a fix!

danog pushed a commit to danog/psalm that referenced this issue Jan 29, 2021
* fix vimeo#5010 function exec() is disabled

* Improve error message

Co-authored-by: Thomas Bley <thomas.bley@bringmeister.de>
Co-authored-by: Matthew Brown <github@muglug.com>
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