- Issue created by @porchlight
Ran into an issue...user wants to put a timestamp in their body text like [12:57] - this is being seen as a token by smart_trim and all other modules that look for tokens, but long story short my error:
"smart_trim_tokens(): Argument #1 ($type) must be of type string, int given"
I went to that function which is using HOOK_tokens and see the $type is expecting a string, but if I look at the core HOOK_tokens, the $type argument is not hinted. If we remove this hint, my error goes away. All other contrib modules I looked at are not type-hinting this argument either, so I say we follow the core example which is:
function hook_tokens($type, $tokens, array $data, array $options, \Drupal\Core\Render\BubbleableMetadata $bubbleable_metadata) {}
Looks like smart_trim is hinting the $tokens argument as well, so we could remove that as well.
Active
2.2
Code