1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-05 21:19:03 +01:00
psalm/src/Psalm/TraitChecker.php

35 lines
978 B
PHP
Raw Normal View History

<?php
2016-07-26 00:37:44 +02:00
namespace Psalm;
use PhpParser;
class TraitChecker extends ClassChecker
{
public function __construct(PhpParser\Node\Stmt\Trait_ $class, StatementsSource $source, $absolute_class)
{
$this->_class = $class;
$this->_namespace = $source->getNamespace();
$this->_aliased_classes = $source->getAliasedClasses();
$this->_file_name = $source->getFileName();
$this->_absolute_class = $absolute_class;
$this->_parent_class = null;
2016-08-08 20:36:18 +02:00
$this->_suppressed_issues = $source->getSuppressedIssues();
self::$_existing_classes[$absolute_class] = 1;
2016-08-08 20:36:18 +02:00
self::$_class_checkers[$absolute_class] = $this;
}
public function check($check_methods = true, Context $class_context = null)
{
if (!$class_context) {
throw new \InvalidArgumentException('TraitChecker::check must be called with a $class_context');
}
2016-08-08 20:36:18 +02:00
parent::check($check_methods, $class_context);
}
}