mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-07-04 07:56:12 +00:00
fix phpstan errors: undefined variable or type invalid
This commit is contained in:
parent
e23ef35b75
commit
c42f62de4c
@ -80,11 +80,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php
|
||||
|
||||
-
|
||||
message: "#^Foreach overwrites \\$action with its value variable\\.$#"
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
|
||||
|
||||
-
|
||||
message: "#^Foreach overwrites \\$action with its value variable\\.$#"
|
||||
count: 1
|
||||
|
@ -30,36 +30,6 @@ parameters:
|
||||
count: 2
|
||||
path: src/Bundle/ChillPersonBundle/Household/MembersEditorFactory.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\$action of method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkRepository\\:\\:buildQueryBySocialActionWithDescendants\\(\\) has invalid type Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\SocialAction\\.$#"
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\$action of method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkRepository\\:\\:countBySocialActionWithDescendants\\(\\) has invalid type Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\SocialAction\\.$#"
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
|
||||
|
||||
-
|
||||
message: "#^Undefined variable\\: \\$action$#"
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
|
||||
|
||||
-
|
||||
message: "#^Undefined variable\\: \\$limit$#"
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
|
||||
|
||||
-
|
||||
message: "#^Undefined variable\\: \\$offset$#"
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
|
||||
|
||||
-
|
||||
message: "#^Undefined variable\\: \\$orderBy$#"
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
|
||||
|
||||
-
|
||||
message: "#^Variable variables are not allowed\\.$#"
|
||||
count: 4
|
||||
|
@ -400,11 +400,6 @@ parameters:
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php
|
||||
|
||||
-
|
||||
message: "#^Method Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\AccompanyingPeriodWorkRepository\\:\\:buildQueryBySocialActionWithDescendants\\(\\) has invalid return type Chill\\\\PersonBundle\\\\Repository\\\\AccompanyingPeriod\\\\QueryBuilder\\.$#"
|
||||
count: 1
|
||||
path: src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php
|
||||
|
||||
-
|
||||
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
|
||||
count: 3
|
||||
|
@ -14,6 +14,7 @@ namespace Chill\PersonBundle\Repository\AccompanyingPeriod;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
@ -97,22 +98,6 @@ final class AccompanyingPeriodWorkRepository implements ObjectRepository
|
||||
return AccompanyingPeriodWork::class;
|
||||
}
|
||||
|
||||
public function toDelete()
|
||||
{
|
||||
$qb = $this->buildQueryBySocialActionWithDescendants($action);
|
||||
$qb->select('g');
|
||||
|
||||
foreach ($orderBy as $sort => $order) {
|
||||
$qb->addOrderBy('g.' . $sort, $order);
|
||||
}
|
||||
|
||||
return $qb
|
||||
->setMaxResults($limit)
|
||||
->setFirstResult($offset)
|
||||
->getQuery()
|
||||
->getResult();
|
||||
}
|
||||
|
||||
private function buildQueryBySocialActionWithDescendants(SocialAction $action): QueryBuilder
|
||||
{
|
||||
$actions = $action->getDescendantsWithThis();
|
||||
@ -122,9 +107,9 @@ final class AccompanyingPeriodWorkRepository implements ObjectRepository
|
||||
$orx = $qb->expr()->orX();
|
||||
$i = 0;
|
||||
|
||||
foreach ($actions as $action) {
|
||||
foreach ($actions as $a) {
|
||||
$orx->add(":action_{$i} MEMBER OF g.socialActions");
|
||||
$qb->setParameter("action_{$i}", $action);
|
||||
$qb->setParameter("action_{$i}", $a);
|
||||
}
|
||||
$qb->where($orx);
|
||||
|
||||
|
@ -486,7 +486,7 @@ final class SingleTaskController extends AbstractController
|
||||
);
|
||||
|
||||
default:
|
||||
throw new BadRequestException("format not supported: {$format}");
|
||||
throw new BadRequestException("format not supported: {$_format}");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user