PHP code example of halloverden / symfony-route-deprecation-bundle

1. Go to this page and download the library: Download halloverden/symfony-route-deprecation-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/ */

    

halloverden / symfony-route-deprecation-bundle example snippets


// config/bundles.php

return [
    // ...
    HalloVerden\RouteDeprecationBundle\HalloVerdenRouteDeprecationBundle::class => ['all' => true],
];



namespace App\Controller;

use HalloVerden\RouteDeprecationBundle\Attribute\DeprecatedRoute;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;


#[Route(path: self::PATH, name: self::NAME, methods: ['GET'])]
#[DeprecatedRoute(since: '2023-01-01')]
class GetHealthzController extends BaseController {
  const PATH = '/healthz';
  const NAME = 'healthz_get';

  /**
   * @return Response
   */
  public function __invoke(): Response {
    return new Response('ok');
  }

}