mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 18:43:49 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\EventBundle\Entity;
|
||||
|
||||
use ArrayIterator;
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Entity\HasCenterInterface;
|
||||
use Chill\MainBundle\Entity\HasScopeInterface;
|
||||
@@ -21,13 +20,14 @@ use DateTime;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Traversable;
|
||||
|
||||
/**
|
||||
* Class Event.
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="Chill\EventBundle\Repository\EventRepository")
|
||||
*
|
||||
* @ORM\Table(name="chill_event_event")
|
||||
*
|
||||
* @ORM\HasLifecycleCallbacks
|
||||
*/
|
||||
class Event implements HasCenterInterface, HasScopeInterface
|
||||
@@ -48,10 +48,10 @@ class Event implements HasCenterInterface, HasScopeInterface
|
||||
private ?\DateTime $date;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Id
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
*
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private ?int $id = null;
|
||||
@@ -68,6 +68,7 @@ class Event implements HasCenterInterface, HasScopeInterface
|
||||
|
||||
/**
|
||||
* @var Collection<Participation>
|
||||
*
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity="Chill\EventBundle\Entity\Participation",
|
||||
* mappedBy="event")
|
||||
@@ -118,7 +119,7 @@ class Event implements HasCenterInterface, HasScopeInterface
|
||||
/**
|
||||
* Get date.
|
||||
*
|
||||
* @return DateTime
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getDate()
|
||||
{
|
||||
@@ -151,17 +152,15 @@ class Event implements HasCenterInterface, HasScopeInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<Participation>
|
||||
* @return Collection<int, Participation>
|
||||
*/
|
||||
public function getParticipations(): \ArrayIterator|\Doctrine\Common\Collections\Collection|\Traversable
|
||||
public function getParticipations(): Collection
|
||||
{
|
||||
return new ArrayCollection(iterator_to_array($this->getParticipationsOrdered()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort Collection of Participations.
|
||||
*
|
||||
* @return ArrayIterator|Traversable
|
||||
*/
|
||||
public function getParticipationsOrdered(): \ArrayIterator|\Traversable
|
||||
{
|
||||
@@ -169,7 +168,7 @@ class Event implements HasCenterInterface, HasScopeInterface
|
||||
|
||||
uasort($iterator, static fn ($first, $second) => strnatcasecmp((string) $first->getPerson()->getFirstName(), (string) $second->getPerson()->getFirstName()));
|
||||
|
||||
return new ArrayIterator($iterator);
|
||||
return new \ArrayIterator($iterator);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -223,7 +222,7 @@ class Event implements HasCenterInterface, HasScopeInterface
|
||||
*
|
||||
* @return Event
|
||||
*/
|
||||
public function setDate(DateTime $date)
|
||||
public function setDate(\DateTime $date)
|
||||
{
|
||||
$this->date = $date;
|
||||
|
||||
|
Reference in New Issue
Block a user