Rector: Feature Request: Symfony Rector to make commands lazy

Created on 30 May 2019  路  7Comments  路  Source: rectorphp/rector

Most helpful comment

@TomasVotruba Check your email 馃槃

All 7 comments

What exactly that means for the command class?

  • remove $this->setName(X)
  • add static property $defalutName = X

@TomasVotruba Yes that would be the easiest approach.

So:

  • look for setName('command:doing:something') call or for parent::__construct('command:doing:something'); call (best on all files with name: *Command.php or something like that, eventually in given folders :) ),
  • extract that command:doing:something,
  • put protected static $defaultName = 'command:doing:something'; back into class,
  • remove calls to setName() if found,
  • remove argument from __construct call on parent: parent::__construct();

Nice list, thanks :)

Would you like to learn how to do it?

Following code in repository & example code in README, I was able to do step 1 & 5 but rest was black magic for me & I'm not sure I will have enough time for it.

But company for which I work for, may consider sponsoring this feature :)

But company for which I work for, may consider sponsoring this feature :)

That would be amazing. There 2 ways to sponsor - one time or Patreon:
https://github.com/rectorphp/rector/blob/master/README.md#sponsors

I think I could add sponsoring company to the @sponsorannotation to the class.

I'll prepare prototype today.

awesome!

@TomasVotruba Check your email 馃槃

Was this page helpful?
0 / 5 - 0 ratings