title: check entity parameter route
body: <p>How can i check if element exists with this method :</p>
  <pre><code>#[Route('/edit/{id}', name: 'edit')]
  public function edit(Category $category): Response
  {
      //some code
      return $this-&gt;render('someView.html.twig');
  }
  </code></pre>
  <p>Like with this method :</p>
  <pre><code>#[Route('/edit/{id}', name: 'edit')]
  public function edit($id, CategoryRepository $categoryRepository): Response
  {
      $category= $categoryRepository-&gt;findOneBy(['id' =&gt; $id]);
      if (!$category) return $this-&gt;redirectToRoute('category_list');
      return $this-&gt;render('someView.html.twig');
  }
  </code></pre>