jungi / framework-extra-bundle
attributes for request and response operations, content negotiation, and more for symfony projects
Installs: 663
Dependents: 0
Suggesters: 0
Security: 0
Stars: 21
Watchers: 3
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.0.2
- symfony/dependency-injection: ^6.0
- symfony/framework-bundle: ^6.0
- symfony/http-kernel: ^6.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.11
- phpunit/phpunit: ^9.5
- symfony/property-access: ^6.0
- symfony/property-info: ^6.0
- symfony/serializer: ^6.0
Suggests
- symfony/serializer: For serializer adapters
README
This bundle adds additional features whose main purpose is to facilitate request/response operations.
Attributes:
Development
With the new release of Symfony v6.3 mapping request data to typed objects, the development and further need for this bundle has come to an end.
Documentation
Quick insight
namespace App\Controller; use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\Routing\Attribute\Route; use Jungi\FrameworkExtraBundle\Attribute\QueryParams; use Jungi\FrameworkExtraBundle\Attribute\RequestBody; use Jungi\FrameworkExtraBundle\Attribute\QueryParam; use Jungi\FrameworkExtraBundle\Attribute\RequestParam; use Jungi\FrameworkExtraBundle\Controller\ControllerTrait; #[Route('/users')] class UserController { use ControllerTrait; #[Route('/{userId}/residential-address', methods: ['PATCH'])] public function changeResidentialAddress(string $userId, #[RequestBody] UserResidentialAddressData $data) { // .. } #[Route('/{userId}/files/{fileName}', methods: ['PUT'])] public function uploadFile(string $userId, string $fileName, #[RequestBody] UploadedFile $file) { // .. } #[Route('/{userId}/avatar', methods: ['PATCH'])] public function replaceAvatar(string $userId, #[RequestParam] UploadedFile $file, #[RequestParam] string $title) { // .. } #[Route(methods: ['GET'])] public function getUsers(#[QueryParam] ?int $limit = null, #[QueryParam] ?int $offset = null) { // .. } #[Route(methods: ['GET'])] public function filterUsers(#[QueryParams] FilterUsersDto $filterData) { // .. /** @var UserData[] $filteredUsers */ return $this->entity($filteredUsers); } }