@@ -53,7 +53,7 @@ use Enjoy\HttpStatusCode\Statuscodes;
53
53
<?php endforeach ; ?>
54
54
<?php endif ; ?>
55
55
<?php endforeach ; ?>
56
- <?php if (! empty ( $ this ->base_structures ) ): ?>
56
+ <?php if ($ this ->base_structures !== [] ): ?>
57
57
<a class="mdl-navigation__link" href="#"><strong>Objects</strong></a>
58
58
<?php foreach ($ this ->base_structures as $ key => $ structure ): ?>
59
59
<a class="mdl-navigation__link"
@@ -65,18 +65,18 @@ use Enjoy\HttpStatusCode\Statuscodes;
65
65
<main class="mdl-layout__content main-content">
66
66
<div class="page-content">
67
67
<?php foreach ($ this ->categories as $ category ): ?>
68
- <?php if (!empty ($ category ->title )): ?>
68
+ <?php if (!is_null ($ category ->title )): ?>
69
69
<h3><a id="<?= $ category ->get_href (); ?> "><?= $ category ->title ; ?> </a></h3>
70
70
<?php endif ; ?>
71
- <?php if (!empty ($ category ->description )): ?>
71
+ <?php if (!is_null ($ category ->description )): ?>
72
72
<p><?= $ category ->description ; ?> </p>
73
73
<?php endif ; ?>
74
74
<?php foreach ($ category ->children as $ resource ): ?>
75
75
<h4>
76
76
<a id="<?= str_replace ('- ' , '/ ' , $ resource ->get_href ()); ?> "><?= $ resource ->title ; ?> </a>
77
77
<small><?= $ resource ->href ; ?> </small>
78
78
</h4>
79
- <?php if (!empty ($ resource ->description )): ?>
79
+ <?php if (!is_null ($ resource ->description )): ?>
80
80
<p><?= $ resource ->description ; ?> </p>
81
81
<?php endif ; ?>
82
82
<?php foreach ($ resource ->children as $ transition ): ?>
@@ -90,26 +90,26 @@ use Enjoy\HttpStatusCode\Statuscodes;
90
90
</div>
91
91
<div class="mdl-card__supporting-text">
92
92
<?= $ transition ->description ; ?>
93
- <?php if (!empty ($ transition ->requests ) || !empty ($ transition ->responses )): $ i = 0 ;?>
93
+ <?php if (!is_null ($ transition ->requests ) || !is_null ($ transition ->responses )): $ i = 0 ;?>
94
94
<div class="mdl-tabs mdl-js-tabs mdl-js-ripple-effect">
95
95
<div class="mdl-tabs__tab-bar">
96
- <?php if (! empty ( $ transition ->requests ) ): ?>
96
+ <?php if ($ transition ->requests !== [] ): ?>
97
97
<?php foreach ($ transition ->requests as $ request ): ?>
98
98
<a href="#request-panel-<?= $ request ->get_id (); ?> "
99
99
class="mdl-tabs__tab<?= ($ i < 1 ) ? ' is-active ' : '' ?> ">
100
- <strong>Request</strong> <?= ( empty ( $ request ->title ) ? '' : ' ' . $ request ->title ) ?>
100
+ <strong>Request</strong> <?= is_null ( $ request ->title ? '' : ' ' . $ request ->title ) ?>
101
101
</a>
102
102
<?php $ i ++; endforeach ; ?>
103
103
<?php endif ; ?>
104
- <?php if (! empty ( $ transition ->responses ) ): ?>
104
+ <?php if ($ transition ->responses !== [] ): ?>
105
105
<?php foreach ($ transition ->responses as $ response ): ?>
106
106
<a href="#response-panel-<?= $ response ->get_id (); ?> "
107
107
class="mdl-tabs__tab<?= ($ i < 1 ) ? ' is-active ' : '' ?> <?= $ this ->get_response_status ($ response ->statuscode ) ?> "
108
108
title="<?= $ response ->statuscode . ' ' . $ this ->http_status ->getReasonPhrase ($ response ->statuscode ) ?> "><?= $ response ->statuscode ; ?> </a>
109
109
<?php $ i ++; endforeach ; ?>
110
110
<?php endif ; ?>
111
111
</div>
112
- <?php $ i = 0 ; if (!empty ( $ transition ->requests ) ): ?>
112
+ <?php $ i = 0 ; if (!$ transition ->requests !== [] ): ?>
113
113
<?php foreach ($ transition ->requests as $ key => $ request ): ?>
114
114
<dialog class="mdl-dialog"
115
115
id="mdl-dialog-<?= $ request ->get_id (); ?> ">
@@ -148,7 +148,7 @@ use Enjoy\HttpStatusCode\Statuscodes;
148
148
<?php endforeach ; ?>
149
149
</ul>
150
150
<?php endif ; ?>
151
- <?php if (! empty ( $ request ->body ) ): ?>
151
+ <?php if ($ request ->body !== [] ): ?>
152
152
<h5>Body</h5>
153
153
<?php foreach ($ request ->body as $ value ): ?>
154
154
<?php if (is_string ($ value )): ?>
@@ -161,7 +161,7 @@ use Enjoy\HttpStatusCode\Statuscodes;
161
161
<?php endif ; ?>
162
162
<?php endforeach ; ?>
163
163
<?php endif ; ?>
164
- <?php if (! empty ( $ request ->struct ) ): ?>
164
+ <?php if ($ request ->struct !== [] ): ?>
165
165
<h5>Structure</h5>
166
166
<?= $ request ->struct ?>
167
167
<?php endif ; ?>
@@ -176,7 +176,7 @@ use Enjoy\HttpStatusCode\Statuscodes;
176
176
</div>
177
177
<?php $ i ++; endforeach ; ?>
178
178
<?php endif ; ?>
179
- <?php if (! empty ( $ transition ->responses ) ): ?>
179
+ <?php if ($ transition ->responses !== [] ): ?>
180
180
<?php foreach ($ transition ->responses as $ key => $ response ): ?>
181
181
<div class="mdl-tabs__panel <?= ($ i < 1 ) ? 'is-active ' : '' ?> "
182
182
id="response-panel-<?= $ response ->get_id (); ?> ">
@@ -201,9 +201,9 @@ use Enjoy\HttpStatusCode\Statuscodes;
201
201
<?php endforeach ; ?>
202
202
<?php endif ; ?>
203
203
<div class="mdl-grid">
204
- <?php foreach ($ response ->content as $ key => $ value ): ?>
204
+ <?php foreach ($ response ->content as $ response_key => $ value ): ?>
205
205
<div class="mdl-cell mdl-cell--<?= 12 / count ($ response ->content ) ?> -col">
206
- <h5 class="response-body"><?= $ key ; ?> </h5>
206
+ <h5 class="response-body"><?= $ response_key ; ?> </h5>
207
207
<pre class="response-body"
208
208
id="request-<?= $ response ->get_id (); ?> "><?= $ value ; ?> </pre>
209
209
</div>
@@ -240,7 +240,7 @@ use Enjoy\HttpStatusCode\Statuscodes;
240
240
<?php $ extras = array_filter ($ this ->base_data , function ($ value ) {
241
241
return !in_array ($ value , ['HOST ' , 'TITLE ' , 'ALT_HOST ' , 'FORMAT ' , 'DESC ' , 'COLOR_1 ' , 'COLOR_2 ' ]);
242
242
}, ARRAY_FILTER_USE_KEY );
243
- if (! empty ( $ extras) ):
243
+ if ($ extras !== [] ):
244
244
$ extras ['host ' ] = $ this ->base_data ['HOST ' ]; ?>
245
245
<button
246
246
type="button"
0 commit comments