<?php

declare(strict_types=1);

namespace App\Module\Integration\Infrastructure\Doctrine;

use App\Module\Integration\Domain\Entity\GiteaConfiguration;
use App\Module\Integration\Domain\Repository\GiteaConfigurationRepositoryInterface;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;

/**
 * @extends ServiceEntityRepository<GiteaConfiguration>
 */
class DoctrineGiteaConfigurationRepository extends ServiceEntityRepository implements GiteaConfigurationRepositoryInterface
{
    public function __construct(ManagerRegistry $registry)
    {
        parent::__construct($registry, GiteaConfiguration::class);
    }

    public function findSingleton(): ?GiteaConfiguration
    {
        return $this->findOneBy([]);
    }
}
