Skip to content

Commit 621867c

Browse files
committed
Update freshness TTL type to int
Signed-off-by: Shyamsundar Gadde <[email protected]>
1 parent f2c85f0 commit 621867c

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

plugins/optimization-detective/class-od-url-metric-group-collection.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ final class OD_URL_Metric_Group_Collection implements Countable, IteratorAggrega
7373
* A freshness age of zero means a URL Metric will always be considered stale.
7474
*
7575
* @since 0.1.0
76-
* @var int<-1, max>
76+
* @var int
7777
*/
7878
private $freshness_ttl;
7979

@@ -104,7 +104,7 @@ final class OD_URL_Metric_Group_Collection implements Countable, IteratorAggrega
104104
*
105105
* @phpstan-param positive-int[] $breakpoints
106106
* @phpstan-param int<1, max> $sample_size
107-
* @phpstan-param int<-1, max> $freshness_ttl
107+
* @phpstan-param int $freshness_ttl
108108
*
109109
* @param OD_URL_Metric[] $url_metrics URL Metrics.
110110
* @param non-empty-string $current_etag The current ETag.
@@ -215,7 +215,7 @@ public function get_sample_size(): int {
215215
*
216216
* @since 1.0.0
217217
*
218-
* @return int<-1, max> Freshness age (TTL) for a given URL Metric.
218+
* @return int Freshness age (TTL) for a given URL Metric.
219219
*/
220220
public function get_freshness_ttl(): int {
221221
return $this->freshness_ttl;
@@ -691,7 +691,7 @@ public function count(): int {
691691
* @return array{
692692
* current_etag: non-empty-string,
693693
* breakpoints: positive-int[],
694-
* freshness_ttl: int<-1, max>,
694+
* freshness_ttl: int,
695695
* sample_size: positive-int,
696696
* all_element_max_intersection_ratios: array<string, float>,
697697
* common_lcp_element: ?OD_Element,

plugins/optimization-detective/class-od-url-metric-group.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ final class OD_URL_Metric_Group implements IteratorAggregate, Countable, JsonSer
6262
*
6363
* @since 0.1.0
6464
*
65-
* @var int<-1, max>
65+
* @var int
6666
*/
6767
private $freshness_ttl;
6868

@@ -102,7 +102,7 @@ final class OD_URL_Metric_Group implements IteratorAggregate, Countable, JsonSer
102102
* @phpstan-param int<0, max> $minimum_viewport_width
103103
* @phpstan-param int<1, max>|null $maximum_viewport_width
104104
* @phpstan-param int<1, max> $sample_size
105-
* @phpstan-param int<-1, max> $freshness_ttl
105+
* @phpstan-param int $freshness_ttl
106106
*
107107
* @param OD_URL_Metric[] $url_metrics URL Metrics to add to the group.
108108
* @param int $minimum_viewport_width Minimum possible viewport width (exclusive) for the group. Must be zero or greater.
@@ -192,7 +192,7 @@ public function get_sample_size(): int {
192192
* @since 0.9.0
193193
*
194194
* @todo Eliminate in favor of readonly public property.
195-
* @return int<-1, max> Freshness age.
195+
* @return int Freshness age.
196196
*/
197197
public function get_freshness_ttl(): int {
198198
return $this->freshness_ttl;
@@ -503,7 +503,7 @@ public function clear_cache(): void {
503503
* @since 0.3.1
504504
*
505505
* @return array{
506-
* freshness_ttl: int<-1, max>,
506+
* freshness_ttl: int,
507507
* sample_size: positive-int,
508508
* minimum_viewport_width: int<0, max>,
509509
* maximum_viewport_width: int<1, max>|null,

plugins/optimization-detective/storage/data.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* @since 0.1.0
2121
* @access private
2222
*
23-
* @return int<-1, max> Expiration TTL in seconds.
23+
* @return int Expiration TTL in seconds.
2424
*/
2525
function od_get_url_metric_freshness_ttl(): int {
2626
/**
@@ -31,7 +31,7 @@ function od_get_url_metric_freshness_ttl(): int {
3131
*
3232
* @since 0.1.0
3333
*
34-
* @param int<-1, max> $ttl Expiration TTL in seconds. Defaults to 1 week.
34+
* @param int $ttl Expiration TTL in seconds. Defaults to 1 week.
3535
*/
3636
return (int) apply_filters( 'od_url_metric_freshness_ttl', WEEK_IN_SECONDS );
3737
}

0 commit comments

Comments
 (0)