protected function sort(array $assets)
    {
        array_walk(
            $assets,
            function (&$v, $k) {
                /** @var AssetInterface $v */
                $v = [$v->getPriority(), $k, $v];
            }
        );

        sort($assets);

        array_walk(
            $assets,
            function (&$v) {
                $v = $v[2];
            }
        );

        return $assets;
    }
protected function sort(array $assets)
    {
        array_walk(
            $assets,
            function (&$v, $k) {
                /** @var AssetInterface $v */
                $v = [$v->getPriority(), $k, $v];
            }
        );

        sort($assets);

        array_walk(
            $assets,
            function (&$v) {
                $v = $v[2];
            }
        );

        return $assets;
    }
protected function sort ( array $ assets ) { array_walk ( $ assets , function ( & $ v , $ k ) { /** @var AssetInterface $v */ $ v = [ $ v -> getPriority ( ) , $ k , $ v ] ; } ) ; sort ( $ assets ) ; array_walk ( $ assets , function ( & $ v ) { $ v = $ v [ 2 ] ; } ) ; return $ assets ; }
Do a Schwartzian Transform for stable sort.

@see http://en.wikipedia.org/wiki/Schwartzian_transform

@param AssetInterface[] $assets

@return AssetInterface[]
Do a Schwartzian Transform for stable sort .