src/Serializer/OrderedSerializer.php
private function order(array $data)
    {
        $filteredData = $this->filterOrderable($data);

        if (!empty($filteredData)) {
            uasort(
                $filteredData,
                function (OrderedNormalizerInterface $a, OrderedNormalizerInterface $b) {
                    return $a->getOrder() > $b->getOrder();
                }
            );

            return array_merge($filteredData, array_diff_key($data, $filteredData));
        }

        return $data;
    }
private function order(array $data)
    {
        $filteredData = $this->filterOrderable($data);

        if (!empty($filteredData)) {
            uasort(
                $filteredData,
                function (OrderedNormalizerInterface $a, OrderedNormalizerInterface $b) {
                    return $a->getOrder() > $b->getOrder();
                }
            );

            return array_merge($filteredData, array_diff_key($data, $filteredData));
        }

        return $data;
    }
private function order ( array $ data ) { $ filteredData = $ this -> filterOrderable ( $ data ) ; if ( ! empty ( $ filteredData ) ) { uasort ( $ filteredData , function ( OrderedNormalizerInterface $ a , OrderedNormalizerInterface $ b ) { return $ a -> getOrder ( ) > $ b -> getOrder ( ) ; } ) ; return array_merge ( $ filteredData , array_diff_key ( $ data , $ filteredData ) ) ; } return $ data ; }
Orders objects if can be done.

@param array $data Data to order.

@return array
Orders objects if can be done .