Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit f60a882

Browse files
committed
Merge branch 'fix/172' into develop
Close #172
2 parents 47892b3 + bdcaaa6 commit f60a882

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ All notable changes to this project will be documented in this file, in reverse
2626

2727
### Fixed
2828

29-
- Nothing.
29+
- [#172](https://github.com/zendframework/zend-code/pull/172) fixes PHP 7.4 compatibility.
3030

3131
## 3.3.2 - 2019-08-31
3232

src/Scanner/ClassScanner.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -912,13 +912,13 @@ protected function scan()
912912
if (is_string($token)) {
913913
$tokenType = null;
914914
$tokenContent = $token;
915-
$tokenLine = $tokenLine + substr_count(
916-
$lastTokenArray[1],
915+
$tokenLine += substr_count(
916+
$lastTokenArray[1] ?? '',
917917
"\n"
918918
); // adjust token line by last known newline count
919919
} else {
920920
$lastTokenArray = $token;
921-
list($tokenType, $tokenContent, $tokenLine) = $token;
921+
[$tokenType, $tokenContent, $tokenLine] = $token;
922922
}
923923

924924
return $tokenIndex;

src/Scanner/MethodScanner.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,12 +451,13 @@ protected function scan()
451451
if (is_string($token)) {
452452
$tokenType = null;
453453
$tokenContent = $token;
454-
$tokenLine = $tokenLine + substr_count(
455-
$lastTokenArray[1],
454+
$tokenLine += substr_count(
455+
$lastTokenArray[1] ?? '',
456456
"\n"
457457
); // adjust token line by last known newline count
458458
} else {
459-
list($tokenType, $tokenContent, $tokenLine) = $token;
459+
$lastTokenArray = $token;
460+
[$tokenType, $tokenContent, $tokenLine] = $token;
460461
}
461462

462463
return $tokenIndex;

0 commit comments

Comments
 (0)