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

Breadcrumb

  1. Drupal Core 11.1.x

Annotation.php

Same filename in this branch
  1. 11.1.x vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php
  2. 11.1.x vendor/google/protobuf/src/Google/Protobuf/Internal/GeneratedCodeInfo/Annotation.php

Namespace

SlevomatCodingStandard\Helpers

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation.php

View source
<?php

declare (strict_types=1);
namespace SlevomatCodingStandard\Helpers;

use PHPStan\PhpDocParser\Ast\PhpDoc\InvalidTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode;

/**
 * @internal
 * @template T of PhpDocTagValueNode
 */
class Annotation {
    
    /** @var PhpDocTagNode */
    private $node;
    
    /** @var int */
    private $startPointer;
    
    /** @var int */
    private $endPointer;
    public function __construct(PhpDocTagNode $node, int $startPointer, int $endPointer) {
        $this->node = $node;
        $this->startPointer = $startPointer;
        $this->endPointer = $endPointer;
    }
    public function getNode() : PhpDocTagNode {
        return $this->node;
    }
    public function getName() : string {
        return $this->node->name;
    }
    
    /**
     * @return T
     */
    public function getValue() : PhpDocTagValueNode {
        
        /** @phpstan-ignore-next-line */
        return $this->node->value;
    }
    public function getStartPointer() : int {
        return $this->startPointer;
    }
    public function getEndPointer() : int {
        return $this->endPointer;
    }
    public function isInvalid() : bool {
        return $this->node->value instanceof InvalidTagValueNode;
    }

}

Classes

Title Deprecated Summary
Annotation @internal @template T of PhpDocTagValueNode

API Navigation

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