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

Add __debugInfo() to managers #25

Open
Firehed opened this issue Jun 17, 2021 · 0 comments
Open

Add __debugInfo() to managers #25

Firehed opened this issue Jun 17, 2021 · 0 comments

Comments

@Firehed
Copy link
Owner

Firehed commented Jun 17, 2021

A couple of the properties can contain enormous amounts of data that's unhelpful for debugging. Adding this magic method can trim that down pretty significantly.

Locally I found the following decent on balance:

InMemoryEntityManager:

    public function __debugInfo(): array
    {
        return [
            'repos' => $this->repos,
            'needIds' => $this->needIds,
            'pendingDeletes' => $this->pendingDeletes,
            'onFlushCallbacks' => sprintf('(%d functions)', count($this->onFlushCallbacks)),
        ];
    }

InMemoryRepository:

    public function __debugInfo(): array
    {
        return [
            'className' => $this->className,
            'idField' => $this->idField,
            'idType' => $this->idType,
            'isIdGenerated' => $this->isIdGenerated,
            'managedEntities' => $this->managedEntities,
        ];
    }
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

No branches or pull requests

1 participant