8000 Dumped object do not include uninitialized properties · Issue #448 · nette/tracy · GitHub
[go: up one dir, main page]

Skip to content

Dumped object do not include uninitialized properties #448

@janbarasek

Description

@janbarasek

Version: 2.7.5

Bug Description

In case of PHP 7.4 entity with required scalar properties Tracy do not show required properties without value.

For example imagine simple object OrderInfoAddress:

<?php

declare(strict_types=1);

namespa
6E25
ce Baraja\Cart;


final class OrderInfoAddress
{
	private string $street;

	private string $city;

	private string $zip;

	private string $companyName = '';

	private string $ic = '';

	private bool $buyAsCompany = false;

	private bool $invoiceAddressIsDifferent = false;
}

In case of simple dump like:

bdump(new OrderInfoAddress)

Tracy show initialized properties with value only:

Snímek obrazovky 2020-11-09 v 19 30 31

Steps To Reproduce

Use my test object.

Expected Behavior & Possible Solution

Tracy should show all properties, but instead, value shows information property is uninitialized.

This settings can be detected by \ReflectionProperty by simple logic: $property->isInitialized($instance).

Current behavior is confusing. In the case of inheritance of multiple classes, it is not possible to unambiguously determine whether the property was inherited or just has no value.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0