aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/plugin-class-classifier/src/ParamInfo.php
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-21 02:54:18 +0900
committernsfisis <nsfisis@gmail.com>2026-07-23 22:07:16 +0900
commit765b7749d31675d3cbf541b146ead1aafd6d6ae9 (patch)
tree11f8a07cd9e3d4ef92bb2f75a0811e41b1d928ba /scripts/plugin-class-classifier/src/ParamInfo.php
parent770013c7097b6b5c0c49c7fa46d9235c308c4ad5 (diff)
downloadphp-shirabe-765b7749d31675d3cbf541b146ead1aafd6d6ae9.tar.gz
php-shirabe-765b7749d31675d3cbf541b146ead1aafd6d6ae9.tar.zst
php-shirabe-765b7749d31675d3cbf541b146ead1aafd6d6ae9.zip
feat(plugin-class-classifier): add deterministic plugin-boundary classifier
Decides, for every composer/composer class, how it is treated at the plugin boundary (rust-proxy / rust-snapshot / contract / two-world / php-native / unsupported) so that upstream updates re-classify new or rewritten classes without re-deriving the design by hand. Rules and category definitions live in docs/dev/plugin-class-classification.md; the tool (PHP + nikic/PHP-Parser) implements them as a reachability closure with direction marks, per-method pure/mutator analysis, and a leaf-first fixed point for unreachable classes, with three small versioned exception lists. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'scripts/plugin-class-classifier/src/ParamInfo.php')
-rw-r--r--scripts/plugin-class-classifier/src/ParamInfo.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/plugin-class-classifier/src/ParamInfo.php b/scripts/plugin-class-classifier/src/ParamInfo.php
new file mode 100644
index 00000000..3caaa07f
--- /dev/null
+++ b/scripts/plugin-class-classifier/src/ParamInfo.php
@@ -0,0 +1,24 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Shirabe\PluginClassifier;
+
+final class ParamInfo
+{
+ public function __construct(
+ public readonly string $name,
+ public readonly bool $byRef,
+ public readonly bool $variadic,
+ /** Class-like FQCNs in the native type. @var list<string> */
+ public readonly array $classTypes,
+ /** Native type is array/iterable/mixed/object or absent. */
+ public readonly bool $expandable,
+ /** Class-like FQCNs from the `@param` docblock. @var list<string> */
+ public readonly array $docblockTypes,
+ /** Native type mentions callable or \Closure: the value is a
+ * callback that needs a handle across the boundary. */
+ public readonly bool $callable = false,
+ ) {
+ }
+}