diff --git a/src/Bundle/ChillDocStoreBundle/Entity/StoredObjectLock.php b/src/Bundle/ChillDocStoreBundle/Entity/StoredObjectLock.php index d65ed2cad..95890b9c7 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/StoredObjectLock.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/StoredObjectLock.php @@ -40,13 +40,13 @@ class StoredObjectLock public function __construct( #[ORM\ManyToOne(targetEntity: StoredObject::class, inversedBy: 'locks')] private StoredObject $storedObject, - #[ORM\Column(type: 'string', length: 10, nullable: false, enumType: StoredObjectLockMethodEnum::class)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 10, nullable: false, enumType: StoredObjectLockMethodEnum::class)] private StoredObjectLockMethodEnum $method, - #[ORM\Column(type: 'datetimetz_immutable', nullable: false)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIMETZ_IMMUTABLE, nullable: false)] private \DateTimeImmutable $createdAt, - #[ORM\Column(type: 'text', nullable: false, options: ['default' => ''])] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])] private string $token = '', - #[ORM\Column(type: 'datetimetz_immutable', nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIMETZ_IMMUTABLE, nullable: true)] private ?\DateTimeImmutable $expireAt = null, array $users = [], ) { diff --git a/src/Bundle/ChillDocStoreBundle/Tests/Dav/Utils/LockTimeoutAnalyzerTest.php b/src/Bundle/ChillDocStoreBundle/Tests/Dav/Utils/LockTimeoutAnalyzerTest.php index 9d4e049f9..2c3c05aa6 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/Dav/Utils/LockTimeoutAnalyzerTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/Dav/Utils/LockTimeoutAnalyzerTest.php @@ -32,7 +32,7 @@ class LockTimeoutAnalyzerTest extends TestCase self::assertEquals($expected, $result); } - public function provideTimeoutData(): iterable + public static function provideTimeoutData(): iterable { yield 'Second-1800' => [ 'Second-1800', diff --git a/src/Bundle/ChillDocStoreBundle/Tests/Dav/Utils/LockTokenParserTest.php b/src/Bundle/ChillDocStoreBundle/Tests/Dav/Utils/LockTokenParserTest.php index 33c2cd828..2f4c7b460 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/Dav/Utils/LockTokenParserTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/Dav/Utils/LockTokenParserTest.php @@ -40,7 +40,7 @@ class LockTokenParserTest extends TestCase $this->assertSame($expectedToken, $this->parser->parseIfCondition($request)); } - public function provideIfConditions(): array + public static function provideIfConditions(): array { return [ 'standard lock token' => [ diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentLockManager.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentLockManager.php index 589c23065..bd25da49c 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentLockManager.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentLockManager.php @@ -22,7 +22,7 @@ use Symfony\Component\Clock\ClockInterface; use Symfony\Component\Security\Core\Security; use Webmozart\Assert\Assert; -final class ChillDocumentLockManager implements DocumentLockManagerInterface +final readonly class ChillDocumentLockManager implements DocumentLockManagerInterface { private const LOCK_DURATION = 60 * 30; @@ -32,10 +32,10 @@ final class ChillDocumentLockManager implements DocumentLockManagerInterface private const LOCK_GRACEFUL_DURATION_TIME = 3; public function __construct( - private readonly Security $security, - private readonly ClockInterface $clock, - private readonly StoredObjectLockManager $storedObjectLockManager, - private readonly int $ttlAfterDeleteSeconds = self::LOCK_GRACEFUL_DURATION_TIME, + private Security $security, + private ClockInterface $clock, + private StoredObjectLockManager $storedObjectLockManager, + private int $ttlAfterDeleteSeconds = self::LOCK_GRACEFUL_DURATION_TIME, ) {} public function deleteLock(Document $document, RequestInterface $request): bool