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

Breadcrumb

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

function ReferenceUsedNamesOnlySniff::isRequiredToBeUsed

1 call to ReferenceUsedNamesOnlySniff::isRequiredToBeUsed()
ReferenceUsedNamesOnlySniff::process in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/ReferenceUsedNamesOnlySniff.php
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/ReferenceUsedNamesOnlySniff.php, line 650

Class

ReferenceUsedNamesOnlySniff

Namespace

SlevomatCodingStandard\Sniffs\Namespaces

Code

private function isRequiredToBeUsed(string $name) : bool {
    if ($this->namespacesRequiredToUse === null || $this->namespacesRequiredToUse === []) {
        return true;
    }
    foreach ($this->getNamespacesRequiredToUse() as $namespace) {
        if (!NamespaceHelper::isTypeInNamespace($name, $namespace)) {
            continue;
        }
        return true;
    }
    return false;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal