Use partial function application in the engine source once PHP 8.6 is the minimum
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
This is a blocked tracking issue, not a task to start: partial function application needs PHP 8.6 as the minimum version, and PHPStan and php-cs-fixer do not yet support it. The candidate sites are in src/Instrument/PathResolver.php, src/Aop/Pointcut/PointcutGrammar.php, src/Core/Container.php, src/Console/CommandLoader.php and src/Aop/Pointcut/ReturnTypePointcut.php. Done would mean the tooling supports 8.6 and the minimum version is raised, which is outside a first contribution.
由索引模型根据 Issue 内容生成。
描述
A tracking issue for using PFA in src/. It is blocked until the minimum PHP version is ^8.6 and the tooling supports the syntax.
Blockers (checked on 8.6.0RC2)
- PHPStan 2.3.4 crashes on any
?placeholder: "Internal error: ArgumentsHandler::matchArgParameter(): Argument #2 ($arg) must be of type PhpParser\Node\Arg, PhpParser\Node\ArgPlaceholder given". - php-cs-fixer 3.95 supports syntax only up to PHP 8.5.
composer.jsonrequiresphp: ^8.4.
Candidates (cosmetic only: no runtime gain, a PFA costs the same as a closure)
| Place | Today | With PFA |
|---|---|---|
src/Instrument/PathResolver.php:47 |
static fn(string $path) => self::realpath($path, $shouldCheckExistence) |
self::realpath(?, $shouldCheckExistence) |
src/Aop/Pointcut/PointcutGrammar.php:328 |
fn(int $group, ModifierPointcut $matcher) => self::addModifierGroup($matcher, $group) |
self::addModifierGroup(group: ?, matcher: ?) (named placeholders keep the written order) |
src/Core/Container.php:278 |
fn(): object => $factory($this) |
$factory($this, ...) (thunk) |
src/Console/CommandLoader.php:57 |
static fn(): Command => $instantiate($commandClass) |
$instantiate($commandClass, ...) |
src/Aop/Pointcut/ReturnTypePointcut.php:145 |
fn($a, $b) => $this->atomMatches($a, $b) |
$this->atomMatches(...): FCC, already possible today |
Must stay closures
src/Aop/Pointcut/PointcutGrammar.php:330:fn(int $group) => self::addModifierGroup(new ModifierPointcut(), $group). PFA evaluates its arguments when the closure is created, so every match would share oneModifierPointcutinstance.src/Aop/Framework/StaticTraitAliasMethodInvocation.php:75, theforward_static_call_array()shim. It is rebound withbindTo(null, $scope)to carry late static binding. A PFA closure can't be rebound to another scope ("Cannot rebind scope of closure created from function", returnsnull).- Closures that compose calls (
Enumerator.php:85,:150,:200) or call a method on a varying receiver (AndPointcut/OrPointcut). 8.6 has no placeholder for the object a method is called on.
Generated code
No change proposed. Proxies already use first-class callables ($this->mOriginalAlias(...), The::aspect(X::class)->m(...)), and PFA can't express an unbound method reference (see #796).
Part of #789.
- 主要语言
- PHP
- 星标
- 1.7k
- 派生
- 166
- 平均合并
- 1 天 1 小时
- 30 天内合并 PR
- 38
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
goaop/framework 的其他 Issue
-
Enhancement
难度 3/5 1-2 天 新手友好度 72/100
维护者通常 1 天内回复
-
cache:warmup:opcache runs out of memory with the default memory_limit (128M) on larger applications未关闭Bug
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
-
Bug To Be Discussed
难度 5/5 一周以上 新手友好度 28/100
维护者通常 1 天内回复
-
Bug
难度 4/5 1-2 天 新手友好度 56/100
维护者通常 1 天内回复
-
Bug
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 1 天内回复
相似的 Issue
-
enhancement priority Sales
难度 2/5 1-3 小时 新手友好度 78/100
novalo-dev/Prestashop-MCP-Server#201 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
Include flows spanning the full report time window可能已有人在做 @somethingwithproof 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 77/100
Cacti/plugin_flowview#306 ·
维护者通常 1 天内回复
-
bug origin: upstream priority: low
难度 2/5 1-3 小时 新手友好度 78/100
mattytap/Mattytap-Sermons#105 ·
-
priority:low type:bug
难度 2/5 1-3 小时 新手友好度 82/100
crazy-goat/workerman-bundle#1189 ·
维护者通常 1 天内回复