ReeceM / mocker

Dynamic PHP object, useful for mocking objects in faking and tests
MIT License
7 stars 3 forks source link

Objects with values stored don't return the whole array #5

Open ReeceM opened 5 years ago

ReeceM commented 5 years ago

When a object is assigned to a value e.g.:

$mocked->value['sub_value'] = 'stripes'

echo $mocked->value;
// returns 
// mocked->value

What would be nicer is that when the value is called with __toString() which triggers that reaction of printing a formatted

[
    "sub_value" => 'stripes'
]

or if the values is just called by the magic __get it should return the value as a php array type, instead of assuming that it may be calling another dynamically generated value.

ReeceM commented 4 years ago

Actually this was fixed by #15 ... the toString returns the JSON array, can make it be JSON_PRETTY 😝 lol, but still this >

or if the values is just called by the magic __get it should return the value as a php array type, instead of assuming that it may be calling another dynamically generated value.

is an issue