- Issue created by @darvanen
- 🇮🇳India sayan_k_dutta
Adding the following code to .neon file of phpstan removes the error.
scanDirectories: - web/core - web/modules/custom - web/modules/contrib
- 🇦🇺Australia darvanen Sydney, Australia
Hi @sayan_k_dutta, welcome to the community, I see you're fairly new :)
The purpose of the PHPStan test is to ensure that the code we write is as type-safe as possible.
Can you explain why you made the change you did? Keep in mind that the error is pointing to a potential problem - the goal here is to fix any potential problems, not just to "remove" the error.
- 🇮🇳India sayan_k_dutta
Tried to figure out the cause of phpstan failure, but could not find the solution. Checked if the implemented interface is defined in the correct place or not and the module is installed or not.
- Assigned to koustav_mondal
- 🇮🇳India koustav_mondal Kolkata
@darvanen I also tried to reproduce the error. Got the following error but not able to reproduce the error that you mentioned.
------ ----------------------------------------------------------------------------------------------------- Line tests/src/Kernel/TokenFilterKernelTest.php ------ ----------------------------------------------------------------------------------------------------- :47 \Drupal calls should be avoided in classes, use dependency injection instead :identification_card: globalDrupalDependencyInjection.useDependencyInjection :55 Call to an undefined method Drupal\Tests\token_filter\Kernel\TokenFilterKernelTest::assertEquals(). :identification_card: method.notFound