From ab587ca50cf1d06ae22498568b10864ad0449b89 Mon Sep 17 00:00:00 2001 From: "Nek (Maxime Veber)" Date: Wed, 19 Aug 2020 15:26:36 +0200 Subject: [PATCH] refactor: make melodiia a real bundle --- CHANGELOG.md | 1 + src/Bridge/Symfony/Exception/ConfigException.php | 11 ----------- src/Crud/Controller/BaseCrudController.php | 2 +- src/Crud/Controller/GetAll.php | 2 +- src/Crud/FilterCollection.php | 2 +- .../DependencyInjection/Configuration.php | 2 +- .../DependencyInjection/MelodiiaExtension.php | 2 +- src/{Bridge => }/Doctrine/DoctrineDataStore.php | 2 +- .../EventListener/ExceptionListener.php | 2 +- src/Exception/ConfigException.php | 9 +++++++++ src/{Bridge/Symfony => }/Form/AbstractType.php | 4 ++-- src/Form/ApiRequestHandler.php | 2 +- .../Form/DomainObjectDataMapperInterface.php | 2 +- .../Symfony => }/Form/DomainObjectsDataMapper.php | 2 +- .../Form/Extension/DateTimeExtension.php | 2 +- .../ReorderDataToMatchCollectionListener.php | 2 +- src/{Bridge/Symfony => }/Form/Type/ApiType.php | 6 +++--- src/{Bridge/Symfony => }/Form/Type/BooleanType.php | 2 +- .../Symfony => }/Form/Type/DateTimeType.php | 2 +- .../Form/Type/MelodiiaCollectionType.php | 4 ++-- src/{Bridge/Symfony => }/MelodiiaBundle.php | 4 ++-- src/{Bridge/Symfony => }/MelodiiaConfiguration.php | 13 ++----------- .../Symfony => }/Resources/config/crud.yaml | 2 +- .../Resources/config/error-management.xml | 2 +- .../Symfony => }/Resources/config/form.yaml | 2 +- .../Symfony => }/Resources/config/services.yaml | 3 +-- .../Resources/public/swagger/favicon-16x16.png | Bin .../Resources/public/swagger/favicon-32x32.png | Bin .../Resources/public/swagger/oauth2-redirect.html | 0 .../Resources/public/swagger/swagger-ui-bundle.js | 0 .../public/swagger/swagger-ui-bundle.js.map | 0 .../public/swagger/swagger-ui-standalone-preset.js | 0 .../swagger/swagger-ui-standalone-preset.js.map | 0 .../Resources/public/swagger/swagger-ui.css | 0 .../Resources/public/swagger/swagger-ui.css.map | 0 .../Resources/public/swagger/swagger-ui.js | 0 .../Resources/public/swagger/swagger-ui.js.map | 0 .../Symfony => }/Resources/views/openapi.html.twig | 0 .../Symfony => }/Response/FormErrorResponse.php | 3 +-- tests/Melodiia/Crud/Controller/CreateTest.php | 2 +- tests/Melodiia/Crud/Controller/GetAllTest.php | 2 +- tests/Melodiia/Crud/Controller/UpdateTest.php | 2 +- .../DependencyInjection/MelodiiaExtensionTest.php | 4 ++-- .../Doctrine/DoctrineDataStoreTest.php | 4 ++-- .../EventListener/ExceptionListenerTest.php | 4 ++-- tests/Melodiia/Form/ApiRequestHandlerTest.php | 2 +- .../{Bridge/Symfony => }/Form/ApiTypeTest.php | 8 ++++---- .../{Bridge/Symfony => }/Form/DateTimeTypeTest.php | 4 ++-- .../Form/DomainObjectsDataMapperTest.php | 4 ++-- .../ReorderDataToMatchCollectionListenerTest.php | 4 ++-- .../Symfony => }/MelodiiaConfigurationTest.php | 4 ++-- .../Response/FormErrorResponseTest.php | 3 ++- .../Melodiia/TestFixtures/FakeMelodiiaFormType.php | 2 +- tests/TestApplication/config/bundles.php | 12 +----------- tests/TestApplication/src/Form/TodoType.php | 2 +- 55 files changed, 67 insertions(+), 88 deletions(-) delete mode 100644 src/Bridge/Symfony/Exception/ConfigException.php rename src/{Bridge/Symfony => }/DependencyInjection/Configuration.php (95%) rename src/{Bridge/Symfony => }/DependencyInjection/MelodiiaExtension.php (96%) rename src/{Bridge => }/Doctrine/DoctrineDataStore.php (97%) rename src/{Bridge/Symfony => }/EventListener/ExceptionListener.php (96%) create mode 100644 src/Exception/ConfigException.php rename src/{Bridge/Symfony => }/Form/AbstractType.php (64%) rename src/{Bridge/Symfony => }/Form/DomainObjectDataMapperInterface.php (83%) rename src/{Bridge/Symfony => }/Form/DomainObjectsDataMapper.php (97%) rename src/{Bridge/Symfony => }/Form/Extension/DateTimeExtension.php (93%) rename src/{Bridge/Symfony => }/Form/Listener/ReorderDataToMatchCollectionListener.php (97%) rename src/{Bridge/Symfony => }/Form/Type/ApiType.php (91%) rename src/{Bridge/Symfony => }/Form/Type/BooleanType.php (84%) rename src/{Bridge/Symfony => }/Form/Type/DateTimeType.php (92%) rename src/{Bridge/Symfony => }/Form/Type/MelodiiaCollectionType.php (92%) rename src/{Bridge/Symfony => }/MelodiiaBundle.php (65%) rename src/{Bridge/Symfony => }/MelodiiaConfiguration.php (78%) rename src/{Bridge/Symfony => }/Resources/config/crud.yaml (97%) rename src/{Bridge/Symfony => }/Resources/config/error-management.xml (94%) rename src/{Bridge/Symfony => }/Resources/config/form.yaml (55%) rename src/{Bridge/Symfony => }/Resources/config/services.yaml (93%) rename src/{Bridge/Symfony => }/Resources/public/swagger/favicon-16x16.png (100%) rename src/{Bridge/Symfony => }/Resources/public/swagger/favicon-32x32.png (100%) rename src/{Bridge/Symfony => }/Resources/public/swagger/oauth2-redirect.html (100%) rename src/{Bridge/Symfony => }/Resources/public/swagger/swagger-ui-bundle.js (100%) rename src/{Bridge/Symfony => }/Resources/public/swagger/swagger-ui-bundle.js.map (100%) rename src/{Bridge/Symfony => }/Resources/public/swagger/swagger-ui-standalone-preset.js (100%) rename src/{Bridge/Symfony => }/Resources/public/swagger/swagger-ui-standalone-preset.js.map (100%) rename src/{Bridge/Symfony => }/Resources/public/swagger/swagger-ui.css (100%) rename src/{Bridge/Symfony => }/Resources/public/swagger/swagger-ui.css.map (100%) rename src/{Bridge/Symfony => }/Resources/public/swagger/swagger-ui.js (100%) rename src/{Bridge/Symfony => }/Resources/public/swagger/swagger-ui.js.map (100%) rename src/{Bridge/Symfony => }/Resources/views/openapi.html.twig (100%) rename src/{Bridge/Symfony => }/Response/FormErrorResponse.php (96%) rename tests/Melodiia/{Bridge/Symfony => }/DependencyInjection/MelodiiaExtensionTest.php (82%) rename tests/Melodiia/{Bridge => }/Doctrine/DoctrineDataStoreTest.php (95%) rename tests/Melodiia/{Bridge/Symfony => }/EventListener/ExceptionListenerTest.php (91%) rename tests/Melodiia/{Bridge/Symfony => }/Form/ApiTypeTest.php (90%) rename tests/Melodiia/{Bridge/Symfony => }/Form/DateTimeTypeTest.php (80%) rename tests/Melodiia/{Bridge/Symfony => }/Form/DomainObjectsDataMapperTest.php (93%) rename tests/Melodiia/{Bridge/Symfony => }/Form/Listener/ReorderDataToMatchCollectionListenerTest.php (96%) rename tests/Melodiia/{Bridge/Symfony => }/MelodiiaConfigurationTest.php (95%) rename tests/Melodiia/{Bridge/Symfony => }/Response/FormErrorResponseTest.php (98%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 576260a..9111e0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 to follow HTTP verbs. - Removal of the dependency to zend json (thanks to php 7.3 upgrade) - BC Break: the ApiResponse now contains also headers. If you do not extends another response you will need to add the missing method +- BC Break: many many many changes of namespaces because the Bridge do not exists anymore. ## Removed - BC break: the documentation is no more automatically generated. This removes a lot of configuration for Melodiia. diff --git a/src/Bridge/Symfony/Exception/ConfigException.php b/src/Bridge/Symfony/Exception/ConfigException.php deleted file mode 100644 index 54ad2ba..0000000 --- a/src/Bridge/Symfony/Exception/ConfigException.php +++ /dev/null @@ -1,11 +0,0 @@ -config = $config; - $this->router = $router; } /** diff --git a/src/Bridge/Symfony/Resources/config/crud.yaml b/src/Resources/config/crud.yaml similarity index 97% rename from src/Bridge/Symfony/Resources/config/crud.yaml rename to src/Resources/config/crud.yaml index aede679..1d7b7b2 100644 --- a/src/Bridge/Symfony/Resources/config/crud.yaml +++ b/src/Resources/config/crud.yaml @@ -1,6 +1,6 @@ services: melodiia.doctrine.data_provider: - class: SwagIndustries\Melodiia\Bridge\Doctrine\DoctrineDataStore + class: SwagIndustries\Melodiia\Doctrine\DoctrineDataStore arguments: $registry: '@doctrine' diff --git a/src/Bridge/Symfony/Resources/config/error-management.xml b/src/Resources/config/error-management.xml similarity index 94% rename from src/Bridge/Symfony/Resources/config/error-management.xml rename to src/Resources/config/error-management.xml index b0a1f6c..25d6091 100644 --- a/src/Bridge/Symfony/Resources/config/error-management.xml +++ b/src/Resources/config/error-management.xml @@ -9,7 +9,7 @@ - + false diff --git a/src/Bridge/Symfony/Resources/config/form.yaml b/src/Resources/config/form.yaml similarity index 55% rename from src/Bridge/Symfony/Resources/config/form.yaml rename to src/Resources/config/form.yaml index f73945a..2d4ce2c 100644 --- a/src/Bridge/Symfony/Resources/config/form.yaml +++ b/src/Resources/config/form.yaml @@ -1,6 +1,6 @@ services: melodiia.form.extension.datetime: - class: SwagIndustries\Melodiia\Bridge\Symfony\Form\Extension\DateTimeExtension + class: SwagIndustries\Melodiia\Form\Extension\DateTimeExtension tags: - { name: form.type_extension } diff --git a/src/Bridge/Symfony/Resources/config/services.yaml b/src/Resources/config/services.yaml similarity index 93% rename from src/Bridge/Symfony/Resources/config/services.yaml rename to src/Resources/config/services.yaml index f6e9d30..8361ca6 100644 --- a/src/Bridge/Symfony/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -6,10 +6,9 @@ services: $templating: '@twig' melodiia.configuration: - class: SwagIndustries\Melodiia\Bridge\Symfony\MelodiiaConfiguration + class: SwagIndustries\Melodiia\MelodiiaConfiguration arguments: $config: '%melodiia.config%' - $router: '@router.default' # Priority -1 is DX. It allow the user to implement its own normalizers diff --git a/src/Bridge/Symfony/Resources/public/swagger/favicon-16x16.png b/src/Resources/public/swagger/favicon-16x16.png similarity index 100% rename from src/Bridge/Symfony/Resources/public/swagger/favicon-16x16.png rename to src/Resources/public/swagger/favicon-16x16.png diff --git a/src/Bridge/Symfony/Resources/public/swagger/favicon-32x32.png b/src/Resources/public/swagger/favicon-32x32.png similarity index 100% rename from src/Bridge/Symfony/Resources/public/swagger/favicon-32x32.png rename to src/Resources/public/swagger/favicon-32x32.png diff --git a/src/Bridge/Symfony/Resources/public/swagger/oauth2-redirect.html b/src/Resources/public/swagger/oauth2-redirect.html similarity index 100% rename from src/Bridge/Symfony/Resources/public/swagger/oauth2-redirect.html rename to src/Resources/public/swagger/oauth2-redirect.html diff --git a/src/Bridge/Symfony/Resources/public/swagger/swagger-ui-bundle.js b/src/Resources/public/swagger/swagger-ui-bundle.js similarity index 100% rename from src/Bridge/Symfony/Resources/public/swagger/swagger-ui-bundle.js rename to src/Resources/public/swagger/swagger-ui-bundle.js diff --git a/src/Bridge/Symfony/Resources/public/swagger/swagger-ui-bundle.js.map b/src/Resources/public/swagger/swagger-ui-bundle.js.map similarity index 100% rename from src/Bridge/Symfony/Resources/public/swagger/swagger-ui-bundle.js.map rename to src/Resources/public/swagger/swagger-ui-bundle.js.map diff --git a/src/Bridge/Symfony/Resources/public/swagger/swagger-ui-standalone-preset.js b/src/Resources/public/swagger/swagger-ui-standalone-preset.js similarity index 100% rename from src/Bridge/Symfony/Resources/public/swagger/swagger-ui-standalone-preset.js rename to src/Resources/public/swagger/swagger-ui-standalone-preset.js diff --git a/src/Bridge/Symfony/Resources/public/swagger/swagger-ui-standalone-preset.js.map b/src/Resources/public/swagger/swagger-ui-standalone-preset.js.map similarity index 100% rename from src/Bridge/Symfony/Resources/public/swagger/swagger-ui-standalone-preset.js.map rename to src/Resources/public/swagger/swagger-ui-standalone-preset.js.map diff --git a/src/Bridge/Symfony/Resources/public/swagger/swagger-ui.css b/src/Resources/public/swagger/swagger-ui.css similarity index 100% rename from src/Bridge/Symfony/Resources/public/swagger/swagger-ui.css rename to src/Resources/public/swagger/swagger-ui.css diff --git a/src/Bridge/Symfony/Resources/public/swagger/swagger-ui.css.map b/src/Resources/public/swagger/swagger-ui.css.map similarity index 100% rename from src/Bridge/Symfony/Resources/public/swagger/swagger-ui.css.map rename to src/Resources/public/swagger/swagger-ui.css.map diff --git a/src/Bridge/Symfony/Resources/public/swagger/swagger-ui.js b/src/Resources/public/swagger/swagger-ui.js similarity index 100% rename from src/Bridge/Symfony/Resources/public/swagger/swagger-ui.js rename to src/Resources/public/swagger/swagger-ui.js diff --git a/src/Bridge/Symfony/Resources/public/swagger/swagger-ui.js.map b/src/Resources/public/swagger/swagger-ui.js.map similarity index 100% rename from src/Bridge/Symfony/Resources/public/swagger/swagger-ui.js.map rename to src/Resources/public/swagger/swagger-ui.js.map diff --git a/src/Bridge/Symfony/Resources/views/openapi.html.twig b/src/Resources/views/openapi.html.twig similarity index 100% rename from src/Bridge/Symfony/Resources/views/openapi.html.twig rename to src/Resources/views/openapi.html.twig diff --git a/src/Bridge/Symfony/Response/FormErrorResponse.php b/src/Response/FormErrorResponse.php similarity index 96% rename from src/Bridge/Symfony/Response/FormErrorResponse.php rename to src/Response/FormErrorResponse.php index ad5370b..8594ae3 100644 --- a/src/Bridge/Symfony/Response/FormErrorResponse.php +++ b/src/Response/FormErrorResponse.php @@ -2,11 +2,10 @@ declare(strict_types=1); -namespace SwagIndustries\Melodiia\Bridge\Symfony\Response; +namespace SwagIndustries\Melodiia\Response; use Nekland\Tools\StringTools; use SwagIndustries\Melodiia\Exception\InvalidResponseException; -use SwagIndustries\Melodiia\Response\AbstractUserDataErrorResponse; use SwagIndustries\Melodiia\Response\Model\UserDataError; use Symfony\Component\Form\FormError; use Symfony\Component\Form\FormInterface; diff --git a/tests/Melodiia/Crud/Controller/CreateTest.php b/tests/Melodiia/Crud/Controller/CreateTest.php index e35b069..5d6c148 100644 --- a/tests/Melodiia/Crud/Controller/CreateTest.php +++ b/tests/Melodiia/Crud/Controller/CreateTest.php @@ -7,7 +7,6 @@ use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; -use SwagIndustries\Melodiia\Bridge\Symfony\Response\FormErrorResponse; use SwagIndustries\Melodiia\Crud\Controller\Create; use SwagIndustries\Melodiia\Crud\CrudControllerInterface; use SwagIndustries\Melodiia\Crud\Event\CrudEvent; @@ -15,6 +14,7 @@ use SwagIndustries\Melodiia\Crud\Persistence\DataStoreInterface; use SwagIndustries\Melodiia\Response\ApiResponse; use SwagIndustries\Melodiia\Response\Created; +use SwagIndustries\Melodiia\Response\FormErrorResponse; use SwagIndustries\Melodiia\Test\MockDispatcherTrait; use SwagIndustries\Melodiia\Test\TestFixtures\FakeMelodiiaFormType; use SwagIndustries\Melodiia\Test\TestFixtures\FakeMelodiiaModel; diff --git a/tests/Melodiia/Crud/Controller/GetAllTest.php b/tests/Melodiia/Crud/Controller/GetAllTest.php index 6099e96..845ba61 100644 --- a/tests/Melodiia/Crud/Controller/GetAllTest.php +++ b/tests/Melodiia/Crud/Controller/GetAllTest.php @@ -9,7 +9,6 @@ use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; -use SwagIndustries\Melodiia\Bridge\Symfony\Response\FormErrorResponse; use SwagIndustries\Melodiia\Crud\Controller\GetAll; use SwagIndustries\Melodiia\Crud\CrudControllerInterface; use SwagIndustries\Melodiia\Crud\FilterCollection; @@ -17,6 +16,7 @@ use SwagIndustries\Melodiia\Crud\Pagination\PaginationRequest; use SwagIndustries\Melodiia\Crud\Pagination\PaginationRequestFactoryInterface; use SwagIndustries\Melodiia\Crud\Persistence\DataStoreInterface; +use SwagIndustries\Melodiia\Response\FormErrorResponse; use SwagIndustries\Melodiia\Response\OkContent; use SwagIndustries\Melodiia\Test\TestFixtures\FakeMelodiiaModel; use Symfony\Component\Form\FormInterface; diff --git a/tests/Melodiia/Crud/Controller/UpdateTest.php b/tests/Melodiia/Crud/Controller/UpdateTest.php index 985706a..b8eca78 100644 --- a/tests/Melodiia/Crud/Controller/UpdateTest.php +++ b/tests/Melodiia/Crud/Controller/UpdateTest.php @@ -7,7 +7,6 @@ use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\Prophecy\ObjectProphecy; -use SwagIndustries\Melodiia\Bridge\Symfony\Response\FormErrorResponse; use SwagIndustries\Melodiia\Crud\Controller\Update; use SwagIndustries\Melodiia\Crud\CrudControllerInterface; use SwagIndustries\Melodiia\Crud\Event\CrudEvent; @@ -15,6 +14,7 @@ use SwagIndustries\Melodiia\Crud\Persistence\DataStoreInterface; use SwagIndustries\Melodiia\Crud\Tools\IdResolverInterface; use SwagIndustries\Melodiia\Response\ApiResponse; +use SwagIndustries\Melodiia\Response\FormErrorResponse; use SwagIndustries\Melodiia\Response\OkContent; use SwagIndustries\Melodiia\Test\MockDispatcherTrait; use SwagIndustries\Melodiia\Test\TestFixtures\FakeMelodiiaFormType; diff --git a/tests/Melodiia/Bridge/Symfony/DependencyInjection/MelodiiaExtensionTest.php b/tests/Melodiia/DependencyInjection/MelodiiaExtensionTest.php similarity index 82% rename from tests/Melodiia/Bridge/Symfony/DependencyInjection/MelodiiaExtensionTest.php rename to tests/Melodiia/DependencyInjection/MelodiiaExtensionTest.php index 9ef9006..9e4efd0 100644 --- a/tests/Melodiia/Bridge/Symfony/DependencyInjection/MelodiiaExtensionTest.php +++ b/tests/Melodiia/DependencyInjection/MelodiiaExtensionTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace SwagIndustries\Melodiia\Test\Bridge\Symfony\DependencyInjection; +namespace SwagIndustries\Melodiia\Test\DependencyInjection; use PHPUnit\Framework\TestCase; -use SwagIndustries\Melodiia\Bridge\Symfony\DependencyInjection\MelodiiaExtension; +use SwagIndustries\Melodiia\DependencyInjection\MelodiiaExtension; use Symfony\Component\DependencyInjection\ContainerBuilder; class MelodiiaExtensionTest extends TestCase diff --git a/tests/Melodiia/Bridge/Doctrine/DoctrineDataStoreTest.php b/tests/Melodiia/Doctrine/DoctrineDataStoreTest.php similarity index 95% rename from tests/Melodiia/Bridge/Doctrine/DoctrineDataStoreTest.php rename to tests/Melodiia/Doctrine/DoctrineDataStoreTest.php index 46e1ef6..b524cdc 100644 --- a/tests/Melodiia/Bridge/Doctrine/DoctrineDataStoreTest.php +++ b/tests/Melodiia/Doctrine/DoctrineDataStoreTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace SwagIndustries\Melodiia\Test\Bridge\Doctrine; +namespace SwagIndustries\Melodiia\Test\Doctrine; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; @@ -11,9 +11,9 @@ use Pagerfanta\Pagerfanta; use PHPUnit\Framework\TestCase; use Prophecy\Argument; -use SwagIndustries\Melodiia\Bridge\Doctrine\DoctrineDataStore; use SwagIndustries\Melodiia\Crud\FilterCollection; use SwagIndustries\Melodiia\Crud\Persistence\DataStoreInterface; +use SwagIndustries\Melodiia\Doctrine\DoctrineDataStore; class DoctrineDataStoreTest extends TestCase { diff --git a/tests/Melodiia/Bridge/Symfony/EventListener/ExceptionListenerTest.php b/tests/Melodiia/EventListener/ExceptionListenerTest.php similarity index 91% rename from tests/Melodiia/Bridge/Symfony/EventListener/ExceptionListenerTest.php rename to tests/Melodiia/EventListener/ExceptionListenerTest.php index 641072a..2615b7b 100644 --- a/tests/Melodiia/Bridge/Symfony/EventListener/ExceptionListenerTest.php +++ b/tests/Melodiia/EventListener/ExceptionListenerTest.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace SwagIndustries\Melodiia\Test\Bridge\Symfony\EventListener; +namespace SwagIndustries\Melodiia\Test\EventListener; use PHPUnit\Framework\TestCase; use Prophecy\Prophecy\ObjectProphecy; -use SwagIndustries\Melodiia\Bridge\Symfony\EventListener\ExceptionListener; +use SwagIndustries\Melodiia\EventListener\ExceptionListener; use SwagIndustries\Melodiia\MelodiiaConfigurationInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Event\ExceptionEvent; diff --git a/tests/Melodiia/Form/ApiRequestHandlerTest.php b/tests/Melodiia/Form/ApiRequestHandlerTest.php index 5e0a003..dcc8674 100644 --- a/tests/Melodiia/Form/ApiRequestHandlerTest.php +++ b/tests/Melodiia/Form/ApiRequestHandlerTest.php @@ -6,8 +6,8 @@ use PHPUnit\Framework\TestCase; use Prophecy\Argument; -use SwagIndustries\Melodiia\Bridge\Symfony\Form\Type\ApiType; use SwagIndustries\Melodiia\Form\ApiRequestHandler; +use SwagIndustries\Melodiia\Form\Type\ApiType; use Symfony\Component\Form\FormConfigInterface; use Symfony\Component\Form\FormError; use Symfony\Component\Form\FormInterface; diff --git a/tests/Melodiia/Bridge/Symfony/Form/ApiTypeTest.php b/tests/Melodiia/Form/ApiTypeTest.php similarity index 90% rename from tests/Melodiia/Bridge/Symfony/Form/ApiTypeTest.php rename to tests/Melodiia/Form/ApiTypeTest.php index 039663f..e0f71d9 100644 --- a/tests/Melodiia/Bridge/Symfony/Form/ApiTypeTest.php +++ b/tests/Melodiia/Form/ApiTypeTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace SwagIndustries\Melodiia\Test\Bridge\Symfony\Form; +namespace SwagIndustries\Melodiia\Test\Form; -use SwagIndustries\Melodiia\Bridge\Symfony\Form\DomainObjectsDataMapper; -use SwagIndustries\Melodiia\Bridge\Symfony\Form\Type\ApiType; +use SwagIndustries\Melodiia\Form\DomainObjectsDataMapper; +use SwagIndustries\Melodiia\Form\Type\ApiType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormView; @@ -85,7 +85,7 @@ public function getFoo() } } -class FakeTypeUsingApiType extends \SwagIndustries\Melodiia\Bridge\Symfony\Form\AbstractType +class FakeTypeUsingApiType extends \SwagIndustries\Melodiia\Form\AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/tests/Melodiia/Bridge/Symfony/Form/DateTimeTypeTest.php b/tests/Melodiia/Form/DateTimeTypeTest.php similarity index 80% rename from tests/Melodiia/Bridge/Symfony/Form/DateTimeTypeTest.php rename to tests/Melodiia/Form/DateTimeTypeTest.php index 1ceaa25..d7f2b62 100644 --- a/tests/Melodiia/Bridge/Symfony/Form/DateTimeTypeTest.php +++ b/tests/Melodiia/Form/DateTimeTypeTest.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace SwagIndustries\Melodiia\Test\Bridge\Symfony\Form; +namespace SwagIndustries\Melodiia\Test\Form; -use SwagIndustries\Melodiia\Bridge\Symfony\Form\Type\DateTimeType; +use SwagIndustries\Melodiia\Form\Type\DateTimeType; use Symfony\Component\Form\Test\TypeTestCase; class DateTimeTypeTest extends TypeTestCase diff --git a/tests/Melodiia/Bridge/Symfony/Form/DomainObjectsDataMapperTest.php b/tests/Melodiia/Form/DomainObjectsDataMapperTest.php similarity index 93% rename from tests/Melodiia/Bridge/Symfony/Form/DomainObjectsDataMapperTest.php rename to tests/Melodiia/Form/DomainObjectsDataMapperTest.php index b228ced..ecabff1 100644 --- a/tests/Melodiia/Bridge/Symfony/Form/DomainObjectsDataMapperTest.php +++ b/tests/Melodiia/Form/DomainObjectsDataMapperTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace SwagIndustries\Melodiia\Test\Bridge\Symfony\Form; +namespace SwagIndustries\Melodiia\Test\Form; use PHPUnit\Framework\TestCase; -use SwagIndustries\Melodiia\Bridge\Symfony\Form\DomainObjectsDataMapper; +use SwagIndustries\Melodiia\Form\DomainObjectsDataMapper; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\Form\DataMapperInterface; use Symfony\Component\Form\Extension\Core\DataMapper\PropertyPathMapper; diff --git a/tests/Melodiia/Bridge/Symfony/Form/Listener/ReorderDataToMatchCollectionListenerTest.php b/tests/Melodiia/Form/Listener/ReorderDataToMatchCollectionListenerTest.php similarity index 96% rename from tests/Melodiia/Bridge/Symfony/Form/Listener/ReorderDataToMatchCollectionListenerTest.php rename to tests/Melodiia/Form/Listener/ReorderDataToMatchCollectionListenerTest.php index 28a9d5c..ceb1770 100644 --- a/tests/Melodiia/Bridge/Symfony/Form/Listener/ReorderDataToMatchCollectionListenerTest.php +++ b/tests/Melodiia/Form/Listener/ReorderDataToMatchCollectionListenerTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace SwagIndustries\Melodiia\Test\Bridge\Symfony\Form\Listener; +namespace SwagIndustries\Melodiia\Test\Form\Listener; -use SwagIndustries\Melodiia\Bridge\Symfony\Form\Listener\ReorderDataToMatchCollectionListener; use SwagIndustries\Melodiia\Crud\MelodiiaModel; +use SwagIndustries\Melodiia\Form\Listener\ReorderDataToMatchCollectionListener; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Event\PreSubmitEvent; diff --git a/tests/Melodiia/Bridge/Symfony/MelodiiaConfigurationTest.php b/tests/Melodiia/MelodiiaConfigurationTest.php similarity index 95% rename from tests/Melodiia/Bridge/Symfony/MelodiiaConfigurationTest.php rename to tests/Melodiia/MelodiiaConfigurationTest.php index 5b23801..b96fab6 100644 --- a/tests/Melodiia/Bridge/Symfony/MelodiiaConfigurationTest.php +++ b/tests/Melodiia/MelodiiaConfigurationTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace SwagIndustries\Melodiia\Test\Bridge\Symfony; +namespace SwagIndustries\Melodiia\Test; use PHPUnit\Framework\TestCase; -use SwagIndustries\Melodiia\Bridge\Symfony\MelodiiaConfiguration; +use SwagIndustries\Melodiia\MelodiiaConfiguration; use SwagIndustries\Melodiia\MelodiiaConfigurationInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\RouterInterface; diff --git a/tests/Melodiia/Bridge/Symfony/Response/FormErrorResponseTest.php b/tests/Melodiia/Response/FormErrorResponseTest.php similarity index 98% rename from tests/Melodiia/Bridge/Symfony/Response/FormErrorResponseTest.php rename to tests/Melodiia/Response/FormErrorResponseTest.php index 8c41584..6250681 100644 --- a/tests/Melodiia/Bridge/Symfony/Response/FormErrorResponseTest.php +++ b/tests/Melodiia/Response/FormErrorResponseTest.php @@ -2,9 +2,10 @@ declare(strict_types=1); -namespace SwagIndustries\Melodiia\Bridge\Symfony\Response; +namespace SwagIndustries\Melodiia\Test\Response; use PHPUnit\Framework\TestCase; +use SwagIndustries\Melodiia\Response\FormErrorResponse; use SwagIndustries\Melodiia\Response\Model\UserDataError; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\CollectionType; diff --git a/tests/Melodiia/TestFixtures/FakeMelodiiaFormType.php b/tests/Melodiia/TestFixtures/FakeMelodiiaFormType.php index e8d1339..1b83efd 100644 --- a/tests/Melodiia/TestFixtures/FakeMelodiiaFormType.php +++ b/tests/Melodiia/TestFixtures/FakeMelodiiaFormType.php @@ -4,7 +4,7 @@ namespace SwagIndustries\Melodiia\Test\TestFixtures; -use SwagIndustries\Melodiia\Bridge\Symfony\Form\AbstractType; +use SwagIndustries\Melodiia\Form\AbstractType; class FakeMelodiiaFormType extends AbstractType { diff --git a/tests/TestApplication/config/bundles.php b/tests/TestApplication/config/bundles.php index e3d7daa..a4ea923 100644 --- a/tests/TestApplication/config/bundles.php +++ b/tests/TestApplication/config/bundles.php @@ -6,18 +6,8 @@ Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], -// Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], -// Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], -// Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], FriendsOfBehat\SymfonyExtension\Bundle\FriendsOfBehatSymfonyExtensionBundle::class => ['test' => true], - \SwagIndustries\Melodiia\Bridge\Symfony\MelodiiaBundle::class => ['all' => true], -// DAMA\DoctrineTestBundle\DAMADoctrineTestBundle::class => ['test' => true], -// Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], -// Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true], -// Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], -// Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], -// Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true], -// HtmlSanitizer\Bundle\HtmlSanitizerBundle::class => ['all' => true], + \SwagIndustries\Melodiia\MelodiiaBundle::class => ['all' => true], ]; diff --git a/tests/TestApplication/src/Form/TodoType.php b/tests/TestApplication/src/Form/TodoType.php index d93b06c..e2f9b2a 100644 --- a/tests/TestApplication/src/Form/TodoType.php +++ b/tests/TestApplication/src/Form/TodoType.php @@ -4,7 +4,7 @@ namespace TestApplication\Form; -use SwagIndustries\Melodiia\Bridge\Symfony\Form\AbstractType; +use SwagIndustries\Melodiia\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver;