Comments (4)
HI @kanduvisla I would think the problem could be using the shim version. The readme of the GitHub repo sates that they are using a "prefixed" version, so I think the namespaces might be different.
Mind checking with the non-shim version?
from phpstan-magento.
I'll check if I can get it to work with the non-shim version. In the meanwhile I did manage to find a fix for this issue when using the shim. I'm not sure if it's the best fix, but it might help others experiencing the same issue:
I've create a new file in the root of my module called phpstan.php
:
<?php
declare(strict_types=1);
use bitExpert\PHPStan\Magento\Autoload\Autoloader;
// Since we're using the PHPStan Shim, we need to write a fix for the
// autoloader hack as defined by bitExpert/phpstan-magento:
Autoloader::register();
And in my phpstan.neon
I've added the following line:
parameters:
autoload_files:
- phpstan.php
from phpstan-magento.
I've tested with the non-shim version and I can confirm that works fine without the fix. So this is an issue caused by using the shim. I think this ticket can be closed now.
The only thing I can think of is to add an update to the README for known issues when using the shim (and perhaps suggest this fix?)
from phpstan-magento.
Mind providing a fix for the readme then? ;)
from phpstan-magento.
Related Issues (20)
- No coverage data is *not* sent to Coveralls
- Certain CI steps run several times without additional result HOT 1
- Move stubs out of src/ HOT 6
- DateTimeFactory Issue; HOT 6
- Use Magento root for TestFrameworkAutoloader HOT 8
- Project config file at path app/code/Vendor/Module does not exist. HOT 5
- Factory generation misnames output class HOT 4
- Current release version not updated HOT 5
- Wrong directory used as "magentoRoot" when current working direcory is not magento root HOT 2
- private string $magentoRoot; not work in PHP 7.2 HOT 4
- Generated class ProductExtension is passed on incorrectly to phpstan HOT 30
- Missing Interface class HOT 9
- Add support for PHP 8.2 HOT 3
- Compatibility with PHPstan 1.10.x HOT 4
- Failure with `phpstan/phpstan-phpunit` and PHPStan cache usage HOT 19
- Version 0.30.0 fails with errors about unexpected items in parameters HOT 4
- Extend ci_neon_lint script to validate parametersSchema
- Incompatibility with phpstan & rector and 2.4.6 HOT 1
- Internal error: Class\Foo does not exist and has no extension interface in file class.php HOT 2
- Occasional Errors In Pipeline HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpstan-magento.