PHPackages                             unfunco/phpspec-sort-use-statements - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. unfunco/phpspec-sort-use-statements

AbandonedArchivedLibrary[Testing &amp; Quality](/categories/testing)

unfunco/phpspec-sort-use-statements
===================================

PhpSpec extension for sorting use statements in generated files.

0.1.1(7y ago)226.8kApache-2.0PHP

Since Jul 20Pushed 7y agoCompare

[ Source](https://github.com/unfunco/phpspec-sort-use-statements)[ Packagist](https://packagist.org/packages/unfunco/phpspec-sort-use-statements)[ RSS](/packages/unfunco-phpspec-sort-use-statements/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Sorted use statements for PhpSpec
=================================

[](#sorted-use-statements-for-phpspec)

1. Are you working on a project with a namespace beginning with Q, R, S, T, U, V, W, X, Y, or Z?
2. Do you like your use statements sorted alphabetically?

If you answered yes to both of those questions, this is the PhpSpec extension for you!

Requirements
------------

[](#requirements)

- [PHP version 7.1+](https://secure.php.net)
- [PhpSpec version 4.0+](https://github.com/phpspec/phpspec)

Installation and beyond
-----------------------

[](#installation-and-beyond)

Using [Composer](https://getcomposer.org), require this package as a development dependency:

```
$ composer require --dev unfunco/phpspec-sort-use-statements
```

…and enable the extension by adding the following to your `phpspec.yml`configuration.

```
extensions:
  Unfunco\PhpSpec\Extension\SortUseStatements: ~
```

Generate specifications as you normally would. If you are using a custom specification template, you can add `%use%` to your template to interpolate sorted `use` statements, as in this example:

```
