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

Information dense entity dumper #5716

Merged
merged 1 commit into from
Jul 24, 2023
Merged

Conversation

chx
Copy link
Contributor

@chx chx commented Jul 24, 2023

Now that we can load entities fast, we should have useful information after loading them.

This PR

  1. Shows the field types
  2. Shows how many values currently there are if more than one
  3. Shows as much information as possible on a single line. See the hide_translation field below for a demo of the first three.
  4. Shows entity references with an executable snippet: User::load(123) shows a reference to user 123. It's very easy to load it, this way. Yes, Paragraph::loadRevision() is not a thing yet but just wait. It still tells the story in a very compact way. It doesn't do this for config entities to avoid NodeType::load() for node types. Perhaps it could for config entities which do not have a bundleOf annotation. Alas, this PR is written with one particular consumer in mind (me) and I didn't need this one. There's always the next PR.

2023-07-19 09 47 31 (1)

2023-07-19 10 19 54 (1)

@chx chx requested a review from damiankloip as a code owner July 24, 2023 09:18
@chx chx force-pushed the entity-formatter branch 3 times, most recently from 4990055 to 2f6a7ef Compare July 24, 2023 09:37
Copy link
Member

@weitzman weitzman left a comment

Choose a reason for hiding this comment

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

LGTM. Just one feedback.

src/Psysh/Caster.php Outdated Show resolved Hide resolved
@weitzman weitzman merged commit 47377de into drush-ops:12.x Jul 24, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants