From 00b480fcb0e34d34ad30ec3a51fada1934e4c3c0 Mon Sep 17 00:00:00 2001 From: Ilian Ranguelov Date: Fri, 3 Apr 2020 19:40:49 +0200 Subject: [PATCH] apply PSR-4 to source --- composer.json | 4 +--- phpcs.xml.dist | 4 +--- psalm.xml.dist | 7 +------ .../Exception}/UnsupportedPsalmVersion.php | 0 {hooks => src/Hooks}/TestCaseHandler.php | 0 Plugin.php => src/Plugin.php | 12 ++++++------ 6 files changed, 9 insertions(+), 18 deletions(-) rename {Exception => src/Exception}/UnsupportedPsalmVersion.php (100%) rename {hooks => src/Hooks}/TestCaseHandler.php (100%) rename Plugin.php => src/Plugin.php (72%) diff --git a/composer.json b/composer.json index c024582..e1dde98 100755 --- a/composer.json +++ b/composer.json @@ -27,9 +27,7 @@ }, "autoload": { "psr-4": { - "Psalm\\PhpUnitPlugin\\": ["."], - "Psalm\\PhpUnitPlugin\\Hooks\\": ["hooks"], - "Psalm\\PhpUnitPlugin\\Exception\\" : ["Exception"] + "Psalm\\PhpUnitPlugin\\": "src" } }, "autoload-dev": { diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 729276b..ac7580c 100755 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -5,11 +5,9 @@ - Plugin.php + src tests/_support/Helper tests/_support/AcceptanceTester.php - hooks - Exception diff --git a/psalm.xml.dist b/psalm.xml.dist index 633d409..44f67aa 100755 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -6,12 +6,7 @@ xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" > - - - - - - + diff --git a/Exception/UnsupportedPsalmVersion.php b/src/Exception/UnsupportedPsalmVersion.php similarity index 100% rename from Exception/UnsupportedPsalmVersion.php rename to src/Exception/UnsupportedPsalmVersion.php diff --git a/hooks/TestCaseHandler.php b/src/Hooks/TestCaseHandler.php similarity index 100% rename from hooks/TestCaseHandler.php rename to src/Hooks/TestCaseHandler.php diff --git a/Plugin.php b/src/Plugin.php similarity index 72% rename from Plugin.php rename to src/Plugin.php index debc2f1..c538a27 100755 --- a/Plugin.php +++ b/src/Plugin.php @@ -15,14 +15,14 @@ class Plugin implements PluginEntryPointInterface /** @return void */ public function __invoke(RegistrationInterface $psalm, SimpleXMLElement $config = null) { - $psalm->addStubFile(__DIR__ . '/stubs/Assert.php'); + $psalm->addStubFile(__DIR__ . '/../stubs/Assert.php'); if ($this->packageVersionIs('phpunit/phpunit', '>=', '7.5')) { - $psalm->addStubFile(__DIR__ . '/stubs/Assert_75.php'); + $psalm->addStubFile(__DIR__ . '/../stubs/Assert_75.php'); } - $psalm->addStubFile(__DIR__ . '/stubs/TestCase.php'); - $psalm->addStubFile(__DIR__ . '/stubs/MockBuilder.php'); - $psalm->addStubFile(__DIR__ . '/stubs/InvocationMocker.php'); - $psalm->addStubFile(__DIR__ . '/stubs/Prophecy.php'); + $psalm->addStubFile(__DIR__ . '/../stubs/TestCase.php'); + $psalm->addStubFile(__DIR__ . '/../stubs/MockBuilder.php'); + $psalm->addStubFile(__DIR__ . '/../stubs/InvocationMocker.php'); + $psalm->addStubFile(__DIR__ . '/../stubs/Prophecy.php'); class_exists(Hooks\TestCaseHandler::class, true); $psalm->registerHooksFromClass(Hooks\TestCaseHandler::class);