- Issue created by @longwave
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Different set for me, on
b0ef5921b5fdc7575d9418db1ebefa1f90555da5
of Drupal core's11.1.x
branch:$ php vendor/bin/phpstan analyze modules/contrib/experience_builder --memory-limit=256M --configuration=modules/contrib/experience_builder/phpstan.neon -vvv Result cache not used because the metadata do not match: projectConfig, composerLocks, composerInstalled 306/306 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% 10 secs/10 secs Result cache is saved. ------ --------------------------------------- Line src/Plugin/BlockManager.php ------ --------------------------------------- 25 Plugin definitions cannot be altered. ------ --------------------------------------- ------ --------------------------------------- Line src/Plugin/ComponentPluginManager.php ------ --------------------------------------- 30 Plugin definitions cannot be altered. ------ --------------------------------------- ------ ------------------------------------------------------ Line tests/src/Kernel/ClientDataToEntityConverterTest.php ------ ------------------------------------------------------ 346 Plugin definitions cannot be altered. ------ ------------------------------------------------------ ------ --------------------------------------------------------------------- Line tests/src/Kernel/Entity/PageMetatagIntegrationTest.php ------ --------------------------------------------------------------------- 141 Function metatag_get_tags_from_route not found. 🪪 function.notFound 💡 Learn more at https://phpstan.org/user-guide/discovering-symbols ------ --------------------------------------------------------------------- ------ -------------------------------------------------------------------------------------------------------------------------------- Line tests/src/Unit/Access/XbHttpApiEligibleConfigEntityAccessCheckTest.php ------ -------------------------------------------------------------------------------------------------------------------------------- 26 Call to an undefined method Prophecy\Prophecy\ObjectProphecy<Drupal\Core\Routing\RouteMatchInterface>::getParameter(). 🪪 method.notFound 42 Call to an undefined method Prophecy\Prophecy\ObjectProphecy<Drupal\Core\Config\Entity\ConfigEntityTypeInterface>::getClass(). 🪪 method.notFound 45 Call to an undefined method Prophecy\Prophecy\ObjectProphecy<Drupal\Core\Entity\EntityTypeManagerInterface>::getDefinition(). 🪪 method.notFound ------ -------------------------------------------------------------------------------------------------------------------------------- ------ ------------------------------------------------------------------------------------------------------------------------------------------ Line tests/src/Unit/DataType/ComponentInputsTest.php ------ ------------------------------------------------------------------------------------------------------------------------------------------ 46 Call to an undefined method Prophecy\Prophecy\ObjectProphecy<Drupal\experience_builder\Plugin\DataType\ComponentTreeStructure>::getComponentId(). 🪪 method.notFound 47 Call to an undefined method Prophecy\Prophecy\ObjectProphecy<Drupal\experience_builder\Plugin\DataType\ComponentTreeStructure>::getComponentSource(). 🪪 method.notFound 50 Call to an undefined method Prophecy\Prophecy\ObjectProphecy<Drupal\experience_builder\Plugin\Field\FieldType\ComponentTreeItem>::get(). 🪪 method.notFound 51 Call to an undefined method Prophecy\Prophecy\ObjectProphecy<Drupal\experience_builder\Plugin\Field\FieldType\ComponentTreeItem>::onChange(). 🪪 method.notFound 68 Call to an undefined method Prophecy\Prophecy\ObjectProphecy<Drupal\experience_builder\Plugin\DataType\ComponentTreeStructure>::getComponentSource(). 🪪 method.notFound 69 Call to an undefined method Prophecy\Prophecy\ObjectProphecy<Drupal\experience_builder\ComponentSource\ComponentSourceInterface>::requiresExplicitInput(). 🪪 method.notFound 75 Call to an undefined method Prophecy\Prophecy\ObjectProphecy<Drupal\experience_builder\ComponentSource\ComponentSourceInterface>::requiresExplicitInput(). 🪪 method.notFound ------ ------------------------------------------------------------------------------------------------------------------------------------------ ------ ------------------------------------------------------------------------------------------------------------------------------------ Line tests/src/Unit/EntityHandlers/ContentCreatorVisibleXbConfigEntityAccessControlHandlerTest.php ------ ------------------------------------------------------------------------------------------------------------------------------------ 38 Call to an undefined method Prophecy\Prophecy\ObjectProphecy<Drupal\Core\Cache\Context\CacheContextsManager>::assertValidTokens(). 🪪 method.notFound 75 Call to an undefined method Prophecy\Prophecy\ObjectProphecy<Drupal\Core\Cache\Context\CacheContextsManager>::assertValidTokens(). 🪪 method.notFound ------ ------------------------------------------------------------------------------------------------------------------------------------ ------ ------------------------------------------------------------------------------------------------------------------------------------ Line tests/src/Unit/EntityHandlers/XbConfigEntityAccessControlHandlerTest.php ------ ------------------------------------------------------------------------------------------------------------------------------------ 35 Call to an undefined method Prophecy\Prophecy\ObjectProphecy<Drupal\Core\Cache\Context\CacheContextsManager>::assertValidTokens(). 🪪 method.notFound ------ ------------------------------------------------------------------------------------------------------------------------------------ [ERROR] Found 17 errors PHP runtime version: 8.3.19 PHP version for analysis: 8.3 (from config.platform.php in composer.json) PHPStan version: 1.12.12 PHPStan running from: /Users/wim.leers/core/vendor/phpstan/phpstan Extension installer: composer/composer: 2.8.3 composer/pcre: 3.3.2 mglaman/phpstan-drupal: 1.3.1 phpstan/phpstan-deprecation-rules: 1.2.1 phpstan/phpstan-phpunit: 1.4.1 Discovered Composer project root: /Users/wim.leers/core Parallel processing scheduler: # of detected CPU cores: 10 # of analysed files: 306 # of jobs: 16 # of spawned processes: 8 Elapsed time: 14 seconds Used memory: 1.52 GB wim.leers at MacBookPro-WimLeers in ~/core on 11.1.x* $ php vendor/bin/phpstan analyze modules/contrib/experience_builder --memory-limit=256M --configuration=modules/contrib/experience_builder/phpstan.neo
- 🇬🇧United Kingdom longwave UK
The issues in the IS are because I was still on 11.x instead of 11.1 after previously debugging a separate issue with @penyaskito.
I can fix the errors in #2 by upgrading everything and installing another package:
$ composer require --dev jangregor/phpstan-prophecy ... $ ../vendor/bin/phpstan analyze modules/contrib/experience_builder --memory-limit=256M --configuration=modules/contrib/experience_builder/phpstan.neon -vvv Result cache not used because the metadata do not match: projectConfig, composerLocks, composerInstalled 311/311 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% 16 secs/16 secs Result cache is saved. [OK] No errors PHP runtime version: 8.3.6 PHP version for analysis: 8.3.6 (from runtime) PHPStan version: 1.12.25 PHPStan running from: /home/dave/projects/xb/vendor/phpstan/phpstan Extension installer: composer/composer: 2.8.6 composer/pcre: 3.3.2 jangregor/phpstan-prophecy: 1.0.2 mglaman/phpstan-drupal: 1.3.7 phpstan/phpstan-deprecation-rules: 1.2.1 phpstan/phpstan-phpunit: 1.4.2 Discovered Composer project root: /home/dave/projects/xb Parallel processing scheduler: # of detected CPU cores: 14 # of analysed files: 311 # of jobs: 16 # of spawned processes: 8 Elapsed time: 17 seconds Used memory: 1.62 GB
@Wim can you try installing this and also running
composer update
to get the latest PHPStan and extensions? - 🇬🇧United Kingdom longwave UK
We should fix the errors in the IS over in 🐛 PHPUnit Next Major tests failing Active as I assume they will pop up on CI over there.
- 🇬🇧United Kingdom longwave UK
Bingo, same fails at https://git.drupalcode.org/project/experience_builder/-/jobs/5103955 - will continue over there
- 🇬🇧United Kingdom longwave UK
I currently get no errors on 11.1.2, 11.1.6 or 11.1.x-dev (which matches your commit hash).
Did you try
composer require --dev jangregor/phpstan-prophecy
?I also have Metatag in composer.json which is likely why I don't get the error about
metatag_get_tags_from_route
. - 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
I did not. I've been doing
composer require league/openapi-psr7-validator webflo/drupal-finder devizzent/cebe-php-openapi --dev
per our
CONTRIBUTING.md
.Just did that and … yep, that's it! So we just need to update our
CONTRIBUTING.md
! - @wim-leers opened merge request.
- 🇧🇪Belgium wim leers Ghent 🇧🇪🇪🇺
Just manually stepped through this multiple times, can confirm this makes it work reliably 👍 Thanks, @longwave!
-
wim leers →
committed 328b8a3c on 0.x
Issue #3521792 by wim leers, longwave: PHPStan errors when developing...
-
wim leers →
committed 328b8a3c on 0.x
Automatically closed - issue fixed for 2 weeks with no activity.