This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Collection::macro('join', function ($items, callable $callback) { | |
return $this->flatMap(function ($value) use ($items, $callback) { | |
return $items->filter(function ($item) use ($value, $callback) { | |
return $callback($value, $item); | |
})->map(function ($item) use ($value) { | |
return new Collection([$value, $item]); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Match | |
{ | |
protected $value; | |
protected $result; | |
protected $hasMatch; | |
public function __construct($value) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class FakeSoapClient extends \SoapClient | |
{ | |
protected $response; | |
protected $customizer; | |
public static function wsdl($wsdl) | |
{ | |
return new self($wsdl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Temporary | |
{ | |
public static function file($contents, $callback) | |
{ | |
$path = tempnam(sys_get_temp_dir(), 'php_'); | |
file_put_contents($path, $contents); | |
try { |