mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 07:33:50 +00:00
fixes after merge of master into upgrade-sf4
This commit is contained in:
@@ -55,8 +55,8 @@ final readonly class TempUrlOpenstackGenerator implements TempUrlGeneratorInterf
|
||||
* @throws TempUrlGeneratorException
|
||||
*/
|
||||
public function generatePost(
|
||||
int $expire_delay = null,
|
||||
int $submit_delay = null,
|
||||
?int $expire_delay = null,
|
||||
?int $submit_delay = null,
|
||||
int $max_file_count = 1,
|
||||
): SignedUrlPost {
|
||||
$delay = $expire_delay ?? $this->max_expire_delay;
|
||||
@@ -112,7 +112,7 @@ final readonly class TempUrlOpenstackGenerator implements TempUrlGeneratorInterf
|
||||
/**
|
||||
* Generate an absolute public url for a GET request on the object.
|
||||
*/
|
||||
public function generate(string $method, string $object_name, int $expire_delay = null): SignedUrl
|
||||
public function generate(string $method, string $object_name, ?int $expire_delay = null): SignedUrl
|
||||
{
|
||||
if ($expire_delay > $this->max_expire_delay) {
|
||||
throw new TempUrlGeneratorException(sprintf('The expire delay (%d) is greater than the max_expire_delay (%d)', $expire_delay, $this->max_expire_delay));
|
||||
|
@@ -13,7 +13,7 @@ namespace Chill\DocStoreBundle\AsyncUpload\Exception;
|
||||
|
||||
class BadCallToRemoteServer extends \LogicException
|
||||
{
|
||||
public function __construct(string $content, int $statusCode, int $code = 0, \Throwable $previous = null)
|
||||
public function __construct(string $content, int $statusCode, int $code = 0, ?\Throwable $previous = null)
|
||||
{
|
||||
parent::__construct("Bad call to remote server: {$statusCode}, {$content}", $code, $previous);
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ namespace Chill\DocStoreBundle\AsyncUpload\Exception;
|
||||
|
||||
class TempUrlRemoteServerException extends \RuntimeException
|
||||
{
|
||||
public function __construct(int $statusCode, int $code = 0, \Throwable $previous = null)
|
||||
public function __construct(int $statusCode, int $code = 0, ?\Throwable $previous = null)
|
||||
{
|
||||
parent::__construct('Could not reach remote server: '.(string) $statusCode, $code, $previous);
|
||||
}
|
||||
|
@@ -14,10 +14,10 @@ namespace Chill\DocStoreBundle\AsyncUpload;
|
||||
interface TempUrlGeneratorInterface
|
||||
{
|
||||
public function generatePost(
|
||||
int $expire_delay = null,
|
||||
int $submit_delay = null,
|
||||
?int $expire_delay = null,
|
||||
?int $submit_delay = null,
|
||||
int $max_file_count = 1
|
||||
): SignedUrlPost;
|
||||
|
||||
public function generate(string $method, string $object_name, int $expire_delay = null): SignedUrl;
|
||||
public function generate(string $method, string $object_name, ?int $expire_delay = null): SignedUrl;
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@ class AsyncUploadExtension extends AbstractExtension
|
||||
];
|
||||
}
|
||||
|
||||
public function computeSignedUrl(StoredObject|string $file, string $method = 'GET', int $expiresDelay = null): string
|
||||
public function computeSignedUrl(StoredObject|string $file, string $method = 'GET', ?int $expiresDelay = null): string
|
||||
{
|
||||
if ($file instanceof StoredObject) {
|
||||
$object_name = $file->getFilename();
|
||||
@@ -47,7 +47,7 @@ class AsyncUploadExtension extends AbstractExtension
|
||||
return $this->tempUrlGenerator->generate($method, $object_name, $expiresDelay)->url;
|
||||
}
|
||||
|
||||
public function computeGenerateUrl(StoredObject|string $file, string $method = 'GET', int $expiresDelay = null): string
|
||||
public function computeGenerateUrl(StoredObject|string $file, string $method = 'GET', ?int $expiresDelay = null): string
|
||||
{
|
||||
if ($file instanceof StoredObject) {
|
||||
$object_name = $file->getFilename();
|
||||
|
@@ -29,8 +29,7 @@ final readonly class GenericDocForAccompanyingPeriodController
|
||||
private PaginatorFactory $paginator,
|
||||
private Security $security,
|
||||
private \Twig\Environment $twig,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @throws \Doctrine\DBAL\Exception
|
||||
|
@@ -29,8 +29,7 @@ final readonly class GenericDocForPerson
|
||||
private PaginatorFactory $paginator,
|
||||
private Security $security,
|
||||
private \Twig\Environment $twig,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @throws \Doctrine\DBAL\Exception
|
||||
|
@@ -20,9 +20,7 @@ use Symfony\Component\Security\Core\Security;
|
||||
|
||||
class StoredObjectApiController
|
||||
{
|
||||
public function __construct(private readonly Security $security)
|
||||
{
|
||||
}
|
||||
public function __construct(private readonly Security $security) {}
|
||||
|
||||
/**
|
||||
* @Route("/api/1.0/doc-store/stored-object/{uuid}/is-ready")
|
||||
|
@@ -53,8 +53,7 @@ class DocumentCategory
|
||||
* @var int The id which is unique inside the bundle
|
||||
*/
|
||||
private $idInsideBundle
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function getBundleId() // ::class BundleClass (FQDN)
|
||||
{
|
||||
|
@@ -30,9 +30,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class PersonDocumentType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly ScopeResolverDispatcher $scopeResolverDispatcher, private readonly ParameterBagInterface $parameterBag, private readonly CenterResolverDispatcher $centerResolverDispatcher)
|
||||
{
|
||||
}
|
||||
public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly ScopeResolverDispatcher $scopeResolverDispatcher, private readonly ParameterBagInterface $parameterBag, private readonly CenterResolverDispatcher $centerResolverDispatcher) {}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
|
@@ -54,8 +54,7 @@ class FetchQuery implements FetchQueryInterface
|
||||
private array $selectIdentifierTypes = [],
|
||||
private array $selectDateParams = [],
|
||||
private array $selectDateTypes = [],
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function addJoinClause(string $sql, array $params = [], array $types = []): int
|
||||
{
|
||||
|
@@ -21,8 +21,7 @@ final readonly class GenericDocDTO
|
||||
public array $identifiers,
|
||||
public \DateTimeImmutable $docDate,
|
||||
public AccompanyingPeriod|Person $linked,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function getContext(): string
|
||||
{
|
||||
|
@@ -31,8 +31,7 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen
|
||||
public function __construct(
|
||||
private Security $security,
|
||||
private EntityManagerInterface $entityManager,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
|
||||
{
|
||||
|
@@ -27,8 +27,7 @@ final readonly class PersonDocumentGenericDocProvider implements GenericDocForPe
|
||||
public function __construct(
|
||||
private Security $security,
|
||||
private PersonDocumentACLAwareRepositoryInterface $personDocumentACLAwareRepository,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function buildFetchQueryForPerson(
|
||||
Person $person,
|
||||
|
@@ -23,8 +23,7 @@ final readonly class AccompanyingCourseDocumentGenericDocRenderer implements Gen
|
||||
public function __construct(
|
||||
private AccompanyingCourseDocumentRepository $accompanyingCourseDocumentRepository,
|
||||
private PersonDocumentRepository $personDocumentRepository,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function supports(GenericDocDTO $genericDocDTO, $options = []): bool
|
||||
{
|
||||
|
@@ -25,8 +25,7 @@ final readonly class GenericDocExtensionRuntime implements RuntimeExtensionInter
|
||||
* @var list<GenericDocRendererInterface>
|
||||
*/
|
||||
private iterable $renderers,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @throws RuntimeError
|
||||
|
@@ -20,9 +20,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
final readonly class MenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
public function __construct(private Security $security, private TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
public function __construct(private Security $security, private TranslatorInterface $translator) {}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
|
@@ -34,8 +34,7 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA
|
||||
private CenterResolverManagerInterface $centerResolverManager,
|
||||
private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser,
|
||||
private Security $security,
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function buildQueryByPerson(Person $person): QueryBuilder
|
||||
{
|
||||
|
@@ -20,9 +20,7 @@ class StoredObjectDenormalizer implements DenormalizerInterface
|
||||
{
|
||||
use ObjectToPopulateTrait;
|
||||
|
||||
public function __construct(private readonly StoredObjectRepository $storedObjectRepository)
|
||||
{
|
||||
}
|
||||
public function __construct(private readonly StoredObjectRepository $storedObjectRepository) {}
|
||||
|
||||
public function denormalize($data, $type, $format = null, array $context = [])
|
||||
{
|
||||
|
@@ -30,9 +30,7 @@ final class StoredObjectManager implements StoredObjectManagerInterface
|
||||
public function __construct(
|
||||
private readonly HttpClientInterface $client,
|
||||
private readonly TempUrlGeneratorInterface $tempUrlGenerator
|
||||
)
|
||||
{
|
||||
}
|
||||
) {}
|
||||
|
||||
public function getLastModified(StoredObject $document): \DateTimeInterface
|
||||
{
|
||||
|
@@ -120,9 +120,7 @@ final readonly class WopiEditTwigExtensionRuntime implements RuntimeExtensionInt
|
||||
|
||||
private const TEMPLATE_BUTTON_GROUP = '@ChillDocStore/Button/button_group.html.twig';
|
||||
|
||||
public function __construct(private DiscoveryInterface $discovery, private NormalizerInterface $normalizer)
|
||||
{
|
||||
}
|
||||
public function __construct(private DiscoveryInterface $discovery, private NormalizerInterface $normalizer) {}
|
||||
|
||||
/**
|
||||
* return true if the document is editable.
|
||||
|
@@ -68,7 +68,7 @@ class AsyncUploadControllerTest extends TestCase
|
||||
bool $isGranted,
|
||||
): AsyncUploadController {
|
||||
$tempUrlGenerator = new class () implements TempUrlGeneratorInterface {
|
||||
public function generatePost(int $expire_delay = null, int $submit_delay = null, int $max_file_count = 1): SignedUrlPost
|
||||
public function generatePost(?int $expire_delay = null, ?int $submit_delay = null, int $max_file_count = 1): SignedUrlPost
|
||||
{
|
||||
return new SignedUrlPost(
|
||||
'https://object.store.example',
|
||||
@@ -82,7 +82,7 @@ class AsyncUploadControllerTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function generate(string $method, string $object_name, int $expire_delay = null): SignedUrl
|
||||
public function generate(string $method, string $object_name, ?int $expire_delay = null): SignedUrl
|
||||
{
|
||||
return new SignedUrl(
|
||||
$method,
|
||||
|
Reference in New Issue
Block a user