<commit_before><?php
declare(strict_types = 1);
/**
 * /src/Controller/HealthzController.php
 *
 * @author TLe, <NAME> <<EMAIL>>
 */

namespace App\Controller;

use App\Rest\ResponseHandler;
use App\Utils\HealthzService;
use OpenApi\Annotations as OA;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Throwable;

/**
 * Class HealthzController
 *
 * @package App\Controller
 * @author TLe, <NAME> <<EMAIL>>
 */
class HealthzController
{
    public function __construct(
        private ResponseHandler $responseHandler,
        private HealthzService $healthzService,
    ) {
    }

    /**
     * Route for application health check. This action will make some simple
     * tasks to ensure that application is up and running like expected.
     *
     * @see https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
     *
     * @Route(
     *     path="/healthz",
     *     methods={"GET"}
     *  )
     *
     * @OA\Response(
     *      response=200,
     *      description="success",
     *      @OA\Schema(
     *          type="object",
     *          example={"timestamp": "2018-01-01T13:08:05+00:00"},
     *          @OA\Property(property="timestamp", type="string"),
     *      ),
     *  )
     *
     * @throws Throwable
     */
    public function __invoke(Request $request): Response
    {
        return $this->responseHandler->createResponse(
            $request,
            $this->healthzService->check(),
            null,
            200,
            ResponseHandler::FORMAT_JSON,
            [
                'groups' => [
                    'Healthz.timestamp',
                ],
            ]
        );
    }
}
<commit_msg>Use PHP 8 named parameters feature<commit_after><?php
declare(strict_types = 1);
/**
 * /src/Controller/HealthzController.php
 *
 * @author TLe, <NAME> <<EMAIL>>
 */

namespace App\Controller;

use App\Rest\ResponseHandler;
use App\Utils\HealthzService;
use OpenApi\Annotations as OA;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Throwable;

/**
 * Class HealthzController
 *
 * @package App\Controller
 * @author TLe, <NAME> <<EMAIL>>
 */
class HealthzController
{
    public function __construct(
        private ResponseHandler $responseHandler,
        private HealthzService $healthzService,
    ) {
    }

    /**
     * Route for application health check. This action will make some simple
     * tasks to ensure that application is up and running like expected.
     *
     * @see https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
     *
     * @Route(
     *     path="/healthz",
     *     methods={"GET"}
     *  )
     *
     * @OA\Response(
     *      response=200,
     *      description="success",
     *      @OA\Schema(
     *          type="object",
     *          example={"timestamp": "2018-01-01T13:08:05+00:00"},
     *          @OA\Property(property="timestamp", type="string"),
     *      ),
     *  )
     *
     * @throws Throwable
     */
    public function __invoke(Request $request): Response
    {
        return $this->responseHandler->createResponse(
            $request,
            $this->healthzService->check(),
            format: ResponseHandler::FORMAT_JSON,
            context: [
                'groups' => [
                    'Healthz.timestamp',
                ],
            ],
        );
    }
}

{'fraction_non_alphanumeric': 0.12688232013385387, 'fraction_numerical': 0.013385387618516454, 'mean_word_length': 2.1575704225352115, 'pattern_counts': {'":': 2, '<': 17, '<?xml version=': 0, '>': 25, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1671182', 'n_tokens_mistral': 1065, 'n_tokens_neox': 1019, 'n_words': 199}