Enhancement: fall back to `.php-version` and `.tool-versions` for the PHP runtime
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 86/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- php, typescript
- 领域
- cli
调研方向
从 src/core-open/scanners/php-scanner.ts 中的 parseComposerJson 和 test/php-config-platform-runtime.test.ts 中的测试开始。追踪 Composer 运行时值的选择方式,然后为 issue 中描述的 pin 文件优先级、token 解析、注释、空行和不可读文件补充测试覆盖。验收用例通过,并且缺少或无法读取的 pin 文件不会导致扫描失败时,即为完成。
由索引模型根据 Issue 内容生成。
描述
- Difficulty: small
- Area: PHP scanner
Problem
parseComposerJson in src/core-open/scanners/php-scanner.ts (around lines 102–107) takes the PHP runtime only from require.php, then config.platform.php (#647). A project that pins the interpreter with phpenv or asdf, and does not declare those Composer keys, reports no runtime:
# .php-version
8.3.12
# .tool-versions
php 8.3.12
Expected behaviour
When require.php and config.platform.php are both absent, read .php-version in the same directory as composer.json, then .tool-versions. Use the first version token (8.3, 8.3.12; drop a leading v). Skip system and other non-version tokens. require.php still wins over config.platform.php, which still wins over the pin files. .php-version wins over .tool-versions. A missing or unreadable pin file never fails the scan.
Acceptance
- Add tests next to
test/php-config-platform-runtime.test.ts. - Cases: only
.php-version; only.tool-versions(php 8.3.12); both (.php-versionwins);require.phppresent (Composer wins);config.platform.phppresent and norequire.php(platform wins); asystementry yields no runtime; comments and blank lines are ignored.
- 主要语言
- TypeScript
- 星标
- 4
- 派生
- 3
- 平均合并
- 1 天 22 小时
- 30 天内合并 PR
- 76
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
vibgrate/cli 的其他 Issue
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
相似的 Issue
-
documentation Entwickler
难度 1/5 1 小时以内 新手友好度 89/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
area:frontend bug ci-test level:low priority:high
难度 2/5 1-3 小时 新手友好度 75/100
skytuhua-org/Gen-V1#2974 · 4 条评论 ·
维护者通常 2 天内回复
-
area: cli area: core priority: P3 type: bug
难度 2/5 1-3 小时 新手友好度 75/100
appandflow/stim#6736 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
naomiaro/waveform-playlist#973 ·
维护者通常 1 天内回复