File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * This file is part of Blitz PHP framework.
5+ *
6+ * (c) 2022 Dimitri Sitchet Tomkeu <devcode.dst@gmail.com>
7+ *
8+ * For the full copyright and license information, please view
9+ * the LICENSE file that was distributed with this source code.
10+ */
11+
12+ namespace BlitzPHP \Traits \Mixins ;
13+
14+ class HigherOrderTapProxy
15+ {
16+ /**
17+ * Créez une nouvelle instance de proxy tactile.
18+ *
19+ * @param mixed $target La cible étant tapée.
20+ */
21+ public function __construct (public mixed $ target )
22+ {
23+
24+ }
25+
26+ /**
27+ * Passez dynamiquement les appels de méthode à la cible.
28+ */
29+ public function __call (string $ method , array $ parameters = []): mixed
30+ {
31+ $ this ->target ->{$ method }(...$ parameters );
32+
33+ return $ this ->target ;
34+ }
35+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * This file is part of Blitz PHP framework.
5+ *
6+ * (c) 2022 Dimitri Sitchet Tomkeu <devcode.dst@gmail.com>
7+ *
8+ * For the full copyright and license information, please view
9+ * the LICENSE file that was distributed with this source code.
10+ */
11+
12+ namespace BlitzPHP \Traits \Support ;
13+
14+ use BlitzPHP \Utilities \Helpers ;
15+
16+ trait Tappable
17+ {
18+ /**
19+ * Appelez la Closure donnée avec cette instance puis renvoyez l'instance.
20+ *
21+ * @return $this|\BlitzPHP\Traits\Mixins\HigherOrderTapProxy
22+ */
23+ public function tap (?callable $ callback = null )
24+ {
25+ return Helpers::tap ($ this , $ callback );
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments