mmoreram / php-formatter

PHP Formatter is a PHP developer friendly set of tools
MIT License
166 stars 17 forks source link

Feature request: Additional sorting functions #10

Closed hacfi closed 9 years ago

hacfi commented 9 years ago

I would like to suggest some new features for the sorter:

use-sort:
    group:
        - Symfony
        - _main
        - App
        - ['Sensio\Bundle\FrameworkExtraBundle\Configuration', 'JMS\DiExtraBundle\Annotation']
    group-type: each
    sort-type: alph
    sort-direction: asc

Wdyt @mmoreram ?

hacfi commented 9 years ago

So as this currently is string-based (and not with ReflectionClasses or a PHP token parser) I would only like to add sorting/grouping within a group. I’ll create a PR so allow those nested arrays.

hacfi commented 9 years ago

@mmoreram What do you think of 1. and 2.?

hacfi commented 9 years ago

Closing as 1. and 2. would require parsing the php code which isn’t part of the tool yet and I think makes everything too complicated.