Skip to content

Commit a8f247f

Browse files
committed
Implémentation du AssembleeGeneraleRepository Doctrine
1 parent 717b9f5 commit a8f247f

17 files changed

Lines changed: 178 additions & 275 deletions

File tree

phpstan-baseline.php

Lines changed: 3 additions & 195 deletions
Original file line numberDiff line numberDiff line change
@@ -2920,23 +2920,17 @@
29202920
$ignoreErrors[] = [
29212921
'message' => '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#',
29222922
'identifier' => 'foreach.nonIterable',
2923-
'count' => 4,
2923+
'count' => 3,
29242924
'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/BadgesComputer.php',
29252925
];
29262926
$ignoreErrors[] = [
29272927
'message' => '#^Binary operation "\\." between \'Participation à l…\' and mixed results in an error\\.$#',
29282928
'identifier' => 'binaryOp.invalid',
2929-
'count' => 2,
2930-
'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/BadgesComputer.php',
2931-
];
2932-
$ignoreErrors[] = [
2933-
'message' => '#^Binary operation "\\." between \'Speaker de l\\\\\'année \' and mixed results in an error\\.$#',
2934-
'identifier' => 'binaryOp.invalid',
29352929
'count' => 1,
29362930
'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/BadgesComputer.php',
29372931
];
29382932
$ignoreErrors[] = [
2939-
'message' => '#^Binary operation "\\." between \'ag\\-\' and mixed results in an error\\.$#',
2933+
'message' => '#^Binary operation "\\." between \'Speaker de l\\\\\'année \' and mixed results in an error\\.$#',
29402934
'identifier' => 'binaryOp.invalid',
29412935
'count' => 1,
29422936
'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/BadgesComputer.php',
@@ -2980,7 +2974,7 @@
29802974
$ignoreErrors[] = [
29812975
'message' => '#^Cannot call method format\\(\\) on mixed\\.$#',
29822976
'identifier' => 'method.nonObject',
2983-
'count' => 7,
2977+
'count' => 3,
29842978
'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/BadgesComputer.php',
29852979
];
29862980
$ignoreErrors[] = [
@@ -2989,12 +2983,6 @@
29892983
'count' => 2,
29902984
'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/BadgesComputer.php',
29912985
];
2992-
$ignoreErrors[] = [
2993-
'message' => '#^Cannot call method getDate\\(\\) on mixed\\.$#',
2994-
'identifier' => 'method.nonObject',
2995-
'count' => 1,
2996-
'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/BadgesComputer.php',
2997-
];
29982986
$ignoreErrors[] = [
29992987
'message' => '#^Cannot call method getDateStart\\(\\) on mixed\\.$#',
30002988
'identifier' => 'method.nonObject',
@@ -3031,12 +3019,6 @@
30313019
'count' => 1,
30323020
'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/BadgesComputer.php',
30333021
];
3034-
$ignoreErrors[] = [
3035-
'message' => '#^Cannot call method isPresent\\(\\) on mixed\\.$#',
3036-
'identifier' => 'method.nonObject',
3037-
'count' => 1,
3038-
'path' => __DIR__ . '/sources/AppBundle/Association/UserMembership/BadgesComputer.php',
3039-
];
30403022
$ignoreErrors[] = [
30413023
'message' => '#^Cannot cast mixed to string\\.$#',
30423024
'identifier' => 'cast.string',
@@ -4951,24 +4933,6 @@
49514933
'count' => 1,
49524934
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/CompanyListAction.php',
49534935
];
4954-
$ignoreErrors[] = [
4955-
'message' => '#^Cannot access offset \'description\' on mixed\\.$#',
4956-
'identifier' => 'offsetAccess.nonOffsetAccessible',
4957-
'count' => 1,
4958-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/EditAction.php',
4959-
];
4960-
$ignoreErrors[] = [
4961-
'message' => '#^Parameter \\#1 \\$date of method AppBundle\\\\GeneralMeeting\\\\GeneralMeetingRepository\\:\\:save\\(\\) expects DateTimeInterface, mixed given\\.$#',
4962-
'identifier' => 'argument.type',
4963-
'count' => 1,
4964-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/EditAction.php',
4965-
];
4966-
$ignoreErrors[] = [
4967-
'message' => '#^Parameter \\#2 \\$description of method AppBundle\\\\GeneralMeeting\\\\GeneralMeetingRepository\\:\\:save\\(\\) expects string, mixed given\\.$#',
4968-
'identifier' => 'argument.type',
4969-
'count' => 1,
4970-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/EditAction.php',
4971-
];
49724936
$ignoreErrors[] = [
49734937
'message' => '#^Parameter \\#2 \\$datetime of static method DateTimeImmutable\\:\\:createFromFormat\\(\\) expects string, mixed given\\.$#',
49744938
'identifier' => 'argument.type',
@@ -4987,18 +4951,6 @@
49874951
'count' => 1,
49884952
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/ListingAction.php',
49894953
];
4990-
$ignoreErrors[] = [
4991-
'message' => '#^Cannot access offset \'date\' on mixed\\.$#',
4992-
'identifier' => 'offsetAccess.nonOffsetAccessible',
4993-
'count' => 1,
4994-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/PrepareAction.php',
4995-
];
4996-
$ignoreErrors[] = [
4997-
'message' => '#^Cannot access offset \'description\' on mixed\\.$#',
4998-
'identifier' => 'offsetAccess.nonOffsetAccessible',
4999-
'count' => 1,
5000-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/PrepareAction.php',
5001-
];
50024954
$ignoreErrors[] = [
50034955
'message' => '#^Parameter \\#1 \\$date of method AppBundle\\\\GeneralMeeting\\\\GeneralMeetingRepository\\:\\:prepare\\(\\) expects DateTimeInterface, mixed given\\.$#',
50044956
'identifier' => 'argument.type',
@@ -5071,108 +5023,12 @@
50715023
'count' => 2,
50725024
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeeting/ReportsAction.php',
50735025
];
5074-
$ignoreErrors[] = [
5075-
'message' => '#^Cannot call method format\\(\\) on DateTimeImmutable\\|false\\.$#',
5076-
'identifier' => 'method.nonObject',
5077-
'count' => 1,
5078-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/AddAction.php',
5079-
];
5080-
$ignoreErrors[] = [
5081-
'message' => '#^Cannot call method format\\(\\) on DateTimeInterface\\|null\\.$#',
5082-
'identifier' => 'method.nonObject',
5083-
'count' => 1,
5084-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/AddAction.php',
5085-
];
5086-
$ignoreErrors[] = [
5087-
'message' => '#^Method AppBundle\\\\Controller\\\\Admin\\\\Members\\\\GeneralMeetingQuestion\\\\AddAction\\:\\:__invoke\\(\\) has parameter \\$date with no type specified\\.$#',
5088-
'identifier' => 'missingType.parameter',
5089-
'count' => 1,
5090-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/AddAction.php',
5091-
];
5092-
$ignoreErrors[] = [
5093-
'message' => '#^Parameter \\#1 \\$date of method AppBundle\\\\Association\\\\Model\\\\GeneralMeetingQuestion\\:\\:setDate\\(\\) expects DateTimeInterface, mixed given\\.$#',
5094-
'identifier' => 'argument.type',
5095-
'count' => 1,
5096-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/AddAction.php',
5097-
];
5098-
$ignoreErrors[] = [
5099-
'message' => '#^Parameter \\#1 \\$date of method AppBundle\\\\GeneralMeeting\\\\GeneralMeetingRepository\\:\\:findOneByDate\\(\\) expects DateTimeInterface, DateTimeImmutable\\|false given\\.$#',
5100-
'identifier' => 'argument.type',
5101-
'count' => 1,
5102-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/AddAction.php',
5103-
];
51045026
$ignoreErrors[] = [
51055027
'message' => '#^Parameter \\#2 \\$datetime of static method DateTimeImmutable\\:\\:createFromFormat\\(\\) expects string, mixed given\\.$#',
51065028
'identifier' => 'argument.type',
51075029
'count' => 1,
5108-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/AddAction.php',
5109-
];
5110-
$ignoreErrors[] = [
5111-
'message' => '#^Cannot call method format\\(\\) on DateTimeInterface\\|null\\.$#',
5112-
'identifier' => 'method.nonObject',
5113-
'count' => 1,
5114-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/DeleteAction.php',
5115-
];
5116-
$ignoreErrors[] = [
5117-
'message' => '#^Method AppBundle\\\\Controller\\\\Admin\\\\Members\\\\GeneralMeetingQuestion\\\\DeleteAction\\:\\:__invoke\\(\\) has parameter \\$id with no type specified\\.$#',
5118-
'identifier' => 'missingType.parameter',
5119-
'count' => 1,
5120-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/DeleteAction.php',
5121-
];
5122-
$ignoreErrors[] = [
5123-
'message' => '#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#',
5124-
'identifier' => 'argument.type',
5125-
'count' => 1,
5126-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/DeleteAction.php',
5127-
];
5128-
$ignoreErrors[] = [
5129-
'message' => '#^Cannot call method format\\(\\) on DateTimeInterface\\|null\\.$#',
5130-
'identifier' => 'method.nonObject',
5131-
'count' => 1,
5132-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/EditAction.php',
5133-
];
5134-
$ignoreErrors[] = [
5135-
'message' => '#^Method AppBundle\\\\Controller\\\\Admin\\\\Members\\\\GeneralMeetingQuestion\\\\EditAction\\:\\:__invoke\\(\\) has no return type specified\\.$#',
5136-
'identifier' => 'missingType.return',
5137-
'count' => 1,
5138-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/EditAction.php',
5139-
];
5140-
$ignoreErrors[] = [
5141-
'message' => '#^Method AppBundle\\\\Controller\\\\Admin\\\\Members\\\\GeneralMeetingQuestion\\\\EditAction\\:\\:__invoke\\(\\) has parameter \\$id with no type specified\\.$#',
5142-
'identifier' => 'missingType.parameter',
5143-
'count' => 1,
5144-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/EditAction.php',
5145-
];
5146-
$ignoreErrors[] = [
5147-
'message' => '#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#',
5148-
'identifier' => 'argument.type',
5149-
'count' => 1,
5150-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingQuestion/EditAction.php',
5151-
];
5152-
$ignoreErrors[] = [
5153-
'message' => '#^Cannot call method format\\(\\) on DateTimeInterface\\|null\\.$#',
5154-
'identifier' => 'method.nonObject',
5155-
'count' => 1,
5156-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingVote/CloseAction.php',
5157-
];
5158-
$ignoreErrors[] = [
5159-
'message' => '#^Parameter \\#1 \\$generalMeetingDate of method AppBundle\\\\Association\\\\Model\\\\Repository\\\\GeneralMeetingQuestionRepository\\:\\:loadByDate\\(\\) expects DateTimeInterface, DateTimeImmutable\\|null given\\.$#',
5160-
'identifier' => 'argument.type',
5161-
'count' => 1,
51625030
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingVote/ListAction.php',
51635031
];
5164-
$ignoreErrors[] = [
5165-
'message' => '#^Parameter \\#2 \\$datetime of static method DateTimeImmutable\\:\\:createFromFormat\\(\\) expects string, mixed given\\.$#',
5166-
'identifier' => 'argument.type',
5167-
'count' => 1,
5168-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingVote/ListAction.php',
5169-
];
5170-
$ignoreErrors[] = [
5171-
'message' => '#^Cannot call method format\\(\\) on DateTimeInterface\\|null\\.$#',
5172-
'identifier' => 'method.nonObject',
5173-
'count' => 1,
5174-
'path' => __DIR__ . '/sources/AppBundle/Controller/Admin/Members/GeneralMeetingVote/OpenAction.php',
5175-
];
51765032
$ignoreErrors[] = [
51775033
'message' => '#^Parameter \\#1 \\$entity of method CCMBenchmark\\\\Ting\\\\Repository\\\\Repository\\<AppBundle\\\\Event\\\\Model\\\\UserBadge\\>\\:\\:delete\\(\\) expects AppBundle\\\\Event\\\\Model\\\\UserBadge, AppBundle\\\\Event\\\\Model\\\\UserBadge\\|null given\\.$#',
51785034
'identifier' => 'argument.type',
@@ -6493,12 +6349,6 @@
64936349
'count' => 1,
64946350
'path' => __DIR__ . '/sources/AppBundle/Controller/Website/Member/CompanyPublicProfileAction.php',
64956351
];
6496-
$ignoreErrors[] = [
6497-
'message' => '#^Parameter \\#1 \\$value of function count expects array\\|Countable, iterable\\<AppBundle\\\\Association\\\\Model\\\\GeneralMeetingQuestion\\> given\\.$#',
6498-
'identifier' => 'argument.type',
6499-
'count' => 1,
6500-
'path' => __DIR__ . '/sources/AppBundle/Controller/Website/Member/IndexAction.php',
6501-
];
65026352
$ignoreErrors[] = [
65036353
'message' => '#^Binary operation "\\+" between int\\<0, max\\> and mixed results in an error\\.$#',
65046354
'identifier' => 'binaryOp.invalid',
@@ -6655,12 +6505,6 @@
66556505
'count' => 1,
66566506
'path' => __DIR__ . '/sources/AppBundle/Controller/Website/Membership/GeneralMeeting/IndexAction.php',
66576507
];
6658-
$ignoreErrors[] = [
6659-
'message' => '#^Cannot call method getId\\(\\) on mixed\\.$#',
6660-
'identifier' => 'method.nonObject',
6661-
'count' => 1,
6662-
'path' => __DIR__ . '/sources/AppBundle/Controller/Website/Membership/GeneralMeeting/IndexAction.php',
6663-
];
66646508
$ignoreErrors[] = [
66656509
'message' => '#^Cannot call method getTimestamp\\(\\) on DateTime\\|null\\.$#',
66666510
'identifier' => 'method.nonObject',
@@ -6685,18 +6529,6 @@
66856529
'count' => 1,
66866530
'path' => __DIR__ . '/sources/AppBundle/Controller/Website/Membership/GeneralMeeting/IndexAction.php',
66876531
];
6688-
$ignoreErrors[] = [
6689-
'message' => '#^Parameter \\#1 \\$date of method AppBundle\\\\GeneralMeeting\\\\GeneralMeetingRepository\\:\\:getAttendees\\(\\) expects DateTimeInterface, DateTimeInterface\\|null given\\.$#',
6690-
'identifier' => 'argument.type',
6691-
'count' => 1,
6692-
'path' => __DIR__ . '/sources/AppBundle/Controller/Website/Membership/GeneralMeeting/VoteAction.php',
6693-
];
6694-
$ignoreErrors[] = [
6695-
'message' => '#^Parameter \\#1 \\$userId of method AppBundle\\\\Association\\\\Model\\\\GeneralMeetingVote\\:\\:setUserId\\(\\) expects int, int\\|null given\\.$#',
6696-
'identifier' => 'argument.type',
6697-
'count' => 1,
6698-
'path' => __DIR__ . '/sources/AppBundle/Controller/Website/Membership/GeneralMeeting/VoteAction.php',
6699-
];
67006532
$ignoreErrors[] = [
67016533
'message' => '#^Parameter \\#1 \\$content of class Symfony\\\\Component\\\\HttpFoundation\\\\Response constructor expects string\\|null, string\\|false given\\.$#',
67026534
'identifier' => 'argument.type',
@@ -9697,12 +9529,6 @@
96979529
'count' => 1,
96989530
'path' => __DIR__ . '/sources/AppBundle/GeneralMeeting/GeneralMeeting.php',
96999531
];
9700-
$ignoreErrors[] = [
9701-
'message' => '#^Class AppBundle\\\\GeneralMeeting\\\\GeneralMeetingQuestionFormType extends generic class Symfony\\\\Component\\\\Form\\\\AbstractType but does not specify its types\\: TData$#',
9702-
'identifier' => 'missingType.generics',
9703-
'count' => 1,
9704-
'path' => __DIR__ . '/sources/AppBundle/GeneralMeeting/GeneralMeetingQuestionFormType.php',
9705-
];
97069532
$ignoreErrors[] = [
97079533
'message' => '#^Binary operation "\\." between \'@\' and mixed results in an error\\.$#',
97089534
'identifier' => 'binaryOp.invalid',
@@ -9733,12 +9559,6 @@
97339559
'count' => 1,
97349560
'path' => __DIR__ . '/sources/AppBundle/GeneralMeeting/GeneralMeetingRepository.php',
97359561
];
9736-
$ignoreErrors[] = [
9737-
'message' => '#^Method AppBundle\\\\GeneralMeeting\\\\GeneralMeetingRepository\\:\\:getAttendees\\(\\) has parameter \\$direction with no type specified\\.$#',
9738-
'identifier' => 'missingType.parameter',
9739-
'count' => 1,
9740-
'path' => __DIR__ . '/sources/AppBundle/GeneralMeeting/GeneralMeetingRepository.php',
9741-
];
97429562
$ignoreErrors[] = [
97439563
'message' => '#^Method AppBundle\\\\GeneralMeeting\\\\GeneralMeetingRepository\\:\\:getPowerSelectionList\\(\\) should return array\\<int, string\\> but returns array\\<string\\>\\.$#',
97449564
'identifier' => 'return.type',
@@ -9775,12 +9595,6 @@
97759595
'count' => 2,
97769596
'path' => __DIR__ . '/sources/AppBundle/GeneralMeeting/GeneralMeetingRepository.php',
97779597
];
9778-
$ignoreErrors[] = [
9779-
'message' => '#^Parameter \\#2 \\$order of method Doctrine\\\\DBAL\\\\Query\\\\QueryBuilder\\:\\:orderBy\\(\\) expects string\\|null, mixed given\\.$#',
9780-
'identifier' => 'argument.type',
9781-
'count' => 1,
9782-
'path' => __DIR__ . '/sources/AppBundle/GeneralMeeting/GeneralMeetingRepository.php',
9783-
];
97849598
$ignoreErrors[] = [
97859599
'message' => '#^Parameter \\#3 \\$login of class AppBundle\\\\GeneralMeeting\\\\Attendee constructor expects string, mixed given\\.$#',
97869600
'identifier' => 'argument.type',
@@ -9811,12 +9625,6 @@
98119625
'count' => 1,
98129626
'path' => __DIR__ . '/sources/AppBundle/GeneralMeeting/GeneralMeetingRepository.php',
98139627
];
9814-
$ignoreErrors[] = [
9815-
'message' => '#^Class AppBundle\\\\GeneralMeeting\\\\PrepareFormType extends generic class Symfony\\\\Component\\\\Form\\\\AbstractType but does not specify its types\\: TData$#',
9816-
'identifier' => 'missingType.generics',
9817-
'count' => 1,
9818-
'path' => __DIR__ . '/sources/AppBundle/GeneralMeeting/PrepareFormType.php',
9819-
];
98209628
$ignoreErrors[] = [
98219629
'message' => '#^Method AppBundle\\\\Github\\\\Exception\\\\UnableToFindGithubUserException\\:\\:__construct\\(\\) has parameter \\$username with no type specified\\.$#',
98229630
'identifier' => 'missingType.parameter',

sources/AppBundle/AssembleeGenerale/Entity/AssembleeGenerale.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,24 @@
44

55
namespace AppBundle\AssembleeGenerale\Entity;
66

7-
use AppBundle\Doctrine\Type\UnixTimestampType;
87
use Doctrine\ORM\Mapping as ORM;
98

109
#[ORM\Entity]
1110
#[ORM\Table(name: 'afup_assemblee_generale')]
1211
class AssembleeGenerale
1312
{
13+
/**
14+
* Identifiant = timestamp Unix (colonne `date`, int unsigned, clé de fait de la table).
15+
*
16+
* On le mappe en `int` et non en `\DateTime` (via UnixTimestampType) car Doctrine
17+
* ne sait pas hasher un objet `DateTime` dans son identity map :
18+
* UnitOfWork::getIdHashByIdentifier() fait un implode() qui exige une valeur scalaire.
19+
* Un identifiant `\DateTime` provoque donc « Object of class DateTime could not be
20+
* converted to string » à chaque flush où l'entité est managée.
21+
*/
1422
#[ORM\Id]
15-
#[ORM\Column(type: UnixTimestampType::NAME)]
16-
public \DateTime $date;
23+
#[ORM\Column]
24+
public int $date;
1725

1826
#[ORM\Column(type: 'text', nullable: true)]
1927
public ?string $description = null;

0 commit comments

Comments
 (0)