Namespaces and PSR-4 compliance
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- php
调研方向
检查练习的 README.md 文件和提议的 src 与 test 目录,然后检查将使用它们的测试自动化。将提议的 Exercism\Bob 和 ExercismTest\Bob 命名空间及文件布局与当前练习进行比较。当维护者就具体结构及其对自动化的影响达成一致时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
One of the points I am missing in the exercises of this track is the concept of namespaces (PSR-4 compatibility). Therefore, I would like to discuss and propose the following change.
Suggestion
Each exercise separates actual business logic from tests by having separate src and test directories. The README.md stays in the exercise's root folder. The example solution (and coming stub file) are going into src and the test file into test.
The terminating class name corresponds to a file name ending in .php. The file name MUST match the case of the terminating class name.
Since there is no definition for declaration of functions pertaining to the filename, two possible solutions are crossing my mind. Either name the file functions.php or exercise-name.php - both residing within the exercise's namespace. Here I am interested in suggestions, since I haven't used a file collecting various functions in years.
Example
Taking Bob as an example, this would result in the following structure:
/src→ namespaceExercism\BobBob.php(stub file)example.php(example solution)
/test→ namespaceExercismTest\BobBobTest.php
README.md
Looking for feedback
My intention is to provide an even greater learning experience for the student within a modern (meaning current) environment.
It would be great to get some feedback on the suggestion over all and possible side effects I might not have fully considered yet (like implications on test automation etc.). Thank you!
- 主要语言
- PHP
- 星标
- 167
- 派生
- 150
- 平均合并
- 1 天 18 小时
- 30 天内合并 PR
- 7
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
exercism/php 的其他 Issue
-
难度 5/5 一周以上 新手友好度 20/100
-
难度 5/5 一周以上 新手友好度 25/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
Discussion: Test generator design可能重新可做 @mk-mxp 于 372 天前认领,目前没有进行中的 PR。 未关闭
-
难度 5/5 一周以上 新手友好度 20/100
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 78/100
backdrop-contrib/commerce#60 ·
-
难度 1/5 1 小时以内 新手友好度 76/100
-
needs-triage Platform(Default)
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
Feature-Request
难度 2/5 1-3 小时 新手友好度 65/100
RSS-Bridge/rss-bridge#5123 ·
维护者通常 1 天内回复
-
[Store] RstLoader detects headings inside indented code blocks可能已有人在做 @lazerg 今天认领。 未关闭Bug Status: Needs Review Store
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复