Fix php strict standards bug, Code cleanup according to moodle codechecker