Hi
I am using Timber with php v7
After update timber to v1.2.1 twig updated to version ^2.0 from ^1.0
Argument 1 passed to Twig_Filter::__construct() must be an instance of string, string given, called in wp-content/plugins/timber-library/lib/Twig.php on line 40 and defined in /vendor/twig/twig/lib/Twig/Filter.php on line 35
When I remove string declaration I get another error
Argument 1 passed to Twig_Environment::addFunction() must be an instance of Twig_Function, instance of Twig_SimpleFunction given, ...
etc.
I think it's something with php V7 and scalars. Is this problem of Timber or it's Twig problem?
WordPress 4.7.1, PHP 7.0.14, Timber 1.2.1
Timber installed via Composer
Thanks
@ogrosko this looks to be Timber's problem with how this line is handled...
$twig->addFilter(new \Twig_SimpleFilter('resize', array('Timber\ImageHelper', 'resize')));
... based on some reading it seems that at least one of those strings should be a string instance. This is where I get lost (also I'm not able to re-create the error) — is this something you could help isolate and debug @ogrosko?
@ogrosko Just add composer dependency for Twig 1 and everything should be working again.
@mahagr Temporary I solve the problem like you wrote
@jarednova I'll check that
Closed by #1359
Most helpful comment
@ogrosko Just add composer dependency for Twig 1 and everything should be working again.