What would have been best of all would have been for the Arduino designers to provide a type to represent a pin number, so people could get into the habit of using the correct data type without having to think about what type was most appropriate. Unfortunately Arduino isn't into type safety.

I only provide help via the forum - please do not contact me for private consultancy.