fixes after merge of master into upgrade-sf4

This commit is contained in:
2024-02-12 22:31:16 +01:00
parent 37af488f69
commit f889d67e94
664 changed files with 795 additions and 1980 deletions

View File

@@ -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));

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -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();