protected function parseCallbacks(array $callbacks)
    {
        foreach (array('before', 'after') as $position) {
            // Remove disabled callbacks
            foreach ($callbacks[$position] as $i => $callback) {
                if ($callback['disabled']) {
                    unset($callbacks[$position][$i]);
                }
            }

            // Order callbacks according to priority index
            uasort($callbacks[$position], function($a, $b) {
                if ($a['priority'] === $b['priority']) {
                    return 0;
                }
                return $a['priority'] < $b['priority'] ? -1 : 1;
            });
        }

        return $callbacks;
    }
protected function parseCallbacks(array $callbacks)
    {
        foreach (array('before', 'after') as $position) {
            // Remove disabled callbacks
            foreach ($callbacks[$position] as $i => $callback) {
                if ($callback['disabled']) {
                    unset($callbacks[$position][$i]);
                }
            }

            // Order callbacks according to priority index
            uasort($callbacks[$position], function($a, $b) {
                if ($a['priority'] === $b['priority']) {
                    return 0;
                }
                return $a['priority'] < $b['priority'] ? -1 : 1;
            });
        }

        return $callbacks;
    }
protected function parseCallbacks ( array $ callbacks ) { foreach ( array ( 'before' , 'after' ) as $ position ) { // Remove disabled callbacks foreach ( $ callbacks [ $ position ] as $ i => $ callback ) { if ( $ callback [ 'disabled' ] ) { unset ( $ callbacks [ $ position ] [ $ i ] ) ; } } // Order callbacks according to priority index uasort ( $ callbacks [ $ position ] , function ( $ a , $ b ) { if ( $ a [ 'priority' ] === $ b [ 'priority' ] ) { return 0 ; } return $ a [ 'priority' ] < $ b [ 'priority' ] ? - 1 : 1 ; } ) ; } return $ callbacks ; }
Allows the disabling of callbacks

@param array $callbacks

@return array
Allows the disabling of callbacks