Skip to content

Commit 842c4f5

Browse files
refactor: Apply rector changes
Signed-off-by: GitHub <noreply@github.com>
1 parent f16c6c9 commit 842c4f5

4 files changed

Lines changed: 11 additions & 10 deletions

File tree

apps/dav/lib/Connector/Sabre/File.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
use OCP\Files\InvalidContentException;
3030
use OCP\Files\InvalidPathException;
3131
use OCP\Files\LockNotAcquiredException;
32+
use OCP\Files\NotEnoughSpaceException;
3233
use OCP\Files\NotFoundException;
3334
use OCP\Files\NotPermittedException;
3435
use OCP\Files\Storage\IWriteStreamStorage;
@@ -621,7 +622,7 @@ private function convertToSabreException(\Exception $e) {
621622
if ($e instanceof NotFoundException) {
622623
throw new NotFound($this->l10n->t('File not found: %1$s', [$e->getMessage()]), 0, $e);
623624
}
624-
if ($e instanceof Files\NotEnoughSpaceException) {
625+
if ($e instanceof NotEnoughSpaceException) {
625626
throw new EntityTooLarge($this->l10n->t('Insufficient space'), 0, $e);
626627
}
627628

core/Controller/UpdateController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use OCP\AppFramework\Http\Attribute\OpenAPI;
2626
use OCP\AppFramework\Http\Attribute\PublicPage;
2727
use OCP\AppFramework\Http\DataResponse;
28+
use OCP\AppFramework\OCSController;
2829
use OCP\EventDispatcher\IEventDispatcher;
2930
use OCP\IConfig;
3031
use OCP\IEventSourceFactory;
@@ -34,7 +35,7 @@
3435
use Psr\Log\LoggerInterface;
3536

3637
#[OpenAPI(scope: OpenApi::SCOPE_IGNORE)]
37-
class UpdateController extends \OCP\AppFramework\OCSController {
38+
class UpdateController extends OCSController {
3839
public function __construct(
3940
string $appName,
4041
IRequest $request,

lib/private/Files/Cache/Cache.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
use OCP\Files\Cache\CacheEntryInsertedEvent;
2525
use OCP\Files\Cache\CacheEntryRemovedEvent;
2626
use OCP\Files\Cache\CacheEntryUpdatedEvent;
27-
use OCP\Files\Cache\CacheInsertEvent;
28-
use OCP\Files\Cache\CacheUpdateEvent;
2927
use OCP\Files\Cache\ICache;
3028
use OCP\Files\Cache\ICacheEntry;
3129
use OCP\Files\Config\IUserMountCache;
@@ -333,7 +331,7 @@ public function insert($file, array $data) {
333331
}
334332

335333
$event = new CacheEntryInsertedEvent($this->storage, $file, $fileId, $storageId);
336-
$this->eventDispatcher->dispatch(CacheInsertEvent::class, $event);
334+
$this->eventDispatcher->dispatch(CacheEntryInsertedEvent::class, $event);
337335
$this->eventDispatcher->dispatchTyped($event);
338336
return $fileId;
339337
}
@@ -437,7 +435,7 @@ public function update($id, array $data) {
437435
// path can still be null if the file doesn't exist
438436
if ($path !== null) {
439437
$event = new CacheEntryUpdatedEvent($this->storage, $path, $id, $this->getNumericStorageId());
440-
$this->eventDispatcher->dispatch(CacheUpdateEvent::class, $event);
438+
$this->eventDispatcher->dispatch(CacheEntryUpdatedEvent::class, $event);
441439
$this->eventDispatcher->dispatchTyped($event);
442440
}
443441
}
@@ -851,11 +849,11 @@ public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) {
851849
$this->eventDispatcher->dispatchTyped(new CacheEntriesRemovedEvent([$event]));
852850

853851
$event = new CacheEntryInsertedEvent($this->storage, $targetPath, $sourceId, $this->getNumericStorageId());
854-
$this->eventDispatcher->dispatch(CacheInsertEvent::class, $event);
852+
$this->eventDispatcher->dispatch(CacheEntryInsertedEvent::class, $event);
855853
$this->eventDispatcher->dispatchTyped($event);
856854
} else {
857855
$event = new CacheEntryUpdatedEvent($this->storage, $targetPath, $sourceId, $this->getNumericStorageId());
858-
$this->eventDispatcher->dispatch(CacheUpdateEvent::class, $event);
856+
$this->eventDispatcher->dispatch(CacheEntryUpdatedEvent::class, $event);
859857
$this->eventDispatcher->dispatchTyped($event);
860858
}
861859
} else {

tests/lib/Files/Storage/Wrapper/QuotaTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use OC\Files\Storage\Local;
1414
use OC\Files\Storage\Wrapper\Quota;
1515
use OCP\Files;
16+
use OCP\Files\NotEnoughSpaceException;
1617
use OCP\ITempManager;
1718
use OCP\Server;
1819

@@ -246,14 +247,14 @@ public function testNoWriteStreamQuota(): void {
246247
$stream = fopen('php://temp', 'w+');
247248
fwrite($stream, 'foobar');
248249
rewind($stream);
249-
$this->expectException(Files\NotEnoughSpaceException::class);
250+
$this->expectException(NotEnoughSpaceException::class);
250251
$instance->writeStream('files/test.txt', $stream);
251252
}
252253

253254
public function testNoWriteStreamQuotaZero(): void {
254255
$instance = $this->getLimitedStorage(0.0);
255256
$stream = fopen('php://temp', 'w+');
256-
$this->expectException(Files\NotEnoughSpaceException::class);
257+
$this->expectException(NotEnoughSpaceException::class);
257258
$instance->writeStream('files/test.txt', $stream);
258259
}
259260
}

0 commit comments

Comments
 (0)