DX: fix phpstan errors

This commit is contained in:
2023-02-04 00:50:58 +01:00
parent a01cc23c14
commit 856eea37ee
16 changed files with 94 additions and 120 deletions

View File

@@ -26,6 +26,7 @@ use Chill\PersonBundle\Repository\PersonACLAwareRepositoryInterface;
use DateTime;
use Exception;
use libphonenumber\PhoneNumber;
use libphonenumber\PhoneNumberUtil;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Templating\EngineInterface;
@@ -162,11 +163,11 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf
$phonenumber = new PhoneNumber();
$phonenumber->setNationalNumber($terms['phonenumber']);
} catch (Exception $ex) {
throw new ParsingException("The date for {$key} is "
throw new ParsingException("The data for {$key} is "
. 'not parsable', 0, $ex);
}
$data['phonenumber'] = $phonenumber ?? null;
$data['phonenumber'] = $phonenumber;
}
return $data;

View File

@@ -51,7 +51,7 @@ class AccompanyingPeriodWorkEvaluationVoter extends Voter implements ChillVoterI
{
switch ($attribute) {
case self::STATS:
return $this->security->isGranted(AccompanyingPeriodWorkVoter::STATS, $subject);
return $this->security->isGranted(AccompanyingPeriodVoter::STATS, $subject);
case self::SEE:
return $this->security->isGranted(AccompanyingPeriodWorkVoter::SEE, $subject->getAccompanyingPeriodWork());

View File

@@ -24,12 +24,12 @@ class AuthorizedCenterOnPersonCreation implements AuthorizedCenterOnPersonCreati
public function __construct(AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser, ParameterBagInterface $parameterBag)
{
$this->authorizationHelperForCurrentUser = $authorizationHelperForCurrentUser;
$this->showCenter = $parameterBag->get('chill_main')['acl']['form_show_centers'];
$this->showCenters = $parameterBag->get('chill_main')['acl']['form_show_centers'];
}
public function getCenters(): array
{
if (!$this->showCenter) {
if (!$this->showCenters) {
return [];
}