Skip to content
Open
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
5 changes: 5 additions & 0 deletions app/config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ doctrine:
is_bundle: false
dir: '%kernel.project_dir%/../sources/AppBundle/Veille/Entity'
prefix: 'AppBundle\Veille\Entity'
PlanetePHP:
type: attribute
is_bundle: false
dir: '%kernel.project_dir%/../sources/PlanetePHP'
prefix: 'PlanetePHP'
when@test:
doctrine:
dbal:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class CleanupUserIdInPlaneteFlux extends AbstractMigration
{
public function change(): void
{
$this->query(<<<SQL
UPDATE afup_planete_flux
SET id_personne_physique = NULL
WHERE id_personne_physique = 0;
SQL);
}
}
306 changes: 0 additions & 306 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -10813,311 +10813,5 @@
'count' => 1,
'path' => __DIR__ . '/sources/AppBundle/VideoNotifier/StatusGenerator.php',
];
$ignoreErrors[] = [
'message' => '#^Binary operation "\\*" between mixed and mixed results in an error\\.$#',
'identifier' => 'binaryOp.invalid',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Cannot cast mixed to int\\.$#',
'identifier' => 'cast.int',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Cannot cast mixed to string\\.$#',
'identifier' => 'cast.string',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedArticleRepository\\:\\:findIdByKey\\(\\) has no return type specified\\.$#',
'identifier' => 'missingType.return',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedArticleRepository\\:\\:findIdByKey\\(\\) has parameter \\$key with no type specified\\.$#',
'identifier' => 'missingType.parameter',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedArticleRepository\\:\\:findLatest\\(\\) has parameter \\$format with no type specified\\.$#',
'identifier' => 'missingType.parameter',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedArticleRepository\\:\\:findLatest\\(\\) has parameter \\$nombre with no type specified\\.$#',
'identifier' => 'missingType.parameter',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedArticleRepository\\:\\:findLatest\\(\\) has parameter \\$page with no type specified\\.$#',
'identifier' => 'missingType.parameter',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedArticleRepository\\:\\:hydrate\\(\\) has parameter \\$rows with no value type specified in iterable type array\\.$#',
'identifier' => 'missingType.iterableValue',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedArticleRepository\\:\\:hydrate\\(\\) return type has no value type specified in iterable type array\\.$#',
'identifier' => 'missingType.iterableValue',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedArticleRepository\\:\\:hydrateDisplayable\\(\\) has parameter \\$format with no type specified\\.$#',
'identifier' => 'missingType.parameter',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedArticleRepository\\:\\:hydrateDisplayable\\(\\) has parameter \\$rows with no value type specified in iterable type array\\.$#',
'identifier' => 'missingType.iterableValue',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedArticleRepository\\:\\:insert\\(\\) has no return type specified\\.$#',
'identifier' => 'missingType.return',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedArticleRepository\\:\\:isRelevant\\(\\) has parameter \\$content with no type specified\\.$#',
'identifier' => 'missingType.parameter',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedArticleRepository\\:\\:save\\(\\) has no return type specified\\.$#',
'identifier' => 'missingType.return',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedArticleRepository\\:\\:search\\(\\) should return array\\<PlanetePHP\\\\FeedArticle\\> but returns array\\.$#',
'identifier' => 'return.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedArticleRepository\\:\\:update\\(\\) has no return type specified\\.$#',
'identifier' => 'missingType.return',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedArticleRepository\\:\\:update\\(\\) has parameter \\$id with no type specified\\.$#',
'identifier' => 'missingType.parameter',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(mixed\\)\\: mixed\\)\\|null, Closure\\(array\\)\\: PlanetePHP\\\\DisplayableFeedArticle given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(mixed\\)\\: mixed\\)\\|null, Closure\\(array\\)\\: PlanetePHP\\\\FeedArticle given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$format of function date expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$id of class PlanetePHP\\\\FeedArticle constructor expects int\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$title of class PlanetePHP\\\\DisplayableFeedArticle constructor expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$value of function intval expects array\\|bool\\|float\\|GMP\\|int\\|resource\\|SimpleXMLElement\\|string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 2,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#10 \\$status of class PlanetePHP\\\\FeedArticle constructor expects int\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#2 \\$feedId of class PlanetePHP\\\\FeedArticle constructor expects int\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#2 \\$url of class PlanetePHP\\\\DisplayableFeedArticle constructor expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#3 \\$key of class PlanetePHP\\\\FeedArticle constructor expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#4 \\$author of class PlanetePHP\\\\DisplayableFeedArticle constructor expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#4 \\$title of class PlanetePHP\\\\FeedArticle constructor expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#5 \\$content of class PlanetePHP\\\\DisplayableFeedArticle constructor expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#5 \\$url of class PlanetePHP\\\\FeedArticle constructor expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#6 \\$feedName of class PlanetePHP\\\\DisplayableFeedArticle constructor expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#6 \\$update of class PlanetePHP\\\\FeedArticle constructor expects int\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#7 \\$author of class PlanetePHP\\\\FeedArticle constructor expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#7 \\$feedUrl of class PlanetePHP\\\\DisplayableFeedArticle constructor expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#8 \\$summary of class PlanetePHP\\\\FeedArticle constructor expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#9 \\$content of class PlanetePHP\\\\FeedArticle constructor expects string\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedArticleRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedRepository\\:\\:find\\(\\) should return array\\<PlanetePHP\\\\Feed\\> but returns array\\.$#',
'identifier' => 'return.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedRepository\\:\\:findActive\\(\\) should return array\\<PlanetePHP\\\\Feed\\> but returns array\\.$#',
'identifier' => 'return.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedRepository\\:\\:hydrate\\(\\) has parameter \\$row with no value type specified in iterable type array\\.$#',
'identifier' => 'missingType.iterableValue',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedRepository\\:\\:hydrateAll\\(\\) has parameter \\$rows with no value type specified in iterable type array\\.$#',
'identifier' => 'missingType.iterableValue',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Method PlanetePHP\\\\FeedRepository\\:\\:hydrateAll\\(\\) return type has no value type specified in iterable type array\\.$#',
'identifier' => 'missingType.iterableValue',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(mixed\\)\\: mixed\\)\\|null, Closure\\(array\\)\\: PlanetePHP\\\\Feed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$id of class PlanetePHP\\\\Feed constructor expects int, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$row of method PlanetePHP\\\\FeedRepository\\:\\:hydrate\\(\\) expects array, array\\<string, mixed\\>\\|false given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$value of static method PlanetePHP\\\\FeedStatus\\:\\:from\\(\\) expects int\\|string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#2 \\$name of class PlanetePHP\\\\Feed constructor expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#3 \\$url of class PlanetePHP\\\\Feed constructor expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#4 \\$feed of class PlanetePHP\\\\Feed constructor expects string, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedRepository.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#6 \\$userId of class PlanetePHP\\\\Feed constructor expects int\\|null, mixed given\\.$#',
'identifier' => 'argument.type',
'count' => 1,
'path' => __DIR__ . '/sources/PlanetePHP/FeedRepository.php',
];

