Correcting PHPCS and PHPStan comments

This commit is contained in:
2023-07-08 12:49:47 +02:00
parent 2e6c6a8f97
commit c4e2ae721e
6 changed files with 40 additions and 29 deletions

View File

@@ -2,7 +2,7 @@
namespace App\Entity;
use \OutOfRangeException;
use OutOfRangeException;
use App\Entity\Document;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\CriminalRepository;
@@ -14,9 +14,9 @@ use Symfony\Component\Validator\Constraints as Assert;
*/
class Criminal extends Document
{
const TYPE_JAIL = 'jail';
const TYPE_FINE = 'fine';
const TYPE_COMMUNITY_WORK = 'community_work';
public const TYPE_JAIL = 'jail';
public const TYPE_FINE = 'fine';
public const TYPE_COMMUNITY_WORK = 'community_work';
/**
* @ORM\ManyToOne(targetEntity=Directory::class, inversedBy="criminals")
@@ -172,7 +172,8 @@ class Criminal extends Document
return $this;
}
public function addSettlement($type, $amount) {
public function addSettlement($type, $amount)
{
if ($type == Criminal::TYPE_FINE) {
if ($this->getAmountMoney() - $this->getAmountMoneySettled() < $amount) {
throw new OutOfRangeException();
@@ -183,7 +184,6 @@ class Criminal extends Document
throw new OutOfRangeException();
}
$this->setAmountTimeSettled($this->getAmountTimeSettled() + $amount);
} elseif ($type == Criminal::TYPE_COMMUNITY_WORK) {
if ($this->getAmountCommunityWork() - $this->getAmountCommunityWorkSettled() < $amount) {
throw new OutOfRangeException();