I'm using the jwt firebase class in a project, it's path in vendor is:
vendor\firebase\php-jwt\src\jwt
I'm trying to define the class as a service to be able to inject in another class, but I'm not able to do it.
I'm to do this in the service.yml file:
#services.yaml
services:
Firebase:
class: '../vendor\firebase\php-jwt\JWT'
An this is the class I have created:
<?php
namespace App\Helpers;
use Firebase\JWT\JWT;
use Symfony\Component\HttpKernel\KernelInterface;
class simpleJwt
{
private $encrypt = 'RS256';
function __construct(KernelInterface $kernel, JWT $JWT )
{
$this->rootDir = $kernel->getProjectDir();
$this->jwt = $JWT;
}
}
When I try to load it I get this error:
Cannot autowire service "App\Helpers\simpleJwt": argument "$JWT" of method "__construct()" references class "Firebase\JWT\JWT" but no such service exists.
Thanks