-
Notifications
You must be signed in to change notification settings - Fork 2
Action template refactoring #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simply return RecordActionTemplate and remove templateName property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could name it as FileBasedActionTemplate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And named the other as CodeGenActionTemplate since it's using CodeGen package to generate Actions
OK 先把 CRUD 清掉,然後舊的 CRUD test 直接 drop 掉就好 |
src/ActionKit/ActionRunner.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
應該改成 registerAction 會比較好
…ionWithTemplate to registerAction
src/ActionKit/ActionGenerator.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use an UndefinedTemplateException ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class UndefinedTemplateException extends LogicException
src/ActionKit/ActionRunner.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
這個好像可以拿掉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should pass $this->className to str_replace, not cacheFile.
|
我整理了一下: d6a1172 因為 ActionGenerate->generate 得回傳 GeneratedAction, 因此 cache 機制可能還是在 Runner 做比較恰趟,在 generate 裡面做 require 的動作變得不夠清楚,所以我後來還是把 cache 搬出來了。 要做在 ActionGenerate 裡面好像也是可以,但可能會是另外一個 method,來做 generate + load 這兩件事情。 |
|
另外由於時間上來不及帶你做 rebase ,我先幫你把 changes 用 rebase 壓縮成一個 commit: 81e2a95 如果你如果要 pull changes,記得先 local 做 reset 到上一個 PR 的 commit,再做 pull: 再強制更新你的 GitHub repository |
|
另外 Exception 的地方需要分成 LogicException 跟 RuntimeException,我修改在這邊: cb806e0 |
No description provided.