Move query classes to storage module

This commit is contained in:
Krzysztof Sikorski 2024-01-28 05:00:06 +01:00
parent 7b05a6aa60
commit bb12655ca8
Signed by: krzysztof-sikorski
GPG key ID: 4EB564BD08FE8476
7 changed files with 27 additions and 8 deletions

View file

@ -2,11 +2,10 @@
declare(strict_types=1);
namespace App\Service\Query;
namespace Quintolin\Storage\Query;
use Quintolin\Storage\QueryResult\ReleaseNote;
use DateTimeImmutable;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Quintolin\Storage\QueryResult\ReleaseNote;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Finder\SplFileInfo;
@ -15,7 +14,6 @@ use function sprintf;
abstract readonly class AbstractReleaseNotesQuery
{
public function __construct(
#[Autowire('%kernel.project_dir%/data/release-notes')]
private string $projectDir,
) {}

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace App\Service\Query;
namespace Quintolin\Storage\Query;
use Quintolin\Storage\QueryResult\ReleaseNote;

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace App\Service\Query;
namespace Quintolin\Storage\Query;
use Quintolin\Storage\QueryResult\ReleaseNote;

View file

@ -0,0 +1,18 @@
services:
_defaults:
autowire: true
autoconfigure: true
Quintolin\Storage\Query\:
resource: '../../../modules/storage/src/Query/'
Quintolin\Storage\Query\AbstractReleaseNotesQuery:
abstract: true
arguments:
$projectDir: '%kernel.project_dir%/data/release-notes'
Quintolin\Storage\Query\LatestReleaseNoteQuery:
parent: Quintolin\Storage\Query\AbstractReleaseNotesQuery
Quintolin\Storage\Query\ReleaseNotesQuery:
parent: Quintolin\Storage\Query\AbstractReleaseNotesQuery

View file

@ -1,3 +1,6 @@
imports:
- {resource: 'modules/storage.yaml'}
# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.

View file

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace App\Controller\Website;
use App\Service\Query\LatestReleaseNoteQuery;
use Quintolin\Storage\Query\LatestReleaseNoteQuery;
use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Attribute\AsController;

View file

@ -4,7 +4,7 @@ declare(strict_types=1);
namespace App\Controller\Website;
use App\Service\Query\ReleaseNotesQuery;
use Quintolin\Storage\Query\ReleaseNotesQuery;
use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Attribute\AsController;