File tree Expand file tree Collapse file tree 1 file changed +0
-50
lines changed Expand file tree Collapse file tree 1 file changed +0
-50
lines changed Original file line number Diff line number Diff line change @@ -95,56 +95,6 @@ public function reflect($object = null)
95
95
return $ fields ;
96
96
}
97
97
98
- public function reflect ($ object = null )
99
- {
100
- if ($ object == null ) {
101
- $ object = $ this ;
102
- }
103
-
104
- $ reflection = new \ReflectionObject ($ object );
105
- $ properties = $ reflection ->getProperties ();
106
-
107
- $ fields = [];
108
-
109
- foreach ($ properties as $ property ) {
110
- $ name = $ property ->getName ();
111
-
112
- if ($ name == 'bot_name ' ) {
113
- continue ;
114
- }
115
-
116
- if (!$ property ->isPrivate ()) {
117
- $ array_of_obj = false ;
118
- if (is_array ($ object ->$ name )) {
119
- $ array_of_obj = true ;
120
- foreach ($ object ->$ name as $ elm ) {
121
- if (!is_object ($ elm )) {
122
- $ array_of_obj = false ;
123
- break ;
124
- }
125
- }
126
- }
127
-
128
- if (is_object ($ object ->$ name )) {
129
- $ fields [$ name ] = $ this ->reflect ($ object ->$ name );
130
- } elseif ($ array_of_obj ) {
131
- foreach ($ object ->$ name as $ elm ) {
132
- $ fields [$ name ][] = $ this ->reflect ($ elm );
133
- }
134
- } else {
135
- $ property ->setAccessible (true );
136
- $ value = $ property ->getValue ($ object );
137
- if (is_null ($ value )) {
138
- continue ;
139
- }
140
- $ fields [$ name ] = $ value ;
141
- }
142
- }
143
- }
144
- return $ fields ;
145
- }
146
-
147
-
148
98
public function __toString ()
149
99
{
150
100
return $ this ->toJson ();
You can’t perform that action at this time.
0 commit comments