Closed netzhuffle closed 11 years ago
Great job! However it isn't as clean as I envisioned it - there is something in treating the Testify object as a hash that doesn't feel quite right.
But I agree that array access is shorter and more convenient. So as a compromise solution, I think about keeping $tf->data and using array access as an alternative.
So it would be the best to use Testify::data also for array access instead of a new Testify::storedData.
Hi @netzhuffle, I recently inherited the ownership of this project, and unfortunately, I don't feel like this feature really adds any value to the project. I agree with martin's comment that it does not feel right. I know it's been a long time since you submitted this and you might not even remember, but feel free to contribute any other ideas that you have for the project!
Implementing ArrayAccess to get a more intuitive way to store variables: $tf["calc"] = new MyCalc(10); $calc = $tf["calc"];
Instead of: $tf->data->calc = new MyCalc(10); $calc = $tf->data->calc;
$tf->data is still there for backward compatibility, but set to deprecated.