mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix phpstan errors on ThirdPartyRender
This commit is contained in:
parent
ae10a8bd1c
commit
63cdc97c47
@ -460,8 +460,3 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: src/Bundle/ChillThirdPartyBundle/Search/ThirdPartySearch.php
|
path: src/Bundle/ChillThirdPartyBundle/Search/ThirdPartySearch.php
|
||||||
|
|
||||||
-
|
|
||||||
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
|
|
||||||
count: 1
|
|
||||||
path: src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php
|
|
||||||
|
|
||||||
|
@ -29,8 +29,12 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
|
|
||||||
final class PersonResourceType extends AbstractType
|
final class PersonResourceType extends AbstractType
|
||||||
{
|
{
|
||||||
|
private PersonRenderInterface $personRender;
|
||||||
|
|
||||||
private ResourceKindRender $resourceKindRender;
|
private ResourceKindRender $resourceKindRender;
|
||||||
|
|
||||||
|
private ThirdPartyRender $thirdPartyRender;
|
||||||
|
|
||||||
private TranslatorInterface $translator;
|
private TranslatorInterface $translator;
|
||||||
|
|
||||||
public function __construct(ResourceKindRender $resourceKindRender, PersonRenderInterface $personRender, ThirdPartyRender $thirdPartyRender, TranslatorInterface $translator)
|
public function __construct(ResourceKindRender $resourceKindRender, PersonRenderInterface $personRender, ThirdPartyRender $thirdPartyRender, TranslatorInterface $translator)
|
||||||
|
@ -71,13 +71,13 @@ class ThirdPartyRender extends AbstractChillEntityRender
|
|||||||
$civility = '';
|
$civility = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($entity->getAcronym())) {
|
if ('' !== (string) $entity->getAcronym()) {
|
||||||
$acronym = ' (' . $entity->getAcronym() . ')';
|
$acronym = ' (' . $entity->getAcronym() . ')';
|
||||||
} else {
|
} else {
|
||||||
$acronym = '';
|
$acronym = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$firstname = empty($entity->getFirstname()) ? '' : $entity->getFirstname();
|
$firstname = ('' === $entity->getFirstname()) ? '' : $entity->getFirstname();
|
||||||
|
|
||||||
return $civility . $firstname . ' ' . $entity->getName() . $acronym;
|
return $civility . $firstname . ' ' . $entity->getName() . $acronym;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user