Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/Reflection/ClassReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,6 @@ public function isBackedEnum(): bool
return $this->data[Data::BackingType] !== null;
}

/**
* @return (TObject is \BackedEnum ? Type<int|string> : ?Type<int|string>)
*/
public function enumBackingType(): ?Type
{
return $this->data[Data::BackingType];
Expand Down
2 changes: 1 addition & 1 deletion src/Reflection/Internal/Data/BackingTypeKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* @internal
* @psalm-internal Typhoon\Reflection\Internal
* @implements OptionalKey<?Type<int|string>>
* @implements OptionalKey<?Type>
*/
enum BackingTypeKey implements OptionalKey
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ private static function reflectParents(\ReflectionClass $class): array
return $parents;
}

/**
* @return ?Type<int|string>
*/
private static function reflectBackingType(\ReflectionEnum $enum): ?Type
{
$type = $enum->getBackingType();
Expand Down
1 change: 0 additions & 1 deletion src/Reflection/Internal/PhpParser/NodeReflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ public function reflectClassLike(ClassLike $node, Context $context): TypedMap
}

if ($node instanceof Enum_) {
/** @var ?Type<int|string> */
$backingType = $this->reflectType($context, $node->scalarType);

return $data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* @internal
* @psalm-internal Typhoon\Reflection\Internal\PhpParser
* @implements Type<mixed>
*/
final class UnresolvedConstantType implements Type
{
Expand Down
6 changes: 6 additions & 0 deletions src/Type/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed

- Remove `Type<TType>` template in favor of future plugins for Psalm and PHPStan.

## [0.4.3] 2024-08-06

### Added
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/AliasType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<mixed>
*/
final class AliasType implements Type
{
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/ArgumentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<mixed>
*/
final class ArgumentType implements Type
{
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/ArrayType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<array<mixed>>
*/
final class ArrayType implements Type
{
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/CallableType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<callable>
*/
final class CallableType implements Type
{
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/ClassConstantMaskType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<mixed>
*/
final class ClassConstantMaskType implements Type
{
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/ClassConstantType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<mixed>
*/
final class ClassConstantType implements Type
{
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/ClassStringType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<non-empty-string>
*/
final class ClassStringType implements Type
{
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/ConditionalType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<mixed>
*/
final class ConditionalType implements Type
{
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/ConstantType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<mixed>
*/
final class ConstantType implements Type
{
Expand Down
2 changes: 0 additions & 2 deletions src/Type/Internal/FloatType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
* @internal
* @psalm-internal Typhoon\Type
* @readonly
* @template-covariant TValue of float
* @implements Type<TValue>
*/
final class FloatType implements Type
{
Expand Down
5 changes: 0 additions & 5 deletions src/Type/Internal/FloatValueType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @template-covariant TValue of float
* @implements Type<TValue>
*/
final class FloatValueType implements Type
{
/**
* @param TValue $value
*/
public function __construct(
private readonly float $value,
) {}
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/IntMaskType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<int>
*/
final class IntMaskType implements Type
{
Expand Down
2 changes: 0 additions & 2 deletions src/Type/Internal/IntType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
* @internal
* @psalm-internal Typhoon\Type
* @readonly
* @template-covariant TValue of int
* @implements Type<TValue>
*/
final class IntType implements Type
{
Expand Down
5 changes: 0 additions & 5 deletions src/Type/Internal/IntValueType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @template-covariant TValue of int
* @implements Type<TValue>
*/
final class IntValueType implements Type
{
/**
* @param TValue $value
*/
public function __construct(
private readonly int $value,
) {}
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/IntersectionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<mixed>
*/
final class IntersectionType implements Type
{
Expand Down
7 changes: 0 additions & 7 deletions src/Type/Internal/IterableType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,9 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @template-covariant TKey
* @template-covariant TValue
* @implements Type<iterable<TKey, TValue>>
*/
final class IterableType implements Type
{
/**
* @param Type<TKey> $key
* @param Type<TValue> $value
*/
public function __construct(
private readonly Type $key,
private readonly Type $value,
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/KeyType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<mixed>
*/
final class KeyType implements Type
{
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/ListType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<list<mixed>>
*/
final class ListType implements Type
{
Expand Down
5 changes: 0 additions & 5 deletions src/Type/Internal/LiteralType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @template-covariant TType
* @implements Type<TType>
*/
final class LiteralType implements Type
{
/**
* @param Type<TType> $type
*/
public function __construct(
private readonly Type $type,
) {}
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/NamedObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<object>
*/
final class NamedObjectType implements Type
{
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/NonEmptyArrayType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<non-empty-array<mixed>>
*/
final class NonEmptyArrayType implements Type
{
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/NotType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<mixed>
*/
final class NotType implements Type
{
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/ObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<object>
*/
final class ObjectType implements Type
{
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/OffsetType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<mixed>
*/
final class OffsetType implements Type
{
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/ParentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<object>
*/
final class ParentType implements Type
{
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/SelfType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<object>
*/
final class SelfType implements Type
{
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/StaticType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<object>
*/
final class StaticType implements Type
{
Expand Down
5 changes: 0 additions & 5 deletions src/Type/Internal/StringValueType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @template-covariant TValue of string
* @implements Type<TValue>
*/
final class StringValueType implements Type
{
/**
* @param TValue $value
*/
public function __construct(
private readonly string $value,
) {}
Expand Down
1 change: 0 additions & 1 deletion src/Type/Internal/TemplateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @implements Type<mixed>
*/
final class TemplateType implements Type
{
Expand Down
4 changes: 1 addition & 3 deletions src/Type/Internal/UnionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @template-covariant TType
* @implements Type<TType>
*/
final class UnionType implements Type
{
/**
* @param non-empty-list<Type<TType>> $types
* @param non-empty-list<Type> $types
*/
public function __construct(
private readonly array $types,
Expand Down
5 changes: 0 additions & 5 deletions src/Type/Internal/VarianceAwareType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,9 @@
/**
* @internal
* @psalm-internal Typhoon\Type
* @template-covariant TType
* @implements Type<TType>
*/
final class VarianceAwareType implements Type
{
/**
* @param Type<TType> $type
*/
public function __construct(
private readonly Type $type,
private readonly Variance $variance,
Expand Down
4 changes: 0 additions & 4 deletions src/Type/Parameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@

/**
* @api
* @template-covariant TType
*/
final class Parameter
{
/**
* @param Type<TType> $type
*/
public function __construct(
public readonly Type $type = types::mixed,
public readonly bool $hasDefault = false,
Expand Down
4 changes: 0 additions & 4 deletions src/Type/ShapeElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@

/**
* @api
* @template-covariant TType
*/
final class ShapeElement
{
/**
* @param Type<TType> $type
*/
public function __construct(
public readonly Type $type,
public readonly bool $optional = false,
Expand Down
1 change: 0 additions & 1 deletion src/Type/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

/**
* @api
* @template-covariant TType
*/
interface Type
{
Expand Down
Loading