Comments (3)
The configure sample in markdown is removed because of buggy, ref rectorphp/rector-doctrine#238 (comment)
from rector.
Hi @joachim-n , thanks for feedback. We had a configuration examples before, but it lead to miss-understandings, especially in the complex ones. Markdown generator can go wrong very easily.
The code is the documentaiton here. That's why we went with configure()
method convention. Every configurable rule has such a method, more complex accepting value objects. Those are designed to be explored in the IDE directly while writing rule configuration 👍
from rector.
Code is no substitute for documentation. For example, looking at ArgumentAdder:
public function __construct(string $class, string $method, int $position, ?string $argumentName = null, $argumentDefaultValue = null, ?\PHPStan\Type\Type $argumentType = null, ?string $scope = null)
{
$this->class = $class;
$this->method = $method;
$this->position = $position;
$this->argumentName = $argumentName;
$this->argumentDefaultValue = $argumentDefaultValue;
$this->argumentType = $argumentType;
$this->scope = $scope;
RectorAssert::className($class);
}
What does $scope do? What are the possible values?
What do you pass in for $argumentType?
Is $position 0- or 1-indexed?
How do you specify that there is no default value (turns out you can't -- I wasted time on that).
from rector.
Related Issues (20)
- Incorrect property type and default value in Doctrine Entity (Symfony) HOT 3
- Incorrect behavior of RenamePropertyToMatchTypeRector
- parent call to function replaced with null
- ReturnNeverTypeRector results in incompatible function signatures
- Skipper with match: */Expected* should not skip file named MatchParamTypeExpectedNameResolver.php HOT 3
- ReturnTypeFromStrictTypedCallRector infers static return type as static in caller
- fix invalid union return phpdocs with `void`. HOT 4
- can't set a new parameter to have no default value HOT 3
- PHP Fatal error: Uncaught Error: Typed static property RectorPrefix202312 HOT 2
- Incorrect behavior of SensitiveConstantNameRector, NullToStrictStringFuncCallArgRector HOT 1
- System error: "Scope not available on "PhpParser\Node\Expr\Array_" node, but is required by a refactorWithScope() method of "Rector\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector HOT 5
- Rector does not refactor PHP8.3 ldap_connect deprecated signature
- Wrong variable name replacement for `$this` HOT 1
- Rector fails to convert dataProvider annotation to #[DataProvider] attribute for PHPUnit 10 HOT 3
- The filename, directory name, or volume label syntax is incorrect. HOT 10
- Enum name in upper snake case instead of upper case [offering to help] HOT 4
- rector debug file HOT 1
- System error: Scope not available on PhpParser\Node\Expr\FuncCall node, but is required by a refactorWithScope() method HOT 1
- Incorrect behavior of TernaryFalseExpressionToIfRector
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 rector.