PHP type casting
Use elseif instead of else if
Correct order of property declaration
Correct type declarations
Merge pull request #5766 from mongosoft/feature

Code style fixes