v.0.1
This commit is contained in:
38
vendor/illuminate/support/HigherOrderTapProxy.php
vendored
Normal file
38
vendor/illuminate/support/HigherOrderTapProxy.php
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Support;
|
||||
|
||||
class HigherOrderTapProxy
|
||||
{
|
||||
/**
|
||||
* The target being tapped.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
public $target;
|
||||
|
||||
/**
|
||||
* Create a new tap proxy instance.
|
||||
*
|
||||
* @param mixed $target
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($target)
|
||||
{
|
||||
$this->target = $target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dynamically pass method calls to the target.
|
||||
*
|
||||
* @param string $method
|
||||
* @param array $parameters
|
||||
* @return mixed
|
||||
*/
|
||||
public function __call($method, $parameters)
|
||||
{
|
||||
$this->target->{$method}(...$parameters);
|
||||
|
||||
return $this->target;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user