mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 11:03:50 +00:00
upgrade php-cs 3.49
This commit is contained in:
@@ -13,5 +13,5 @@ namespace Chill\DocGeneratorBundle\GeneratorDriver;
|
||||
|
||||
interface DriverInterface
|
||||
{
|
||||
public function generateFromString(string $template, string $resourceType, array $data, string $templateName = null): string;
|
||||
public function generateFromString(string $template, string $resourceType, array $data, ?string $templateName = null): string;
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ namespace Chill\DocGeneratorBundle\GeneratorDriver\Exception;
|
||||
*/
|
||||
class TemplateException extends \RuntimeException
|
||||
{
|
||||
public function __construct(private readonly array $errors, $code = 0, \Throwable $previous = null)
|
||||
public function __construct(private readonly array $errors, $code = 0, ?\Throwable $previous = null)
|
||||
{
|
||||
parent::__construct('Error while generating document from template', $code, $previous);
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ final class RelatorioDriver implements DriverInterface
|
||||
$this->url = $parameterBag->get('chill_doc_generator')['driver']['relatorio']['url'];
|
||||
}
|
||||
|
||||
public function generateFromString(string $template, string $resourceType, array $data, string $templateName = null): string
|
||||
public function generateFromString(string $template, string $resourceType, array $data, ?string $templateName = null): string
|
||||
{
|
||||
$form = new FormDataPart(
|
||||
[
|
||||
|
@@ -58,7 +58,7 @@ final class DocGeneratorTemplateRepository implements ObjectRepository
|
||||
*
|
||||
* @return DocGeneratorTemplate[]
|
||||
*/
|
||||
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
|
||||
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
|
||||
{
|
||||
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
||||
}
|
||||
@@ -85,7 +85,7 @@ final class DocGeneratorTemplateRepository implements ObjectRepository
|
||||
->getResult();
|
||||
}
|
||||
|
||||
public function findOneBy(array $criteria, array $orderBy = null): ?DocGeneratorTemplate
|
||||
public function findOneBy(array $criteria, ?array $orderBy = null): ?DocGeneratorTemplate
|
||||
{
|
||||
return $this->repository->findOneBy($criteria, $orderBy);
|
||||
}
|
||||
|
@@ -20,7 +20,7 @@ class NormalizeNullValueHelper
|
||||
{
|
||||
}
|
||||
|
||||
public function normalize(array $attributes, string $format = 'docgen', ?array $context = [], ClassMetadataInterface $classMetadata = null)
|
||||
public function normalize(array $attributes, string $format = 'docgen', ?array $context = [], ?ClassMetadataInterface $classMetadata = null)
|
||||
{
|
||||
$data = [];
|
||||
$data['isNull'] = true;
|
||||
|
@@ -21,7 +21,7 @@ class BaseContextData
|
||||
{
|
||||
}
|
||||
|
||||
public function getData(User $user = null): array
|
||||
public function getData(?User $user = null): array
|
||||
{
|
||||
$data = [];
|
||||
|
||||
|
@@ -46,10 +46,10 @@ class Generator implements GeneratorInterface
|
||||
DocGeneratorTemplate $template,
|
||||
int $entityId,
|
||||
array $contextGenerationDataNormalized,
|
||||
StoredObject $destinationStoredObject = null,
|
||||
?StoredObject $destinationStoredObject = null,
|
||||
bool $isTest = false,
|
||||
File $testFile = null,
|
||||
User $creator = null
|
||||
?File $testFile = null,
|
||||
?User $creator = null
|
||||
): ?string {
|
||||
if ($destinationStoredObject instanceof StoredObject && StoredObject::STATUS_PENDING !== $destinationStoredObject->getStatus()) {
|
||||
$this->logger->info(self::LOG_PREFIX.'Aborting generation of an already generated document');
|
||||
|
@@ -16,7 +16,7 @@ class GeneratorException extends \RuntimeException
|
||||
/**
|
||||
* @param string[] $errors
|
||||
*/
|
||||
public function __construct(private readonly array $errors = [], \Throwable $previous = null)
|
||||
public function __construct(private readonly array $errors = [], ?\Throwable $previous = null)
|
||||
{
|
||||
parent::__construct(
|
||||
'Could not generate the document',
|
||||
|
@@ -33,9 +33,9 @@ interface GeneratorInterface
|
||||
DocGeneratorTemplate $template,
|
||||
int $entityId,
|
||||
array $contextGenerationDataNormalized,
|
||||
StoredObject $destinationStoredObject = null,
|
||||
?StoredObject $destinationStoredObject = null,
|
||||
bool $isTest = false,
|
||||
File $testFile = null,
|
||||
User $creator = null
|
||||
?File $testFile = null,
|
||||
?User $creator = null
|
||||
): ?string;
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ namespace Chill\DocGeneratorBundle\Service\Generator;
|
||||
|
||||
class RelatedEntityNotFoundException extends \RuntimeException
|
||||
{
|
||||
public function __construct(string $relatedEntityClass, int $relatedEntityId, \Throwable $previous = null)
|
||||
public function __construct(string $relatedEntityClass, int $relatedEntityId, ?\Throwable $previous = null)
|
||||
{
|
||||
parent::__construct(
|
||||
sprintf('Related entity not found: %s, %s', $relatedEntityClass, $relatedEntityId),
|
||||
|
@@ -56,7 +56,7 @@ final class BaseContextDataTest extends KernelTestCase
|
||||
}
|
||||
|
||||
private function buildBaseContext(
|
||||
NormalizerInterface $normalizer = null
|
||||
?NormalizerInterface $normalizer = null
|
||||
): BaseContextData {
|
||||
return new BaseContextData(
|
||||
$normalizer ?? self::$container->get(NormalizerInterface::class)
|
||||
|
Reference in New Issue
Block a user