Documentation

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

Constants

MODE_DISABLED  = 'disabled'
MODE_STRICT  = 'max[total]=0'
MODE_WEAK  = 'max[total]=999999&verbose=0'

Properties

$configuration  : mixed
$deprecationGroups  : array<string|int, DeprecationGroup>
$errorHandler  : mixed
$isRegistered  : mixed
$mode  : mixed

Methods

__construct()  : mixed
collectDeprecations()  : mixed
register()  : mixed
Registers and configures the deprecation handler.
colorize()  : string
displayDeprecations()  : mixed
getConfiguration()  : mixed
getPhpUnitErrorHandler()  : callable
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

register()

Registers and configures the deprecation handler.

public static register([int|string|false $mode = 0 ]) : 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 = 0

The reporting mode, defaults to not allowing any deprecations

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) : mixed
Parameters
$groups : array<string|int, string>
$configuration : Configuration
Tags
throws
InvalidArgumentException

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

        
On this page

Search results