xyNNN / GoogleTagManagerBundle

Google Tag Manager Bundle for Symfony 2
https://github.com/xyNNN/GoogleTagManagerBundle
GNU Lesser General Public License v3.0
27 stars 15 forks source link

Make getRenderedTemplate always return a string (not bool) #27

Closed stefandoorn closed 6 years ago

stefandoorn commented 6 years ago

To make it compatible with the return type specified in the phpdoc and the phpdoc of the methods using this method.

xyNNN commented 6 years ago

I would prefer to modify the return type to string|null and to return null if the helper is not enabled. What do you think about it?

stefandoorn commented 6 years ago

Checked your suggestion. Issue is that further in the code (e.g. in GoogleTagManagerListener) the results are simply treated as if strings. That would also require rewriting then. Basically it's now weird to use get 'false' returned, looking at the replacements done in GoogleTagManagerListener::onKernelResponse & the extensions we can use inside the templates. The easy 'improvement' is simply returning a string always I think. In further versions we might need to improve this anyway when we go for 7.1 and return types.