mirror of
https://github.com/danog/psalm.git
synced 2024-12-12 01:09:38 +01:00
unnecessary identical child method
This commit is contained in:
parent
4577a11a2f
commit
5d6d3df4cf
@ -1624,16 +1624,6 @@ abstract class FunctionLikeAnalyzer extends SourceAnalyzer
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getFQCLN(): ?string
|
||||
{
|
||||
return $this->source->getFQCLN();
|
||||
}
|
||||
|
||||
public function getClassName(): ?string
|
||||
{
|
||||
return $this->source->getClassName();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, Type\Union>>|null
|
||||
*/
|
||||
@ -1647,16 +1637,6 @@ abstract class FunctionLikeAnalyzer extends SourceAnalyzer
|
||||
return $this->storage->template_types;
|
||||
}
|
||||
|
||||
public function getParentFQCLN(): ?string
|
||||
{
|
||||
return $this->source->getParentFQCLN();
|
||||
}
|
||||
|
||||
public function getNodeTypeProvider() : \Psalm\NodeTypeProvider
|
||||
{
|
||||
return $this->source->getNodeTypeProvider();
|
||||
}
|
||||
|
||||
public function isStatic(): bool
|
||||
{
|
||||
return $this->is_static;
|
||||
|
@ -11,8 +11,4 @@ class TCallableArray extends TNonEmptyArray
|
||||
*/
|
||||
public $value = 'callable-array';
|
||||
|
||||
public function getKey(bool $include_extra = true): string
|
||||
{
|
||||
return 'array';
|
||||
}
|
||||
}
|
||||
|
@ -40,19 +40,6 @@ class TIntMask extends TInt
|
||||
return 'int-mask<' . substr($s, 0, -2) . '>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*/
|
||||
public function toPhpString(
|
||||
?string $namespace,
|
||||
array $aliased_classes,
|
||||
?string $this_class,
|
||||
int $php_major_version,
|
||||
int $php_minor_version
|
||||
): ?string {
|
||||
return $php_major_version >= 7 ? 'int' : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*
|
||||
|
@ -29,19 +29,6 @@ class TIntMaskOf extends TInt
|
||||
return $this->getKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*/
|
||||
public function toPhpString(
|
||||
?string $namespace,
|
||||
array $aliased_classes,
|
||||
?string $this_class,
|
||||
int $php_major_version,
|
||||
int $php_minor_version
|
||||
): ?string {
|
||||
return $php_major_version >= 7 ? 'int' : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*/
|
||||
|
@ -42,19 +42,6 @@ class TIntRange extends TInt
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*/
|
||||
public function toPhpString(
|
||||
?string $namespace,
|
||||
array $aliased_classes,
|
||||
?string $this_class,
|
||||
int $php_major_version,
|
||||
int $php_minor_version
|
||||
): ?string {
|
||||
return $php_major_version >= 7 ? 'int' : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*/
|
||||
|
@ -24,19 +24,6 @@ class TLiteralFloat extends TFloat
|
||||
return 'float(' . $this->value . ')';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*/
|
||||
public function toPhpString(
|
||||
?string $namespace,
|
||||
array $aliased_classes,
|
||||
?string $this_class,
|
||||
int $php_major_version,
|
||||
int $php_minor_version
|
||||
): ?string {
|
||||
return $php_major_version >= 7 ? 'float' : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*
|
||||
|
@ -29,19 +29,6 @@ class TLiteralInt extends TInt
|
||||
return 'int(' . $this->value . ')';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*/
|
||||
public function toPhpString(
|
||||
?string $namespace,
|
||||
array $aliased_classes,
|
||||
?string $this_class,
|
||||
int $php_major_version,
|
||||
int $php_minor_version
|
||||
): ?string {
|
||||
return $php_major_version >= 7 ? 'int' : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*
|
||||
|
@ -23,11 +23,6 @@ class TLiteralString extends TString
|
||||
return 'string(' . $this->value . ')';
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return 'string';
|
||||
}
|
||||
|
||||
public function getId(bool $nested = false): string
|
||||
{
|
||||
// quote control characters, backslashes and double quote
|
||||
@ -44,19 +39,6 @@ class TLiteralString extends TString
|
||||
return 'string(' . $this->value . ')';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*/
|
||||
public function toPhpString(
|
||||
?string $namespace,
|
||||
array $aliased_classes,
|
||||
?string $this_class,
|
||||
int $php_major_version,
|
||||
int $php_minor_version
|
||||
): ?string {
|
||||
return $php_major_version >= 7 ? 'string' : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*
|
||||
|
@ -3,11 +3,6 @@ namespace Psalm\Type\Atomic;
|
||||
|
||||
class TLowercaseString extends TString
|
||||
{
|
||||
public function getKey(bool $include_extra = true): string
|
||||
{
|
||||
return 'string';
|
||||
}
|
||||
|
||||
public function getId(bool $nested = false): string
|
||||
{
|
||||
return 'lowercase-string';
|
||||
|
@ -6,11 +6,6 @@ namespace Psalm\Type\Atomic;
|
||||
*/
|
||||
class TNonEmptyLowercaseString extends TNonEmptyString
|
||||
{
|
||||
public function getKey(bool $include_extra = true): string
|
||||
{
|
||||
return 'string';
|
||||
}
|
||||
|
||||
public function getId(bool $nested = false): string
|
||||
{
|
||||
return 'non-empty-lowercase-string';
|
||||
|
@ -7,11 +7,6 @@ namespace Psalm\Type\Atomic;
|
||||
*/
|
||||
class TNonEmptyNonspecificLiteralString extends TNonspecificLiteralString
|
||||
{
|
||||
public function getKey(bool $include_extra = true): string
|
||||
{
|
||||
return 'string';
|
||||
}
|
||||
|
||||
public function getId(bool $nested = false): string
|
||||
{
|
||||
return 'non-empty-literal-string';
|
||||
|
@ -12,11 +12,6 @@ class TNonspecificLiteralInt extends TInt
|
||||
return 'literal-int';
|
||||
}
|
||||
|
||||
public function getKey(bool $include_extra = true) : string
|
||||
{
|
||||
return 'int';
|
||||
}
|
||||
|
||||
public function canBeFullyExpressedInPhp(int $php_major_version, int $php_minor_version): bool
|
||||
{
|
||||
return false;
|
||||
|
@ -12,11 +12,6 @@ class TNonspecificLiteralString extends TString
|
||||
return 'literal-string';
|
||||
}
|
||||
|
||||
public function getKey(bool $include_extra = true) : string
|
||||
{
|
||||
return 'string';
|
||||
}
|
||||
|
||||
public function canBeFullyExpressedInPhp(int $php_major_version, int $php_minor_version): bool
|
||||
{
|
||||
return false;
|
||||
|
@ -61,16 +61,4 @@ class TTemplateIndexedAccess extends \Psalm\Type\Atomic
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*
|
||||
*/
|
||||
public function toNamespacedString(
|
||||
?string $namespace,
|
||||
array $aliased_classes,
|
||||
?string $this_class,
|
||||
bool $use_phpdoc_format
|
||||
): string {
|
||||
return $this->getKey();
|
||||
}
|
||||
}
|
||||
|
@ -48,27 +48,6 @@ class TTemplateKeyOf extends TArrayKey
|
||||
return 'key-of<' . $this->param_name . ':' . $this->defining_class . ' as ' . $this->as->getId() . '>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*/
|
||||
public function toPhpString(
|
||||
?string $namespace,
|
||||
array $aliased_classes,
|
||||
?string $this_class,
|
||||
int $php_major_version,
|
||||
int $php_minor_version
|
||||
): ?string {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return false
|
||||
*/
|
||||
public function canBeFullyExpressedInPhp(int $php_major_version, int $php_minor_version): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*/
|
||||
|
@ -49,24 +49,6 @@ class TTemplateParamClass extends TClassString
|
||||
return 'class-string<' . $this->param_name . '>';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*/
|
||||
public function toPhpString(
|
||||
?string $namespace,
|
||||
array $aliased_classes,
|
||||
?string $this_class,
|
||||
int $php_major_version,
|
||||
int $php_minor_version
|
||||
): ?string {
|
||||
return 'string';
|
||||
}
|
||||
|
||||
public function canBeFullyExpressedInPhp(int $php_major_version, int $php_minor_version): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*
|
||||
@ -80,8 +62,4 @@ class TTemplateParamClass extends TClassString
|
||||
return $this->param_name . '::class';
|
||||
}
|
||||
|
||||
public function getChildNodes() : array
|
||||
{
|
||||
return $this->as_type ? [$this->as_type] : [];
|
||||
}
|
||||
}
|
||||
|
@ -78,19 +78,6 @@ class TTypeAlias extends \Psalm\Type\Atomic
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<lowercase-string, string> $aliased_classes
|
||||
*
|
||||
*/
|
||||
public function toNamespacedString(
|
||||
?string $namespace,
|
||||
array $aliased_classes,
|
||||
?string $this_class,
|
||||
bool $use_phpdoc_format
|
||||
): string {
|
||||
return $this->getKey();
|
||||
}
|
||||
|
||||
public function getAssertionString(bool $exact = false): string
|
||||
{
|
||||
return 'mixed';
|
||||
|
Loading…
Reference in New Issue
Block a user