From 340fc5eedce18274dfd7eda22c29e8b9397b18db Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Tue, 19 Aug 2025 21:56:04 +0700 Subject: [PATCH] Use @deprecated above class to allow static analyzer like PHPStan detect deprecation --- lib/PhpParser/Node/Expr/ArrayItem.php | 6 +++++- lib/PhpParser/Node/Expr/ClosureUse.php | 6 +++++- lib/PhpParser/Node/Scalar/DNumber.php | 6 +++++- lib/PhpParser/Node/Scalar/Encapsed.php | 6 +++++- lib/PhpParser/Node/Scalar/EncapsedStringPart.php | 6 +++++- lib/PhpParser/Node/Scalar/LNumber.php | 6 +++++- lib/PhpParser/Node/Stmt/DeclareDeclare.php | 6 +++++- lib/PhpParser/Node/Stmt/PropertyProperty.php | 6 +++++- lib/PhpParser/Node/Stmt/StaticVar.php | 6 +++++- lib/PhpParser/Node/Stmt/UseUse.php | 6 +++++- 10 files changed, 50 insertions(+), 10 deletions(-) diff --git a/lib/PhpParser/Node/Expr/ArrayItem.php b/lib/PhpParser/Node/Expr/ArrayItem.php index be9d0708d1..55ef163502 100644 --- a/lib/PhpParser/Node/Expr/ArrayItem.php +++ b/lib/PhpParser/Node/Expr/ArrayItem.php @@ -5,7 +5,11 @@ require __DIR__ . '/../ArrayItem.php'; if (false) { - // For classmap-authoritative support. + /** + * For classmap-authoritative support. + * + * @deprecated use \PhpParser\Node\ArrayItem instead. + */ class ArrayItem extends \PhpParser\Node\ArrayItem { } } diff --git a/lib/PhpParser/Node/Expr/ClosureUse.php b/lib/PhpParser/Node/Expr/ClosureUse.php index b395617202..279aa26adc 100644 --- a/lib/PhpParser/Node/Expr/ClosureUse.php +++ b/lib/PhpParser/Node/Expr/ClosureUse.php @@ -5,7 +5,11 @@ require __DIR__ . '/../ClosureUse.php'; if (false) { - // For classmap-authoritative support. + /** + * For classmap-authoritative support. + * + * @deprecated use \PhpParser\Node\ClosureUse instead. + */ class ClosureUse extends \PhpParser\Node\ClosureUse { } } diff --git a/lib/PhpParser/Node/Scalar/DNumber.php b/lib/PhpParser/Node/Scalar/DNumber.php index aaafc5fece..5b5e410d9c 100644 --- a/lib/PhpParser/Node/Scalar/DNumber.php +++ b/lib/PhpParser/Node/Scalar/DNumber.php @@ -5,7 +5,11 @@ require __DIR__ . '/Float_.php'; if (false) { - // For classmap-authoritative support. + /** + * For classmap-authoritative support. + * + * @deprecated use \PhpParser\Node\Scalar\Float_ instead. + */ class DNumber extends Float_ { } } diff --git a/lib/PhpParser/Node/Scalar/Encapsed.php b/lib/PhpParser/Node/Scalar/Encapsed.php index a97545e7bd..57fccebc6e 100644 --- a/lib/PhpParser/Node/Scalar/Encapsed.php +++ b/lib/PhpParser/Node/Scalar/Encapsed.php @@ -5,7 +5,11 @@ require __DIR__ . '/InterpolatedString.php'; if (false) { - // For classmap-authoritative support. + /** + * For classmap-authoritative support. + * + * @deprecated use \PhpParser\Node\Scalar\InterpolatedString instead. + */ class Encapsed extends InterpolatedString { } } diff --git a/lib/PhpParser/Node/Scalar/EncapsedStringPart.php b/lib/PhpParser/Node/Scalar/EncapsedStringPart.php index 7ef5fb0c09..d67011a0f7 100644 --- a/lib/PhpParser/Node/Scalar/EncapsedStringPart.php +++ b/lib/PhpParser/Node/Scalar/EncapsedStringPart.php @@ -7,7 +7,11 @@ require __DIR__ . '/../InterpolatedStringPart.php'; if (false) { - // For classmap-authoritative support. + /** + * For classmap-authoritative support. + * + * @deprecated use \PhpParser\Node\InterpolatedStringPart instead. + */ class EncapsedStringPart extends InterpolatedStringPart { } } diff --git a/lib/PhpParser/Node/Scalar/LNumber.php b/lib/PhpParser/Node/Scalar/LNumber.php index 0d1287105d..868d78f860 100644 --- a/lib/PhpParser/Node/Scalar/LNumber.php +++ b/lib/PhpParser/Node/Scalar/LNumber.php @@ -5,7 +5,11 @@ require __DIR__ . '/Int_.php'; if (false) { - // For classmap-authoritative support. + /** + * For classmap-authoritative support. + * + * @deprecated use \PhpParser\Node\Scalar\Int_ instead. + */ class LNumber extends Int_ { } } diff --git a/lib/PhpParser/Node/Stmt/DeclareDeclare.php b/lib/PhpParser/Node/Stmt/DeclareDeclare.php index 1a3c3616d4..c18613438f 100644 --- a/lib/PhpParser/Node/Stmt/DeclareDeclare.php +++ b/lib/PhpParser/Node/Stmt/DeclareDeclare.php @@ -7,7 +7,11 @@ require __DIR__ . '/../DeclareItem.php'; if (false) { - // For classmap-authoritative support. + /** + * For classmap-authoritative support. + * + * @deprecated use \PhpParser\Node\DeclareItem instead. + */ class DeclareDeclare extends DeclareItem { } } diff --git a/lib/PhpParser/Node/Stmt/PropertyProperty.php b/lib/PhpParser/Node/Stmt/PropertyProperty.php index fe7c99736b..62556e709a 100644 --- a/lib/PhpParser/Node/Stmt/PropertyProperty.php +++ b/lib/PhpParser/Node/Stmt/PropertyProperty.php @@ -7,7 +7,11 @@ require __DIR__ . '/../PropertyItem.php'; if (false) { - // For classmap-authoritative support. + /** + * For classmap-authoritative support. + * + * @deprecated use \PhpParser\Node\PropertyItem instead. + */ class PropertyProperty extends PropertyItem { } } diff --git a/lib/PhpParser/Node/Stmt/StaticVar.php b/lib/PhpParser/Node/Stmt/StaticVar.php index 6775b9597f..a3c5fa6e6f 100644 --- a/lib/PhpParser/Node/Stmt/StaticVar.php +++ b/lib/PhpParser/Node/Stmt/StaticVar.php @@ -5,7 +5,11 @@ require __DIR__ . '/../StaticVar.php'; if (false) { - // For classmap-authoritative support. + /** + * For classmap-authoritative support. + * + * @deprecated use \PhpParser\Node\StaticVar instead. + */ class StaticVar extends \PhpParser\Node\StaticVar { } } diff --git a/lib/PhpParser/Node/Stmt/UseUse.php b/lib/PhpParser/Node/Stmt/UseUse.php index b14fbd6ea1..9e504f8922 100644 --- a/lib/PhpParser/Node/Stmt/UseUse.php +++ b/lib/PhpParser/Node/Stmt/UseUse.php @@ -7,7 +7,11 @@ require __DIR__ . '/../UseItem.php'; if (false) { - // For classmap-authoritative support. + /** + * For classmap-authoritative support. + * + * @deprecated use \PhpParser\Node\UseItem instead. + */ class UseUse extends UseItem { } }