1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-15 02:47:02 +01:00
psalm/src/Psalm/Internal/Analyzer/TraitAnalyzer.php

59 lines
1.2 KiB
PHP
Raw Normal View History

<?php
2018-11-06 03:57:36 +01:00
namespace Psalm\Internal\Analyzer;
use PhpParser;
2018-01-21 18:44:46 +01:00
use Psalm\Aliases;
/**
* @internal
*/
2018-11-06 03:57:36 +01:00
class TraitAnalyzer extends ClassLikeAnalyzer
{
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;
public function __construct(
PhpParser\Node\Stmt\Trait_ $class,
2018-11-06 03:57:36 +01:00
SourceAnalyzer $source,
string $fq_class_name,
2018-01-21 18:44:46 +01:00
Aliases $aliases
) {
$this->source = $source;
2018-11-11 18:01:14 +01:00
$this->file_analyzer = $source->getFileAnalyzer();
2018-11-06 03:57:36 +01:00
$this->aliases = $source->getAliases();
$this->class = $class;
$this->fq_class_name = $fq_class_name;
$codebase = $source->getCodebase();
$this->storage = $codebase->classlike_storage_provider->get($fq_class_name);
2018-01-21 18:44:46 +01:00
$this->aliases = $aliases;
}
public function getNamespace(): ?string
2018-01-21 18:44:46 +01:00
{
return $this->aliases->namespace;
}
public function getAliases(): Aliases
2018-01-21 18:44:46 +01:00
{
return $this->aliases;
}
/**
* @return array<string, string>
*/
public function getAliasedClassesFlipped(): array
2018-01-21 18:44:46 +01:00
{
return [];
}
2019-06-06 04:13:33 +02:00
/**
* @return array<string, string>
*/
public function getAliasedClassesFlippedReplaceable(): array
2019-06-06 04:13:33 +02:00
{
return [];
}
}