Skip to content

Commit

Permalink
Update blog
Browse files Browse the repository at this point in the history
  • Loading branch information
Iain Cambridge committed Jan 22, 2024
1 parent f0b56fb commit 7f97403
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion content/posts/creating-dynamic-workflows-with-symfony.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,30 @@ It fetches the places for the workflow from the PlacesProvider which returns the

### Building the Transitions

The transitions are built by using
The transitions are built by using

```php
/**
* @param PlaceInterface[] $places
*
* @return Transition[]
*/
private function getTransitions(array $places): array
{
$output = [];
$from = null;
foreach ($places as $place) {
if ($from instanceof PlaceInterface) {
$output[] = new Transition(
$place->getToTransitionName(),
$from->getName(),
$place->getName(),
);
}

$from = $place;
}

return $output;
}
```

0 comments on commit 7f97403

Please sign in to comment.