I have not yet tried OOP in PHP but, based on using OOP in C++, I offer these comments.
I am surprised to see the class “Converter
”. Within the “Room
” class I would have getImperialWidth()
and getImperialLength()
functions.
Have you considered having a “House
” class that contains a list of the room objects, perhaps together with other data such as detached/semii-detached/terraced? I think it may then be appropriate for your foreach
loop to be within a function of the “House
” class.