voici mon code controlleur : <?php

namespace App\Controller;

use App\Form\MatchingformType;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\Serializer;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\Constraints\File;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;

#[Route('/matching')]
class MatchingController extends AbstractController
{
    #[Route('/', name: 'matching', methods: ['GET', 'POST'])]
    public function index(Request $request): Response
    {
        $form = $this->createForm(MatchingformType::class);
        $form->handleRequest($request);
         if ($form->isSubmitted() && $form->isValid()) {
            $file = $form->get('file')->getData();
             if (!is_null($file) && $file->getMimeType() == 'application/json') {
                $fileData = $this->readJsonFile($file);
                 $fileCompanyNames = array_column($fileData['value'], 'name');
                 $publicFilePath = $this->getParameter('kernel.project_dir') . '/public/Uploads/Json/list01.json';
                $publicFileData = $this->readJsonFile($publicFilePath);
                $publicCompanyNames = array_column($publicFileData, 'Inferred company name', 'URL');
                var_dump( $publicCompanyNames );
                 $matchedData = $this->matchJsonKeys($fileCompanyNames, $publicCompanyNames);

                 $downloadData = json_encode($matchedData);

                 return $this->render('matching/result.html.twig', [
                     'matchedData' => $matchedData,
                     'jsonFilePath' => $publicFilePath,
                     'downloadData' => $downloadData,

                 ]);

            } else {
                $this->addFlash('error', 'Veuillez télécharger un fichier JSON valide.');
            }
        }

         return $this->render('matching/index.html.twig', [
            'form' => $form->createView(),
        ]);
    }
     private function matchJsonKeys(array $fileData, array $publicData): array
    {
        $matchedData = array_intersect($fileData, $publicData);
        return $matchedData;
    }



     private function readJsonFile($filePath)
    {
        try {
            $fileContent = file_get_contents($filePath Write your response using less than 800 words.
user