Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
19 / 19
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
6 / 6
CRAP
100.00% covered (success)
100.00%
1 / 1
HookProxy
100.00% covered (success)
100.00%
19 / 19
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
6 / 6
7
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 __get
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 __set
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 __call
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
2
 __get_private
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 __call_private
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php namespace GorillaClaw;
2
3class HookProxy {
4   
5    public $__cb;
6    protected $__that;
7 
8    function __construct(&$hook_cb, &$that) {
9        $proxy = &$this;
10        $this->__that = &$that;
11        $this->__cb = \Closure::bind(function (...$args) use (&$proxy, &$hook_cb) {
12            return \Closure::bind($hook_cb, $proxy)(...$args);
13        }, $that);
14    }
15 
16    function __get($prop) {
17        return $this->__get_private($prop);
18    }
19 
20    function __set($prop, $val) {
21        $private = &$this->__get_private($prop);
22        $private = $val;
23    }
24 
25    function __call($method, $args) {
26
27        if($method === '__cb') {
28            return $this->__cb->bindTo($this->__that, $this->__that)(...$args);
29        }
30
31        return $this->__call_private($method, $args);
32    }
33     
34    public function &__get_private($var): mixed {
35        $that = &$this->__that;
36        return \Closure::bind(function &($that) use ($var) {
37            return $that->$var;
38        }, $that, $that)($that);
39    }
40
41    public function __call_private($var, $args): mixed {
42        $that = &$this->__that;
43        return \Closure::bind(function ($that) use ($var, $args) {
44            return $that->$var(...$args);
45        }, $that, $that)($that);
46    }
47 }

Paths

Below are the source code lines that represent each code path as identified by Xdebug. Please note a path is not necessarily coterminous with a line, a line may contain multiple paths and therefore show up more than once. Please also be aware that some paths may include implicit rather than explicit branches, e.g. an if statement always has an else as part of its logical flow even if you didn't write one.

HookProxy->__call
25    function __call($method, $args) {
26
27        if($method === '__cb') {
 
28            return $this->__cb->bindTo($this->__that, $this->__that)(...$args);
25    function __call($method, $args) {
26
27        if($method === '__cb') {
 
31        return $this->__call_private($method, $args);
32    }
HookProxy->__call_private
41    public function __call_private($var, $args): mixed {
42        $that = &$this->__that;
43        return \Closure::bind(function ($that) use ($var, $args) {
44            return $that->$var(...$args);
45        }, $that, $that)($that);
46    }
HookProxy->__construct
8    function __construct(&$hook_cb, &$that) {
9        $proxy = &$this;
10        $this->__that = &$that;
11        $this->__cb = \Closure::bind(function (...$args) use (&$proxy, &$hook_cb) {
12            return \Closure::bind($hook_cb, $proxy)(...$args);
13        }, $that);
14    }
HookProxy->__get
16    function __get($prop) {
17        return $this->__get_private($prop);
18    }
HookProxy->__get_private
34    public function &__get_private($var): mixed {
35        $that = &$this->__that;
36        return \Closure::bind(function &($that) use ($var) {
37            return $that->$var;
38        }, $that, $that)($that);
39    }
HookProxy->__set
20    function __set($prop, $val) {
21        $private = &$this->__get_private($prop);
22        $private = $val;
23    }
GorillaClaw\{closure:/home/runner/work/gorilla-claw/gorilla-claw/src/class/HookProxy.php:11-13}
11        $this->__cb = \Closure::bind(function (...$args) use (&$proxy, &$hook_cb) {
12            return \Closure::bind($hook_cb, $proxy)(...$args);
13        }, $that);
GorillaClaw\{closure:/home/runner/work/gorilla-claw/gorilla-claw/src/class/HookProxy.php:36-38}
36        return \Closure::bind(function &($that) use ($var) {
37            return $that->$var;
38        }, $that, $that)($that);
GorillaClaw\{closure:/home/runner/work/gorilla-claw/gorilla-claw/src/class/HookProxy.php:43-45}
43        return \Closure::bind(function ($that) use ($var, $args) {
44            return $that->$var(...$args);
45        }, $that, $that)($that);