Fix most PHP CodeSniffer warnings in includes/api