Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: regions list #2

Merged
merged 4 commits into from
Dec 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"symfony/dotenv": "6.2.*",
"symfony/flex": "^2",
"symfony/framework-bundle": "6.2.*",
"symfony/monolog-bundle": "^3.8",
"symfony/runtime": "6.2.*",
"symfony/security-bundle": "6.2.*",
"symfony/serializer": "6.2.*",
Expand Down
267 changes: 266 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
];
54 changes: 54 additions & 0 deletions config/packages/monolog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
monolog:
channels:
- deprecation # Deprecations are logged in the dedicated "deprecation" channel when it exists

when@dev:
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: [ "!event" ]
console:
type: console
level: debug
process_psr_3_messages: false
channels: [ "!event", "!doctrine", "!console" ]

when@test:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [ 404, 405 ]
channels: [ "!event" ]
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug

when@prod:
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
excluded_http_codes: [ 404, 405 ]
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
nested:
type: stream
path: php://stderr
level: debug
formatter: monolog.formatter.json
console:
type: console
process_psr_3_messages: false
channels: [ "!event", "!doctrine" ]
deprecation:
type: stream
channels: [ deprecation ]
path: php://stderr
22 changes: 22 additions & 0 deletions src/Action/Region/Get/GetRegionsAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

namespace App\Action\Region\Get;

use App\Repository\RegionRepositoryInterface;

readonly class GetRegionsAction implements GetRegionsActionInterface
{
public function __construct(private RegionRepositoryInterface $regionRepository)
{
}

public function run(GetRegionsActionRequest $request): GetRegionsActionResponse
{
return new GetRegionsActionResponse(
$this->regionRepository->list($request->offset, $request->limit, $request->title)
);
}

}
10 changes: 10 additions & 0 deletions src/Action/Region/Get/GetRegionsActionInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace App\Action\Region\Get;

interface GetRegionsActionInterface
{
public function run(GetRegionsActionRequest $request): GetRegionsActionResponse;
}
Loading