..
Inheritance: implements Phan\Language\Element\TypedElementInterface, use trait Phan\Memoize
示例#1
0
 /**
  * @param CodeBase $code_base
  * The code base in which the function exists
  *
  * @param TypedElement $element
  * Any element such as function, method, class
  *
  * @return void
  */
 private function analyzeTypedElement(CodeBase $code_base, TypedElement $element)
 {
     // Get the set of suppressed issues on the element
     $suppress_issue_list = $element->getSuppressIssueList();
     // Check to see if any are unused
     foreach ($suppress_issue_list as $issue_type => $use_count) {
         if (0 === $use_count) {
             $this->emitIssue($code_base, $element->getContext(), 'UnusedSuppression', "Element {$element->getFQSEN()} suppresses issue {$issue_type} but does not use it");
         }
     }
 }
示例#2
0
 public function isInternal() : bool
 {
     return $this->element->isInternal();
 }
示例#3
0
文件: Variable.php 项目: tpunt/phan
 /**
  * @param \phan\Context $context
  * The context in which the structural element lives
  *
  * @param string $name,
  * The name of the typed structural element
  *
  * @param UnionType $type,
  * A '|' delimited set of types satisfyped by this
  * typed structural element.
  *
  * @param int $flags,
  * The flags property contains node specific flags. It is
  * always defined, but for most nodes it is always zero.
  * ast\kind_uses_flags() can be used to determine whether
  * a certain kind has a meaningful flags value.
  */
 public function __construct(Context $context, string $name, UnionType $type, int $flags)
 {
     parent::__construct($context, $name, $type, $flags);
 }
示例#4
0
文件: Variable.php 项目: etsy/phan
 /**
  * Variables can't be variadic. This is the same as getUnionType for
  * variables, but not necessarily for subclasses. Method will return
  * the element type (such as `DateTime`) for variadic parameters.
  */
 public function getVariadicElementUnionType() : UnionType
 {
     return parent::getUnionType();
 }
示例#5
0
 /**
  * After a clone is called on this object, clone our
  * type and fqsen so that they survive copies intact
  *
  * @return void
  */
 public function __clone()
 {
     parent::__clone();
     $this->setFQSEN(clone $this->getFQSEN());
 }
示例#6
0
 /**
  * @param Context $context
  * The context in which the structural element lives
  *
  * @param string $name,
  * The name of the typed structural element
  *
  * @param UnionType $type,
  * A '|' delimited set of types satisfyped by this
  * typed structural element.
  *
  * @param int $flags,
  * The flags property contains node specific flags. It is
  * always defined, but for most nodes it is always zero.
  * ast\kind_uses_flags() can be used to determine whether
  * a certain kind has a meaningful flags value.
  *
  * @param FQSEN $fqsen
  * A fully qualified name for the element
  */
 public function __construct(Context $context, string $name, UnionType $type, int $flags, FQSEN $fqsen)
 {
     parent::__construct($context, $name, $type, $flags);
     $this->setFQSEN($fqsen);
 }