phpspec / prophecy

Highly opinionated mocking framework for PHP 5.3+
MIT License
8.53k stars 241 forks source link

PHP 8.4 support #624

Open andypost opened 5 months ago

andypost commented 5 months ago

I started testing Drupal 11 with PHP 8.4 and faced issues because of https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated

I did patch some code (will provide PR) but still getting deprecation warnings from mocks

Probably the \Prophecy\Doubler\ClassPatch\DisableConstructorPatch::apply() needs changes

    OK (6 tests, 154 assertions)

    Other deprecation notices (2)

      1x:
    Double\Drupal\Core\Cache\Context\CacheContextsManager\P1::__construct():
    Implicitly marking parameter $container as nullable is deprecated, the
    explicit nullable type must be used instead
        1x in VariationCacheTest::setUp from Drupal\Tests\Core\Cache

      1x:
    Double\Drupal\Core\Cache\Context\CacheContextsManager\P1::__construct():
    Implicitly marking parameter $contexts as nullable is deprecated, the
    explicit nullable type must be used instead
        1x in VariationCacheTest::setUp from Drupal\Tests\Core\Cache