mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 03:23:48 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -21,13 +21,11 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
use function array_fill_keys;
|
||||
use function array_keys;
|
||||
|
||||
/**
|
||||
* AbstractTask.
|
||||
*
|
||||
* @ORM\MappedSuperclass
|
||||
*
|
||||
* @Serializer\DiscriminatorMap(typeProperty="type", mapping={
|
||||
* "single_task": SingleTask::class
|
||||
* })
|
||||
@@ -38,6 +36,7 @@ abstract class AbstractTask implements HasCenterInterface, HasScopeInterface
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\MainBundle\Entity\User"
|
||||
* )
|
||||
*
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private ?\Chill\MainBundle\Entity\User $assignee = null;
|
||||
@@ -51,25 +50,28 @@ abstract class AbstractTask implements HasCenterInterface, HasScopeInterface
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="closed", type="boolean", options={ "default": false })
|
||||
*
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private bool $closed = false;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="\Chill\PersonBundle\Entity\AccompanyingPeriod")
|
||||
*
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private ?\Chill\PersonBundle\Entity\AccompanyingPeriod $course = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="current_states", type="json", options={"jsonb"=true, "default"="[]"})
|
||||
*
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private array $currentStates = [];
|
||||
|
||||
/**
|
||||
*
|
||||
* @ORM\Column(name="description", type="text")
|
||||
*
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private string $description = '';
|
||||
@@ -78,21 +80,23 @@ abstract class AbstractTask implements HasCenterInterface, HasScopeInterface
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity="\Chill\PersonBundle\Entity\Person"
|
||||
* )
|
||||
*
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private ?\Chill\PersonBundle\Entity\Person $person = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* @ORM\Column(name="title", type="text")
|
||||
*
|
||||
* @Assert\NotBlank
|
||||
*
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private string $title = '';
|
||||
|
||||
/**
|
||||
*
|
||||
* @ORM\Column(name="type", type="string", length=255)
|
||||
*
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private ?string $type = null;
|
||||
@@ -137,7 +141,7 @@ abstract class AbstractTask implements HasCenterInterface, HasScopeInterface
|
||||
*/
|
||||
public function getCurrentStates()
|
||||
{
|
||||
return array_fill_keys($this->currentStates, 1);
|
||||
return \array_fill_keys($this->currentStates, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -185,7 +189,7 @@ abstract class AbstractTask implements HasCenterInterface, HasScopeInterface
|
||||
return $this->closed;
|
||||
}
|
||||
|
||||
public function setAssignee(?User $assignee = null)
|
||||
public function setAssignee(User $assignee = null)
|
||||
{
|
||||
$this->assignee = $assignee;
|
||||
|
||||
@@ -216,13 +220,11 @@ abstract class AbstractTask implements HasCenterInterface, HasScopeInterface
|
||||
*
|
||||
* The current states are sorted in a single array, non associative.
|
||||
*
|
||||
* @param $currentStates
|
||||
*
|
||||
* @return AbstractTask
|
||||
*/
|
||||
public function setCurrentStates($currentStates)
|
||||
{
|
||||
$this->currentStates = array_keys($currentStates);
|
||||
$this->currentStates = \array_keys($currentStates);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
Reference in New Issue
Block a user