Skip to content

Commit 42fed7d

Browse files
committed
better deprecation messages
1 parent d7195a2 commit 42fed7d

File tree

3 files changed

+63
-28
lines changed

3 files changed

+63
-28
lines changed

src/PhpGenerator/ClassLike.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ abstract class ClassLike
2626
VisibilityProtected = 'protected',
2727
VisibilityPrivate = 'private';
2828

29-
/** @deprecated */
30-
public const
31-
VISIBILITY_PUBLIC = self::VisibilityPublic,
32-
VISIBILITY_PROTECTED = self::VisibilityProtected,
33-
VISIBILITY_PRIVATE = self::VisibilityPrivate;
29+
/** @deprecated use ClassLike::VisibilityPublic */
30+
public const VISIBILITY_PUBLIC = self::VisibilityPublic;
31+
32+
/** @deprecated use ClassLike::VisibilityProtected */
33+
public const VISIBILITY_PROTECTED = self::VisibilityProtected;
34+
35+
/** @deprecated use ClassLike::VisibilityPrivate */
36+
public const VISIBILITY_PRIVATE = self::VisibilityPrivate;
3437

3538
private ?PhpNamespace $namespace;
3639
private ?string $name;

src/PhpGenerator/PhpNamespace.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,14 @@ final class PhpNamespace
3030
NameFunction = 'f',
3131
NameConstant = 'c';
3232

33-
/** @deprecated */
34-
public const
35-
NAME_NORMAL = self::NameNormal,
36-
NAME_FUNCTION = self::NameFunction,
37-
NAME_CONSTANT = self::NameConstant;
33+
/** @deprecated use PhpNamespace::NameNormal */
34+
public const NAME_NORMAL = self::NameNormal;
35+
36+
/** @deprecated use PhpNamespace::NameFunction */
37+
public const NAME_FUNCTION = self::NameFunction;
38+
39+
/** @deprecated use PhpNamespace::NameConstant */
40+
public const NAME_CONSTANT = self::NameConstant;
3841

3942
private string $name;
4043

src/PhpGenerator/Type.php

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,53 @@ class Type
3434
Parent = 'parent',
3535
Static = 'static';
3636

37-
/** @deprecated */
38-
public const
39-
STRING = self::String,
40-
INT = self::Int,
41-
FLOAT = self::Float,
42-
BOOL = self::Bool,
43-
ARRAY = self::Array,
44-
OBJECT = self::Object,
45-
CALLABLE = self::Callable,
46-
ITERABLE = self::Iterable,
47-
VOID = self::Void,
48-
NEVER = self::Never,
49-
MIXED = self::Mixed,
50-
FALSE = self::False,
51-
NULL = self::Null,
52-
SELF = self::Self,
53-
PARENT = self::Parent,
54-
STATIC = self::Static;
37+
/** @deprecated use Type::String */
38+
public const STRING = self::String;
39+
40+
/** @deprecated use Type::Int */
41+
public const INT = self::Int;
42+
43+
/** @deprecated use Type::Float */
44+
public const FLOAT = self::Float;
45+
46+
/** @deprecated use Type::Bool */
47+
public const BOOL = self::Bool;
48+
49+
/** @deprecated use Type::Array */
50+
public const ARRAY = self::Array;
51+
52+
/** @deprecated use Type::Object */
53+
public const OBJECT = self::Object;
54+
55+
/** @deprecated use Type::Callable */
56+
public const CALLABLE = self::Callable;
57+
58+
/** @deprecated use Type::Iterable */
59+
public const ITERABLE = self::Iterable;
60+
61+
/** @deprecated use Type::Void */
62+
public const VOID = self::Void;
63+
64+
/** @deprecated use Type::Never */
65+
public const NEVER = self::Never;
66+
67+
/** @deprecated use Type::Mixed */
68+
public const MIXED = self::Mixed;
69+
70+
/** @deprecated use Type::False */
71+
public const FALSE = self::False;
72+
73+
/** @deprecated use Type::Null */
74+
public const NULL = self::Null;
75+
76+
/** @deprecated use Type::Self */
77+
public const SELF = self::Self;
78+
79+
/** @deprecated use Type::Parent */
80+
public const PARENT = self::Parent;
81+
82+
/** @deprecated use Type::Static */
83+
public const STATIC = self::Static;
5584

5685

5786
public static function nullable(string $type, bool $state = true): string

0 commit comments

Comments
 (0)