Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
🚨 (src) Linted folder src
Browse files Browse the repository at this point in the history
  • Loading branch information
Teddy Roncin committed Feb 3, 2023
1 parent 7b353c7 commit 2c5ec60
Show file tree
Hide file tree
Showing 58 changed files with 600 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/DataFixtures/GroupSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class GroupSeeder extends Fixture implements DependentFixtureInterface
* @var int The minimum number of groups which will have the isVisible property set to true
*/
protected int $minimumVisibleGroupCount;

/**
* @var int The maximum number of groups which will have the isVisible property set to true
*/
Expand Down
25 changes: 25 additions & 0 deletions src/Entity/Asso.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* The main entity that represents all Assos.
*
* @ORM\Entity(repositoryClass=AssoRepository::class)
*
* @ORM\Table(name="assos")
*/
#[
Expand Down Expand Up @@ -58,9 +59,13 @@ class Asso
{
/**
* @ORM\Id
*
* @ORM\Column(type="uuid", unique=true)
*
* @ORM\GeneratedValue(strategy="CUSTOM")
*
* @ORM\CustomIdGenerator(class=UuidGenerator::class)
*
* @Assert\Uuid
*/
#[Groups([
Expand All @@ -73,15 +78,20 @@ class Asso
* The login used for the CAS.
*
* @ORM\Column(type="string", length=50, unique=true)
*
* @Assert\Type("string")
*
* @Assert\Length(min=1, max=50)
*
* @Assert\Regex("/^[a-z_0-9]{1,50}$/")
*/
private $login;

/**
* @ORM\Column(type="string", length=100, unique=true)
*
* @Assert\Type("string")
*
* @Assert\Length(min=1, max=100)
*/
#[Groups([
Expand Down Expand Up @@ -116,8 +126,11 @@ class Asso
* The email address of the association.
*
* @ORM\Column(type="string", length=100)
*
* @Assert\Type("string")
*
* @Assert\Length(min=1, max=100)
*
* @Assert\Email
*/
#[Groups([
Expand All @@ -129,8 +142,11 @@ class Asso
* The phone number of the association.
*
* @ORM\Column(type="string", length=30, nullable=true)
*
* @Assert\Type("string")
*
* @Assert\Length(min=0, max=30)
*
* @Assert\Regex("/^0[0-9]{9}$/")
*/
#[Groups([
Expand All @@ -142,8 +158,11 @@ class Asso
* The website of the association. It is optional.
*
* @ORM\Column(type="string", length=100, nullable=true)
*
* @Assert\Type("string")
*
* @Assert\Length(min=0, max=100)
*
* @Assert\Url
*/
#[Groups([
Expand All @@ -155,7 +174,9 @@ class Asso
* Link to the logo of the association. It is optional.
*
* @ORM\Column(type="string", length=100, nullable=true)
*
* @Assert\Type("string")
*
* @Assert\Length(min=0, max=100)
*/
#[Groups([
Expand All @@ -166,6 +187,7 @@ class Asso

/**
* @ORM\Column(type="datetime")
*
* @Assert\Type("\DateTimeInterface")
*/
#[Groups([
Expand All @@ -175,12 +197,14 @@ class Asso

/**
* @ORM\Column(type="datetime")
*
* @Assert\Type("\DateTimeInterface")
*/
private $updatedAt;

/**
* @ORM\Column(type="datetime", nullable=true)
*
* @Assert\Type("\DateTimeInterface")
*/
private $deletedAt;
Expand All @@ -189,6 +213,7 @@ class Asso
* The relation to all Keywords of this Asso.
*
* @ORM\ManyToMany(targetEntity=AssoKeyword::class, inversedBy="assos")
*
* @ORM\JoinTable(
* name="assos_keywords",
* joinColumns={@ORM\JoinColumn(name="asso_id", referencedColumnName="id")},
Expand Down
5 changes: 5 additions & 0 deletions src/Entity/AssoKeyword.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@

/**
* @ORM\Entity(repositoryClass=AssoKeywordRepository::class)
*
* @ORM\Table(name="asso_keywords")
*/
class AssoKeyword
{
/**
* @ORM\Id
*
* @ORM\Column(type="string", length=30, unique=true)
*
* @Assert\Type("string")
*
* @Assert\Length(min=1, max=30)
*
* @Assert\Regex("/^[a-z]{1,30}$/")
*/
#[Groups([
Expand Down
10 changes: 10 additions & 0 deletions src/Entity/AssoMembership.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@

/**
* @ORM\Entity(repositoryClass=AssoMembershipRepository::class)
*
* @ORM\Table(name="asso_memberships")
*/
class AssoMembership
{
/**
* @ORM\Id
*
* @ORM\Column(type="uuid", unique=true)
*
* @ORM\GeneratedValue(strategy="CUSTOM")
*
* @ORM\CustomIdGenerator(class=UuidGenerator::class)
*
* @Assert\Uuid
*/
private $id;
Expand All @@ -30,6 +35,7 @@ class AssoMembership
* The relation to the User that is subscribed to an Asso.
*
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="assoMembership")
*
* @ORM\JoinColumn(nullable=false)
*/
#[Groups([
Expand All @@ -41,6 +47,7 @@ class AssoMembership
* The Asso in which the User is subscribed.
*
* @ORM\ManyToOne(targetEntity=Asso::class, inversedBy="assoMemberships")
*
* @ORM\JoinColumn(nullable=false)
*/
private $asso;
Expand All @@ -49,6 +56,7 @@ class AssoMembership
* The relation to the roles accorded to the User in an Asso.
*
* @ORM\ManyToMany(targetEntity=AssoMembershipRole::class)
*
* @ORM\JoinTable(
* name="asso_memberships_roles",
* joinColumns={@ORM\JoinColumn(name="member_id", referencedColumnName="id")},
Expand All @@ -61,6 +69,7 @@ class AssoMembership
* The relation to the permissions accorded to the User in an Asso.
*
* @ORM\ManyToMany(targetEntity=AssoMembershipPermission::class)
*
* @ORM\JoinTable(
* name="asso_memberships_permissions",
* joinColumns={@ORM\JoinColumn(name="member_id", referencedColumnName="id")},
Expand All @@ -81,6 +90,7 @@ class AssoMembership

/**
* @ORM\Column(type="datetime")
*
* @Assert\Type("\DateTimeInterface")
*/
private $createdAt;
Expand Down
5 changes: 5 additions & 0 deletions src/Entity/AssoMembershipPermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/**
* @ORM\Entity(repositoryClass=AssoMemberPermissionRepository::class)
*
* @ORM\Table(name="asso_membership_permissions")
*/
class AssoMembershipPermission
Expand All @@ -16,9 +17,13 @@ class AssoMembershipPermission
* The permission accorded in the association (e.g. "daymail", "events", "edit_desc").
*
* @ORM\Id
*
* @ORM\Column(type="string", length=50)
*
* @Assert\Type("string")
*
* @Assert\Length(min=1, max=50)
*
* @Assert\Regex("/^[a-z_]{1,50}/")
*/
private $name;
Expand Down
5 changes: 5 additions & 0 deletions src/Entity/AssoMembershipRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @ORM\Entity(repositoryClass=AssoMemberRoleRepository::class)
*
* @ORM\Table(name="asso_membership_roles")
*/
class AssoMembershipRole
Expand All @@ -17,9 +18,13 @@ class AssoMembershipRole
* The name of the role in the association (e.g. "president"), not necessary for members.
*
* @ORM\Id
*
* @ORM\Column(type="string", length=255)
*
* @Assert\Type("string")
*
* @Assert\Length(min=1, max=255)
*
* @Assert\Regex("/^[a-z_]{1,255}/")
*/
private $name;
Expand Down
10 changes: 10 additions & 0 deletions src/Entity/AssoMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@

/**
* @ORM\Entity(repositoryClass=AssoMessageRepository::class)
*
* @ORM\Table(name="asso_messages")
*/
class AssoMessage
{
/**
* @ORM\Id
*
* @ORM\Column(type="uuid", unique=true)
*
* @ORM\GeneratedValue(strategy="CUSTOM")
*
* @ORM\CustomIdGenerator(class=UuidGenerator::class)
*
* @Assert\Uuid
*/
private $id;
Expand All @@ -28,6 +33,7 @@ class AssoMessage
* The relation to the Asso that sent this AssoMessage.
*
* @ORM\ManyToOne(targetEntity=Asso::class, inversedBy="assoMessages")
*
* @ORM\JoinColumn(name="asso_id", nullable=false)
*/
private $asso;
Expand All @@ -52,6 +58,7 @@ class AssoMessage
* The date of the event presented in the message.
*
* @ORM\Column(type="datetime")
*
* @Assert\Type("\DateTimeInterface")
*/
private $date;
Expand All @@ -60,6 +67,7 @@ class AssoMessage
* Whether the message should be displayed on mobile or not.
*
* @ORM\Column(type="boolean")
*
* @Assert\Type("bool")
*/
private $sendToMobile;
Expand All @@ -68,12 +76,14 @@ class AssoMessage
* Whether the message should be send in the daymails or not.
*
* @ORM\Column(type="boolean")
*
* @Assert\Type("bool")
*/
private $sendAsDaymail;

/**
* @ORM\Column(type="datetime")
*
* @Assert\Type("\DateTimeInterface")
*/
private $createdAt;
Expand Down
16 changes: 16 additions & 0 deletions src/Entity/Badge.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,20 @@

/**
* @ORM\Entity(repositoryClass=BadgeRepository::class)
*
* @ORM\Table(name="badges")
*/
class Badge
{
/**
* @ORM\Id
*
* @ORM\Column(type="uuid", unique=true)
*
* @ORM\GeneratedValue(strategy="CUSTOM")
*
* @ORM\CustomIdGenerator(class=UuidGenerator::class)
*
* @Assert\Uuid
*/
private $id;
Expand All @@ -30,7 +35,9 @@ class Badge
* The Serie is a group of Badge with the same idea (e.g. Badges that deal with being an asso member).
*
* @ORM\Column(type="string", length=50, nullable=true)
*
* @Assert\Type("string")
*
* @Assert\Length(max=50)
*/
private $serie;
Expand All @@ -39,14 +46,18 @@ class Badge
* The Level is serves to determine which badge of a serie is more advanced.
*
* @ORM\Column(type="smallint", nullable=true)
*
* @Assert\Type("int")
*
* @Assert\Positive
*/
private $level;

/**
* @ORM\Column(type="string", length=100)
*
* @Assert\Type("string")
*
* @Assert\Length(min=1, max=100)
*/
private $name;
Expand All @@ -55,7 +66,9 @@ class Badge
* The path to the picture of the badge.
*
* @ORM\Column(type="string", length=255)
*
* @Assert\Type("string")
*
* @Assert\Length(min=1, max=255)
*/
private $picture;
Expand All @@ -70,12 +83,14 @@ class Badge

/**
* @ORM\Column(type="datetime")
*
* @Assert\Type("\DateTimeInterface")
*/
private $createdAt;

/**
* @ORM\Column(type="datetime", nullable=true)
*
* @Assert\Type("\DateTimeInterface")
*/
private $deletedAt;
Expand All @@ -84,6 +99,7 @@ class Badge
* The relation that allow to add many Badges to many Users.
*
* @ORM\ManyToMany(targetEntity=User::class, inversedBy="badges")
*
* @ORM\JoinTable(
* name="users_badges",
* joinColumns={@ORM\JoinColumn(name="badge_id", referencedColumnName="id")},
Expand Down
Loading

0 comments on commit 2c5ec60

Please sign in to comment.