mediatekformation

DeprecationErrorHandler
in package

Catch deprecation notices and print a summary report at the end of the test suite.

Tags
author

Nicolas Grekas p@tchwork.com

Table of Contents

MODE_DISABLED  = 'disabled'
MODE_STRICT  = 'max[total]=0'
MODE_WEAK  = 'max[total]=999999&verbose=0'
$configuration  : mixed
$deprecationGroups  : array<string|int, DeprecationGroup>
$errorHandler  : mixed
$isRegistered  : mixed
$mode  : mixed
__construct()  : mixed
collectDeprecations()  : mixed
register()  : mixed
Registers and configures the deprecation handler.
colorize()  : string
displayDeprecations()  : mixed
getConfiguration()  : mixed
getPhpUnitErrorHandler()  : mixed
hasColorSupport()  : bool
Returns true if STDOUT is defined and supports colorization.
resetDeprecationGroups()  : mixed

Constants

Properties

Methods

collectDeprecations()

public static collectDeprecations(mixed $outputFile) : mixed
Parameters
$outputFile : mixed
Return values
mixed

register()

Registers and configures the deprecation handler.

public static register(int|string|false $mode) : mixed

The mode is a query string with options:

  • "disabled" to enable/disable the deprecation handler
  • "verbose" to enable/disable displaying the deprecation report
  • "quiet" to disable displaying the deprecation report only for some groups (i.e. quiet[]=other)
  • "max" to configure the number of deprecations to allow before exiting with a non-zero status code; it's an array with keys "total", "self", "direct" and "indirect"

The default mode is "max[total]=0&verbose=1".

The mode can alternatively be "/some-regexp/" to stop the test suite whenever a deprecation message matches the given regular expression.

Parameters
$mode : int|string|false

The reporting mode, defaults to not allowing any deprecations

Return values
mixed

colorize()

private static colorize(string $str, bool $red) : string
Parameters
$str : string
$red : bool
Return values
string

displayDeprecations()

private displayDeprecations(array<string|int, string> $groups, Configuration $configuration, bool $isFailing) : mixed
Parameters
$groups : array<string|int, string>
$configuration : Configuration
$isFailing : bool
Tags
throws
InvalidArgumentException
Return values
mixed

hasColorSupport()

Returns true if STDOUT is defined and supports colorization.

private static hasColorSupport() : bool

Reference: Composer\XdebugHandler\Process::supportsColor https://github.com/composer/xdebug-handler

Return values
bool

Search results