welcome back to dyb-tech

This commit is contained in:
Daniel Guzman
2024-05-18 02:28:01 +02:00
parent 9513cdba09
commit 9f30bc98c7
6149 changed files with 668407 additions and 0 deletions
@@ -0,0 +1,58 @@
<?php
namespace Lexik\Bundle\JWTAuthenticationBundle\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
/**
* The "AND" in the if statement is a temporary fix for the following issue:
* https://github.com/lexik/LexikJWTAuthenticationBundle/issues/944
* https://github.com/vimeo/psalm/issues/7923
*/
if (80000 <= \PHP_VERSION_ID and (new \ReflectionMethod(JsonResponse::class, 'setData'))->hasReturnType()) {
eval('
namespace Lexik\Bundle\JWTAuthenticationBundle\Response;
use Symfony\Component\HttpFoundation\JsonResponse;
/**
* Compatibility layer for Symfony 6.0 and later.
*
* @internal
*/
abstract class JWTCompatAuthenticationFailureResponse extends JsonResponse
{
/**
* Sets the response data with the statusCode & message included.
*
* {@inheritdoc}
*
* @return static
*/
public function setData($data = []): static
{
return parent::setData((array)$data + ["code" => $this->statusCode, "message" => $this->getMessage()]);
}
}
');
} else {
/**
* Compatibility layer for Symfony 5.4 and earlier.
*
* @internal
*/
abstract class JWTCompatAuthenticationFailureResponse extends JsonResponse
{
/**
* Sets the response data with the statusCode & message included.
*
* {@inheritdoc}
*
* @return static
*/
public function setData($data = [])
{
return parent::setData((array)$data + ['code' => $this->statusCode, 'message' => $this->getMessage()]);
}
}
}