Comments (4)
No idea what you're talking about, can you provide an example?
from phpstan-nette.
a project which references class from a different package in a .neon file like e.g.
services:
-
class: Symplify\PHPStanRules\CognitiveComplexity\Rules\FunctionLikeCognitiveComplexityRule
tags: [phpstan.rules.rule]
arguments:
maxMethodCognitiveComplexity: 8
would be interessted whether the class Symplify\PHPStanRules\CognitiveComplexity\Rules\FunctionLikeCognitiveComplexityRule
is considered deprecated and might go away in a future release (or a alternative should be used).
when such file is only referenced in .neon files, noone see a error otherwise anywhere.
from phpstan-nette.
I know that people tend to do this and PHPStan more or less supports it, but the package author isn't free to change constructor arguments and add/remove/rename the classes. I'm careful with this in PHPStan itself but I don't want to ask this of other authors.
The longterm solution isn't to include rules in custom configs like this but instead take advantage of error identifiers (phpstan/phpstan#3065) to include/exclude rules in config.
Right now your only correct option is to use the whole package and ignore errors based on regexes in ignoreErrors
.
Another option is to contribute/ask for separate config parameter that would be used in conditionalTags
section like this:
parameters:
symplify:
functionLikeCognitiveComplexity: true
parametersSchema:
symplify:
structure([
functionLikeCognitiveComplexity: bool()
])
conditionalTags:
Symplify\PHPStanRules\CognitiveComplexity\Rules\FunctionLikeCognitiveComplexityRule:
phpstan.rules.rule: %symplify.functionLikeCognitiveComplexity%
services:
-
class: Symplify\PHPStanRules\CognitiveComplexity\Rules\FunctionLikeCognitiveComplexityRule
arguments:
maxMethodCognitiveComplexity: 8
(FYI I'd welcome these parameters in phpstan-strict-rules too.)
That way you'd be able to turn off this rule with these lines in your phpstan.neon:
parameters:
symplify:
functionLikeCognitiveComplexity: false
Another nice benefit is that you'd be able to use phpstan/extension-installer even if you don't want to use everyhing a package offers.
But if you include rule classes in your config like this I think it's right to expect it can break from time to time.
from phpstan-nette.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from phpstan-nette.
Related Issues (20)
- Resolving BaseControl in presenter HOT 3
- Weird PHPStan errors for renamed interfaces HOT 10
- Strings::match() should be checked for invalid regex HOT 4
- Call to undefined method Nette\Forms\Control HOT 9
- Access to an uninitialized property which is @inject-ed HOT 1
- PHPStan: Call to an undefined method Slince\Shopify\Client::methodName() HOT 2
- Checking links HOT 6
- Nette 3 redirect error HOT 5
- Nette forms callbacks HOT 2
- FatalError after composer update (last version of Nette\PhpGenerator) HOT 3
- Broken compatibility with Nette 2.x HOT 4
- Nette Tester Asserts HOT 6
- Presenter#sendResponse() is not taken as early terminating method call even it is stated in config file HOT 5
- RouteList does not accept Route HOT 10
- False positive on 0.12.15? HOT 8
- Missing dynamic return type for Nette\Http\Session::getSection() HOT 4
- Form events errors HOT 3
- [Security] Workflow release.yml is using vulnerable action metcalfc/changelog-generator HOT 1
- Dependency Dashboard
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-nette.