Closed apss-pohl closed 7 months ago
Which version are you using? The -c parameter should specify the config file.
I am working on ubuntu linux
Ah I meant the version of the PHPStan program itself. What version is that?
sure:
"name": "phpstan/phpstan",
"version": "1.10.63",
i might have messed up with the php executable. After a fresh restart of vscode the message disappeared. Unfortunately a new one came up:
[client] Starting extension with configuration: {
"binPath": "./bin/library-dev/vendor/bin/phpstan",
"binCommand": [],
"configFile": "phpstan.neon,phpstan.neon.dist,phpstan.dist.neon",
"rootDir": "",
"options": [],
"enableStatusBar": true,
"memoryLimit": "1G",
"enabled": true,
"projectTimeout": 300000,
"suppressTimeoutMessage": false,
"paths": {},
"showProgress": true,
"enableLanguageServer": true,
"ignoreErrors": [],
"suppressWorkspaceMessage": false,
"pro": false,
"proTmpDir": "",
"checkValidity": false
}
[client] Initializing done
[client] Showing one-time messages (if needed)
[server] Language server ready
[server] Language server started
[file-watcher] New document active (file:///mnt/share/dev/code/freeclimber-gtk3/ka/module/bill/func_bill.php), triggering
[check:1] Check started for project
[status-bar] Showing status bar
[server] PHPStan version: PHPStan - PHP Static Analysis Tool 1.10.63
[check:1] Spawning PHPStan with the following configuration: {"binStr":"/mnt/share/dev/code/freeclimber-gtk3/bin/library-dev/vendor/bin/phpstan","args":["analyse","-c","/mnt/share/dev/code/freeclimber-gtk3/phpstan.neon","--error-format=json","--no-interaction","--memory-limit=1G","-a","/home/sven/.vscode/extensions/sanderronde.phpstan-vscode-3.1.1/_config/autoload.php","-c","/home/sven/.vscode/extensions/sanderronde.phpstan-vscode-3.1.1/_config/config.neon"]}
[process-spawner] Spawning process 146446 with timeout 900000
[check:1] PHPStan process exited with error filteredErr=PHP Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /home/sven/.vscode/extensions/sanderronde.phpstan-vscode-3.1.1/_config/TreeFetcher.php on line 202
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /home/sven/.vscode/extensions/sanderronde.phpstan-vscode-3.1.1/_config/TreeFetcher.php on line 202 rawErr=PHP Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR) in /home/sven/.vscode/extensions/sanderronde.phpstan-vscode-3.1.1/_config/TreeFetcher.php on line 202
I am on a php 7.4 project, therefore this will not work:
$scope->getClassReflection()?->getName(),
However i also have php 8 available. Should i configure the extension to use this? Is it is possible?
Can you disable the languageServer setting? (i think it should be disabled by default). That should fix the issue
I managed that php 8 is used, everything working fine now. Maybe an option to configure the executable would be a nice to have.
Thank you and sorry for confusion!
You can configure the executable using the phpstan.binCommand
setting, you can use that to run anything you want (so ['/bin/php8', 'vendor/bin/phpstan']
etc :)
No worries, glad you were able to figure it out.
I cant get it working, i always fail with:
But
works perfectly fine. What could be the issue?