lib/ServiceDescriptionLoader.php
private function nest($value, $path)
    {
        if ($path) {
            $elements = explode('/', $path);

            foreach (array_reverse($elements) as $element) {
                $value = array($element => $value);
            }
        }

        return $value;
    }
private function nest($value, $path)
    {
        if ($path) {
            $elements = explode('/', $path);

            foreach (array_reverse($elements) as $element) {
                $value = array($element => $value);
            }
        }

        return $value;
    }
private function nest ( $ value , $ path ) { if ( $ path ) { $ elements = explode ( '/' , $ path ) ; foreach ( array_reverse ( $ elements ) as $ element ) { $ value = array ( $ element => $ value ) ; } } return $ value ; }
Nests an array under a particular path

As an example:

nest(array('foo' => 'bar'), 'baz/qux')

This will return:

array(
'baz' => array(
'qux' => array(
'foo' => 'bar'
)
)
)

@param mixed  $value The value to put at the given path
@param string $path  The slash-separated path to put the value

@return array
Nests an array under a particular path