PluginProbe ʕ •ᴥ•ʔ
Kirki – Freeform Page Builder, Website Builder & Customizer / trunk
Kirki – Freeform Page Builder, Website Builder & Customizer vtrunk
6.3.0 6.2.5 6.2.4 6.2.3 6.2.2 6.2.1 6.2.0 6.1.1 6.1.0 6.0.14 6.0.13 6.0.12 6.0.11 6.0.10 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.19 4.0.20 4.0.21 4.0.22 4.0.23 4.0.24 4.1 4.2.0 5.0.0 5.1.0 5.1.1 5.2.0 5.2.1 5.2.2 5.2.3 6.0.0 trunk 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.1.0 3.1.1 3.1.2
kirki / libraries / framework / Supports / HigherOrderTapProxy.php
kirki / libraries / framework / Supports Last commit date
Facades 2 weeks ago Traits 1 month ago Arr.php 1 month ago DataCaster.php 1 month ago Fluent.php 1 month ago HigherOrderTapProxy.php 1 month ago MediaAttachment.php 1 month ago MessagesBag.php 1 month ago Somoy.php 1 month ago Str.php 1 month ago Url.php 1 month ago Utils.php 1 month ago
HigherOrderTapProxy.php
54 lines
1 <?php
2
3 /**
4 * Proxy that invokes methods on a target object and always returns the target for chaining.
5 * Powers the tap helper pattern where side-effect calls should not break fluent pipelines.
6 * Delegates __call to the wrapped instance.
7 *
8 * @package Framework
9 * @subpackage Supports
10 * @since 1.0.0
11 */
12 namespace Kirki\Framework\Supports;
13
14 \defined('ABSPATH') || exit;
15 class HigherOrderTapProxy
16 {
17 /**
18 * The target instance.
19 *
20 * @var object
21 *
22 * @since 1.0.0
23 */
24 protected $target;
25 /**
26 * Create a new proxy instance.
27 *
28 * @param mixed $target The target.
29 *
30 * @return void
31 *
32 * @since 1.0.0
33 */
34 public function __construct($target)
35 {
36 $this->target = $target;
37 }
38 /**
39 * Dynamically handle calls to the object.
40 *
41 * @param mixed $method The method name.
42 * @param mixed $parameters The parameters array.
43 *
44 * @return mixed
45 *
46 * @since 1.0.0
47 */
48 public function __call($method, $parameters)
49 {
50 $this->target->{$method}(...$parameters);
51 return $this->target;
52 }
53 }
54