Skip to content

Commit

Permalink
feat(type): mark type classes as readonly (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
veewee authored Apr 5, 2024
1 parent 5ab5416 commit 765f499
Show file tree
Hide file tree
Showing 50 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/ArrayKeyType.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* @internal
*/
final class ArrayKeyType extends UnionType
final readonly class ArrayKeyType extends UnionType
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/BackedEnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @extends Type\Type<T>
*/
final class BackedEnumType extends Type\Type
final readonly class BackedEnumType extends Type\Type
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/BoolType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @internal
*/
final class BoolType extends Type\Type
final readonly class BoolType extends Type\Type
{
/**
* @psalm-assert-if-true bool $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/ClassStringType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @internal
*/
final class ClassStringType extends Type
final readonly class ClassStringType extends Type
{
/**
* @var class-string<T> $classname
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/ConvertedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @internal
*/
final class ConvertedType extends Type\Type
final readonly class ConvertedType extends Type\Type
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/DictType.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @internal
*/
final class DictType extends Type\Type
final readonly class DictType extends Type\Type
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/F32Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @internal
*/
final class F32Type extends Type\Type
final readonly class F32Type extends Type\Type
{
/**
* @ara-assert-if-true f32 $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/F64Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* @internal
*/
final class F64Type extends Type\Type
final readonly class F64Type extends Type\Type
{
/**
* @ara-assert-if-true f64 $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/FloatType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @internal
*/
final class FloatType extends Type\Type
final readonly class FloatType extends Type\Type
{
/**
* @psalm-assert-if-true float $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/I16Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @internal
*/
final class I16Type extends Type\Type
final readonly class I16Type extends Type\Type
{
/**
* @ara-assert-if-true i16 $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/I32Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @internal
*/
final class I32Type extends Type\Type
final readonly class I32Type extends Type\Type
{
/**
* @ara-assert-if-true i32 $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/I64Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* @internal
*/
final class I64Type extends Type\Type
final readonly class I64Type extends Type\Type
{
/**
* @ara-assert-if-true i64 $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/I8Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* @internal
*/
final class I8Type extends Type\Type
final readonly class I8Type extends Type\Type
{
/**
* @ara-assert-if-true i8 $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/InstanceOfType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @internal
*/
final class InstanceOfType extends Type
final readonly class InstanceOfType extends Type
{
/**
* @var class-string<T> $classname
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/IntType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @internal
*/
final class IntType extends Type\Type
final readonly class IntType extends Type\Type
{
/**
* @psalm-assert-if-true int $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/IntersectionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @internal
*/
final class IntersectionType extends Type
final readonly class IntersectionType extends Type
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/IterableType.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @internal
*/
final class IterableType extends Type\Type
final readonly class IterableType extends Type\Type
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/LiteralScalarType.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @internal
*/
final class LiteralScalarType extends Type\Type
final readonly class LiteralScalarType extends Type\Type
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/MapType.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @internal
*/
final class MapType extends Type\Type
final readonly class MapType extends Type\Type
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/MixedDictType.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @internal
*/
final class MixedDictType extends Type\Type
final readonly class MixedDictType extends Type\Type
{
/**
* @throws CoercionException
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/MixedType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*
* @internal
*/
final class MixedType extends Type
final readonly class MixedType extends Type
{
/**
* @psalm-assert-if-true mixed $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/MixedVecType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @internal
*/
final class MixedVecType extends Type\Type
final readonly class MixedVecType extends Type\Type
{
/**
* @psalm-assert-if-true list<Tv> $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/MutableMapType.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @internal
*/
final class MutableMapType extends Type\Type
final readonly class MutableMapType extends Type\Type
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/MutableVectorType.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @internal
*/
final class MutableVectorType extends Type\Type
final readonly class MutableVectorType extends Type\Type
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/NonEmptyDictType.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @internal
*/
final class NonEmptyDictType extends Type\Type
final readonly class NonEmptyDictType extends Type\Type
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/NonEmptyStringType.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* @internal
*/
final class NonEmptyStringType extends Type\Type
final readonly class NonEmptyStringType extends Type\Type
{
/**
* @psalm-assert-if-true non-empty-string $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/NonEmptyVecType.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @internal
*/
final class NonEmptyVecType extends Type\Type
final readonly class NonEmptyVecType extends Type\Type
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/NonNullType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @internal
*/
final class NonNullType extends Type\Type
final readonly class NonNullType extends Type\Type
{
/**
* @psalm-assert-if-true mixed $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/NullType.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @internal
*/
final class NullType extends Type\Type
final readonly class NullType extends Type\Type
{
/**
* @psalm-assert-if-true null $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/NullableType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @internal
*/
final class NullableType extends Type\Type
final readonly class NullableType extends Type\Type
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/NumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* @internal
*/
final class NumType extends UnionType
final readonly class NumType extends UnionType
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/NumericStringType.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* @internal
*/
final class NumericStringType extends Type\Type
final readonly class NumericStringType extends Type\Type
{
/**
* @psalm-assert-if-true numeric-string $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/ObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @internal
*/
final class ObjectType extends Type
final readonly class ObjectType extends Type
{
/**
* @psalm-assert-if-true T $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/OptionalType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @internal
*/
final class OptionalType extends Type\Type
final readonly class OptionalType extends Type\Type
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/PathExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* This class can be used for building the "path" parts of an exception message.
* It is introduced to make sure the same path formatting is used when constructing the exception message.
*/
final class PathExpression
final readonly class PathExpression
{
/**
* @pure
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/PositiveIntType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @internal
*/
final class PositiveIntType extends Type\Type
final readonly class PositiveIntType extends Type\Type
{
/**
* @psalm-assert-if-true positive-int $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/ResourceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @internal
*/
final class ResourceType extends Type\Type
final readonly class ResourceType extends Type\Type
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/ScalarType.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* @internal
*/
final class ScalarType extends UnionType
final readonly class ScalarType extends UnionType
{
/**
* @psalm-mutation-free
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/ShapeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* @extends Type\Type<array<Tk, Tv>>
*/
final class ShapeType extends Type\Type
final readonly class ShapeType extends Type\Type
{
/**
* @var array<Tk, Type\TypeInterface<Tv>>
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/StringType.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* @internal
*/
final class StringType extends Type\Type
final readonly class StringType extends Type\Type
{
/**
* @psalm-assert-if-true string $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/U16Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @internal
*/
final class U16Type extends Type\Type
final readonly class U16Type extends Type\Type
{
/**
* @ara-assert-if-true u16 $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/U32Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @internal
*/
final class U32Type extends Type\Type
final readonly class U32Type extends Type\Type
{
/**
* @ara-assert-if-true u32 $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/U8Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @internal
*/
final class U8Type extends Type\Type
final readonly class U8Type extends Type\Type
{
/**
* @ara-assert-if-true u8 $value
Expand Down
2 changes: 1 addition & 1 deletion src/Psl/Type/Internal/UIntType.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @internal
*/
final class UIntType extends Type\Type
final readonly class UIntType extends Type\Type
{
/**
* @ara-assert-if-true unit $value
Expand Down
Loading

0 comments on commit 765f499

Please sign in to comment.