debesha / DoctrineProfileExtraBundle

Bundle to get information about doctrine hydration performance
MIT License
123 stars 16 forks source link

"Cannot use a scalar value as an array" at HydrationLogger #13

Closed svitiashchuk closed 5 months ago

svitiashchuk commented 5 years ago

Hi! There are a problem with one line of code in version 1.3.0

HydrationLogger class has a public field $hydrations and it's type is defined as an array. In HydrationDataCollector class, value of this field is set to integer 0.

So next call of method start($type) of HydrationLogger class will cause a warning "Cannot use a scalar value as an array", because of this line of code:

$this->hydrations[++$this->currentHydration]['type'] = $type;

I think, this can be fixed with changing the

$this->hydrationLogger->hydrations = 0;

to

$this->hydrationLogger->hydrations = [];

in HydrationDataCollector class method reset.

Best regards!

gam6itko commented 5 years ago

bump @debesha

debesha commented 5 years ago

Would you guys prepare a pull request?

kshtompel commented 2 years ago

@debesha PR prepared https://github.com/debesha/DoctrineProfileExtraBundle/pull/16

kshtompel commented 2 years ago

@debesha can you publish new tag 1.3.3 please

debesha commented 2 years ago

Done

shakaran commented 5 months ago

@debesha this issue could be marked as fixed and closed?