mirror of
https://github.com/danog/psalm.git
synced 2024-12-15 02:47:02 +01:00
8c7423505a
* add native param types * redundant phpdoc * add more param types and adds "?" to nullable types * remove redundant phpdoc * add more param types and remove redundant phpdoc * add more param types and remove redundant phpdoc
59 lines
1.2 KiB
PHP
59 lines
1.2 KiB
PHP
<?php
|
|
namespace Psalm\Internal\Analyzer;
|
|
|
|
use PhpParser;
|
|
use Psalm\Aliases;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
class TraitAnalyzer extends ClassLikeAnalyzer
|
|
{
|
|
/**
|
|
* @var Aliases
|
|
*/
|
|
private $aliases;
|
|
|
|
public function __construct(
|
|
PhpParser\Node\Stmt\Trait_ $class,
|
|
SourceAnalyzer $source,
|
|
string $fq_class_name,
|
|
Aliases $aliases
|
|
) {
|
|
$this->source = $source;
|
|
$this->file_analyzer = $source->getFileAnalyzer();
|
|
$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);
|
|
$this->aliases = $aliases;
|
|
}
|
|
|
|
public function getNamespace(): ?string
|
|
{
|
|
return $this->aliases->namespace;
|
|
}
|
|
|
|
public function getAliases(): Aliases
|
|
{
|
|
return $this->aliases;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
public function getAliasedClassesFlipped(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
public function getAliasedClassesFlippedReplaceable(): array
|
|
{
|
|
return [];
|
|
}
|
|
}
|