NAME
Module::Checkstyle::Util - Convenient functions for checks
SUBROUTINES
- format_expected_err ($expected, $got)
-
Return the string "Expected '$expected' but got '$got'" but with
$expected
and$got
reduced to the reftype if they are references. - new_problem ($config, $directive, $message, $line, $file)
-
Creates a new
Module::Checkstyle::Problem
object.$config
must be aModule::Checkstyle::Config
object which will be used togther will the caller and$directive
to determine severity.$line
can be either aPPI::Element
object, 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::Problem
object with the given severity, message, line and file. - as_true ($value)
-
Returns 1 if
$value
is either "y", "yes", "true" or "1" not regarding case. All other value returns 0. - as_numeric ($value)
-
Returns the numeric value given in
$value
if 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
$value
equals a valid position property. These are same and alone. - is_valid_align ($value)
-
Returns a true value if the string
$value
equals a valid alignment property. These are left, middle and right.