public function sort($sort = null)
    {
        if ($sort !== null && ! is_int($sort)) {
            throw new \InvalidArgumentException(
                'Invalid sort type. Sort type must ne integer.',
                E_USER_ERROR
            );
        }

        return $sort === null
            ? sort($this->storedData)
            : sort($this->storedData, $sort);
    }
public function sort($sort = null)
    {
        if ($sort !== null && ! is_int($sort)) {
            throw new \InvalidArgumentException(
                'Invalid sort type. Sort type must ne integer.',
                E_USER_ERROR
            );
        }

        return $sort === null
            ? sort($this->storedData)
            : sort($this->storedData, $sort);
    }
public function sort ( $ sort = null ) { if ( $ sort !== null && ! is_int ( $ sort ) ) { throw new \ InvalidArgumentException ( 'Invalid sort type. Sort type must ne integer.' , E_USER_ERROR ) ; } return $ sort === null ? sort ( $ this -> storedData ) : sort ( $ this -> storedData , $ sort ) ; }
Sort an array collection

@param null|int $sort
@return bool
@throws \InvalidArgumentException
Sort an array collection