Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Ruleset.php

function Ruleset::shouldProcessElement

Determine if an element should be processed or ignored.

Parameters

\SimpleXMLElement $element An object from a ruleset XML file.:

Return value

bool

2 calls to Ruleset::shouldProcessElement()
Ruleset::processRule in vendor/squizlabs/php_codesniffer/src/Ruleset.php
Processes a rule from a ruleset XML file, overriding built-in defaults.
Ruleset::processRuleset in vendor/squizlabs/php_codesniffer/src/Ruleset.php
Processes a single ruleset and returns a list of the sniffs it represents.

File

vendor/squizlabs/php_codesniffer/src/Ruleset.php, line 1281

Class

Ruleset

Namespace

PHP_CodeSniffer

Code

private function shouldProcessElement($element) {
    if (isset($element['phpcbf-only']) === false && isset($element['phpcs-only']) === false) {
        // No exceptions are being made.
        return true;
    }
    if (PHP_CODESNIFFER_CBF === true && isset($element['phpcbf-only']) === true && (string) $element['phpcbf-only'] === 'true') {
        return true;
    }
    if (PHP_CODESNIFFER_CBF === false && isset($element['phpcs-only']) === true && (string) $element['phpcs-only'] === 'true') {
        return true;
    }
    return false;
}
RSS feed
Powered by Drupal