Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion UPGRADE-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 2 additions & 0 deletions src/Instrument/ClassLoading/AopComposerLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ final class AopComposerLoader

/**
* Lazy-initialized filter for allowed files
*
* @var (Closure(string): bool)|null
*/
private ?Closure $isAllowedFilter = null;

Expand Down
4 changes: 2 additions & 2 deletions src/Proxy/Generator/TypeGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand Down
Loading