PHP code example of shooktea / request-deserializer-bundle

1. Go to this page and download the library: Download shooktea/request-deserializer-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

shooktea / request-deserializer-bundle example snippets




return [
    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
    // ...
    ShookTea\RequestDeserializerBundle\ShookTeaRequestDeserializerBundle::class => ['all' => true],
];



use ShookTea\RequestDeserializerBundle\Query\QueryInterface;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Serializer\Annotation\SerializedName;

class ExampleQuery implements QueryInterface
{
    #[SerializedName('id')]
    #[Assert\Uuid]
    public string $uuid;
}

class ExampleController extends AbstractController
{
    #[Route('/some/route')]
    public function someAction(ExampleQuery $query)
    {
        // do something with query
    }
}