Giter VIP home page Giter VIP logo

Comments (3)

samsonasik avatar samsonasik commented on May 24, 2024

The configure sample in markdown is removed because of buggy, ref rectorphp/rector-doctrine#238 (comment)

from rector.

TomasVotruba avatar TomasVotruba commented on May 24, 2024

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.

joachim-n avatar joachim-n commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.