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

Most upvoted comments

It’s solved on Composer v1 too thanks to the other commit.

Thanks for the heads-up, the following worked now:

composer req --dev phpstan/phpstan "dev-master#84d77fec170663d7ef2f48fa73fda67e5cd747f8"

👍

You can depend on dev-master, or wait a few days 😃

(Composer patching fails due to src VS phar and dev-master runs into a timeout …)

I don’t understand what problem are you referring to.

I confirm that PHPStan’s dev-master can analyse the phpstan-typo3 repo even with Composer v1, thanks to this commit https://github.com/phpstan/phpstan-src/commit/d1990b804a997af97573dcb9172832b53592a407