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.
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getActiveCustomFields()
|
||||
public function getActiveCustomFields(): array
|
||||
{
|
||||
if (null === $this->activeCustomFields) {
|
||||
$this->activeCustomFields = [];
|
||||
@ -143,15 +141,11 @@ class CustomFieldsGroup
|
||||
|
||||
/**
|
||||
* 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
|
||||
if ($language) {
|
||||
if (null !== $language) {
|
||||
if (isset($this->name[$language])) {
|
||||
return $this->name[$language];
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ class Evaluation
|
||||
public function removeSocialAction(SocialAction $socialAction): self
|
||||
{
|
||||
if ($this->socialActions->contains($socialAction)) {
|
||||
$this->socialActions->remove($socialAction);
|
||||
$this->socialActions->removeElement($socialAction);
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
@ -92,7 +92,7 @@ class SocialIssue
|
||||
{
|
||||
if (!$this->socialActions->contains($socialAction)) {
|
||||
$this->socialActions[] = $socialAction;
|
||||
$socialAction->setSocialIssue($this);
|
||||
$socialAction->setIssue($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
@ -328,8 +328,8 @@ class SocialIssue
|
||||
{
|
||||
if ($this->socialActions->removeElement($socialAction)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($socialAction->getSocialIssue() === $this) {
|
||||
$socialAction->setSocialIssue(null);
|
||||
if ($socialAction->getIssue() === $this) {
|
||||
$socialAction->setIssue(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,14 +55,12 @@ class RecurringTask extends AbstractTask
|
||||
private $occurenceFrequency;
|
||||
|
||||
/**
|
||||
* @var dateinterval
|
||||
*
|
||||
* @ORM\Column(name="occurence_start_date", type="dateinterval")
|
||||
*/
|
||||
private $occurenceStartDate;
|
||||
|
||||
/**
|
||||
* @var dateinterval
|
||||
*
|
||||
* @ORM\Column(name="occurence_warning_interval", type="dateinterval", nullable=true)
|
||||
*/
|
||||
@ -126,7 +124,6 @@ class RecurringTask extends AbstractTask
|
||||
/**
|
||||
* Get occurenceStartDate.
|
||||
*
|
||||
* @return dateinterval
|
||||
*/
|
||||
public function getOccurenceStartDate()
|
||||
{
|
||||
@ -136,7 +133,6 @@ class RecurringTask extends AbstractTask
|
||||
/**
|
||||
* Get occurenceWarningInterval.
|
||||
*
|
||||
* @return dateinterval
|
||||
*/
|
||||
public function getOccurenceWarningInterval()
|
||||
{
|
||||
@ -188,7 +184,6 @@ class RecurringTask extends AbstractTask
|
||||
/**
|
||||
* Set occurenceStartDate.
|
||||
*
|
||||
* @param dateinterval $occurenceStartDate
|
||||
*
|
||||
* @return RecurringTask
|
||||
*/
|
||||
@ -202,7 +197,6 @@ class RecurringTask extends AbstractTask
|
||||
/**
|
||||
* Set occurenceWarningInterval.
|
||||
*
|
||||
* @param dateinterval $occurenceWarningInterval
|
||||
*
|
||||
* @return RecurringTask
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user