Skip to content

Commit e6bf18e

Browse files
authored
Merge pull request #100 from jmsche/fix/php-8.4-deprecation
Fix PHP 8.4 deprecation
2 parents 7668791 + b1d25f7 commit e6bf18e

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/DropboxAdapter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use Spatie\Dropbox\Client;
2626
use Spatie\Dropbox\Exceptions\BadRequest;
2727

28-
class DropboxAdapter implements FilesystemAdapter, ChecksumProvider
28+
class DropboxAdapter implements ChecksumProvider, FilesystemAdapter
2929
{
3030
protected Client $client;
3131

@@ -36,11 +36,11 @@ class DropboxAdapter implements FilesystemAdapter, ChecksumProvider
3636
public function __construct(
3737
Client $client,
3838
string $prefix = '',
39-
MimeTypeDetector $mimeTypeDetector = null
39+
?MimeTypeDetector $mimeTypeDetector = null
4040
) {
4141
$this->client = $client;
4242
$this->prefixer = new PathPrefixer($prefix);
43-
$this->mimeTypeDetector = $mimeTypeDetector ?: new FinfoMimeTypeDetector();
43+
$this->mimeTypeDetector = $mimeTypeDetector ?: new FinfoMimeTypeDetector;
4444
}
4545

4646
public function getClient(): Client

tests/DropboxAdapterTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
'.tag' => 'file',
3232
]);
3333

34-
$this->dropboxAdapter->write('something', 'contents', new Config());
34+
$this->dropboxAdapter->write('something', 'contents', new Config);
3535
$this->addToAssertionCount(1);
3636
});
3737

@@ -42,7 +42,7 @@
4242
'.tag' => 'file',
4343
]);
4444

45-
$this->dropboxAdapter->writeStream('something', tmpfile(), new Config());
45+
$this->dropboxAdapter->writeStream('something', tmpfile(), new Config);
4646
$this->addToAssertionCount(1);
4747
});
4848

@@ -130,9 +130,9 @@
130130
'path_display' => '/prefix/pass/please',
131131
]);
132132

133-
$this->dropboxAdapter->createDirectory('fail/please', new Config());
133+
$this->dropboxAdapter->createDirectory('fail/please', new Config);
134134

135-
$this->dropboxAdapter->createDirectory('pass/please', new Config());
135+
$this->dropboxAdapter->createDirectory('pass/please', new Config);
136136
$this->addToAssertionCount(1);
137137
})->throws(UnableToCreateDirectory::class);
138138

@@ -168,14 +168,14 @@
168168
it('can move a file', function () {
169169
$this->client->move(Argument::type('string'), Argument::type('string'))->willReturn(['.tag' => 'file', 'path' => 'something']);
170170

171-
$this->dropboxAdapter->move('something', 'something', new Config());
171+
$this->dropboxAdapter->move('something', 'something', new Config);
172172
$this->addToAssertionCount(1);
173173
});
174174

175175
it('can handle a failing move', function () {
176176
$this->client->move('/prefix/something', '/prefix/something')->willThrow(new BadRequest(new Response(409)));
177177

178-
$this->dropboxAdapter->move('something', 'something', new Config());
178+
$this->dropboxAdapter->move('something', 'something', new Config);
179179
})->throws(UnableToMoveFile::class);
180180

181181
it('can copy', function () {
@@ -184,14 +184,14 @@
184184
Argument::type('string')
185185
)->willReturn(['.tag' => 'file', 'path' => 'something']);
186186

187-
$this->dropboxAdapter->copy('something', 'something', new Config());
187+
$this->dropboxAdapter->copy('something', 'something', new Config);
188188
$this->addToAssertionCount(1);
189189
});
190190

191191
it('can handle a failing copy', function () {
192192
$this->client->copy(Argument::any(), Argument::any())->willThrow(new BadRequest(new Response(409)));
193193

194-
$this->dropboxAdapter->copy('something', 'something', new Config());
194+
$this->dropboxAdapter->copy('something', 'something', new Config);
195195
})->throws(UnableToCopyFile::class);
196196

197197
test('getClient')

0 commit comments

Comments
 (0)