diff --git a/README.md b/README.md index a709b608282f4a6c2468a5f0c8a37c0368c8f28e..5199a896363b133c36749a6ff6788745f75c3cf9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# DbpRelayCourseBundle +# DbpRelayBaseCourseBundle This Symfony bundle can be used as a template for creating new bundles for the DBP Relay project. @@ -22,7 +22,7 @@ See [Generate DBP Symfony bundle](https://dbp-demo.tugraz.at/dev-guide/relay/nam * Copy the repo contents * Adjust the package name in `composer.json`, in this example we'll pretend you named your bundle `dbp/relay-your-bundle` * Invent a new PHP namespace and adjust it in all PHP files -* Rename `src/DbpRelayCourseBundle` and `DependencyInjection/DbpRelayCourseExtension` to match the new project name +* Rename `src/DbpRelayBaseCourseBundle` and `DependencyInjection/DbpRelayCourseExtension` to match the new project name ## Integration into the API Server diff --git a/composer.json b/composer.json index 29f622e44acd289bcdb40131c396e7be85960f11..a4d40b87256a099029c56dc031a4a9923d135439 100644 --- a/composer.json +++ b/composer.json @@ -29,12 +29,12 @@ ], "autoload": { "psr-4": { - "Dbp\\Relay\\CourseBundle\\": "src/" + "Dbp\\Relay\\BaseCourseBundle\\": "src/" } }, "autoload-dev": { "psr-4": { - "Dbp\\Relay\\CourseBundle\\Tests\\": "tests/" + "Dbp\\Relay\\BaseCourseBundle\\Tests\\": "tests/" } }, "config": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index e188728faeb92fd5d6129f7da71b2534f1882a1c..9cdc5e4563d8935b1ba33bcaf60bc932033cc0bb 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -12,7 +12,7 @@ <server name="APP_ENV" value="test" force="true"/> <server name="SHELL_VERBOSITY" value="-1"/> <server name="SYMFONY_DEPRECATIONS_HELPER" value='max[direct]=0&quiet[]=indirect'/> - <server name="KERNEL_CLASS" value="Dbp\Relay\CourseBundle\Tests\Kernel"/> + <server name="KERNEL_CLASS" value="Dbp\Relay\BaseCourseBundle\Tests\Kernel"/> </php> <testsuites> <testsuite name="Project Test Suite"> diff --git a/src/API/CourseProviderInterface.php b/src/API/CourseProviderInterface.php index bb27f20620dac41af76ba08530a50f19dca67c5a..db049e1b431ec6bf48d834a0c9d30644d6228cdc 100644 --- a/src/API/CourseProviderInterface.php +++ b/src/API/CourseProviderInterface.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Dbp\Relay\CourseBundle\API; +namespace Dbp\Relay\BaseCourseBundle\API; -use Dbp\Relay\CourseBundle\Entity\Course; -use Dbp\Relay\CourseBundle\Entity\CourseAttendee; +use Dbp\Relay\BaseCourseBundle\Entity\Course; +use Dbp\Relay\BaseCourseBundle\Entity\CourseAttendee; interface CourseProviderInterface { diff --git a/src/Controller/GetAttendeesByCourse.php b/src/Controller/GetAttendeesByCourse.php index 31f5a4a5f74be54eb3f5a29ea9499a5279a40979..c55166e1b4fc34b6f0dccc402678444063539724 100644 --- a/src/Controller/GetAttendeesByCourse.php +++ b/src/Controller/GetAttendeesByCourse.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Dbp\Relay\CourseBundle\Controller; +namespace Dbp\Relay\BaseCourseBundle\Controller; +use Dbp\Relay\BaseCourseBundle\API\CourseProviderInterface; use Dbp\Relay\CoreBundle\Helpers\ArrayFullPaginator; -use Dbp\Relay\CourseBundle\API\CourseProviderInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; diff --git a/src/Controller/GetCoursesByOrganization.php b/src/Controller/GetCoursesByOrganization.php index c093f4944d091770a498e6c60f4582bebf5c0ab5..6dbd3b0104a295228e494e0a6a0e79dc0560f1c0 100644 --- a/src/Controller/GetCoursesByOrganization.php +++ b/src/Controller/GetCoursesByOrganization.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Dbp\Relay\CourseBundle\Controller; +namespace Dbp\Relay\BaseCourseBundle\Controller; use ApiPlatform\Core\DataProvider\PaginatorInterface; +use Dbp\Relay\BaseCourseBundle\API\CourseProviderInterface; use Dbp\Relay\CoreBundle\Helpers\ArrayFullPaginator; -use Dbp\Relay\CourseBundle\API\CourseProviderInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; diff --git a/src/Controller/GetCoursesByPerson.php b/src/Controller/GetCoursesByPerson.php index 6fa8ca70ef7b98312ca5cb1622bfb3993dee15b1..8837097b1b09fb49ca445512f89e18c3d37257db 100644 --- a/src/Controller/GetCoursesByPerson.php +++ b/src/Controller/GetCoursesByPerson.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Dbp\Relay\CourseBundle\Controller; +namespace Dbp\Relay\BaseCourseBundle\Controller; use ApiPlatform\Core\DataProvider\PaginatorInterface; +use Dbp\Relay\BaseCourseBundle\API\CourseProviderInterface; use Dbp\Relay\CoreBundle\Helpers\ArrayFullPaginator; -use Dbp\Relay\CourseBundle\API\CourseProviderInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; diff --git a/src/DataProvider/CourseCollectionDataProvider.php b/src/DataProvider/CourseCollectionDataProvider.php index 9d386f8664d441f84b2cbadd8d0cef0d1d312fc4..89103f1bd004dbaf20cbce6977dc1750b05237d5 100644 --- a/src/DataProvider/CourseCollectionDataProvider.php +++ b/src/DataProvider/CourseCollectionDataProvider.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Dbp\Relay\CourseBundle\DataProvider; +namespace Dbp\Relay\BaseCourseBundle\DataProvider; use ApiPlatform\Core\DataProvider\CollectionDataProviderInterface; use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface; +use Dbp\Relay\BaseCourseBundle\API\CourseProviderInterface; +use Dbp\Relay\BaseCourseBundle\Entity\Course; use Dbp\Relay\CoreBundle\Helpers\ArrayFullPaginator; -use Dbp\Relay\CourseBundle\API\CourseProviderInterface; -use Dbp\Relay\CourseBundle\Entity\Course; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; final class CourseCollectionDataProvider extends AbstractController implements CollectionDataProviderInterface, RestrictedDataProviderInterface diff --git a/src/DataProvider/CourseItemDataProvider.php b/src/DataProvider/CourseItemDataProvider.php index d494724b85c5c5279d4cf1d68e89e5f09a8ac9d3..4b5252ba1c623101208307a4b1925836d8daf3d3 100644 --- a/src/DataProvider/CourseItemDataProvider.php +++ b/src/DataProvider/CourseItemDataProvider.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Dbp\Relay\CourseBundle\DataProvider; +namespace Dbp\Relay\BaseCourseBundle\DataProvider; use ApiPlatform\Core\DataProvider\ItemDataProviderInterface; use ApiPlatform\Core\DataProvider\RestrictedDataProviderInterface; -use Dbp\Relay\CourseBundle\API\CourseProviderInterface; -use Dbp\Relay\CourseBundle\Entity\Course; +use Dbp\Relay\BaseCourseBundle\API\CourseProviderInterface; +use Dbp\Relay\BaseCourseBundle\Entity\Course; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; final class CourseItemDataProvider extends AbstractController implements ItemDataProviderInterface, RestrictedDataProviderInterface diff --git a/src/DbpRelayCourseBundle.php b/src/DbpRelayBaseCourseBundle.php similarity index 71% rename from src/DbpRelayCourseBundle.php rename to src/DbpRelayBaseCourseBundle.php index 79b3e90e251ff111dfda7466f125c29b3dfdd177..9e6eca491bfa96cc99d6287c4a17bd377e2bea45 100644 --- a/src/DbpRelayCourseBundle.php +++ b/src/DbpRelayBaseCourseBundle.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Dbp\Relay\CourseBundle; +namespace Dbp\Relay\BaseCourseBundle; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; -class DbpRelayCourseBundle extends Bundle +class DbpRelayBaseCourseBundle extends Bundle { public function build(ContainerBuilder $container) { diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index ea3012b0edcacadaf75a66224d7f6198b2052c58..2a3f6b102a9ea7333cbe52cc09c14be02269a41b 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Dbp\Relay\CourseBundle\DependencyInjection; +namespace Dbp\Relay\BaseCourseBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; diff --git a/src/DependencyInjection/DbpRelayCourseExtension.php b/src/DependencyInjection/DbpRelayBaseCourseExtension.php similarity index 89% rename from src/DependencyInjection/DbpRelayCourseExtension.php rename to src/DependencyInjection/DbpRelayBaseCourseExtension.php index 36b695836f042acbed9bebfcbcac80191e4e3921..fcc750dd76143f80af98f5f98f4e7cdf93e20356 100644 --- a/src/DependencyInjection/DbpRelayCourseExtension.php +++ b/src/DependencyInjection/DbpRelayBaseCourseExtension.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Dbp\Relay\CourseBundle\DependencyInjection; +namespace Dbp\Relay\BaseCourseBundle\DependencyInjection; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component\HttpKernel\DependencyInjection\ConfigurableExtension; -class DbpRelayCourseExtension extends ConfigurableExtension +class DbpRelayBaseCourseExtension extends ConfigurableExtension { public function loadInternal(array $mergedConfig, ContainerBuilder $container) { diff --git a/src/Entity/Course.php b/src/Entity/Course.php index ca4b8020b7db8d6b78220933db096f2e20cf2cb2..1c6ceea25ed220b6d43c5a7e8c5a956aab92e1ee 100644 --- a/src/Entity/Course.php +++ b/src/Entity/Course.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Dbp\Relay\CourseBundle\Entity; +namespace Dbp\Relay\BaseCourseBundle\Entity; use ApiPlatform\Core\Annotation\ApiResource; -use Dbp\Relay\CourseBundle\Controller\GetCoursesByOrganization; -use Dbp\Relay\CourseBundle\Controller\GetCoursesByPerson; +use Dbp\Relay\BaseCourseBundle\Controller\GetCoursesByOrganization; +use Dbp\Relay\BaseCourseBundle\Controller\GetCoursesByPerson; use Symfony\Component\Serializer\Annotation\Groups; /** diff --git a/src/Entity/CourseAttendee.php b/src/Entity/CourseAttendee.php index f995bfeda301a69fe3c5d37a19447b8aa4e67d00..7ce7bcb1e850c83f6f0d7af7fd5fff259f7c2b18 100644 --- a/src/Entity/CourseAttendee.php +++ b/src/Entity/CourseAttendee.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Dbp\Relay\CourseBundle\Entity; +namespace Dbp\Relay\BaseCourseBundle\Entity; use ApiPlatform\Core\Annotation\ApiResource; +use Dbp\Relay\BaseCourseBundle\Controller\GetAttendeesByCourse; use Dbp\Relay\BasePersonBundle\Entity\PersonInterface; use Dbp\Relay\BasePersonBundle\Entity\PersonTrait; -use Dbp\Relay\CourseBundle\Controller\GetAttendeesByCourse; use Symfony\Component\Serializer\Annotation\Groups; /** diff --git a/src/Entity/CourseInterface.php b/src/Entity/CourseInterface.php index e080e211818abcd77fba0ad0b42e85865fc3bba0..a438edc31da092f183926d0f397f1d8fab9dc776 100644 --- a/src/Entity/CourseInterface.php +++ b/src/Entity/CourseInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Dbp\Relay\CourseBundle\Entity; +namespace Dbp\Relay\BaseCourseBundle\Entity; interface CourseInterface { diff --git a/src/Entity/CourseTrait.php b/src/Entity/CourseTrait.php index fee2a484b41ef8442dff934c6606840a446c3e88..c1fa6f0790c4f5f1e8be9933983872c7bffc8d2c 100644 --- a/src/Entity/CourseTrait.php +++ b/src/Entity/CourseTrait.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Dbp\Relay\CourseBundle\Entity; +namespace Dbp\Relay\BaseCourseBundle\Entity; use ApiPlatform\Core\Annotation\ApiProperty; use Symfony\Component\Serializer\Annotation\Groups; diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml index 62573e7d6a4169a70cd61954fe23ed008b46c6a0..a72592008bc461aceb2cb7180365ab7bf5b85f6d 100644 --- a/src/Resources/config/services.yaml +++ b/src/Resources/config/services.yaml @@ -1,17 +1,17 @@ services: - Dbp\Relay\CourseBundle\Controller\: + Dbp\Relay\BaseCourseBundle\Controller\: resource: '../../Controller' autoconfigure: true autowire: true - Dbp\Relay\CourseBundle\DataProvider\: + Dbp\Relay\BaseCourseBundle\DataProvider\: resource: '../../DataProvider' autowire: true autoconfigure: true - Dbp\Relay\CourseBundle\Service\DummyCourseProvider: + Dbp\Relay\BaseCourseBundle\Service\DummyCourseProvider: autowire: true autoconfigure: true - Dbp\Relay\CourseBundle\API\CourseProviderInterface: - '@Dbp\Relay\CourseBundle\Service\DummyCourseProvider' + Dbp\Relay\BaseCourseBundle\API\CourseProviderInterface: + '@Dbp\Relay\BaseCourseBundle\Service\DummyCourseProvider' diff --git a/src/Service/DummyCourseProvider.php b/src/Service/DummyCourseProvider.php index 3004bddb402706af37869240423d77ed4ec66855..80d4b0b99da0605624b1956eff17e3cd6de45906 100644 --- a/src/Service/DummyCourseProvider.php +++ b/src/Service/DummyCourseProvider.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Dbp\Relay\CourseBundle\Service; +namespace Dbp\Relay\BaseCourseBundle\Service; -use Dbp\Relay\CourseBundle\API\CourseProviderInterface; -use Dbp\Relay\CourseBundle\Entity\Course; -use Dbp\Relay\CourseBundle\Entity\CourseAttendee; +use Dbp\Relay\BaseCourseBundle\API\CourseProviderInterface; +use Dbp\Relay\BaseCourseBundle\Entity\Course; +use Dbp\Relay\BaseCourseBundle\Entity\CourseAttendee; class DummyCourseProvider implements CourseProviderInterface { diff --git a/tests/ApiTest.php b/tests/ApiTest.php index 553e39f4566cafefebce57aa4042adb59722c858..d0feae71bd7acc574a63e5b77909dfbcead3f342 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Dbp\Relay\CourseBundle\Tests; +namespace Dbp\Relay\BaseCourseBundle\Tests; use ApiPlatform\Core\Bridge\Symfony\Bundle\Test\ApiTestCase; use Symfony\Component\HttpFoundation\Response; diff --git a/tests/Kernel.php b/tests/Kernel.php index 988dcbd70eac5dbaf15810b6a8c3e0c095fcfb0e..ce154ab57c4e904eb93e4d63b65f86946f00067b 100644 --- a/tests/Kernel.php +++ b/tests/Kernel.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Dbp\Relay\CourseBundle\Tests; +namespace Dbp\Relay\BaseCourseBundle\Tests; use ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle; +use Dbp\Relay\BaseCourseBundle\DbpRelayBaseCourseBundle; use Dbp\Relay\CoreBundle\DbpRelayCoreBundle; -use Dbp\Relay\CourseBundle\DbpRelayCourseBundle; use Nelmio\CorsBundle\NelmioCorsBundle; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; @@ -30,7 +30,7 @@ class Kernel extends BaseKernel yield new NelmioCorsBundle(); yield new MonologBundle(); yield new ApiPlatformBundle(); - yield new DbpRelayCourseBundle(); + yield new DbpRelayBaseCourseBundle(); yield new DbpRelayCoreBundle(); }