Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Classes/Driver/DropboxDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ protected function canonicalizeAndCheckFolderIdentifier($folderIdentifier): stri
return rtrim($this->canonicalizeAndCheckFileIdentifier($folderIdentifier), '/') . '/';
}

public function getPathInfo(string $folderIdentifier, string $fileIdentifier = null): PathInfoInterface
public function getPathInfo(string $folderIdentifier, ?string $fileIdentifier = null): PathInfoInterface
{
if ($fileIdentifier !== null) {
$fileIdentifier = $fileIdentifier === '/' ? '/' : rtrim($fileIdentifier, '/');
Expand Down
1 change: 0 additions & 1 deletion Classes/Extractor/ImageExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use StefanFroemken\Dropbox\Client\DropboxClient;
use StefanFroemken\Dropbox\Client\DropboxClientFactory;
use TYPO3\CMS\Core\Resource\AbstractFile;
use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\FileType;
use TYPO3\CMS\Core\Resource\Index\ExtractorInterface;
Expand Down
15 changes: 15 additions & 0 deletions Documentation/ChangeLog/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@
ChangeLog
=========

Version 6.1.0
=============

* Add feature to prevent counting files of sub-folders
* Repair creating new file
* Prevent class properties where possible (stateless)
* Use "new" if class has state
* Prevent additional API calls where possible

Version 6.0.0
=============

* Add TYPO3 compatibility
* Remove support for older TYPO3 versions

Version 5.0.2
=============

Expand Down
13 changes: 6 additions & 7 deletions Resources/Private/PHP/spatie/dropbox-api/src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Spatie\Dropbox;

use Exception;
use GrahamCampbell\GuzzleFactory\GuzzleFactory;
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\ClientInterface;
Expand Down Expand Up @@ -300,7 +299,7 @@ public function getThumbnail(string $path, string $format = 'jpeg', string $size

$response = $this->contentEndpointRequest('files/get_thumbnail', $arguments);

return (string) $response->getBody();
return (string)$response->getBody();
}

/**
Expand Down Expand Up @@ -446,7 +445,7 @@ public function uploadChunked(string $path, mixed $contents, string $mode = 'add
}

/**
* @throws Exception
* @throws \Exception
*/
protected function uploadChunk(int $type, StreamInterface &$stream, int $chunkSize, ?UploadSessionCursor $cursor = null): UploadSessionCursor
{
Expand All @@ -469,7 +468,7 @@ protected function uploadChunk(int $type, StreamInterface &$stream, int $chunkSi
return $this->uploadSessionAppend($chunkStream, $cursor);
}

throw new Exception('Invalid type');
throw new \Exception('Invalid type');
} catch (RequestException $exception) {
if ($tries < $maximumTries) {
// rewind
Expand Down Expand Up @@ -578,7 +577,7 @@ protected function normalizePath(string $path): string

$path = trim($path, '/');

return ($path === '') ? '' : '/'.$path;
return ($path === '') ? '' : '/' . $path;
}

protected function getEndpointUrl(string $subdomain, string $endpoint): string
Expand Down Expand Up @@ -652,7 +651,7 @@ public function rpcEndpointRequest(string $endpoint, ?array $parameters = null,
return json_decode($response->getBody(), true) ?? [];
}

protected function determineException(ClientException $exception): Exception
protected function determineException(ClientException $exception): \Exception
{
if (in_array($exception->getResponse()->getStatusCode(), [400, 409])) {
return new BadRequest($exception->getResponse());
Expand Down Expand Up @@ -764,7 +763,7 @@ protected function getHeadersForBearerToken(string $token): array
protected function getHeadersForCredentials(): array
{
return [
'Authorization' => 'Basic '.base64_encode("{$this->appKey}:{$this->appSecret}"),
'Authorization' => 'Basic ' . base64_encode("{$this->appKey}:{$this->appSecret}"),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

namespace Spatie\Dropbox\Exceptions;

use Exception;
use Psr\Http\Message\ResponseInterface;

class BadRequest extends Exception
class BadRequest extends \Exception
{
public ?string $dropboxCode = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

class InMemoryTokenProvider implements TokenProvider
{
public function __construct(protected string $token)
{
}
public function __construct(protected string $token) {}

public function getToken(): string
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ public function __construct(
* The amount of data that has been uploaded so far. We use this to make sure upload data isn't lost or duplicated in the event of a network error.
*/
public int $offset = 0,
) {
}
) {}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"source": "https://github.com/froemken/dropbox"
},
"require": {
"typo3/cms-core": "^13.4.3",
"typo3/cms-core": "^13.4.12",
"spatie/dropbox-api": "1.23.0"
},
"require-dev": {
Expand Down
4 changes: 2 additions & 2 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
'author_email' => 'froemken@gmail.com',
'state' => 'stable',
'clearCacheOnLoad' => true,
'version' => '6.0.0',
'version' => '6.1.0',
'constraints' => [
'depends' => [
'typo3' => '13.4.3-13.4.99',
'typo3' => '13.4.12-13.4.99',
],
'conflicts' => [
],
Expand Down