@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | * @param int $maxAge The maximum age of the cached value (in seconds). |
30 | 30 | * @return self Indication that a value is possibly outdated by up to this many seconds. |
31 | 31 | */ |
32 | - public static function ofMaximumAgeInSeconds( $maxAge ) { |
|
33 | - Assert::parameterType( 'integer', $maxAge, '$maxAge' ); |
|
34 | - Assert::parameter( $maxAge > 0, '$maxAge', '$maxage > 0' ); |
|
32 | + public static function ofMaximumAgeInSeconds($maxAge) { |
|
33 | + Assert::parameterType('integer', $maxAge, '$maxAge'); |
|
34 | + Assert::parameter($maxAge > 0, '$maxAge', '$maxage > 0'); |
|
35 | 35 | $ret = new self; |
36 | 36 | $ret->maxAge = $maxAge; |
37 | 37 | return $ret; |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | * @param array|null $array As returned by toArray. |
43 | 43 | * @return self |
44 | 44 | */ |
45 | - public static function ofArray( array $array = null ) { |
|
45 | + public static function ofArray(array $array = null) { |
|
46 | 46 | $ret = new self; |
47 | - if ( $array !== null ) { |
|
47 | + if ($array !== null) { |
|
48 | 48 | $ret->maxAge = $array['maximumAgeInSeconds']; |
49 | 49 | } |
50 | 50 | return $ret; |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | * @param self[] $metadatas |
55 | 55 | * @return self |
56 | 56 | */ |
57 | - public static function merge( array $metadatas ) { |
|
58 | - Assert::parameterElementType( self::class, $metadatas, '$metadatas' ); |
|
57 | + public static function merge(array $metadatas) { |
|
58 | + Assert::parameterElementType(self::class, $metadatas, '$metadatas'); |
|
59 | 59 | $ret = new self; |
60 | - foreach ( $metadatas as $metadata ) { |
|
61 | - $ret->maxAge = max( $ret->maxAge, $metadata->maxAge ); |
|
60 | + foreach ($metadatas as $metadata) { |
|
61 | + $ret->maxAge = max($ret->maxAge, $metadata->maxAge); |
|
62 | 62 | } |
63 | 63 | return $ret; |
64 | 64 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * For a fresh value, returns 0. |
77 | 77 | */ |
78 | 78 | public function getMaximumAgeInSeconds() { |
79 | - if ( is_int( $this->maxAge ) ) { |
|
79 | + if (is_int($this->maxAge)) { |
|
80 | 80 | return $this->maxAge; |
81 | 81 | } else { |
82 | 82 | return 0; |
@@ -91,8 +91,7 @@ discard block |
||
91 | 91 | return $this->isCached() ? |
92 | 92 | [ |
93 | 93 | 'maximumAgeInSeconds' => $this->maxAge, |
94 | - ] : |
|
95 | - null; |
|
94 | + ] : null; |
|
96 | 95 | } |
97 | 96 | |
98 | 97 | } |