Rector: apply rules for doctrine code quality

This commit is contained in:
2023-08-31 10:35:52 +02:00
parent bc9b7b1776
commit e4e52234ad
32 changed files with 74 additions and 92 deletions

View File

@@ -45,7 +45,7 @@ class Event implements HasCenterInterface, HasScopeInterface
/**
* @ORM\Column(type="datetime")
*/
private ?\DateTime $date = null;
private ?\DateTime $date;
/**
* @var int
@@ -54,19 +54,17 @@ class Event implements HasCenterInterface, HasScopeInterface
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
private ?int $id = null;
/**
* @var User
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User")
*/
private $moderator;
private ?\Chill\MainBundle\Entity\User $moderator = null;
/**
* @var string
* @ORM\Column(type="string", length=150)
*/
private $name;
private ?string $name = null;
/**
* @var Collection<Participation>
@@ -137,10 +135,7 @@ class Event implements HasCenterInterface, HasScopeInterface
return $this->id;
}
/**
* @return int
*/
public function getModerator()
public function getModerator(): User|null
{
return $this->moderator;
}
@@ -235,12 +230,7 @@ class Event implements HasCenterInterface, HasScopeInterface
return $this;
}
/**
* @param int $moderator
*
* @return Event
*/
public function setModerator($moderator)
public function setModerator(User $moderator): self
{
$this->moderator = $moderator;

View File

@@ -26,9 +26,9 @@ class EventType
{
/**
* @var bool
* @ORM\Column(type="boolean")
* @ORM\Column(type="boolean", nullable=false)
*/
private $active;
private bool $active = true;
/**
* @var int
@@ -37,7 +37,7 @@ class EventType
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
private ?int $id = null;
/**
* @var array

View File

@@ -48,7 +48,7 @@ class Participation implements ArrayAccess, HasCenterInterface, HasScopeInterfac
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
private ?int $id = null;
/**
* @ORM\Column(type="datetime")

View File

@@ -24,9 +24,9 @@ class Role
{
/**
* @var bool
* @ORM\Column(type="boolean")
* @ORM\Column(type="boolean", nullable=false)
*/
private $active;
private bool $active = true;
/**
* @var int
@@ -35,7 +35,7 @@ class Role
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
private ?int $id = null;
/**
* @var array

View File

@@ -24,9 +24,9 @@ class Status
{
/**
* @var bool
* @ORM\Column(type="boolean")
* @ORM\Column(type="boolean", nullable=false)
*/
private $active;
private bool $active = true;
/**
* @var int
@@ -35,7 +35,7 @@ class Status
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
private ?int $id = null;
/**
* @var array