phpstan: Major release in nette/bootstrap is crashing PHPStan

Summary of a problem

I just ran a composer update. Some packages were updated. Namely:

Package operations: 0 installs, 5 updates, 0 removals
  - Updating phpunit/phpunit (7.5.7 => 7.5.8): Loading from cache
  - Updating nette/utils (v2.5.3 => v3.0.1): Loading from cache
  - Updating nette/robot-loader (v3.1.1 => v3.2.0):  Checking out 0712a0e39a
  - Updating nette/di (v2.4.15 => v3.0.0-RC2): Loading from cache
  - Updating nette/bootstrap (v2.4.6 => v3.0.0): Loading from cache

After these upgrades, PHPStan stops running:

> php -d memory_limit=3G vendor/bin/phpstan analyse src -c phpstan.neon --level=7 --no-progress -vvv

In Expect.php line 378:
                                                                
  [Nette\DI\InvalidConfigurationException]                      
  Unexpected option 'services › relativePathHelper › factory'.  
                                                                

It seems the upgrade of package “nette/bootstrap” is causing the issue.

Both PHPStan 0.10 and 0.11 are affected.

The problem can be temporarily fixed by adding a stronger version constraint in composer.json:

{
      "require-dev" : {
        "nette/bootstrap": "^2.4.6"
    },
}

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 12
  • Comments: 16 (13 by maintainers)

Commits related to this issue

Most upvoted comments

I released RC3 with the fix, so it should work now.

@lookyman Good idea. The library that has a bug in the test version must be replaced. Anyone who makes a mistake in master should commit hara-kiri.

DI, bootstrap, config (neon) all go together. Anyway, there isn’t a reason to get rid of Nette. Bugs can happen to anyone and in combination with minimum-stability: dev, it’s the users that shoot themselves in the foot 😊

I prefer working on features tha find more bugs in code and make PHPStan smarter.

On Wed, 27 Mar 2019 at 08:27, Lukáš Unger notifications@github.com wrote:

I’m gonna play the devil’s advocate here for a moment and propose we move away from Nette entirely. We currently depend on 7 Nette packages.

nette/bootstrap nette/di nette/finder nette/neon nette/php-generator nette/robot-loader nette/utils

We could easily get rid of finder, robot-loader and utils. Neon can stay, so we don’t have to change configs. And if we were to adopt a different dependency injection container, bootstrap, di, and php-generator would all go in one swoop. Of course, this would be by far the most difficult part.

Thoughts?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/phpstan/phpstan/issues/2033#issuecomment-477013824, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGZuOXQ3lZJIoFb-RYD1Mb_ucDqlT2lks5vax1MgaJpZM4cLz0g .

Ondřej Mirtes

I just wanted to mention that this does seem to be fixed in nette/di dev-master, there just hasn’t been a release yet with that fix in it, so if minimum-stability is set to dev (even with prefer-stable set to true) v3.0.0-RC2 of nette/di is pulled down, which has the bug in it.

As others have mentioned, forcing nette/di to anything but v3.0.0-RC2 (many different ways to do that) will fix the issue.