phpstan: 0.12.26+: [autoload_files] typo3/cms-core: Could not read file: .../vendor/typo3/cms-core/Resources/PHP/GlobalDebugFunctions.php
Bug report
https://packagist.org/packages/typo3/cms-core contains an autoload-file: Resources/PHP/GlobalDebugFunctions.php.
But Typo3 comes with a composer-plugin, which moves files to a different direcotry (public/typo3/sysext/ instead of vendor/typo3/).
The plugin alters composer autoload correctly. require "vendor/autoload.php"; works flawless, but phpstan ^0.12.26 doesn’t.
It tries to require the file without respecting vendor/composer/autoload_files.php.
Code snippet that reproduces the problem
composer.json:
"require": {
"typo3/cms-core": "*",
}
helloworld.php:
<?php
Actual output
------ ------------------------------------------------------------------------------------------------------------------------------
Line helloworld.php
------ ------------------------------------------------------------------------------------------------------------------------------
Could not read file:
.../vendor/typo3/cms-core/Resources/PHP/GlobalDebugFunctions.php
------ ------------------------------------------------------------------------------------------------------------------------------
Expected output
[OK] No errors
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 4
- Comments: 17 (10 by maintainers)
Commits related to this issue
- fix(phpstan): 插件目录不在 vendor 中会提示 Could not read file https://github.com/phpstan/phpstan/issues/3426 — committed to miaoxing/dev by twinh 4 years ago
It’s solved on Composer v1 too thanks to the other commit.
Thanks for the heads-up, the following worked now:
👍
You can depend on dev-master, or wait a few days 😃
I don’t understand what problem are you referring to.
I confirm that PHPStan’s dev-master can analyse the
phpstan-typo3repo even with Composer v1, thanks to this commit https://github.com/phpstan/phpstan-src/commit/d1990b804a997af97573dcb9172832b53592a407