Skip to content

General

AbstractAnalysis

Audit gathered data.

Class: Drutiny\Audit\AbstractAnalysis
Extends: Drutiny\Audit
Package: drutiny/drutiny

NOTE: This Audit is abstract and cannot be used directly by a policy.

Parameters

Name Type Description Default
expression string The expression language to evaludate. See https://symfony.com/doc/current/components/expression_language/syntax.html 'true'
not_applicable string The expression language to evaludate if the analysis is not applicable. See https://symfony.com/doc/current/components/expression_language/syntax.html 'false'

Tokens

Name Type Description Default
expression string The expression language to evaludate. See https://symfony.com/doc/current/components/expression_language/syntax.html 'true'
not_applicable string The expression language to evaludate if the analysis is not applicable. See https://symfony.com/doc/current/components/expression_language/syntax.html 'false'
Source
  final public function audit(Sandbox $sandbox)
  {
    $this->gather($sandbox);

    $expressionLanguage = new ExpressionLanguage($sandbox);

    $variables  = $sandbox->getParameterTokens();
    $sandbox->logger()->debug(__CLASS__ . ': ' . Yaml::dump($variables));

    $expression = $sandbox->getParameter('not_applicable', 'false');
    $sandbox->logger()->debug(__CLASS__ . ': ' . $expression);
    if (@$expressionLanguage->evaluate($expression, $variables)) {
      return self::NOT_APPLICABLE;
    }

    $expression = $sandbox->getParameter('expression', 'true');
    $sandbox->logger()->info(__CLASS__ . ': ' . $expression);
    return @$expressionLanguage->evaluate($expression, $variables);
  }

AbstractComparison

Comparatively evaluate two values.

Class: Drutiny\Audit\AbstractComparison
Extends: Drutiny\Audit
Package: drutiny/drutiny

NOTE: This Audit is abstract and cannot be used directly by a policy.

AlwaysError

An audit that always fails.

Class: Drutiny\Audit\AlwaysError
Extends: Drutiny\Audit
Package: drutiny/drutiny

Policies

These are the policies that use this class:

Name Title
Test:Error Always error test policy
Source
  public function audit(Sandbox $sandbox)
  {
    throw new \Exception("This audit will always throw an exception as an error.");
  }

AlwaysFail

An audit that always succeeds.

Class: Drutiny\Audit\AlwaysFail
Extends: Drutiny\Audit
Package: drutiny/drutiny

Policies

These are the policies that use this class:

Name Title
Test:Irrelevant Irrelevant test policy
Test:Fail Always fail test policy
Source
  public function audit(Sandbox $sandbox)
  {
    return FALSE;
  }

AlwaysNA

An audit that always not applicable.

Class: Drutiny\Audit\AlwaysNA
Extends: Drutiny\Audit
Package: drutiny/drutiny

Policies

These are the policies that use this class:

Name Title
Test:NA Not applicable test policy
Source
  public function audit(Sandbox $sandbox)
  {
    // This should never trigger.
    return Audit::FAIL;
  }

AlwaysNotice

An audit that always succeeds.

Class: Drutiny\Audit\AlwaysNotice
Extends: Drutiny\Audit
Package: drutiny/drutiny

Policies

These are the policies that use this class:

Name Title
Test:Notice Always notice test policy
Source
  public function audit(Sandbox $sandbox)
  {
    return Audit::NOTICE;
  }

AlwaysPass

An audit that always succeeds.

Class: Drutiny\Audit\AlwaysPass
Extends: Drutiny\Audit
Package: drutiny/drutiny

Policies

These are the policies that use this class:

Name Title
Test:Pass Always pass test policy
Test:PassDependant Always pass dependant test policy
Source
  public function audit(Sandbox $sandbox)
  {
    return TRUE;
  }

AlwaysWarn

An audit that always succeeds.

Class: Drutiny\Audit\AlwaysWarn
Extends: Drutiny\Audit
Package: drutiny/drutiny

Policies

These are the policies that use this class:

Name Title
Test:Warning Always warn test policy
Source
  public function audit(Sandbox $sandbox)
  {
    return Audit::WARNING;
  }