EvaluationLogger
in package
Class EvaluationLogger
Table of Contents
- $logger : WC_Logger_Interface|null
- Logger class to use.
- $results : array<string|int, mixed>
- Results of rules in the given spec.
- $slug : string
- Slug of the spec.
- $source : string
- Logger source.
- __construct() : mixed
- EvaluationLogger constructor.
- add_result() : mixed
- Add evaluation result of a rule.
- log() : mixed
- Log the results.
Properties
$logger
Logger class to use.
private
WC_Logger_Interface|null
$logger
$results
Results of rules in the given spec.
private
array<string|int, mixed>
$results
= array()
$slug
Slug of the spec.
private
string
$slug
$source
Logger source.
private
string
$source
= ''
Methods
__construct()
EvaluationLogger constructor.
public
__construct(string $slug[, null $source = null ][, WC_Logger_Interface $logger = null ]) : mixed
Parameters
- $slug : string
-
Slug of a spec that is being evaluated.
- $source : null = null
-
Logger source.
- $logger : WC_Logger_Interface = null
-
Logger class to use.
Return values
mixed —add_result()
Add evaluation result of a rule.
public
add_result(string $rule_type, bool $result) : mixed
Parameters
- $rule_type : string
-
name of the rule being tested.
- $result : bool
-
result of a given rule.
Return values
mixed —log()
Log the results.
public
log() : mixed