@@ -1283,6 +1283,7 @@ public function getDeclarationName($stackPtr)
1283
1283
* 'name' => '$var', // The variable name.
1284
1284
* 'token' => integer, // The stack pointer to the variable name.
1285
1285
* 'content' => string, // The full content of the variable definition.
1286
+ * 'attributes' => boolean, // Does the parameter have one or more attributes attached ?
1286
1287
* 'pass_by_reference' => boolean, // Is the variable passed by reference?
1287
1288
* 'reference_token' => integer, // The stack pointer to the reference operator
1288
1289
* // or FALSE if the param is not passed by reference.
@@ -1355,6 +1356,7 @@ public function getMethodParameters($stackPtr)
1355
1356
$ defaultStart = null ;
1356
1357
$ equalToken = null ;
1357
1358
$ paramCount = 0 ;
1359
+ $ attributes = false ;
1358
1360
$ passByReference = false ;
1359
1361
$ referenceToken = false ;
1360
1362
$ variableLength = false ;
@@ -1373,18 +1375,25 @@ public function getMethodParameters($stackPtr)
1373
1375
if (isset ($ this ->tokens [$ i ]['parenthesis_opener ' ]) === true ) {
1374
1376
// Don't do this if it's the close parenthesis for the method.
1375
1377
if ($ i !== $ this ->tokens [$ i ]['parenthesis_closer ' ]) {
1376
- $ i = ($ this ->tokens [$ i ]['parenthesis_closer ' ] + 1 );
1378
+ $ i = $ this ->tokens [$ i ]['parenthesis_closer ' ];
1379
+ continue ;
1377
1380
}
1378
1381
}
1379
1382
1380
1383
if (isset ($ this ->tokens [$ i ]['bracket_opener ' ]) === true ) {
1381
- // Don't do this if it's the close parenthesis for the method.
1382
1384
if ($ i !== $ this ->tokens [$ i ]['bracket_closer ' ]) {
1383
- $ i = ($ this ->tokens [$ i ]['bracket_closer ' ] + 1 );
1385
+ $ i = $ this ->tokens [$ i ]['bracket_closer ' ];
1386
+ continue ;
1384
1387
}
1385
1388
}
1386
1389
1387
1390
switch ($ this ->tokens [$ i ]['code ' ]) {
1391
+ case T_ATTRIBUTE :
1392
+ $ attributes = true ;
1393
+
1394
+ // Skip to the end of the attribute.
1395
+ $ i = $ this ->tokens [$ i ]['attribute_closer ' ];
1396
+ break ;
1388
1397
case T_BITWISE_AND :
1389
1398
if ($ defaultStart === null ) {
1390
1399
$ passByReference = true ;
@@ -1501,6 +1510,7 @@ public function getMethodParameters($stackPtr)
1501
1510
$ vars [$ paramCount ]['default_equal_token ' ] = $ equalToken ;
1502
1511
}
1503
1512
1513
+ $ vars [$ paramCount ]['attributes ' ] = $ attributes ;
1504
1514
$ vars [$ paramCount ]['pass_by_reference ' ] = $ passByReference ;
1505
1515
$ vars [$ paramCount ]['reference_token ' ] = $ referenceToken ;
1506
1516
$ vars [$ paramCount ]['variable_length ' ] = $ variableLength ;
@@ -1526,6 +1536,7 @@ public function getMethodParameters($stackPtr)
1526
1536
$ paramStart = ($ i + 1 );
1527
1537
$ defaultStart = null ;
1528
1538
$ equalToken = null ;
1539
+ $ attributes = false ;
1529
1540
$ passByReference = false ;
1530
1541
$ referenceToken = false ;
1531
1542
$ variableLength = false ;
0 commit comments