Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
bytehead committed Feb 5, 2024
1 parent 594def5 commit 5c10840
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/Controller/AbstractChunkedController.php
Expand Up @@ -39,7 +39,7 @@ abstract protected function parseChunkedRequest(Request $request): array;
* returned array to reassemble the uploaded chunks.
*
* @param UploadedFile $file - The uploaded chunk
* @param responseInterface $response - A response object
* @param ResponseInterface $response - A response object
* @param Request $request - The request object
*/
protected function handleChunkedUpload(UploadedFile $file, ResponseInterface $response, Request $request): void
Expand Down Expand Up @@ -84,7 +84,7 @@ protected function handleChunkedUpload(UploadedFile $file, ResponseInterface $re
* This function is a helper function which dispatches post chunk upload event.
*
* @param mixed $uploaded - The uploaded chunk
* @param responseInterface $response - A response object
* @param ResponseInterface $response - A response object
* @param Request $request - The request object
* @param bool $isLast - True if this is the last chunk, false otherwise
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/AbstractController.php
Expand Up @@ -164,7 +164,7 @@ protected function dispatchPostEvents(File $uploaded, ResponseInterface $respons
}
}

protected function validate(FileInterface $file, Request $request, ResponseInterface $response = null): void
protected function validate(FileInterface $file, Request $request, ?ResponseInterface $response = null): void
{
$event = new ValidationEvent($file, $request, $this->config, $this->type, $response);

Expand Down Expand Up @@ -204,7 +204,7 @@ protected function getRequest(): Request
/**
* Event dispatch proxy that avoids using deprecated interfaces.
*/
protected function dispatchEvent(Event $event, string $eventName = null): void
protected function dispatchEvent(Event $event, ?string $eventName = null): void
{
/** @var EventDispatcherInterface $dispatcher */
$dispatcher = $this->container->get('event_dispatcher');
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/OneupUploaderExtension.php
Expand Up @@ -256,7 +256,7 @@ protected function createStorageService(array &$config, string $key, bool $orpha
return $storageService;
}

protected function registerFilesystem(string $type, string $key, string $class, string $filesystem, string $buffer, string $streamWrapper = null, string $prefix = ''): void
protected function registerFilesystem(string $type, string $key, string $class, string $filesystem, string $buffer, ?string $streamWrapper = null, string $prefix = ''): void
{
switch ($type) {
case 'gaufrette':
Expand Down
4 changes: 2 additions & 2 deletions src/Routing/RouteLoader.php
Expand Up @@ -15,12 +15,12 @@ public function __construct(protected array $controllers)
parent::__construct();
}

public function supports(mixed $resource, string $type = null): bool
public function supports(mixed $resource, ?string $type = null): bool
{
return 'uploader' === $type;
}

public function load(mixed $resource, string $type = null): RouteCollection
public function load(mixed $resource, ?string $type = null): RouteCollection
{
$routes = new RouteCollection();
$separator = '::';
Expand Down
2 changes: 1 addition & 1 deletion src/Uploader/Chunk/Storage/FlysystemStorage.php
Expand Up @@ -37,7 +37,7 @@ public function addChunk(string $uuid, int $index, UploadedFile $chunk, string $
/**
* @throws FilesystemException
*/
public function clear(int $maxAge, string $prefix = null): void
public function clear(int $maxAge, ?string $prefix = null): void
{
$prefix = $prefix ?: $this->prefix;
$matches = $this->filesystem->listContents($prefix, true);
Expand Down
2 changes: 1 addition & 1 deletion src/Uploader/Chunk/Storage/GaufretteStorage.php
Expand Up @@ -42,7 +42,7 @@ public function __construct(FilesystemInterface $filesystem, int $bufferSize, pr
* $prefix must be passable so it can clean the orphanage too
* as it is forced to be the same filesystem.
*/
public function clear(int $maxAge, string $prefix = null): void
public function clear(int $maxAge, ?string $prefix = null): void
{
$prefix = $prefix ?: $this->prefix;
$matches = $this->filesystem->listKeys($prefix);
Expand Down
2 changes: 1 addition & 1 deletion src/Uploader/Response/FineUploaderResponse.php
Expand Up @@ -42,7 +42,7 @@ public function getSuccess(): bool
return $this->success;
}

public function setError(string $msg = null): self
public function setError(?string $msg = null): self
{
$this->error = $msg;

Expand Down
2 changes: 1 addition & 1 deletion src/Uploader/Response/MooUploadResponse.php
Expand Up @@ -42,7 +42,7 @@ public function getId(): int|string|null
return $this->id;
}

public function setName(string $name = null): self
public function setName(?string $name = null): self
{
$this->name = $name;

Expand Down
4 changes: 2 additions & 2 deletions src/Uploader/Storage/FilesystemOrphanageStorage.php
Expand Up @@ -34,7 +34,7 @@ public function __construct(protected StorageInterface $storage, RequestStack $r
*
* @return FileInterface|File
*/
public function upload($file, string $name, string $path = null)
public function upload($file, string $name, ?string $path = null)
{
if (!$this->session instanceof SessionInterface || !$this->session->isStarted()) {
throw new \RuntimeException('You need a running session in order to run the Orphanage.');
Expand All @@ -43,7 +43,7 @@ public function upload($file, string $name, string $path = null)
return parent::upload($file, $name, $this->getPath());
}

public function uploadFiles(array $files = null): array
public function uploadFiles(?array $files = null): array
{
try {
if (null === $files) {
Expand Down
2 changes: 1 addition & 1 deletion src/Uploader/Storage/FilesystemStorage.php
Expand Up @@ -19,7 +19,7 @@ public function __construct(protected string $directory)
*
* @return FileInterface|File
*/
public function upload($file, string $name, string $path = null)
public function upload($file, string $name, ?string $path = null)
{
$path = null === $path ? $name : sprintf('%s/%s', $path, $name);
$path = sprintf('%s/%s', $this->directory, $path);
Expand Down
4 changes: 2 additions & 2 deletions src/Uploader/Storage/FlysystemOrphanageStorage.php
Expand Up @@ -41,7 +41,7 @@ public function __construct(protected StorageInterface $storage, RequestStack $r
*
* @return FileInterface|SymfonyFile
*/
public function upload($file, string $name, string $path = null)
public function upload($file, string $name, ?string $path = null)
{
if (!$this->session instanceof SessionInterface || !$this->session->isStarted()) {
throw new \RuntimeException('You need a running session in order to run the Orphanage.');
Expand All @@ -53,7 +53,7 @@ public function upload($file, string $name, string $path = null)
/**
* @throws FilesystemException
*/
public function uploadFiles(array $files = null): array
public function uploadFiles(?array $files = null): array
{
try {
if (null === $files) {
Expand Down
2 changes: 1 addition & 1 deletion src/Uploader/Storage/FlysystemStorage.php
Expand Up @@ -25,7 +25,7 @@ public function __construct(private FilesystemOperator $filesystem, protected in
*
* @return FileInterface|SymfonyFile
*/
public function upload($file, string $name, string $path = null)
public function upload($file, string $name, ?string $path = null)
{
$path = null === $path ? $name : sprintf('%s/%s', $path, $name);

Expand Down
4 changes: 2 additions & 2 deletions src/Uploader/Storage/GaufretteOrphanageStorage.php
Expand Up @@ -37,7 +37,7 @@ public function __construct(protected StorageInterface $storage, RequestStack $r
*
* @return FileInterface|GaufretteFile
*/
public function upload($file, string $name, string $path = null)
public function upload($file, string $name, ?string $path = null)
{
if (!$this->session instanceof SessionInterface || !$this->session->isStarted()) {
throw new \RuntimeException('You need a running session in order to run the Orphanage.');
Expand All @@ -46,7 +46,7 @@ public function upload($file, string $name, string $path = null)
return parent::upload($file, $name, $this->getPath());
}

public function uploadFiles(array $files = null): array
public function uploadFiles(?array $files = null): array
{
try {
if (null === $files) {
Expand Down
2 changes: 1 addition & 1 deletion src/Uploader/Storage/GaufretteStorage.php
Expand Up @@ -33,7 +33,7 @@ public function __construct(FilesystemInterface $filesystem, int $bufferSize, pr
*
* @return FileInterface|GaufretteFile
*/
public function upload($file, string $name, string $path = null)
public function upload($file, string $name, ?string $path = null)
{
$path = null === $path ? $name : sprintf('%s/%s', $path, $name);

Expand Down
2 changes: 1 addition & 1 deletion src/Uploader/Storage/OrphanageStorageInterface.php
Expand Up @@ -6,5 +6,5 @@

interface OrphanageStorageInterface extends StorageInterface
{
public function uploadFiles(array $files = null): array;
public function uploadFiles(?array $files = null): array;
}
2 changes: 1 addition & 1 deletion src/Uploader/Storage/StorageInterface.php
Expand Up @@ -16,5 +16,5 @@ interface StorageInterface
*
* @return FileInterface|File
*/
public function upload($file, string $name, string $path = null);
public function upload($file, string $name, ?string $path = null);
}
2 changes: 1 addition & 1 deletion tests/Uploader/File/GaufretteFileTest.php
Expand Up @@ -16,7 +16,7 @@ class GaufretteFileTest extends FileTest
protected function setUp(): void
{
$adapter = new Adapter(sys_get_temp_dir(), true);
$filesystem = new GaufretteFilesystem($adapter);
$filesystem = new GaufretteFileSystem($adapter);

$map = StreamWrapper::getFilesystemMap();
$map->set('oneup', $filesystem);
Expand Down

0 comments on commit 5c10840

Please sign in to comment.