PHP type casting
Correct order of property declaration
Correct type declarations
Merge pull request #5766 from mongosoft/feature

Code style fixes