Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
38 lines (33 sloc)
665 Bytes
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 | |
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; | |
} | |
} |