Files
wp-donations/tests/Unit/FakeStateRepository.php
2026-11-15 08:44:52 -08:00

17 lines
452 B
PHP

<?php
declare( strict_types=1 );
namespace StreamGoals\Tests\Unit;
use StreamGoals\Rules\StateRepository;
final class FakeStateRepository implements StateRepository {
public array $data = array();
public function getInt( int $goalId, string $key, int $default = 0 ): int {
return $this->data[ "$goalId:$key" ] ?? $default;
}
public function setInt( int $goalId, string $key, int $value ): void {
$this->data[ "$goalId:$key" ] = $value;
}
}