Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

sebastianbergmann
Copy link
Owner

Copy link

codecov bot commented Mar 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (cb81155) to head (f8faf8a).
Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

src/Exporter.php Outdated Show resolved Hide resolved
@staabm
Copy link
Contributor

staabm commented Mar 29, 2024

lgtm

src/Exporter.php Outdated Show resolved Hide resolved
@sebastianbergmann sebastianbergmann deleted the customizable-object-export branch March 31, 2024 06:52
$buffer = $this->defaultObjectExport($value, $processed, $indentation);
}

return $class . ' Object #' . spl_object_id($value) . ' (' . $buffer . ')';
Copy link
Contributor

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.

Copy link
Owner Author

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?

Copy link
Contributor

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

Copy link
Contributor

@staabm staabm Apr 4, 2024

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..?

Copy link
Owner Author

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.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BladeMF ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants