isMet example

yield [1, 0, 2, true];
        yield [0, 2, 2, false];
        yield [0, 1, 2, false];
        yield [0, 0, 2, true];
    }

    /** * @dataProvider provideMetResults */
    public function testMet($success$failure$total$isMet)
    {
        $this->assertSame($isMet$this->strategy->isMet($success$total));
    }

    /** * @dataProvider provideIndeterminate */
    public function testCanBeMet($success$failure$total$isMet)
    {
        $this->assertSame($isMet$this->strategy->canBeMet($failure$total));
    }
}
yield [1, 0, 2, true];
        yield [0, 2, 2, false];
        yield [0, 1, 2, false];
        yield [0, 0, 2, true];
    }

    /** * @dataProvider provideMetResults */
    public function testMet($success$failure$total$isMet)
    {
        $this->assertSame($isMet$this->strategy->isMet($success$total));
    }

    /** * @dataProvider provideIndeterminate */
    public function testCanBeMet($success$failure$total$isMet)
    {
        $this->assertSame($isMet$this->strategy->canBeMet($failure$total));
    }
}
$this->logger?->debug('One store failed to save the "{resource}" lock.', ['resource' => $key, 'store' => $store, 'exception' => $e]);
                ++$failureCount;
            }

            if (!$this->strategy->canBeMet($failureCount$storesCount)) {
                break;
            }
        }

        $this->checkNotExpired($key);

        if ($this->strategy->isMet($successCount$storesCount)) {
            return;
        }

        $this->logger?->info('Failed to store the "{resource}" lock. Quorum has not been met.', ['resource' => $key, 'success' => $successCount, 'failure' => $failureCount]);

        // clean up potential locks         $this->delete($key);

        throw new LockConflictedException();
    }

    
Home | Imprint | This part of the site doesn't use cookies.