/
githubmirror
/
symfony
Обзор
Документация
Войти
/
githubmirror
/
symfony
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
8.2
src/Symfony/Component/Lock/NoLock.php
56 строк
1015 B
Michael Babker
Make NoLock implement the SharedLockInterface
27 фев 2024, 17:19
Не верифицирован
27 фев 2024, 17:19
22600d0
Код
Авторство
О чём код?
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Lock; /** * A non locking lock. * * This can be used to disable locking in classes * requiring a lock. * * @author Wouter de Jong <wouter@wouterj.nl> */ final class NoLock implements SharedLockInterface { public function acquireRead(bool $blocking = false): bool { return true; } public function acquire(bool $blocking = false): bool { return true; } public function refresh(?float $ttl = null): void { } public function isAcquired(): bool { return true; } public function release(): void { } public function isExpired(): bool { return false; } public function getRemainingLifetime(): ?float { return null; } }