fix: SA: Fix many critical rules.

SA stands for Static Analysis.
This commit is contained in:
Pol Dellaiera
2021-11-16 17:13:39 +01:00
parent db2010082a
commit 5432242376
19 changed files with 345 additions and 655 deletions

View File

@@ -44,13 +44,15 @@ class AsideActivityCategory
* @ORM\ManyToOne(targetEntity=AsideActivityCategory::class, inversedBy="children")
* @ORM\JoinColumn(nullable=true)
*/
private $parent;
private AsideActivityCategory $parent;
/**
* @ORM\OneToMany(targetEntity=AsideActivityCategory::class, mappedBy="parent")
*/
private $children;
private AsideActivityCategory $oldParent;
public function __construct()
{
$this->children = new ArrayCollection();

View File

@@ -1,5 +1,7 @@
<?php
declare(strict_types=1);
namespace Chill\AsideActivityBundle\Form;
use Chill\AsideActivityBundle\Entity\AsideActivityCategory;
@@ -14,12 +16,11 @@ use Symfony\Component\Form\FormBuilderInterface;
final class AsideActivityCategoryType extends AbstractType
{
private CategoryRender $categoryRender;
protected $translatableStringHelper;
public function __construct(TranslatableStringHelper $translatableStringHelper, CategoryRender $categoryRender)
{
$this->translatableStringHelper = $translatableStringHelper;
public function __construct(
CategoryRender $categoryRender
) {
$this->categoryRender = $categoryRender;
}

View File

@@ -25,18 +25,16 @@ use Symfony\Component\Templating\EngineInterface;
final class AsideActivityFormType extends AbstractType
{
protected array $timeChoices;
private array $timeChoices;
private TokenStorageInterface $storage;
private CategoryRender $categoryRender;
public function __construct (
TranslatableStringHelper $translatableStringHelper,
ParameterBagInterface $parameterBag,
TokenStorageInterface $storage,
CategoryRender $categoryRender
){
$this->timeChoices = $parameterBag->get('chill_aside_activity.form.time_duration');
$this->translatableStringHelper = $translatableStringHelper;
$this->storage = $storage;
$this->categoryRender = $categoryRender;
}