*/ private static array $measured = array(); /** * Record a door's measurement. * * @param int $order_id Order. * @param int $minor Amount, in the order's minor units. */ public static function record( int $order_id, int $minor ): void { self::$measured[ $order_id ] = max( $minor, self::$measured[ $order_id ] ?? 0 ); } /** * What a door measured for an order in this request, or null. * * @param int $order_id Order. */ public static function measured( int $order_id ): ?int { return self::$measured[ $order_id ] ?? null; } /** * Forget every measurement: a new request (tests). */ public static function reset(): void { self::$measured = array(); } }