fix: use same terminology
This commit is contained in:
parent
0efd5343e3
commit
a31b283847
@ -31,7 +31,7 @@ services:
|
||||
arguments:
|
||||
$available_currencies: '%app.currencies%'
|
||||
|
||||
App\Service\StubQRCodeGenerator:
|
||||
App\Service\StubQRCodeProvider:
|
||||
arguments:
|
||||
$imagePath: '%kernel.project_dir%/assets/images/wip.png'
|
||||
|
||||
@ -47,7 +47,7 @@ services:
|
||||
$retryCount: 2
|
||||
$retryWaitSeconds: 0.5
|
||||
|
||||
App\Service\CachedQRCodeGenerator:
|
||||
App\Service\CachedQRCodeProvider:
|
||||
arguments:
|
||||
$innerGenerator: '@App\Service\Remote\UsetrenoQRCodeProvider'
|
||||
$cacheDuration: 'PT60S'
|
||||
@ -55,7 +55,7 @@ services:
|
||||
|
||||
App\Service\CurrencyListerInterface: '@App\Service\StaticCurrencyLister'
|
||||
App\Service\QRCodeQROptionsProviderInterface: '@App\Service\QRCodeQROptionsDefaultProvider'
|
||||
App\Service\QRCodeGeneratorInterface: '@App\Service\CachedQRCodeGenerator'
|
||||
App\Service\QRCodeProviderInterface: '@App\Service\CachedQRCodeProvider'
|
||||
|
||||
# add more service definitions when explicit configuration is needed
|
||||
# please note that last definitions always *replace* previous ones
|
||||
|
@ -5,7 +5,7 @@ namespace App\Controller;
|
||||
use App\Entity\Input\QRCode\QRCode;
|
||||
use App\Form\Type\QRCodeType;
|
||||
use App\Service\DTO\QRCodeEntityConverter;
|
||||
use App\Service\QRCodeGeneratorInterface;
|
||||
use App\Service\QRCodeProviderInterface;
|
||||
use App\Service\QRCodeQROptionsProviderInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@ -17,7 +17,7 @@ class IndexController extends AbstractController {
|
||||
#[Route('/', name: 'homepage')]
|
||||
public function indexAction(
|
||||
Request $request,
|
||||
QRCodeGeneratorInterface $qrCodeGenerator,
|
||||
QRCodeProviderInterface $qrCodeGenerator,
|
||||
): Response
|
||||
{
|
||||
$qrCodeImage = null;
|
||||
|
@ -5,7 +5,7 @@ namespace App\Service;
|
||||
|
||||
use App\Entity\DTO\QRCode\QRCode;
|
||||
|
||||
interface CacheableQRCodeGeneratorInterface extends QRCodeGeneratorInterface
|
||||
interface CacheableQRCodeProviderInterface extends QRCodeProviderInterface
|
||||
{
|
||||
// We can't calculate cache key directly from QRCode
|
||||
public function getCacheKey(QRCode $entity): string;
|
@ -10,14 +10,14 @@ use Symfony\Contracts\Cache\CacheInterface;
|
||||
use Symfony\Contracts\Cache\ItemInterface;
|
||||
|
||||
|
||||
final readonly class CachedQRCodeGenerator implements QRCodeGeneratorInterface
|
||||
final readonly class CachedQRCodeProvider implements QRCodeProviderInterface
|
||||
{
|
||||
private \DateInterval $cacheDuration;
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
public function __construct(private CacheableQRCodeGeneratorInterface $innerGenerator, private CacheInterface $cache, private LoggerInterface $logger, string $cacheDuration)
|
||||
public function __construct(private CacheableQRCodeProviderInterface $innerGenerator, private CacheInterface $cache, private LoggerInterface $logger, string $cacheDuration)
|
||||
{
|
||||
$this->cacheDuration = new \DateInterval($cacheDuration);
|
||||
}
|
@ -6,7 +6,7 @@ namespace App\Service;
|
||||
use App\Entity\DTO\QRCode\QRCode;
|
||||
use App\Service\Exception\QRCodeGeneratorException;
|
||||
|
||||
interface QRCodeGeneratorInterface
|
||||
interface QRCodeProviderInterface
|
||||
{
|
||||
/**
|
||||
* Generates QR code from entity
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
namespace App\Service\Remote;
|
||||
|
||||
use App\Entity\DTO\QRCode\QRCode;
|
||||
use App\Service\CacheableQRCodeGeneratorInterface;
|
||||
use App\Service\CacheableQRCodeProviderInterface;
|
||||
use App\Service\Remote\Edge\QRCodeEntityConverter;
|
||||
use App\Service\Remote\Exception\UsetrenoQRCodeException;
|
||||
use App\Service\Remote\Exception\UsetrenoQRCodeRemoteServerErrorException;
|
||||
@ -12,7 +12,7 @@ use Nubium\Exception\ThisShouldNeverHappenException;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\HttpClient\Exception\TransportException;
|
||||
|
||||
class UsetrenoQRCodeProvider implements CacheableQRCodeGeneratorInterface
|
||||
class UsetrenoQRCodeProvider implements CacheableQRCodeProviderInterface
|
||||
{
|
||||
use RetryingFailClientTrait;
|
||||
|
||||
|
@ -5,7 +5,7 @@ namespace App\Service;
|
||||
|
||||
use App\Entity\DTO\QRCode\QRCode;
|
||||
|
||||
readonly final class StubQRCodeGenerator implements QRCodeGeneratorInterface
|
||||
readonly final class StubQRCodeProvider implements QRCodeProviderInterface
|
||||
{
|
||||
public function __construct(private string $imagePath) {}
|
||||
|
@ -3,7 +3,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Tests\Controller;
|
||||
|
||||
use App\Service\QRCodeGeneratorInterface;
|
||||
use App\Service\QRCodeProviderInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
@ -76,7 +76,7 @@ class IndexControllerTest extends WebTestCase
|
||||
|
||||
private function generateClientForSubmitTest(): KernelBrowser
|
||||
{
|
||||
$mock = $this->createMock(QRCodeGeneratorInterface::class);
|
||||
$mock = $this->createMock(QRCodeProviderInterface::class);
|
||||
$mock->expects($this->any())
|
||||
->method('generateQRCodeFromEntity')
|
||||
->will($this->returnValue('foo'));
|
||||
@ -85,7 +85,7 @@ class IndexControllerTest extends WebTestCase
|
||||
$client = static::createClient();
|
||||
$client->disableReboot();
|
||||
|
||||
self::getContainer()->set('App\Service\QRCodeGeneratorInterface', $mock);
|
||||
self::getContainer()->set('App\Service\QRCodeProviderInterface', $mock);
|
||||
|
||||
return $client;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user