From 72bc7f8d95355ebb6062039c1b59af804e50abcf Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 17:53:52 +0000 Subject: [PATCH 1/2] build: require goaop/parser-reflection ^4.0.2 || ^5.0.2 The 4.0.2 and 5.0.2 releases stop reading the pseudo file of classes declared by eval() (no more file_get_contents() warning when such a class is the parent of a woven class) and document the return types of the node visitors, which Symfony's DebugClassLoader reported as deprecations in debug mode. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FxhC1DaSZY1jAz2XfyjhPa --- CHANGELOG.md | 2 +- UPGRADE-4.0.md | 2 +- composer.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20cda91b..e5da830f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ See [UPGRADE-4.0.md](UPGRADE-4.0.md) for the migration guide. **Requirements** * [BC BREAK] Requires PHP 8.4+ -* [BC BREAK] **Dependencies** — `ext-tokenizer`, `goaop/parser-reflection` ^4.0.1 || ^5.0.1, `goaop/dissect` ^4.0, `psr/container` ^1.1 || ^2.0 and `symfony/finder` ^7.4 || ^8.0. `nikic/php-parser` 5 comes through parser-reflection and is no longer required directly. `symfony/console` ^7.4 || ^8.0 is needed for the `bin/aspect` tool. +* [BC BREAK] **Dependencies** — `ext-tokenizer`, `goaop/parser-reflection` ^4.0.2 || ^5.0.2, `goaop/dissect` ^4.0, `psr/container` ^1.1 || ^2.0 and `symfony/finder` ^7.4 || ^8.0. `nikic/php-parser` 5 comes through parser-reflection and is no longer required directly. `symfony/console` ^7.4 || ^8.0 is needed for the `bin/aspect` tool. **Added** * [Feature] **First-class callable advices** — the main way advices are now wired into woven code. Generated proxies declare each aspect-method advice as `Interceptor::before(The::aspect(MonitorAspect::class)->beforeMethodExecution(...))` — an eager first-class callable, since the interceptor list is only built while the intercepted method or hook is already executing (`LazyAdvisorAccessor` is removed). Compiled advisor cache files use the same facade in its lazy static-data form, e.g. `Interceptor::before(MonitorAspect::class, 'beforeMethodExecution')`, which returns a native PHP lazy proxy: interceptor construction, aspect resolution from the container and advice callable creation are all deferred until the advice is actually used, so cached advices whose pointcut never matches never instantiate their aspect. Advices registered in the container as plain closures (not aspect methods) are resolved through the new `The::advice('advisorId')` accessor, which unwraps `Advisor` and interceptor values down to the raw advice closure. diff --git a/UPGRADE-4.0.md b/UPGRADE-4.0.md index 7bad58a0..f1911ac3 100644 --- a/UPGRADE-4.0.md +++ b/UPGRADE-4.0.md @@ -20,7 +20,7 @@ Requirements ------------ - PHP 8.4+ with `ext-tokenizer`. -- `goaop/parser-reflection` ^4.0.1 || ^5.0.1, `goaop/dissect` ^4.0, `symfony/finder` ^7.4 || ^8.0, +- `goaop/parser-reflection` ^4.0.2 || ^5.0.2, `goaop/dissect` ^4.0, `symfony/finder` ^7.4 || ^8.0, `psr/container` ^1.1 || ^2.0. `nikic/php-parser` 5 is installed through parser-reflection. - `laminas/laminas-code` is no longer used: proxies are generated by the internal diff --git a/composer.json b/composer.json index 1644d0ec..b172e859 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "php": "^8.4.0", "ext-tokenizer": "*", "goaop/dissect": "^4.0", - "goaop/parser-reflection": "^4.0.1 || ^5.0.1", + "goaop/parser-reflection": "^4.0.2 || ^5.0.2", "psr/container": "^1.1 || ^2.0", "symfony/finder": "^7.4 || ^8.0" }, From 7fd84e412e4404b06ede33e4992fe6d755f71bf1 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 17:57:23 +0000 Subject: [PATCH 2/2] fix(phpstan): give the strict boolean rules the types they need phpstan-strict-rules 2.1 reports the result of the path filter closure and of ReflectionNamedType::isSelf()/isParent() behind method_exists() as mixed in a boolean context. The filter property documents its closure signature, and the PHP 8.5 methods are compared with true. The CI cache had hidden this: a fresh install of the dependencies fails PHPStan on master as well. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FxhC1DaSZY1jAz2XfyjhPa --- src/Instrument/ClassLoading/AopComposerLoader.php | 2 ++ src/Proxy/Generator/TypeGenerator.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Instrument/ClassLoading/AopComposerLoader.php b/src/Instrument/ClassLoading/AopComposerLoader.php index 72260a15..f8d16188 100644 --- a/src/Instrument/ClassLoading/AopComposerLoader.php +++ b/src/Instrument/ClassLoading/AopComposerLoader.php @@ -60,6 +60,8 @@ final class AopComposerLoader /** * Lazy-initialized filter for allowed files + * + * @var (Closure(string): bool)|null */ private ?Closure $isAllowedFilter = null; diff --git a/src/Proxy/Generator/TypeGenerator.php b/src/Proxy/Generator/TypeGenerator.php index 70a41961..afdd5d7a 100644 --- a/src/Proxy/Generator/TypeGenerator.php +++ b/src/Proxy/Generator/TypeGenerator.php @@ -121,10 +121,10 @@ public function generate(): string public static function resolveReflectionNamedTypeName(ReflectionNamedType $type): string { // PHP 8.5 added isSelf()/isParent() and changed getName() to return the resolved class name. - if (method_exists($type, 'isSelf') && $type->isSelf()) { + if (method_exists($type, 'isSelf') && $type->isSelf() === true) { return 'self'; } - if (method_exists($type, 'isParent') && $type->isParent()) { + if (method_exists($type, 'isParent') && $type->isParent() === true) { return 'parent'; }