Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mentioned in another ticket that I had a few minor improvements to submit. All of these were found with PhpStorm, which I have been using for another project (normally use Eclipse). Simply downloaded a copy with my apache e-mail (free 🎉 ), imported the project, and then did an "Inspect Code".
I think it will be easier to review each commit, as I tried to group the enhancements as they appeared in PhpStorm.
Some other interesting entries not included in this commit as I think it would require further analysis:
\.
in JS regextitle
, you will see that it first is set tordfs:label
, and then set again in the array todct:title
(@osma not in this commit, as I am not sure which one is correct)return $this->returnError(....)
, but actually, the returnError does not return. It sets headers and echoes. I think PHP stops the code execution and returns too, being lenient here. But it could change in the future. Will put another ticket for it somedayIf we started using a bit more of type setting (e.g.
function blabla(): bool
, also phpdocs annotations, and those nice@var $ret array
, etc) I think we could spot more probable bugs, and make the code simpler. I am working with a senior symfony guy, who is teaching me a few more tricks while helping on a project he recently set up. Might come back later with a few more ideas later :-) 🏃♂️