Skip to content

Commit

Permalink
bug #36447 Remove return type for Twig function workflow_metadata() (…
Browse files Browse the repository at this point in the history
…gisostallenberg)

This PR was merged into the 4.4 branch.

Discussion
----------

Remove return type for Twig function workflow_metadata()

Technically it is allowed to have metadata other than string, even data that does not cast to string, like an array.

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36391
| License       | MIT
| Doc PR        | n/a

The workflow metadata store can contain not only strings, but setting nested metadata results in an error when workflow_metadata() is used in Twig.
Also see #36391

Commits
-------

55664c5 Remove return type for Twig function workflow_metadata()
  • Loading branch information
fabpot committed Apr 15, 2020
2 parents efb0dee + 55664c5 commit 39a7ee1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Twig/Extension/WorkflowExtension.php
Expand Up @@ -117,7 +117,7 @@ public function getMarkedPlaces($subject, $placesNameOnly = true, $name = null)
* Use a string (the place name) to get place metadata
* Use a Transition instance to get transition metadata
*/
public function getMetadata($subject, string $key, $metadataSubject = null, string $name = null): ?string
public function getMetadata($subject, string $key, $metadataSubject = null, string $name = null)
{
return $this
->workflowRegistry
Expand Down

0 comments on commit 39a7ee1

Please sign in to comment.