Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 150 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 150 Revision 399
Zeile 631... Zeile 631...
631
    {
631
    {
632
        return $this->passthru('intersect', func_get_args());
632
        return $this->passthru('intersect', func_get_args());
633
    }
633
    }
Zeile 634... Zeile 634...
634
 
634
 
-
 
635
    /**
-
 
636
     * Intersect the collection with the given items, using the callback.
-
 
637
     *
-
 
638
     * @param  \Illuminate\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue>  $items
-
 
639
     * @param  callable(TValue, TValue): int  $callback
-
 
640
     * @return static
-
 
641
     */
-
 
642
    public function intersectUsing()
-
 
643
    {
-
 
644
        return $this->passthru('intersectUsing', func_get_args());
-
 
645
    }
-
 
646
 
-
 
647
    /**
-
 
648
     * Intersect the collection with the given items with additional index check.
-
 
649
     *
-
 
650
     * @param  \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue>  $items
-
 
651
     * @return static
-
 
652
     */
-
 
653
    public function intersectAssoc($items)
-
 
654
    {
-
 
655
        return $this->passthru('intersectAssoc', func_get_args());
-
 
656
    }
-
 
657
 
-
 
658
    /**
-
 
659
     * Intersect the collection with the given items with additional index check, using the callback.
-
 
660
     *
-
 
661
     * @param  \Illuminate\Contracts\Support\Arrayable<array-key, TValue>|iterable<array-key, TValue>  $items
-
 
662
     * @param  callable(TValue, TValue): int  $callback
-
 
663
     * @return static
-
 
664
     */
-
 
665
    public function intersectAssocUsing($items, callable $callback)
-
 
666
    {
-
 
667
        return $this->passthru('intersectAssocUsing', func_get_args());
-
 
668
    }
-
 
669
 
635
    /**
670
    /**
636
     * Intersect the collection with the given items by key.
671
     * Intersect the collection with the given items by key.
637
     *
672
     *
638
     * @param  \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue>  $items
673
     * @param  \Illuminate\Contracts\Support\Arrayable<TKey, TValue>|iterable<TKey, TValue>  $items
639
     * @return static
674
     * @return static
Zeile 1634... Zeile 1669...
1634
 
1669
 
1635
        if (is_array($source)) {
1670
        if (is_array($source)) {
1636
            return new ArrayIterator($source);
1671
            return new ArrayIterator($source);
Zeile -... Zeile 1672...
-
 
1672
        }
1637
        }
1673
 
-
 
1674
        if (is_callable($source)) {
-
 
1675
            $maybeTraversable = $source();
-
 
1676
 
-
 
1677
            return $maybeTraversable instanceof Traversable
-
 
1678
                ? $maybeTraversable
-
 
1679
                : new ArrayIterator(Arr::wrap($maybeTraversable));
-
 
1680
        }
1638
 
1681
 
Zeile 1639... Zeile 1682...
1639
        return $source();
1682
        return new ArrayIterator((array) $source);
1640
    }
1683
    }
1641
 
1684