private function applyFilters()
    {
        // Only apply filters if this is mutable.
        if ($this->isImmutable) {
            return;
        }

        // Reset to original items before filtering.
        $this->exchangeArray($this->originalItems);

        // Apply filter to items.
        if (count($this->filters) > 0) {
            $filtered_array = array_filter(
                $this->getArrayCopy(),
                function ($item) {
                    foreach ($this->filters as $callback) {
                        if (call_user_func($callback, $item) === true) {
                            return true;
                        }
                    }
                    return false;
                }
            );
            $this->exchangeArray(array_values($filtered_array));
        }

        // Filter nested items.
        foreach ($this->getArrayCopy() as $item) {
            if ($item instanceof MultiValue) {
                foreach ($this->filters as $callback) {
                    $item->filter($callback);
                }
            }
        }
    }
private function applyFilters()
    {
        // Only apply filters if this is mutable.
        if ($this->isImmutable) {
            return;
        }

        // Reset to original items before filtering.
        $this->exchangeArray($this->originalItems);

        // Apply filter to items.
        if (count($this->filters) > 0) {
            $filtered_array = array_filter(
                $this->getArrayCopy(),
                function ($item) {
                    foreach ($this->filters as $callback) {
                        if (call_user_func($callback, $item) === true) {
                            return true;
                        }
                    }
                    return false;
                }
            );
            $this->exchangeArray(array_values($filtered_array));
        }

        // Filter nested items.
        foreach ($this->getArrayCopy() as $item) {
            if ($item instanceof MultiValue) {
                foreach ($this->filters as $callback) {
                    $item->filter($callback);
                }
            }
        }
    }
private function applyFilters ( ) { // Only apply filters if this is mutable. if ( $ this -> isImmutable ) { return ; } // Reset to original items before filtering. $ this -> exchangeArray ( $ this -> originalItems ) ; // Apply filter to items. if ( count ( $ this -> filters ) > 0 ) { $ filtered_array = array_filter ( $ this -> getArrayCopy ( ) , function ( $ item ) { foreach ( $ this -> filters as $ callback ) { if ( call_user_func ( $ callback , $ item ) === true ) { return true ; } } return false ; } ) ; $ this -> exchangeArray ( array_values ( $ filtered_array ) ) ; } // Filter nested items. foreach ( $ this -> getArrayCopy ( ) as $ item ) { if ( $ item instanceof MultiValue ) { foreach ( $ this -> filters as $ callback ) { $ item -> filter ( $ callback ) ; } } } }
Apply all filters.
Apply all filters .