@@ -141,7 +141,7 @@ formatter
141141
142142# ## Sort all Use Statements
143143
144- You can sort your Use Statements in a very different ways. For this command you
144+ You can sort your Use Statements in different ways. For this command you
145145must provide as an argument the path where to look for the PHP files you want to
146146process.
147147
@@ -164,12 +164,12 @@ $ php-formatter formatter:use:sort src/ --dry-run
164164
165165# ### Group
166166
167- You can sort your Use statements using as many groups as yo want (***--group***).
167+ You can sort your Use statements using as many groups as you want (***--group***).
168168It means that you can group lines with same root (***Symfony\\***) in a specific
169169order.
170170
171171Common group is named `_main` and if is not specified, is placed in the
172- begining . You can define where to place this group with `--group` option
172+ beginning . You can define where to place this group with the `--group` option
173173
174174` ` ` bash
175175$ php-formatter formatter:use:sort src/ --group="Mmoreram" --group="_main" --group="Symfony"
@@ -191,6 +191,18 @@ use Symfony\AnotherClass;
191191As you can see, a blank line is placed between groups. If any group is defined,
192192one big group is created with all namespaces.
193193
194+ When using a `.formatter.yml` you can also specify subgroups by entering an array
195+
196+ ` ` ` yml
197+ use-sort:
198+ group:
199+ - [Symfony\C omponent\H ttpKernel, Symfony]
200+ - _main
201+ ` ` `
202+
203+ This will create a Symfony group placing all `Symfony\Component\HttpKernel` classes on top.
204+
205+
194206Finally, the `--group-type` defines if you want one `use` literal in every
195207namespace line
196208
@@ -210,7 +222,7 @@ use Mmoreram\MyClass;
210222use Mmoreram\M ySecondClass;
211223` ` `
212224
213- or if you want only one use for all group .
225+ or if you want only one use for all groups .
214226
215227` ` ` bash
216228$ php-formatter formatter:use:sort src/ --group="Mmoreram" --group-type="one"
@@ -302,7 +314,7 @@ use AnotherBundle\AnotherClass;
302314
303315# ## Fix all PHP headers
304316
305- You can define your PHP header in your `.formatter.yml` file an this command
317+ You can define your PHP header in your `.formatter.yml` file and this command
306318will check and fix that all PHP files have it properly.
307319
308320* command: `php-formatter formatter:header:fix`
@@ -311,7 +323,7 @@ will check and fix that all PHP files have it properly.
311323
312324# ### Dry run
313325
314- You can use this tool just to test the files will be modified, using option
326+ You can use this tool just to test the files will be modified, using the option
315327--dry-run
316328
317329` ` ` bash
0 commit comments