return ['parameters' => ['ignoreErrors' => $ignoreErrors]];
22 changes: 10 additions & 12 deletions sources/AppBundle/Controller/Admin/Planete/FeedAddAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
namespace AppBundle\Controller\Admin\Planete;

use AppBundle\AuditLog\Audit;
use AppBundle\Planete\FeedFormData;
use AppBundle\Planete\FeedFormType;
use Exception;
use PlanetePHP\Feed;
use PlanetePHP\FeedRepository;
use PlanetePHP\FeedStatus;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand All @@ -22,20 +23,17 @@ public function __construct(

public function __invoke(Request $request): Response
{
$data = new FeedFormData();
$form = $this->createForm(FeedFormType::class, $data);
$feed = new Feed();
$feed->url = 'https://';
$feed->feed = 'https://';
$feed->status = FeedStatus::Active;
$form = $this->createForm(FeedFormType::class, $feed);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
try {
$this->feedRepository->insert(
$data->name,
$data->url,
$data->feed,
$data->status,
$data->userId,
);

$this->audit->log('Ajout du flux ' . $data->name);
$this->feedRepository->save($feed);

$this->audit->log('Ajout du flux ' . $feed->name);
$this->addFlash('notice', 'Le flux a été ajouté');

return $this->redirectToRoute('admin_planete_feed_list');
Expand Down
Loading
Loading