Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
add idehelper
Browse files Browse the repository at this point in the history
  • Loading branch information
okdewit committed Jul 24, 2019
1 parent 8a904dc commit 3374089
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions _ide_helper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

namespace {
exit("This file should not be included, only analyzed by your IDE");
}


namespace Illuminate\Support {

/**
* Class Collection
* @package Illuminate\Support
*/
class Collection
{

/**
* Matches two sorted collections based on a comparator callable with O(m+n) efficiency
* Accepts callables for matched pairs as well as unmatched elements (on both sides)
* Collections can have ordered duplicates, all permutations become matched pairs
*
* Example:
* ```php
* collect([ 1,2,4,7,8,9,14 ]))->matchWith(
* collect([ 1,2,5,6,8,10,11,13,14 ]),
* function($a, $b) { return $a <=> $b; },
* function($a, $b) { echo "$a matches $b"; },
* function($a) { echo "$a was not found in b"; },
* function($b) { echo "$b was not found in a"; },
* );
* ```
*
* @param Collection $b A collection to match up with
* @param callable $comparator A comparator function, to match orderable elements using a <=> b
* @param callable $matched A callback to be executed on each matched pair
* @param callable $unmatchedA A callback to be executed for each unmatched item in the a collection
* @param callable $unmatchedB A callback to be executed on each unmatched item in the b collection
* @return $this
*/
public function matchWith(Collection $b, callable $comparator, callable $matched, callable $unmatchedA = null, callable $unmatchedB = null): self
{
return $this;
}
}
}

0 comments on commit 3374089

Please sign in to comment.