I recently started using a package called prophecy
which is a mocking library for PHP.
I was intrigued by the way the library was designed and how it was able to return the same object but with a different interface.
This made me think about how I could use this in my own code.
I decided to create a simple example of how this could be done.
I wanted to create an object that could be modified and then returned as a readonly object.