archetype
archetype copied to clipboard
Rewrite StmtInserter
The method insertStmts method automatically sorts the nodes in a strange way.
Typically using ->add() will prepend the node among its equals. So the new use statement below will come out in the top:
PHPFile::load(User::class)
->add()->use(['Add\This']);
Improvements
- ability to bypass automatic sorting (for example put properties AFTER methods if you for some reason want to)
- ability to prepend and push among equals
- sorting styles (by length, alphabetically)