for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ICanBoogie\CLDR\Supplemental\Plurals;
/**
* @internal
*/
final class SamplesCache
{
* @var array<string, Samples>
* Where _key_ is a rule statement and _value_ a {@see Samples}.
private static array $instances = [];
* @param callable():Samples $new
public static function get(string $samples, callable $new): Samples
return self::$instances[$samples] ??= $new();
}