New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make export of objects customizable #56
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #56 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 49 60 +11
===========================================
Files 1 2 +1
Lines 159 179 +20
===========================================
+ Hits 159 179 +20 ☔ View full report in Codecov by Sentry. |
794322c
to
ac6d770
Compare
lgtm |
db75879
to
af726e4
Compare
27502d4
to
a05140e
Compare
$buffer = $this->defaultObjectExport($value, $processed, $indentation); | ||
} | ||
|
||
return $class . ' Object #' . spl_object_id($value) . ' (' . $buffer . ')'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more thing I just noticed.
the $class . ' Object #'
prefix will only be present in "root objects". in custom object exporters this $class . ' Object #'
format needs to be replicated, even if the custom exporter delegates export back to the built-in one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we deal with that in Exporter::exportObject()
or should we trust implementors of custom object exporters to do the right thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a way how Exporter::exportObject()
could do that in a way which would even work when custom exporters would delegate exporting of some stuff back to the exporter object.
Maybe we just need a test-case so we can see whether it works already or what a custom ObjectExporter needs todo to get it right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the problem would be less theoretic if we try to implement a real world exporter
Maybe @BladeMF could try his use-case..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that ... and would rather not make a release without this feature having been validated through real world use cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BladeMF ping
Follows sebastianbergmann/phpunit#5773 (comment).