Remove unrelated code style change.

This commit is contained in:
Pol Dellaiera
2021-03-31 14:57:25 +02:00
parent 48e2d2ceab
commit 03243605da
3 changed files with 83 additions and 79 deletions

View File

@@ -3,7 +3,7 @@
/*
* Chill is a software for social workers
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
@@ -45,17 +45,17 @@ class AccompanyingPeriod
/** @var \Chill\PersonBundle\Entity\Person */
private $person;
/** @var AccompanyingPeriod\ClosingMotive */
private $closingMotive = null;
/**
* The user making the accompanying
*
* @var User
*/
private $user;
/**
*
* @param \DateTime $dateOpening
@@ -68,7 +68,7 @@ class AccompanyingPeriod
/**
* Get id
*
* @return integer
* @return integer
*/
public function getId()
{
@@ -84,7 +84,7 @@ class AccompanyingPeriod
public function setOpeningDate($openingDate)
{
$this->openingDate = $openingDate;
return $this;
}
@@ -100,13 +100,17 @@ class AccompanyingPeriod
/**
* Set closingDate
*
*
* For closing a Person file, you should use Person::setClosed instead.
*
* @param \DateTime $dateClosing
* @return AccompanyingPeriod
*
*/
public function setClosingDate($closingDate)
{
$this->closingDate = $closingDate;
return $this;
}
@@ -119,12 +123,12 @@ class AccompanyingPeriod
{
return $this->closingDate;
}
/**
*
*
* @return boolean
*/
public function isOpen(): bool
public function isOpen(): bool
{
if ($this->getOpeningDate() > new \DateTime('now')) {
return false;
@@ -132,9 +136,9 @@ class AccompanyingPeriod
if ($this->getClosingDate() === null) {
return true;
} else {
return false;
}
return false;
}
/**
@@ -148,16 +152,16 @@ class AccompanyingPeriod
if ($remark === null) {
$remark = '';
}
$this->remark = $remark;
return $this;
}
/**
* Get remark
*
* @return string
* @return string
*/
public function getRemark()
{
@@ -166,7 +170,7 @@ class AccompanyingPeriod
/**
* Set person.
*
*
* For consistency, you should use Person::addAccompanyingPeriod instead.
*
* @param \Chill\PersonBundle\Entity\Person $person
@@ -176,20 +180,20 @@ class AccompanyingPeriod
public function setPerson(\Chill\PersonBundle\Entity\Person $person = null)
{
$this->person = $person;
return $this;
}
/**
* Get person
*
* @return \Chill\PersonBundle\Entity\Person
* @return \Chill\PersonBundle\Entity\Person
*/
public function getPerson()
{
return $this->person;
}
public function getClosingMotive()
{
return $this->closingMotive;
@@ -200,13 +204,13 @@ class AccompanyingPeriod
$this->closingMotive = $closingMotive;
return $this;
}
/**
* If the period can be reopened.
*
* This function test if the period is closed and if the period is the last
*
* This function test if the period is closed and if the period is the last
* for the associated person
*
*
* @return boolean
*/
public function canBeReOpened()
@@ -214,12 +218,12 @@ class AccompanyingPeriod
if ($this->isOpen() === true) {
return false;
}
$periods = $this->getPerson()->getAccompanyingPeriodsOrdered();
return end($periods) === $this;
}
public function reOpen()
{
$this->setClosingDate(null);
@@ -231,29 +235,29 @@ class AccompanyingPeriod
if ($this->isOpen()) {
return;
}
if (! $this->isClosingAfterOpening()) {
$context->buildViolation('The date of closing is before the date of opening')
->atPath('dateClosing')
->addViolation();
}
}
/**
* Returns true if the closing date is after the opening date.
*
*
* @return boolean
*/
public function isClosingAfterOpening() {
$diff = $this->getOpeningDate()->diff($this->getClosingDate());
if ($diff->invert === 0) {
return true;
} else {
return false;
}
}
function getUser(): ?User
{
return $this->user;
@@ -262,7 +266,7 @@ class AccompanyingPeriod
function setUser(User $user): self
{
$this->user = $user;
return $this;
}