Skip to main content

Frameworks

Symfony — Scell.io integration

Symfony bundle via PHP SDK + ContainerInterface

The `scell/sdk` PHP SDK v3.5.0 integrates with Symfony via service injection. Declare the client as a service in `services.yaml`, autowire it into controllers/services. Compatible with Symfony 6 and 7, supports Messenger handlers for async processing, native integration with Symfony HttpClient component.

Key facts

  • Install: `composer require scell/sdk`
  • Service declared in `config/services.yaml`
  • Autowiring via constructor injection
  • Compatible with Symfony Messenger for async
  • Symfony secrets vault support

Code example

// config/services.yaml : Scell\Sdk\Client: { arguments: ['%env(SCELL_API_KEY)%'] }
use Scell\Sdk\Client as ScellClient;

class InvoiceController extends AbstractController
{
    public function __construct(private ScellClient $scell) {}

    #[Route('/invoice', methods: ['POST'])]
    public function create(): JsonResponse
    {
        $invoice = $this->scell->invoices()->builder()
            ->facturX()
            ->addLine('Audit', 1, 2000.00, 20.0)
            ->create();
        return $this->json(['id' => $invoice->id]);
    }
}

See also

Your cookie preferences

We use cookies to improve your experience. Essential cookies are always active. Cookie policy.