-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDemoJsonSerialize.php
More file actions
90 lines (75 loc) · 1.56 KB
/
DemoJsonSerialize.php
File metadata and controls
90 lines (75 loc) · 1.56 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
namespace YPD\Demo;
use YPD\Serializer\Json\YPDJsonSerializer;
use JsonSerializable;
class DemoJsonSerialize implements JsonSerializable
{
use YPDJsonSerializer, DemoJsonSerializeTrait;
/**
* Undocumented variable
*
* @var [string]
* ypd::jsonSerialize
*/
public $publicProp1;
/**
* Undocumented variable
*
* @var [int]
* ypd::jsonSerialize(name=customName1)
*/
public $publicProp2;
public $publicProp3NoSerialize;
/**
* Undocumented variable
*
* @var [type]
* ypd::jsonSerialize(if=canSerialize)
*/
public $sub1;
public function __construct()
{
$this->publicProp1 = "valueProp1";
$this->publicProp2 = 2;
$this->publicProp3NoSerilize = "valueProp3NoSerialize";
$this->sub1 = new DemoSubJsonSerializable();
}
}
class DemoSubJsonSerializable implements JsonSerializable
{
use YPDJsonSerializer;
/**
* Undocumented variable
*
* @var [string]
* ypd::jsonSerialize
*/
public $subProp1;
/**
* Undocumented variable
*
* @var [int]
* ypd::jsonSerialize
*/
public $subProp2;
/**
* Undocumented variable
*
* @var [array]
* ypd::jsonSerialize
*/
public $subProp3;
public function __construct()
{
$this->subProp1 = "subValueProp1";
$this->subProp2 = 22;
$this->subProp3 = ['a', 'b', 'c'];
}
}
trait DemoJsonSerializeTrait
{
public function canSerialize()
{
return true;
}
}