File tree Expand file tree Collapse file tree 12 files changed +42
-42
lines changed Expand file tree Collapse file tree 12 files changed +42
-42
lines changed Original file line number Diff line number Diff line change 66
77use Zlodes \PrometheusClient \Fetcher \Fetcher ;
88
9- final class FetcherExporter implements Exporter
9+ final readonly class FetcherExporter implements Exporter
1010{
1111 public function __construct (
12- private readonly Fetcher $ fetcher ,
12+ private Fetcher $ fetcher ,
1313 ) {
1414 }
1515
Original file line number Diff line number Diff line change 77use Zlodes \PrometheusClient \Metric \Metric ;
88use Zlodes \PrometheusClient \Storage \DTO \MetricValue ;
99
10- final class FetchedMetric
10+ final readonly class FetchedMetric
1111{
1212 /**
1313 * @param list<MetricValue> $values
1414 */
1515 public function __construct (
16- public readonly Metric $ metric ,
17- public readonly array $ values ,
16+ public Metric $ metric ,
17+ public array $ values ,
1818 ) {
1919 }
2020}
Original file line number Diff line number Diff line change 2222use Zlodes \PrometheusClient \Storage \DTO \SummaryMetricValue ;
2323use Zlodes \PrometheusClient \Summary \QuantileCalculator ;
2424
25- final class StoredMetricsFetcher implements Fetcher
25+ final readonly class StoredMetricsFetcher implements Fetcher
2626{
2727 public function __construct (
28- private readonly Registry $ registry ,
29- private readonly CounterStorage $ counterStorage ,
30- private readonly GaugeStorage $ gaugeStorage ,
31- private readonly HistogramStorage $ histogramStorage ,
32- private readonly SummaryStorage $ summaryStorage ,
28+ private Registry $ registry ,
29+ private CounterStorage $ counterStorage ,
30+ private GaugeStorage $ gaugeStorage ,
31+ private HistogramStorage $ histogramStorage ,
32+ private SummaryStorage $ summaryStorage ,
3333 ) {
3434 }
3535
Original file line number Diff line number Diff line change 99/**
1010 * @see https://www.php.net/manual/en/class.hrtime-stopwatch.php
1111 */
12- final class HRTimeStopWatch implements StopWatch
12+ final readonly class HRTimeStopWatch implements StopWatch
1313{
14- private readonly float $ startedAt ;
14+ private float $ startedAt ;
1515
16- public function __construct (private readonly Closure $ onStop )
16+ public function __construct (private Closure $ onStop )
1717 {
1818 $ this ->startedAt = hrtime (true );
1919 }
Original file line number Diff line number Diff line change 66
77use Zlodes \PrometheusClient \Storage \DTO \MetricNameWithLabels ;
88
9- final class IncrementCounter
9+ final readonly class IncrementCounter
1010{
1111 public function __construct (
12- public readonly MetricNameWithLabels $ metricNameWithLabels ,
13- public readonly int |float $ value = 1 ,
12+ public MetricNameWithLabels $ metricNameWithLabels ,
13+ public int |float $ value = 1 ,
1414 ) {
1515 }
1616}
Original file line number Diff line number Diff line change 66
77use Zlodes \PrometheusClient \Storage \DTO \MetricNameWithLabels ;
88
9- final class UpdateGauge
9+ final readonly class UpdateGauge
1010{
1111 public function __construct (
12- public readonly MetricNameWithLabels $ metricNameWithLabels ,
13- public readonly int |float $ value ,
12+ public MetricNameWithLabels $ metricNameWithLabels ,
13+ public int |float $ value ,
1414 ) {
1515 }
1616}
Original file line number Diff line number Diff line change 66
77use Zlodes \PrometheusClient \Storage \DTO \MetricNameWithLabels ;
88
9- final class UpdateHistogram
9+ final readonly class UpdateHistogram
1010{
1111 /**
1212 * @param non-empty-list<float> $buckets
1313 */
1414 public function __construct (
15- public readonly MetricNameWithLabels $ metricNameWithLabels ,
16- public readonly array $ buckets ,
17- public readonly int |float $ value ,
15+ public MetricNameWithLabels $ metricNameWithLabels ,
16+ public array $ buckets ,
17+ public int |float $ value ,
1818 ) {
1919 }
2020}
Original file line number Diff line number Diff line change 66
77use Zlodes \PrometheusClient \Storage \DTO \MetricNameWithLabels ;
88
9- final class UpdateSummary
9+ final readonly class UpdateSummary
1010{
1111 public function __construct (
12- public readonly MetricNameWithLabels $ metricNameWithLabels ,
13- public readonly int |float $ value ,
14- public readonly int $ maxItems = 1_000_000 ,
12+ public MetricNameWithLabels $ metricNameWithLabels ,
13+ public int |float $ value ,
14+ public int $ maxItems = 1_000_000 ,
1515 ) {
1616 }
1717}
Original file line number Diff line number Diff line change 44
55namespace Zlodes \PrometheusClient \Storage \DTO ;
66
7- final class HistogramMetricValue
7+ final readonly class HistogramMetricValue
88{
99 /**
1010 * @param non-empty-array<non-empty-string|positive-int, int|float> $buckets
1111 */
1212 public function __construct (
13- public readonly MetricNameWithLabels $ metricNameWithLabels ,
14- public readonly array $ buckets ,
15- public readonly float $ sum ,
16- public readonly int $ count ,
13+ public MetricNameWithLabels $ metricNameWithLabels ,
14+ public array $ buckets ,
15+ public float $ sum ,
16+ public int $ count ,
1717 ) {
1818 }
1919}
Original file line number Diff line number Diff line change 66
77use Webmozart \Assert \Assert ;
88
9- final class MetricNameWithLabels
9+ final readonly class MetricNameWithLabels
1010{
1111 /**
1212 * @param non-empty-string $metricName
1313 * @param array<non-empty-string, non-empty-string> $labels
1414 */
1515 public function __construct (
16- public readonly string $ metricName ,
17- public readonly array $ labels = [],
16+ public string $ metricName ,
17+ public array $ labels = [],
1818 ) {
1919 Assert::allString (array_keys ($ labels ));
2020 Assert::allStringNotEmpty ($ labels );
You can’t perform that action at this time.
0 commit comments