unfunco / phpspec-sort-use-statements
PhpSpec extension for sorting use statements in generated files.
Installs: 26 800
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
Requires
- php-64bit: >=7.1
- phpspec/phpspec: >=4.0
This package is not auto-updated.
Last update: 2020-01-19 01:34:44 UTC
README
- Are you working on a project with a namespace beginning with Q, R, S, T, U, V, W, X, Y, or Z?
- 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
Installation and beyond
Using Composer, 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:
<?php
namespace %namespace%;
%use%
final class %name% extends ObjectBehavior
{
function it_is_initializable()
{
$this->shouldHaveType(%subject_class%::class);
}
}
License
Copyright © 2018 Daniel Morris
Made available under the terms of the Apache License, Version 2.0.