1
1
<?php
2
+
2
3
declare (strict_types=1 );
3
4
4
5
/**
@@ -23,7 +24,10 @@ class ObjectStructureElement extends BasicStructureElement
23
24
* Unset object function.
24
25
* @internal Only for tests
25
26
*/
26
- public function __clearForTest (){$ this ->object = NULL ;}
27
+ public function __clearForTest ()
28
+ {
29
+ $ this ->object = null ;
30
+ }
27
31
28
32
/**
29
33
* Parse a JSON object to a data structure.
@@ -58,7 +62,9 @@ public function parse(?object $object, array &$dependencies): StructureElement
58
62
$ this ->value = $ object ->content ->value ->content ;
59
63
} elseif (isset ($ object ->content ->value ->attributes ->samples )) {
60
64
$ this ->value = array_reduce ($ object ->content ->value ->attributes ->samples ->content , function ($ carry , $ item ) {
61
- if ($ carry === NULL ) {return "$ item ->content ( $ item ->element ) " ; }
65
+ if ($ carry === null ) {
66
+ return "$ item ->content ( $ item ->element ) " ;
67
+ }
62
68
return "$ carry | $ item ->content ( $ item ->element ) " ;
63
69
});
64
70
} else {
@@ -106,7 +112,7 @@ protected function new_instance(): StructureElement
106
112
* Parse content formed as an array.
107
113
*
108
114
* @param object $object APIB content
109
- * @param array $dependencies Object dependencies
115
+ * @param array $dependencies Object dependencies
110
116
*
111
117
* @return void
112
118
*/
@@ -130,7 +136,7 @@ protected function parse_array_content(object $object, array &$dependencies): vo
130
136
*/
131
137
public function __toString (): string
132
138
{
133
- $ options = array_merge (self ::DEFAULTS ,['member ' , 'select ' , 'option ' , 'ref ' , 'T ' , 'hrefVariables ' ]);
139
+ $ options = array_merge (self ::DEFAULTS , ['member ' , 'select ' , 'option ' , 'ref ' , 'T ' , 'hrefVariables ' ]);
134
140
if (!empty ($ this ->element ) && !in_array ($ this ->element , $ options )) {
135
141
$ this ->description = '<p>Inherits from <a href="#object- ' . strtolower ($ this ->element ) . '"> ' . $ this ->element . '</a></p> ' . $ this ->description ;
136
142
}
@@ -195,7 +201,7 @@ public function __toString(): string
195
201
*/
196
202
protected function construct_string_return (string $ value ): string
197
203
{
198
- if ($ this ->type === NULL ) {
204
+ if ($ this ->type === null ) {
199
205
return $ value ;
200
206
}
201
207
0 commit comments