NAME
Module::Checkstyle::Util - Convenient functions for checks
SUBROUTINES
- format_expected_err ($expected, $got)
-
Return the string "Expected '$expected' but got '$got'" but with
$expectedand$gotreduced to the reftype if they are references. - new_problem ($config, $directive, $message, $line, $file)
-
Creates a new
Module::Checkstyle::Problemobject.$configmust be aModule::Checkstyle::Configobject which will be used togther will the caller and$directiveto determine severity.$linecan be either aPPI::Elementobject, an array reference or a scalar. If it is an array reference the 0-elementwill be used as line. - new_problem ($severity, $message, $line, $file)
-
Creates a new
Module::Checkstyle::Problemobject with the given severity, message, line and file. - as_true ($value)
-
Returns 1 if
$valueis either "y", "yes", "true" or "1" not regarding case. All other value returns 0. - as_numeric ($value)
-
Returns the numeric value given in
$valueif it is integer-numeric with an optional minus-sign. All other values returns 0. - as_regexp ($value)
-
Returns a regular expression object that will match what's given in
$value. If it creation of the regexp-object was unsuccessfull it will return undefined. - is_valid_position ($value)
-
Returns a true value if the string
$valueequals a valid position property. These are same and alone. - is_valid_align ($value)
-
Returns a true value if the string
$valueequals a valid alignment property. These are left, middle and right.