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
Add check for max length of strings, reduce classes size #251
Conversation
The diff is huge mostly because of the phpDOC cleanup and code movements. Some notes to make review a little easier:
|
Regarding this bug ("attach to bugzilla" not selecting the locale component): it's actually true, and I don't think it ever worked after the initial refactor (I tracked back the current link, which used to be called To fix it I'm including the Bugzilla class from Webdashboard, so that we can create locale names like "id / Indonesian". Not sure if there are better ways to do this, since this forces us to keep the class in sync between projects. Also kept this change in its own commit for now. |
Maybe we should maintain a separate repo for the libs we use across projects and include them via composer, I checked Composer documentation and it seems possible to include packages from repositories not registered in Packagist. |
Definitely worth it (probably not in this PR). We now have a Bugzilla class across langchecker+webdashboard, we could probably build a class for generic string related functions, we already have Json (in completely different statuses) in Transvision+langchecker+webdashboard. |
Did some tests and it's indeed not too difficult to do, but I think it's easier to discuss it in a different PR |
Tested locally, works fine, r+ with nits |
**LangManager** * Extract MAX_LENGTH from lang files * Move ['python_vars'] to ['errors']['python'] to support more types of errors * Add function countErrors * Move functions for .po files into a new class * Move error checks in separate functions (python, length) **Utils** * starsWith: accept array of strings as needle * Use mb_strlen instead of strlen, add getLength **GetTextManager** * Functions to manage .po files originally in LangManager **Views** Expose number of errors in JSON, display errors in listsitesperlocale and errors view **Bugzilla** * Include Bugzilla class from Webdashboard and fix 'attach to this bug issue'. Add basic testing. Clean up phpDOC syntax in classes.
Thanks. Fixed nits and squashed, I'll wait for the webdashboard's one to merge. |
Actually leaving the merge to you since this requires a |
Add check for max length of strings, reduce classes size
LangManager
Utils
GetTextManager
Views
Expose number of errors in JSON, display errors in listsitesperlocale and errors view
Clean up phpDOC syntax in all classes.