mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix small risky code
This commit is contained in:
parent
075aca493b
commit
6e6f19c499
@ -95,10 +95,8 @@ class CustomFieldsGroup
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all the custom.
|
* Get all the custom.
|
||||||
*
|
|
||||||
* @return Collection
|
|
||||||
*/
|
*/
|
||||||
public function getActiveCustomFields()
|
public function getActiveCustomFields(): array
|
||||||
{
|
{
|
||||||
if (null === $this->activeCustomFields) {
|
if (null === $this->activeCustomFields) {
|
||||||
$this->activeCustomFields = [];
|
$this->activeCustomFields = [];
|
||||||
@ -143,15 +141,11 @@ class CustomFieldsGroup
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get name.
|
* Get name.
|
||||||
*
|
|
||||||
* @param mixed|null $language
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
public function getName($language = null)
|
public function getName(?string $language = null): string|array
|
||||||
{
|
{
|
||||||
//TODO set this in a service, PLUS twig function
|
//TODO set this in a service, PLUS twig function
|
||||||
if ($language) {
|
if (null !== $language) {
|
||||||
if (isset($this->name[$language])) {
|
if (isset($this->name[$language])) {
|
||||||
return $this->name[$language];
|
return $this->name[$language];
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ class Evaluation
|
|||||||
public function removeSocialAction(SocialAction $socialAction): self
|
public function removeSocialAction(SocialAction $socialAction): self
|
||||||
{
|
{
|
||||||
if ($this->socialActions->contains($socialAction)) {
|
if ($this->socialActions->contains($socialAction)) {
|
||||||
$this->socialActions->remove($socialAction);
|
$this->socialActions->removeElement($socialAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -92,7 +92,7 @@ class SocialIssue
|
|||||||
{
|
{
|
||||||
if (!$this->socialActions->contains($socialAction)) {
|
if (!$this->socialActions->contains($socialAction)) {
|
||||||
$this->socialActions[] = $socialAction;
|
$this->socialActions[] = $socialAction;
|
||||||
$socialAction->setSocialIssue($this);
|
$socialAction->setIssue($this);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@ -328,8 +328,8 @@ class SocialIssue
|
|||||||
{
|
{
|
||||||
if ($this->socialActions->removeElement($socialAction)) {
|
if ($this->socialActions->removeElement($socialAction)) {
|
||||||
// set the owning side to null (unless already changed)
|
// set the owning side to null (unless already changed)
|
||||||
if ($socialAction->getSocialIssue() === $this) {
|
if ($socialAction->getIssue() === $this) {
|
||||||
$socialAction->setSocialIssue(null);
|
$socialAction->setIssue(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,14 +55,12 @@ class RecurringTask extends AbstractTask
|
|||||||
private $occurenceFrequency;
|
private $occurenceFrequency;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var dateinterval
|
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="occurence_start_date", type="dateinterval")
|
* @ORM\Column(name="occurence_start_date", type="dateinterval")
|
||||||
*/
|
*/
|
||||||
private $occurenceStartDate;
|
private $occurenceStartDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var dateinterval
|
|
||||||
*
|
*
|
||||||
* @ORM\Column(name="occurence_warning_interval", type="dateinterval", nullable=true)
|
* @ORM\Column(name="occurence_warning_interval", type="dateinterval", nullable=true)
|
||||||
*/
|
*/
|
||||||
@ -126,7 +124,6 @@ class RecurringTask extends AbstractTask
|
|||||||
/**
|
/**
|
||||||
* Get occurenceStartDate.
|
* Get occurenceStartDate.
|
||||||
*
|
*
|
||||||
* @return dateinterval
|
|
||||||
*/
|
*/
|
||||||
public function getOccurenceStartDate()
|
public function getOccurenceStartDate()
|
||||||
{
|
{
|
||||||
@ -136,7 +133,6 @@ class RecurringTask extends AbstractTask
|
|||||||
/**
|
/**
|
||||||
* Get occurenceWarningInterval.
|
* Get occurenceWarningInterval.
|
||||||
*
|
*
|
||||||
* @return dateinterval
|
|
||||||
*/
|
*/
|
||||||
public function getOccurenceWarningInterval()
|
public function getOccurenceWarningInterval()
|
||||||
{
|
{
|
||||||
@ -188,7 +184,6 @@ class RecurringTask extends AbstractTask
|
|||||||
/**
|
/**
|
||||||
* Set occurenceStartDate.
|
* Set occurenceStartDate.
|
||||||
*
|
*
|
||||||
* @param dateinterval $occurenceStartDate
|
|
||||||
*
|
*
|
||||||
* @return RecurringTask
|
* @return RecurringTask
|
||||||
*/
|
*/
|
||||||
@ -202,7 +197,6 @@ class RecurringTask extends AbstractTask
|
|||||||
/**
|
/**
|
||||||
* Set occurenceWarningInterval.
|
* Set occurenceWarningInterval.
|
||||||
*
|
*
|
||||||
* @param dateinterval $occurenceWarningInterval
|
|
||||||
*
|
*
|
||||||
* @return RecurringTask
|
* @return RecurringTask
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user