nipwaayoni / elastic-apm-php-agent

PHP Agent for Elastic APM
Other
28 stars 15 forks source link

Add agent class option to builder #55

Closed dstepe closed 4 years ago

dstepe commented 4 years ago

Closes #54

tsantos84 commented 4 years ago

Hi, I'm thinking if passing class name to agent builder is the best way to allow devs to create custom instances of the agent. A simple protected function newAgent(): Agent {} returning a new instance of the Agent in the agent builder allows devs to extend the builder and overwrite that method. In that way, the agent builder doesn't need to know agent's constructor signature.

dstepe commented 4 years ago

Ah yes, that does make sense. I was trying to get something out to support https://github.com/arkaitzgarro/elastic-apm-laravel converting to this package and went what came to mind. Extending the AgentBuilder as well would provide a more complete solution if changing the Agent constructor is best alternative. I can work on that.

Apologizes for not asking for a review before I merged this. This project has been pretty quiet for a while and I wanted to get this out quickly. Thanks for jumping in.

tsantos84 commented 4 years ago

Hi @dstepe, don't need to apologizes. Your work on this library has been amazing. 😉