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

56 lines
1.1 KiB
PHP
Raw Normal View History

<?php
namespace Psalm\Checker;
use PhpParser;
2018-01-21 18:44:46 +01:00
use Psalm\Aliases;
use Psalm\StatementsSource;
class TraitChecker extends ClassLikeChecker
{
2016-11-02 07:29:00 +01:00
/**
2018-01-21 18:44:46 +01:00
* @var Aliases
2016-11-02 07:29:00 +01:00
*/
2018-01-21 18:44:46 +01:00
private $aliases;
/**
* @param string $fq_class_name
*/
public function __construct(
PhpParser\Node\Stmt\Trait_ $class,
StatementsSource $source,
$fq_class_name,
Aliases $aliases
) {
$this->source = $source;
$this->file_checker = $source->getFileChecker();
$this->class = $class;
$this->fq_class_name = $fq_class_name;
$this->storage = $this->file_checker->project_checker->classlike_storage_provider->get($fq_class_name);
2018-01-21 18:44:46 +01:00
$this->aliases = $aliases;
}
/**
2018-01-28 23:07:09 +01:00
* @return null|string
2018-01-21 18:44:46 +01:00
*/
public function getNamespace()
{
return $this->aliases->namespace;
}
2018-01-21 18:44:46 +01:00
/**
* @return Aliases
*/
public function getAliases()
{
return $this->aliases;
}
/**
* @return array<string, string>
*/
public function getAliasedClassesFlipped()
{
return [];
}
}