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

Breadcrumb

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

class ReferencedName

@internal

Hierarchy

  • class \SlevomatCodingStandard\Helpers\ReferencedName

Expanded class hierarchy of ReferencedName

6 files declare their use of ReferencedName
AbstractFullyQualifiedGlobalReference.php in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AbstractFullyQualifiedGlobalReference.php
FullyQualifiedClassNameInAnnotationSniff.php in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedClassNameInAnnotationSniff.php
FullyQualifiedGlobalConstantsSniff.php in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedGlobalConstantsSniff.php
FullyQualifiedGlobalFunctionsSniff.php in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/FullyQualifiedGlobalFunctionsSniff.php
ReferenceUsedNamesOnlySniff.php in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/ReferenceUsedNamesOnlySniff.php

... See full list

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ReferencedName.php, line 8

Namespace

SlevomatCodingStandard\Helpers
View source
class ReferencedName {
    public const TYPE_CLASS = 'class';
    public const TYPE_FUNCTION = 'function';
    public const TYPE_CONSTANT = 'constant';
    
    /** @var string */
    private $nameAsReferencedInFile;
    
    /** @var int */
    private $startPointer;
    
    /** @var int */
    private $endPointer;
    
    /** @var string */
    private $type;
    public function __construct(string $nameAsReferencedInFile, int $startPointer, int $endPointer, string $type) {
        $this->nameAsReferencedInFile = $nameAsReferencedInFile;
        $this->startPointer = $startPointer;
        $this->endPointer = $endPointer;
        $this->type = $type;
    }
    public function getNameAsReferencedInFile() : string {
        return $this->nameAsReferencedInFile;
    }
    public function getStartPointer() : int {
        return $this->startPointer;
    }
    public function getType() : string {
        return $this->type;
    }
    public function getEndPointer() : int {
        return $this->endPointer;
    }
    public function isClass() : bool {
        return $this->type === self::TYPE_CLASS;
    }
    public function isConstant() : bool {
        return $this->type === self::TYPE_CONSTANT;
    }
    public function isFunction() : bool {
        return $this->type === self::TYPE_FUNCTION;
    }
    public function hasSameUseStatementType(UseStatement $useStatement) : bool {
        return $this->getType() === $useStatement->getType();
    }

}

Members

Title Sort descending Modifiers Object type Summary
ReferencedName::$endPointer private property @var int
ReferencedName::$nameAsReferencedInFile private property @var string
ReferencedName::$startPointer private property @var int
ReferencedName::$type private property @var string
ReferencedName::getEndPointer public function
ReferencedName::getNameAsReferencedInFile public function
ReferencedName::getStartPointer public function
ReferencedName::getType public function
ReferencedName::hasSameUseStatementType public function
ReferencedName::isClass public function
ReferencedName::isConstant public function
ReferencedName::isFunction public function
ReferencedName::TYPE_CLASS public constant
ReferencedName::TYPE_CONSTANT public constant
ReferencedName::TYPE_FUNCTION public constant
ReferencedName::__construct public function

API Navigation

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