mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-01 12:33:49 +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();
|
||||
|
Reference in New Issue
Block a user