philkra / elastic-apm-php-agent

PHP Agent for Elastic APM
MIT License
285 stars 95 forks source link

Return value of PhilKra\Events\EventBean::getTimestamp() must be of the type integer, float returned #139

Closed pgross41 closed 4 years ago

pgross41 commented 4 years ago

I am trying v7.0.0-rc.3 and getting the following error:

PHP Fatal error: Uncaught TypeError: Return value of PhilKra\Events\EventBean::getTimestamp() must be of the type integer, float returned in /C:/git/web/dragondrop/knowledge/vendor/philkra/elastic-apm-php-agent/src/Events/EventBean.php on line 172

The return type of getTimestamp is int: https://github.com/philkra/elastic-apm-php-agent/blob/7.0.0-rc3/src/Events/EventBean.php#L170-L173

But when it's assigned it's using microtime(true) which returns a float: https://github.com/philkra/elastic-apm-php-agent/blob/7.0.0-rc3/src/Events/EventBean.php#L97

I believe the return type just needs to be changed, I will test and submit a PR.

dstepe commented 4 years ago

I believe this was fixed in the new project:

https://github.com/nipwaayoni/elastic-apm-php-agent/issues/19