-
-
Notifications
You must be signed in to change notification settings - Fork 340
Refactor/error handling #848
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
…lidArgumentException
|
It mostly looks good, but I don't quite understand the point of the AttributeMapper yet. |
Because attribute parsing requires pre-loading, and Doctor and Extension use it, I use it simply to put the attribute loader into a single file for easier debugging. To reduce code size and optimize the structure, in 3.0 I plan to use attributes for library declarations as well. Of course this has no real impact on functionality, it's just for future refactoring and vendor mode loading unification. Although it is possible to directly use reflection each time a attr is used, it also requires a util class to implement it. |
What does this PR do?
Closes #625
This PR is extremely huge, but actually haven't changed any function of building. To sum up, I divided changes into several commits, recommends that reviewing by commits.
Description of major commits:
Remove all @throws PHPDoc, it's almost useless for SPC anymore: Don't need to review, it just removed all@throwstag from code.Refactor all exception classes, remove unclear RuntimeException, InvalidArgumentException: changes all exception classes inSPC\exceptionnamespace.Refactor shell utilities: reorganize namespaces and introduce Shell base class: Make WindowsCmd and UnixShell both extends Shell, which contains several shared methods.Introduce AttributeMapper for managing extensions and doctor attributes: Prepare for 3.0, make attribute loading functions into dedicated class.Refactor all (except command) modules using new exceptions: This may be quite complicated. Generally speaking, it replaces all Exception class names except those in the command class with the new class name.Refactor all command class exception handling: Refactor all command exception handler.Remove craft.log: After introducinglog/, we don't needcraft.loganymore.Chore: Some code cleaning up.Checklist before merging
*.phpor*.json, run them locally to ensure your changes are valid:composer cs-fixcomposer analysecomposer testbin/spc dev:sort-configsrc/globals/test-extensions.php.extension testortest extensionsto trigger full test suite.