Skip to content

Commit

Permalink
PHPStan: update to latest version
Browse files Browse the repository at this point in the history
PHPStan keeps improving and adding more and better checks. Let's use the latest version to get the most benefit from it ;-)

Includes ignoring one newly flagged issue and fixing another.

```
 ------ ---------------------------------------------------------------
  Line   module.audio-video.quicktime.php
 ------ ---------------------------------------------------------------
  1653   Variable $altitude in empty() always exists and is not falsy.
 ------ ---------------------------------------------------------------

 ------ -----------------------------------------------------------------------------------------
  Line   module.audio-video.riff.php
 ------ -----------------------------------------------------------------------------------------
  101    Binary operation "+" between (float|int) and array|float|int|false results in an error.
 ------ -----------------------------------------------------------------------------------------
```
  • Loading branch information
jrfnl committed Sep 11, 2024
1 parent 48b3ded commit 0f8f08e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- uses: "shivammathur/setup-php@v2"
with:
php-version: "8.2"
tools: "phpstan:1.10.57"
tools: "phpstan:1.12.3"
coverage: "none"
- uses: "ramsey/composer-install@v3"
- name: "Run PHPStan"
Expand Down
2 changes: 1 addition & 1 deletion getid3/module.audio-video.quicktime.php
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,7 @@ public function QuicktimeParseAtom($atomname, $atomsize, $atom_data, $baseoffset
@list($all, $latitude, $longitude, $altitude) = $matches;
$info['quicktime']['comments']['gps_latitude'][] = floatval($latitude);
$info['quicktime']['comments']['gps_longitude'][] = floatval($longitude);
if (!empty($altitude)) {
if (!empty($altitude)) { // @phpstan-ignore-line
$info['quicktime']['comments']['gps_altitude'][] = floatval($altitude);
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion getid3/module.audio-video.riff.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function Analyze() {
$info['avdataend'] = $info['filesize'];
}

$nextRIFFoffset = $Original['avdataoffset'] + 8 + $thisfile_riff['header_size']; // 8 = "RIFF" + 32-bit offset
$nextRIFFoffset = (int) $Original['avdataoffset'] + 8 + (int) $thisfile_riff['header_size']; // 8 = "RIFF" + 32-bit offset
while ($nextRIFFoffset < min($info['filesize'], $info['avdataend'])) {
try {
$this->fseek($nextRIFFoffset);
Expand Down

0 comments on commit 0f8f08e

Please sign in to comment.