[backend] bump deps and fix styles

This commit is contained in:
2025-10-07 00:23:41 +02:00
parent 449718cdf2
commit 6855590d6b
8 changed files with 1043 additions and 968 deletions
@@ -75,10 +75,10 @@ class Article
public function defineOpenGraph(?OpenGraph $object): self
{
$this->metadata = new OpenGraph(
title: $object->title,
description: $object->description,
image: $object->image,
locale: $object->locale ?? "fr"
title: $object?->title,
description: $object?->description,
image: $object?->image,
locale: $object->locale ?? 'fr'
);
return $this;
@@ -6,7 +6,6 @@ namespace Basango\Aggregator\Presentation\Web\Controller;
use Basango\Aggregator\Application\UseCase\Command\CreateArticle;
use Basango\Aggregator\Domain\Model\ValueObject\Link;
use Basango\Aggregator\Domain\Model\ValueObject\OpenGraph;
use Basango\Aggregator\Presentation\WriteModel\AddArticleModel;
use Basango\SharedKernel\Presentation\Web\Controller\AbstractController;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
@@ -25,7 +24,7 @@ use Symfony\Component\Routing\Requirement\Requirement;
final class AddArticleController extends AbstractController
{
public function __construct(
#[Autowire(env: "BASANGO_CRAWLER_TOKEN")] private string $token
#[Autowire(env: 'BASANGO_CRAWLER_TOKEN')] private readonly string $token
) {
}
@@ -33,12 +32,12 @@ final class AddArticleController extends AbstractController
path: '/api/aggregator/articles',
name: 'aggregator_add_article',
requirements: [
'token' => Requirement::ASCII_SLUG
'token' => Requirement::ASCII_SLUG,
],
methods: ['POST']
)]
public function __invoke(
#[MapQueryParameter] string $token,
#[MapQueryParameter] string $token,
#[MapRequestPayload] AddArticleModel $model
): JsonResponse {
if ($token !== $this->token) {
@@ -48,14 +47,13 @@ final class AddArticleController extends AbstractController
$this->handleCommand(new CreateArticle(
$model->title,
Link::from($model->link),
join(', ', $model->categories),
implode(', ', $model->categories),
$model->body,
$model->source,
$model->timestamp,
$model->metadata,
));
return new JsonResponse(status: Response::HTTP_CREATED);
}
}
@@ -23,7 +23,7 @@ class Bookmark
/**
* @var DataCollection<int, Article>
*/
private(set) public iterable $articles;
public private(set) iterable $articles;
private function __construct(
public readonly User $user,
@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace Basango\SharedKernel\Domain\DataTransfert;
use Basango\SharedKernel\Domain\Assert;
use BackedEnum as T;
use Symfony\Component\Uid\UuidV7;
/**