1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-14 10:17:33 +01:00
psalm/src/Psalm/Checker/TraitChecker.php

36 lines
974 B
PHP
Raw Normal View History

<?php
namespace Psalm\Checker;
use PhpParser;
use Psalm\StatementsSource;
use Psalm\Context;
class TraitChecker extends ClassLikeChecker
{
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;
$this->suppressed_issues = $source->getSuppressedIssues();
2016-08-08 20:36:18 +02:00
self::$class_checkers[$absolute_class] = $this;
2016-08-08 20:36:18 +02:00
}
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);
}
}