query-monitor icon indicating copy to clipboard operation
query-monitor copied to clipboard

Introduce classes for collector data

Open johnbillion opened this issue 3 years ago • 0 comments

Collectors currently store their data in an array (the $data property) which is not an efficient use of memory because the arrays get copied each time they're passed between methods.

Let's switch the data to a proper class with a property for each element of data. This gives us increased type safety too with PHPStan analysis, which is a blocker for #483.

Third party extensions can read and write to this data so the data class needs to implement ArrayAccess to avoid breakage.

johnbillion avatar Apr 22 '22 19:04 johnbillion