generated from yiisoft/package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathRecorder.php
More file actions
51 lines (40 loc) · 1 KB
/
Recorder.php
File metadata and controls
51 lines (40 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
declare(strict_types=1);
namespace Yiisoft\Definitions\Tests\Support;
final class Recorder
{
private static array $staticRecord = [];
private array $record = [];
public function __call($name, $arguments)
{
$arguments = array_map(
get_debug_type(...),
$arguments,
);
$this->record[] = 'Call ' . $name . '(' . implode(', ', $arguments) . ')';
}
public static function __callStatic($name, $arguments)
{
$arguments = array_map(
get_debug_type(...),
$arguments,
);
self::$staticRecord[] = 'Call ' . $name . '(' . implode(', ', $arguments) . ')';
}
public function __isset($name)
{
return true;
}
public function __set($name, $value)
{
$this->record[] = "Set $$name to " . get_debug_type($value);
}
public function __get($name)
{
return null;
}
public function getEvents(): array
{
return $this->record;
}
}