title: How can I load a vendor class as a Service in Symfony 4?
body: <p>I'm using the jwt firebase class in a project, it's path in vendor is:</p>
  
  <p><code>vendor\firebase\php-jwt\src\jwt</code></p>
  
  <p>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.</p>
  
  <p>I'm to do this in the service.yml file:</p>
  
  <pre><code>#services.yaml    
  services:
      Firebase:
          class: '../vendor\firebase\php-jwt\JWT'
  </code></pre>
  
  <p>An this is the class I have created:</p>
  
  <pre><code>&lt;?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-&gt;rootDir = $kernel-&gt;getProjectDir();
          $this-&gt;jwt = $JWT;
      }
  }
  </code></pre>
  
  <p>When I try to load it I get this error:</p>
  
  <pre><code>Cannot autowire service "App\Helpers\simpleJwt": argument "$JWT" of method "__construct()" references class "Firebase\JWT\JWT" but no such service exists. 
  </code></pre>
  
  <p>Thanks</p>