aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/plugin-stub-generator/src
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/plugin-stub-generator/src')
-rw-r--r--scripts/plugin-stub-generator/src/Generator.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/plugin-stub-generator/src/Generator.php b/scripts/plugin-stub-generator/src/Generator.php
index 12967787..dd62da60 100644
--- a/scripts/plugin-stub-generator/src/Generator.php
+++ b/scripts/plugin-stub-generator/src/Generator.php
@@ -220,12 +220,11 @@ final class Generator
}
}
+ // Constants are compile-time data with no entity behind them, so the declaration is
+ // copied verbatim, visibility included: a local copy cannot diverge from the entity,
+ // and nothing that was unreadable in the real class becomes readable here.
$constants = [];
foreach ($class->getConstants() as $constant) {
- if (!$constant->isPublic()) {
- $this->errors[] = "$fqcn declares a non-public constant; materializing it is not supported";
- continue;
- }
$constants[] = $file->verbatim($constant->getStartLine(), $constant->getEndLine());
}