@@ -126,23 +126,13 @@ public static function createResponseWithAnswersForQuery(Query $query, array $an
126
126
* DNS response messages can not guess the message ID to avoid possible
127
127
* cache poisoning attacks.
128
128
*
129
- * The `random_int()` function is only available on PHP 7+ or when
130
- * https://github.com/paragonie/random_compat is installed. As such, using
131
- * the latest supported PHP version is highly recommended. This currently
132
- * falls back to a less secure random number generator on older PHP versions
133
- * in the hope that this system is properly protected against outside
134
- * attackers, for example by using one of the common local DNS proxy stubs.
135
- *
136
129
* @return int
137
130
* @see self::getId()
138
131
* @codeCoverageIgnore
139
132
*/
140
133
private static function generateId ()
141
134
{
142
- if (function_exists ('random_int ' )) {
143
- return random_int (0 , 0xffff );
144
- }
145
- return mt_rand (0 , 0xffff );
135
+ return random_int (0 , 0xffff );
146
136
}
147
137
148
138
/**
@@ -200,31 +190,31 @@ private static function generateId()
200
190
* An array of Query objects
201
191
*
202
192
* ```php
203
- * $questions = array(
193
+ * $questions = [
204
194
* new Query(
205
195
* 'reactphp.org',
206
196
* Message::TYPE_A,
207
197
* Message::CLASS_IN
208
198
* )
209
- * ) ;
199
+ * ] ;
210
200
* ```
211
201
*
212
202
* @var Query[]
213
203
*/
214
- public $ questions = array () ;
204
+ public $ questions = [] ;
215
205
216
206
/**
217
207
* @var Record[]
218
208
*/
219
- public $ answers = array () ;
209
+ public $ answers = [] ;
220
210
221
211
/**
222
212
* @var Record[]
223
213
*/
224
- public $ authority = array () ;
214
+ public $ authority = [] ;
225
215
226
216
/**
227
217
* @var Record[]
228
218
*/
229
- public $ additional = array () ;
219
+ public $ additional = [] ;
230
220
}
0 commit comments