mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-04-16 10:59:31 +00:00
Rector fixes
This commit is contained in:
@@ -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 = [],
|
||||
) {
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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' => [
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user