Phpstan fixes
What does this MR do?
Increase the phpstan static analysis tool check level to 2 (from 0, where 10 is most verbose) and fix all upcoming issues.
For a few cases, I was actually unable to "properly" fix because I didn't get the logic, so I just went around the problem (for example for a potentially undefined variable access in quizSomething I added the check and implemented the current PHP behaviour manually)
How confident are you it won't break things if deployed?
Pretty sure, as it is a bunch of super small fixes.
Checklist
-
added a test, or explain why one is not needed/possible... -
no unrelated changes -
asked someone for a code review -
joined #foodsharing-beta channel at https://slackin.yunity.org -
added an entry to CHANGELOG.md (description, merge request link, username(s)) -
Once your MR has been merged, you are responsible to update the #foodsharing-beta Slack channel about what has been changed here. They will test your work in different browsers, roles or other settings