From d8666c8abf00a30cdf6218e28f12590ca561b2b0 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Fri, 3 Feb 2023 12:55:01 +0000 Subject: [PATCH] chore: coding style changes --- src/Actions/LoadStructure.php | 5 ++--- src/Concerns/Testable.php | 3 +-- src/Console/Command.php | 4 ++-- src/Laravel/Commands/PestDatasetCommand.php | 3 +-- src/Laravel/Commands/PestInstallCommand.php | 3 +-- src/Laravel/Commands/PestTestCommand.php | 3 +-- src/Logging/JUnit.php | 15 +++++---------- src/Logging/TeamCity.php | 10 +++------- src/Plugins/Version.php | 3 +-- src/Support/HigherOrderMessage.php | 5 ++--- tests/PHPUnit/CustomTestCase/CustomTestCase.php | 4 ++-- tests/PHPUnit/CustomTestCase/ExecutedTest.php | 4 ++-- tests/Unit/Plugins/Version.php | 3 +-- 13 files changed, 24 insertions(+), 41 deletions(-) diff --git a/src/Actions/LoadStructure.php b/src/Actions/LoadStructure.php index e065dc09..4af060bd 100644 --- a/src/Actions/LoadStructure.php +++ b/src/Actions/LoadStructure.php @@ -5,13 +5,12 @@ declare(strict_types=1); namespace Pest\Actions; use Pest\Support\Str; - -use function Pest\testDirectory; - use PHPUnit\Util\FileLoader; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; +use function Pest\testDirectory; + /** * @internal */ diff --git a/src/Concerns/Testable.php b/src/Concerns/Testable.php index ba4c7387..be0b6264 100644 --- a/src/Concerns/Testable.php +++ b/src/Concerns/Testable.php @@ -9,11 +9,10 @@ use Pest\Support\ChainableClosure; use Pest\Support\ExceptionTrace; use Pest\TestSuite; use PHPUnit\Framework\ExecutionOrderDependency; +use Throwable; use function sprintf; -use Throwable; - /** * To avoid inheritance conflicts, all the fields related * to Pest only will be prefixed by double underscore. diff --git a/src/Console/Command.php b/src/Console/Command.php index cf153247..f8e1f396 100644 --- a/src/Console/Command.php +++ b/src/Console/Command.php @@ -4,8 +4,6 @@ declare(strict_types=1); namespace Pest\Console; -use function is_dir; - use Pest\Actions\AddsDefaults; use Pest\Actions\AddsTests; use Pest\Actions\InteractsWithPlugins; @@ -20,6 +18,8 @@ use PHPUnit\TextUI\TestRunner; use SebastianBergmann\FileIterator\Facade as FileIteratorFacade; use Symfony\Component\Console\Output\OutputInterface; +use function is_dir; + /** * @internal */ diff --git a/src/Laravel/Commands/PestDatasetCommand.php b/src/Laravel/Commands/PestDatasetCommand.php index 399611e1..7f12b11a 100644 --- a/src/Laravel/Commands/PestDatasetCommand.php +++ b/src/Laravel/Commands/PestDatasetCommand.php @@ -8,11 +8,10 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\File; use Illuminate\Support\Str; use Pest\Exceptions\InvalidConsoleArgument; +use Pest\TestSuite; use function Pest\testDirectory; -use Pest\TestSuite; - /** * @internal */ diff --git a/src/Laravel/Commands/PestInstallCommand.php b/src/Laravel/Commands/PestInstallCommand.php index fb6275ce..b1a472d9 100644 --- a/src/Laravel/Commands/PestInstallCommand.php +++ b/src/Laravel/Commands/PestInstallCommand.php @@ -8,11 +8,10 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\File; use Pest\Console\Thanks; use Pest\Exceptions\InvalidConsoleArgument; +use Pest\TestSuite; use function Pest\testDirectory; -use Pest\TestSuite; - /** * @internal */ diff --git a/src/Laravel/Commands/PestTestCommand.php b/src/Laravel/Commands/PestTestCommand.php index aa67459e..3e14a998 100644 --- a/src/Laravel/Commands/PestTestCommand.php +++ b/src/Laravel/Commands/PestTestCommand.php @@ -8,11 +8,10 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\File; use Pest\Exceptions\InvalidConsoleArgument; use Pest\Support\Str; +use Pest\TestSuite; use function Pest\testDirectory; -use Pest\TestSuite; - /** * @internal */ diff --git a/src/Logging/JUnit.php b/src/Logging/JUnit.php index 2c75cde3..fd7c95cf 100644 --- a/src/Logging/JUnit.php +++ b/src/Logging/JUnit.php @@ -12,15 +12,9 @@ declare(strict_types=1); namespace Pest\Logging; -use function class_exists; - use DOMDocument; use DOMElement; use Exception; - -use function get_class; -use function method_exists; - use Pest\Concerns\Testable; use PHPUnit\Framework\AssertionFailedError; use PHPUnit\Framework\ExceptionWrapper; @@ -35,12 +29,13 @@ use PHPUnit\Util\Printer; use PHPUnit\Util\Xml; use ReflectionClass; use ReflectionException; - -use function sprintf; -use function str_replace; - use Throwable; +use function class_exists; +use function get_class; +use function method_exists; +use function sprintf; +use function str_replace; use function trim; /** diff --git a/src/Logging/TeamCity.php b/src/Logging/TeamCity.php index f6539939..7a3ba79a 100644 --- a/src/Logging/TeamCity.php +++ b/src/Logging/TeamCity.php @@ -4,14 +4,9 @@ declare(strict_types=1); namespace Pest\Logging; -use function getmypid; - use Pest\Concerns\Logging\WritesToConsole; use Pest\Concerns\Testable; use Pest\Support\ExceptionTrace; - -use function Pest\version; - use PHPUnit\Framework\AssertionFailedError; use PHPUnit\Framework\Test; use PHPUnit\Framework\TestCase; @@ -19,13 +14,14 @@ use PHPUnit\Framework\TestResult; use PHPUnit\Framework\TestSuite; use PHPUnit\Framework\Warning; use PHPUnit\TextUI\DefaultResultPrinter; +use Throwable; +use function getmypid; +use function Pest\version; use function round; use function str_replace; use function strlen; -use Throwable; - final class TeamCity extends DefaultResultPrinter { use WritesToConsole; diff --git a/src/Plugins/Version.php b/src/Plugins/Version.php index 0baeb0b0..f63c563f 100644 --- a/src/Plugins/Version.php +++ b/src/Plugins/Version.php @@ -5,11 +5,10 @@ declare(strict_types=1); namespace Pest\Plugins; use Pest\Contracts\Plugins\HandlesArguments; +use Symfony\Component\Console\Output\OutputInterface; use function Pest\version; -use Symfony\Component\Console\Output\OutputInterface; - /** * @internal */ diff --git a/src/Support/HigherOrderMessage.php b/src/Support/HigherOrderMessage.php index 825079d2..df2593e8 100644 --- a/src/Support/HigherOrderMessage.php +++ b/src/Support/HigherOrderMessage.php @@ -5,12 +5,11 @@ declare(strict_types=1); namespace Pest\Support; use Closure; - -use const PHP_MAJOR_VERSION; - use ReflectionClass; use Throwable; +use const PHP_MAJOR_VERSION; + /** * @internal */ diff --git a/tests/PHPUnit/CustomTestCase/CustomTestCase.php b/tests/PHPUnit/CustomTestCase/CustomTestCase.php index a03b82c9..1328c244 100644 --- a/tests/PHPUnit/CustomTestCase/CustomTestCase.php +++ b/tests/PHPUnit/CustomTestCase/CustomTestCase.php @@ -4,10 +4,10 @@ declare(strict_types=1); namespace Tests\CustomTestCase; -use function PHPUnit\Framework\assertTrue; - use PHPUnit\Framework\TestCase; +use function PHPUnit\Framework\assertTrue; + class CustomTestCase extends TestCase { public function assertCustomTrue() diff --git a/tests/PHPUnit/CustomTestCase/ExecutedTest.php b/tests/PHPUnit/CustomTestCase/ExecutedTest.php index 00e759bb..29aed3cc 100644 --- a/tests/PHPUnit/CustomTestCase/ExecutedTest.php +++ b/tests/PHPUnit/CustomTestCase/ExecutedTest.php @@ -4,10 +4,10 @@ declare(strict_types=1); namespace Tests\CustomTestCase; -use function PHPUnit\Framework\assertTrue; - use PHPUnit\Framework\TestCase; +use function PHPUnit\Framework\assertTrue; + class ExecutedTest extends TestCase { public static $executed = false; diff --git a/tests/Unit/Plugins/Version.php b/tests/Unit/Plugins/Version.php index ffb076c7..a1529a8a 100644 --- a/tests/Unit/Plugins/Version.php +++ b/tests/Unit/Plugins/Version.php @@ -1,11 +1,10 @@