Fix bug where object with protected class attributes and public getters and setters is not being converted.

Whenever trying to read an object from an ORM, such as Doctrine, and protected attributes are used, the reading of their values fails, throwing an error. This is because the method property_exists is called, within the protected method subst, and it throws an error because it finds no public attributes. To avoid this issue, since public getters and setters are required when using protected class attributes, the first type of elements to be read should be public methods. This avoids this issue and that is what this patch does.