Symfony 2 Configuration – Array of associative arrays

Few days ago I have struggled with a problem using Symfony2 configuration. I wanted to add the following kind of configuration to config.yml:

        - { hc_cba: 180 }
        - { cba_hc: -1 }

The problem was that the stuff under transitions is dynamic, so those hc_cba and cba_hc tags can be pretty much anything. After hitting many errors, I came to the solution:

                    ->then(function($values) {
                        $ret = array();
                        foreach ($values as $value) {
                            foreach ($value as $transition => $time) {
                                $ret[] = array('transition' => $transition, 'time' => e);
                        return $ret;

contacts & more