@@ -154,20 +154,15 @@ private function __construct(array $thresholds = [], $regex = '', $verboseOutput
154
154
$ this ->logFile = $ logFile ;
155
155
}
156
156
157
- /**
158
- * @return bool
159
- */
160
- public function isEnabled ()
157
+ public function isEnabled (): bool
161
158
{
162
159
return $ this ->enabled ;
163
160
}
164
161
165
162
/**
166
163
* @param DeprecationGroup[] $deprecationGroups
167
- *
168
- * @return bool
169
164
*/
170
- public function tolerates (array $ deprecationGroups )
165
+ public function tolerates (array $ deprecationGroups ): bool
171
166
{
172
167
$ grandTotal = 0 ;
173
168
@@ -229,10 +224,7 @@ public function toleratesForGroup(string $groupName, array $deprecationGroups):
229
224
return true ;
230
225
}
231
226
232
- /**
233
- * @return bool
234
- */
235
- public function isBaselineDeprecation (Deprecation $ deprecation )
227
+ public function isBaselineDeprecation (Deprecation $ deprecation ): bool
236
228
{
237
229
if ($ deprecation ->isLegacy ()) {
238
230
return false ;
@@ -260,20 +252,17 @@ public function isBaselineDeprecation(Deprecation $deprecation)
260
252
return $ result ;
261
253
}
262
254
263
- /**
264
- * @return bool
265
- */
266
- public function isGeneratingBaseline ()
255
+ public function isGeneratingBaseline (): bool
267
256
{
268
257
return $ this ->generateBaseline ;
269
258
}
270
259
271
- public function getBaselineFile ()
260
+ public function getBaselineFile (): string
272
261
{
273
262
return $ this ->baselineFile ;
274
263
}
275
264
276
- public function writeBaseline ()
265
+ public function writeBaseline (): void
277
266
{
278
267
$ map = [];
279
268
foreach ($ this ->baselineDeprecations as $ location => $ messages ) {
@@ -290,47 +279,37 @@ public function writeBaseline()
290
279
291
280
/**
292
281
* @param string $message
293
- *
294
- * @return bool
295
282
*/
296
- public function shouldDisplayStackTrace ($ message )
283
+ public function shouldDisplayStackTrace ($ message ): bool
297
284
{
298
285
return '' !== $ this ->regex && preg_match ($ this ->regex , $ message );
299
286
}
300
287
301
- /**
302
- * @return bool
303
- */
304
- public function isInRegexMode ()
288
+ public function isInRegexMode (): bool
305
289
{
306
290
return '' !== $ this ->regex ;
307
291
}
308
292
309
- /**
310
- * @return bool
311
- */
312
- public function verboseOutput ($ group )
293
+ public function verboseOutput ($ group ): bool
313
294
{
314
295
return $ this ->verboseOutput [$ group ];
315
296
}
316
297
317
- public function shouldWriteToLogFile ()
298
+ public function shouldWriteToLogFile (): bool
318
299
{
319
300
return null !== $ this ->logFile ;
320
301
}
321
302
322
- public function getLogFile ()
303
+ public function getLogFile (): ? string
323
304
{
324
305
return $ this ->logFile ;
325
306
}
326
307
327
308
/**
328
309
* @param string $serializedConfiguration an encoded string, for instance
329
310
* max[total]=1234&max[indirect]=42
330
- *
331
- * @return self
332
311
*/
333
- public static function fromUrlEncodedString ($ serializedConfiguration )
312
+ public static function fromUrlEncodedString ($ serializedConfiguration ): self
334
313
{
335
314
parse_str ($ serializedConfiguration , $ normalizedConfiguration );
336
315
foreach (array_keys ($ normalizedConfiguration ) as $ key ) {
@@ -376,29 +355,20 @@ public static function fromUrlEncodedString($serializedConfiguration)
376
355
);
377
356
}
378
357
379
- /**
380
- * @return self
381
- */
382
- public static function inDisabledMode ()
358
+ public static function inDisabledMode (): self
383
359
{
384
360
$ configuration = new self ();
385
361
$ configuration ->enabled = false ;
386
362
387
363
return $ configuration ;
388
364
}
389
365
390
- /**
391
- * @return self
392
- */
393
- public static function inStrictMode ()
366
+ public static function inStrictMode (): self
394
367
{
395
368
return new self (['total ' => 0 ]);
396
369
}
397
370
398
- /**
399
- * @return self
400
- */
401
- public static function inWeakMode ()
371
+ public static function inWeakMode (): self
402
372
{
403
373
$ verboseOutput = [];
404
374
foreach (['unsilenced ' , 'direct ' , 'indirect ' , 'self ' , 'other ' ] as $ group ) {
@@ -408,18 +378,12 @@ public static function inWeakMode()
408
378
return new self ([], '' , $ verboseOutput );
409
379
}
410
380
411
- /**
412
- * @return self
413
- */
414
- public static function fromNumber ($ upperBound )
381
+ public static function fromNumber ($ upperBound ): self
415
382
{
416
383
return new self (['total ' => $ upperBound ]);
417
384
}
418
385
419
- /**
420
- * @return self
421
- */
422
- public static function fromRegex ($ regex )
386
+ public static function fromRegex ($ regex ): self
423
387
{
424
388
return new self ([], $ regex );
425
389
}
0 commit comments