fix: Run cs:fix

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
pull/45094/head
Marcel Klehr 2 years ago
parent 17486ad15b
commit ee7592ffdd
  1. 2
      lib/private/Repair/AddRemoveOldTasksBackgroundJob.php
  2. 11
      lib/private/TaskProcessing/RemoveOldTasksBackgroundJob.php
  3. 13
      lib/public/TaskProcessing/ShapeDescriptor.php
  4. 4
      tests/lib/TaskProcessing/TaskProcessingTest.php

@ -25,9 +25,9 @@ declare(strict_types=1);
*/
namespace OC\Repair;
use OC\TaskProcessing\RemoveOldTasksBackgroundJob;
use OC\TextProcessing\RemoveOldTasksBackgroundJob as RemoveOldTextProcessingTasksBackgroundJob;
use OC\TextToImage\RemoveOldTasksBackgroundJob as RemoveOldTextToImageTasksBackgroundJob;
use OC\TaskProcessing\RemoveOldTasksBackgroundJob;
use OCP\BackgroundJob\IJobList;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;

@ -4,18 +4,7 @@ namespace OC\TaskProcessing;
use OC\TaskProcessing\Db\TaskMapper;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\IJobList;
use OCP\BackgroundJob\QueuedJob;
use OCP\BackgroundJob\TimedJob;
use OCP\Files\GenericFileException;
use OCP\Files\NotPermittedException;
use OCP\Lock\LockedException;
use OCP\TaskProcessing\Exception\Exception;
use OCP\TaskProcessing\Exception\NotFoundException;
use OCP\TaskProcessing\Exception\ProcessingException;
use OCP\TaskProcessing\Exception\ValidationException;
use OCP\TaskProcessing\IManager;
use OCP\TaskProcessing\ISynchronousProvider;
use Psr\Log\LoggerInterface;
class RemoveOldTasksBackgroundJob extends TimedJob {

@ -6,7 +6,7 @@ namespace OCP\TaskProcessing;
* Data object for input output shape entries
* @since 30.0.0
*/
class ShapeDescriptor {
class ShapeDescriptor implements \JsonSerializable {
/**
* @param string $name
* @param string $description
@ -43,4 +43,15 @@ class ShapeDescriptor {
public function getShapeType(): EShapeType {
return $this->shapeType;
}
/**
* @return array{name: string, description: string, type: int}
*/
public function jsonSerialize(): array {
return [
'name' => $this->getName(),
'description' => $this->getDescription(),
'type' => $this->getShapeType()->value,
];
}
}

@ -466,8 +466,8 @@ class TaskProcessingTest extends \Test\TestCase {
public function testOldTasksShouldBeCleanedUp() {
$currentTime = new \DateTime('now');
$timeFactory = $this->createMock(ITimeFactory::class);
$timeFactory->expects($this->any())->method('getDateTime')->willReturnCallback(fn() => $currentTime);
$timeFactory->expects($this->any())->method('getTime')->willReturnCallback(fn() => $currentTime->getTimestamp());
$timeFactory->expects($this->any())->method('getDateTime')->willReturnCallback(fn () => $currentTime);
$timeFactory->expects($this->any())->method('getTime')->willReturnCallback(fn () => $currentTime->getTimestamp());
$this->taskMapper = new TaskMapper(
\OCP\Server::get(IDBConnection::class),

Loading…
Cancel
Save