@@ -154,20 +154,15 @@ private function __construct(array $thresholds = [], $regex = '', $verboseOutput
154154 $ this ->logFile = $ logFile ;
155155 }
156156
157- /**
158- * @return bool
159- */
160- public function isEnabled ()
157+ public function isEnabled (): bool
161158 {
162159 return $ this ->enabled ;
163160 }
164161
165162 /**
166163 * @param DeprecationGroup[] $deprecationGroups
167- *
168- * @return bool
169164 */
170- public function tolerates (array $ deprecationGroups )
165+ public function tolerates (array $ deprecationGroups ): bool
171166 {
172167 $ grandTotal = 0 ;
173168
@@ -229,10 +224,7 @@ public function toleratesForGroup(string $groupName, array $deprecationGroups):
229224 return true ;
230225 }
231226
232- /**
233- * @return bool
234- */
235- public function isBaselineDeprecation (Deprecation $ deprecation )
227+ public function isBaselineDeprecation (Deprecation $ deprecation ): bool
236228 {
237229 if ($ deprecation ->isLegacy ()) {
238230 return false ;
@@ -260,20 +252,17 @@ public function isBaselineDeprecation(Deprecation $deprecation)
260252 return $ result ;
261253 }
262254
263- /**
264- * @return bool
265- */
266- public function isGeneratingBaseline ()
255+ public function isGeneratingBaseline (): bool
267256 {
268257 return $ this ->generateBaseline ;
269258 }
270259
271- public function getBaselineFile ()
260+ public function getBaselineFile (): string
272261 {
273262 return $ this ->baselineFile ;
274263 }
275264
276- public function writeBaseline ()
265+ public function writeBaseline (): void
277266 {
278267 $ map = [];
279268 foreach ($ this ->baselineDeprecations as $ location => $ messages ) {
@@ -290,47 +279,37 @@ public function writeBaseline()
290279
291280 /**
292281 * @param string $message
293- *
294- * @return bool
295282 */
296- public function shouldDisplayStackTrace ($ message )
283+ public function shouldDisplayStackTrace ($ message ): bool
297284 {
298285 return '' !== $ this ->regex && preg_match ($ this ->regex , $ message );
299286 }
300287
301- /**
302- * @return bool
303- */
304- public function isInRegexMode ()
288+ public function isInRegexMode (): bool
305289 {
306290 return '' !== $ this ->regex ;
307291 }
308292
309- /**
310- * @return bool
311- */
312- public function verboseOutput ($ group )
293+ public function verboseOutput ($ group ): bool
313294 {
314295 return $ this ->verboseOutput [$ group ];
315296 }
316297
317- public function shouldWriteToLogFile ()
298+ public function shouldWriteToLogFile (): bool
318299 {
319300 return null !== $ this ->logFile ;
320301 }
321302
322- public function getLogFile ()
303+ public function getLogFile (): ? string
323304 {
324305 return $ this ->logFile ;
325306 }
326307
327308 /**
328309 * @param string $serializedConfiguration an encoded string, for instance
329310 * max[total]=1234&max[indirect]=42
330- *
331- * @return self
332311 */
333- public static function fromUrlEncodedString ($ serializedConfiguration )
312+ public static function fromUrlEncodedString ($ serializedConfiguration ): self
334313 {
335314 parse_str ($ serializedConfiguration , $ normalizedConfiguration );
336315 foreach (array_keys ($ normalizedConfiguration ) as $ key ) {
@@ -376,29 +355,20 @@ public static function fromUrlEncodedString($serializedConfiguration)
376355 );
377356 }
378357
379- /**
380- * @return self
381- */
382- public static function inDisabledMode ()
358+ public static function inDisabledMode (): self
383359 {
384360 $ configuration = new self ();
385361 $ configuration ->enabled = false ;
386362
387363 return $ configuration ;
388364 }
389365
390- /**
391- * @return self
392- */
393- public static function inStrictMode ()
366+ public static function inStrictMode (): self
394367 {
395368 return new self (['total ' => 0 ]);
396369 }
397370
398- /**
399- * @return self
400- */
401- public static function inWeakMode ()
371+ public static function inWeakMode (): self
402372 {
403373 $ verboseOutput = [];
404374 foreach (['unsilenced ' , 'direct ' , 'indirect ' , 'self ' , 'other ' ] as $ group ) {
@@ -408,18 +378,12 @@ public static function inWeakMode()
408378 return new self ([], '' , $ verboseOutput );
409379 }
410380
411- /**
412- * @return self
413- */
414- public static function fromNumber ($ upperBound )
381+ public static function fromNumber ($ upperBound ): self
415382 {
416383 return new self (['total ' => $ upperBound ]);
417384 }
418385
419- /**
420- * @return self
421- */
422- public static function fromRegex ($ regex )
386+ public static function fromRegex ($ regex ): self
423387 {
424388 return new self ([], $ regex );
425389 }
0 commit comments