XaminProject / handlebars.php

Handlebars processor for php
331 stars 134 forks source link

Added fix for non-string values #119

Closed Zemistr closed 9 years ago

Zemistr commented 9 years ago

This works too with classes with method __toString.

JustBlackBird commented 9 years ago

It's not a big deal but as for me

return (string)$value;

is more readable than

return "$value";

Also you should add test cases which need type casting.

Zemistr commented 9 years ago

Ok...sooo...better way is:

array_unshift($args, (string)$value); and return (string)$value; ?

JustBlackBird commented 9 years ago

Yes, I think so.

Zemistr commented 9 years ago

Ok, I can change the Pull Request :)

Zemistr commented 9 years ago

Done ;)

fzerorubigd commented 9 years ago

Could you please add a test case for this? a class with __toString() method as a context variable.

Thank you!

JustBlackBird commented 9 years ago

@fzerorubigd is right, we're still waiting a test case...