@@ -46,7 +46,7 @@ class CacheControl
4646 *
4747 * @param Response $response
4848 */
49- public function __construct ($ response )
49+ public function __construct (Response $ response )
5050 {
5151 $ this ->response = $ response ;
5252 }
@@ -135,11 +135,11 @@ public function getMaxAge(): ?int
135135 *
136136 * This methods sets the Cache-Control max-age directive.
137137 *
138- * @param integer $value Number of seconds
138+ * @param integer $value Number of seconds
139139 *
140140 * @return void
141141 */
142- public function setMaxAge ($ value ): void
142+ public function setMaxAge (int $ value ): void
143143 {
144144 $ this ->doSetContainer ('max-age ' , $ value );
145145 $ this ->updateCacheControlHeader ();
@@ -150,11 +150,11 @@ public function setMaxAge($value): void
150150 *
151151 * This methods sets the Cache-Control s-maxage directive.
152152 *
153- * @param integer $value Number of seconds
153+ * @param integer $value Number of seconds
154154 *
155155 * @return void
156156 */
157- public function setSharedMaxAge ($ value ): void
157+ public function setSharedMaxAge (int $ value ): void
158158 {
159159 $ this ->setPublic ();
160160 $ this ->doSetContainer ('s-maxage ' , $ value );
@@ -183,11 +183,11 @@ public function getTtl(): ?int
183183 *
184184 * This method adjusts the Cache-Control/s-maxage directive.
185185 *
186- * @param integer $seconds Number of seconds
186+ * @param integer $seconds Number of seconds
187187 *
188188 * @return void
189189 */
190- public function setTtl ($ seconds ): void
190+ public function setTtl (int $ seconds ): void
191191 {
192192 $ this ->setSharedMaxAge ($ this ->getAge () + $ seconds );
193193 }
@@ -197,11 +197,11 @@ public function setTtl($seconds): void
197197 *
198198 * This method adjusts the Cache-Control/max-age directive.
199199 *
200- * @param integer $seconds Number of seconds
200+ * @param integer $seconds Number of seconds
201201 *
202202 * @return void
203203 */
204- public function setClientTtl ($ seconds ): void
204+ public function setClientTtl (int $ seconds ): void
205205 {
206206 $ this ->setMaxAge ($ this ->getAge () + $ seconds );
207207 }
@@ -219,12 +219,12 @@ public function getEtag(): string
219219 /**
220220 * Sets the ETag value
221221 *
222- * @param string $etag The ETag unique identifier
223- * @param bool $weak Whether you want a weak ETag or not
222+ * @param string $etag The ETag unique identifier
223+ * @param bool $weak Whether you want a weak ETag or not
224224 *
225225 * @return void
226226 */
227- public function setEtag ($ etag , $ weak = false ): void
227+ public function setEtag (string $ etag , bool $ weak = false ): void
228228 {
229229 $ etag = trim ($ etag , '" ' );
230230 $ this ->response ->setHeader ('ETag ' , (true === $ weak ? 'W/ ' : '' ) . '" ' . $ etag . '" ' );
@@ -246,11 +246,11 @@ public function getAge(): int
246246 /**
247247 * Set the age of the response
248248 *
249- * @param integer $age
249+ * @param integer $age
250250 *
251251 * @return void
252252 */
253- public function setAge ($ age ): void
253+ public function setAge (int $ age ): void
254254 {
255255 $ this ->response ->setHeader ('Age ' , $ age );
256256 }
0 commit comments