Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade PHPStan to v1.10.57 #437

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
- uses: "actions/checkout@v3"
- uses: "shivammathur/setup-php@v2"
with:
php-version: "7.4"
tools: "phpstan:1.8.11"
php-version: "8.2"
tools: "phpstan:1.10.57"
coverage: "none"
- uses: "ramsey/composer-install@v2"
- name: "Run PHPStan"
Expand Down
2 changes: 1 addition & 1 deletion getid3/extension.cache.dbm.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public function analyze($filename, $filesize=null, $original_filename='', $fp=nu
$result = parent::analyze($filename, $filesize, $original_filename, $fp);

// Save result
if (isset($key) && file_exists($filename)) {
if ($key !== null) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  246    Right side of && is always true.

dba_insert($key, serialize($result), $this->dba);
}

Expand Down
8 changes: 5 additions & 3 deletions getid3/getid3.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ public static function intValueSupported($num) {
// check if integers are 64-bit
static $hasINT64 = null;
if ($hasINT64 === null) { // 10x faster than is_null()
$hasINT64 = is_int(pow(2, 31)); // 32-bit int are limited to (2^31)-1
/** @var int|float|false $bigInt */
$bigInt = pow(2, 31);
$hasINT64 = is_int($bigInt); // 32-bit int are limited to (2^31)-1
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  119    Negated boolean expression is always false.                                                                
  119    Result of && is always false.                                                                              

if (!$hasINT64 && !defined('PHP_INT_MIN')) {
define('PHP_INT_MIN', ~PHP_INT_MAX);
}
Expand Down Expand Up @@ -1517,7 +1519,7 @@ public static function RGADamplitude2dB($amplitude) {
public static function GetDataImageSize($imgData, &$imageinfo=array()) {
if (PHP_VERSION_ID >= 50400) {
$GetDataImageSize = @getimagesizefromstring($imgData, $imageinfo);
if ($GetDataImageSize === false || !isset($GetDataImageSize[0], $GetDataImageSize[1])) {
if ($GetDataImageSize === false) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1520   Offset 0 on array{0: int, 1: int, 2: int, 3: string, mime: string, channels?: int, bits?: int} in isset()
         always exists and is not nullable.
  1520   Offset 1 on array{0: int, 1: int, 2: int, 3: string, mime: string, channels?: int, bits?: int} in isset()
         always exists and is not nullable.

return false;
}
$GetDataImageSize['height'] = $GetDataImageSize[0];
Expand Down Expand Up @@ -1545,7 +1547,7 @@ public static function GetDataImageSize($imgData, &$imageinfo=array()) {
fwrite($tmp, $imgData);
fclose($tmp);
$GetDataImageSize = @getimagesize($tempfilename, $imageinfo);
if (($GetDataImageSize === false) || !isset($GetDataImageSize[0]) || !isset($GetDataImageSize[1])) {
if ($GetDataImageSize === false) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1548   Offset 0 on array{0: int, 1: int, 2: int, 3: string, mime: string, channels?: int, bits?: int} in isset()
         always exists and is not nullable.
  1548   Offset 1 on array{0: int, 1: int, 2: int, 3: string, mime: string, channels?: int, bits?: int} in isset()
         always exists and is not nullable.

return false;
}
$GetDataImageSize['height'] = $GetDataImageSize[0];
Expand Down
6 changes: 3 additions & 3 deletions getid3/getid3.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,10 @@ public function __construct() {
$memoryLimit = ini_get('memory_limit');
if (preg_match('#([0-9]+) ?M#i', $memoryLimit, $matches)) {
// could be stored as "16M" rather than 16777216 for example
$memoryLimit = $matches[1] * 1048576;
$memoryLimit = (int) $matches[1] * 1048576;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  412    Binary operation "*" between string and 1048576 results in an error.

} elseif (preg_match('#([0-9]+) ?G#i', $memoryLimit, $matches)) { // The 'G' modifier is available since PHP 5.1.0
// could be stored as "2G" rather than 2147483648 for example
$memoryLimit = $matches[1] * 1073741824;
$memoryLimit = (int) $matches[1] * 1073741824;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  415    Binary operation "*" between string and 1073741824 results in an error.

}
$this->memory_limit = $memoryLimit;

Expand Down Expand Up @@ -446,7 +446,7 @@ public function __construct() {
}
// Check for magic_quotes_gpc
if (function_exists('get_magic_quotes_gpc')) {
if (get_magic_quotes_gpc()) { // @phpstan-ignore-line
if (get_magic_quotes_gpc()) {
$this->startup_error .= 'magic_quotes_gpc must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_gpc(0) and set_magic_quotes_gpc(1).'."\n";
}
}
Expand Down
54 changes: 34 additions & 20 deletions getid3/module.audio-video.asf.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,13 +499,17 @@ public function Analyze() {
$offset += 2;
$thisfile_asf_scriptcommandobject['command_types_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
$offset += 2;
for ($CommandTypesCounter = 0; $CommandTypesCounter < $thisfile_asf_scriptcommandobject['command_types_count']; $CommandTypesCounter++) {
$CommandTypeNameLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character
$offset += 2;
$thisfile_asf_scriptcommandobject['command_types'][$CommandTypesCounter]['name'] = substr($ASFHeaderData, $offset, $CommandTypeNameLength);
$offset += $CommandTypeNameLength;
if ($thisfile_asf_scriptcommandobject['command_types_count'] > 0) {
$thisfile_asf_scriptcommandobject['command_types'] = array();
for ($CommandTypesCounter = 0; $CommandTypesCounter < (int) $thisfile_asf_scriptcommandobject['command_types_count']; $CommandTypesCounter++) {
Copy link
Collaborator Author

@StudioMaX StudioMaX Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive

  502    Comparison operation "<" between int<0, max> and ((non-empty-array<literal-string&non-falsy-string,
         mixed>)|float|int|string|false) results in an error.

$CommandTypeNameLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character
$offset += 2;
$thisfile_asf_scriptcommandobject['command_types'][$CommandTypesCounter] = array();
$thisfile_asf_scriptcommandobject['command_types'][$CommandTypesCounter]['name'] = substr($ASFHeaderData, $offset, $CommandTypeNameLength);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  505    Cannot assign offset 'name' to string.

$offset += $CommandTypeNameLength;
}
}
for ($CommandsCounter = 0; $CommandsCounter < $thisfile_asf_scriptcommandobject['commands_count']; $CommandsCounter++) {
for ($CommandsCounter = 0; $CommandsCounter < (int) $thisfile_asf_scriptcommandobject['commands_count']; $CommandsCounter++) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive

  508    Comparison operation "<" between int<0, max> and ((non-empty-array<int<0,
         max>|(literal-string&non-falsy-string), mixed>)|float|int|string|false) results in an error.

$thisfile_asf_scriptcommandobject['commands'][$CommandsCounter]['presentation_time'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
$offset += 4;
$thisfile_asf_scriptcommandobject['commands'][$CommandsCounter]['type_index'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
Expand Down Expand Up @@ -554,6 +558,8 @@ public function Analyze() {
break;
}
$thisfile_asf_markerobject['markers_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
/** @var int|float|false $totalMakersCount */
$totalMakersCount = $thisfile_asf_markerobject['markers_count'];
$offset += 4;
$thisfile_asf_markerobject['reserved_2'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
$offset += 2;
Expand All @@ -565,7 +571,8 @@ public function Analyze() {
$offset += 2;
$thisfile_asf_markerobject['name'] = substr($ASFHeaderData, $offset, $thisfile_asf_markerobject['name_length']);
$offset += $thisfile_asf_markerobject['name_length'];
for ($MarkersCounter = 0; $MarkersCounter < $thisfile_asf_markerobject['markers_count']; $MarkersCounter++) {
for ($MarkersCounter = 0; $MarkersCounter < $totalMakersCount; $MarkersCounter++) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive

  568    Comparison operation "<" between int<0, max> and ((non-empty-array<literal-string&non-falsy-string,
         mixed>)|float|int|string|false) results in an error.

$thisfile_asf_markerobject['markers'][$MarkersCounter] = array();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  569    Cannot assign offset 'offset' to string.

$thisfile_asf_markerobject['markers'][$MarkersCounter]['offset'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));
$offset += 8;
$thisfile_asf_markerobject['markers'][$MarkersCounter]['presentation_time'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));
Expand Down Expand Up @@ -615,7 +622,7 @@ public function Analyze() {
}
$thisfile_asf_bitratemutualexclusionobject['stream_numbers_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
$offset += 2;
for ($StreamNumberCounter = 0; $StreamNumberCounter < $thisfile_asf_bitratemutualexclusionobject['stream_numbers_count']; $StreamNumberCounter++) {
for ($StreamNumberCounter = 0; $StreamNumberCounter < (int) $thisfile_asf_bitratemutualexclusionobject['stream_numbers_count']; $StreamNumberCounter++) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive

  618    Comparison operation "<" between int<0, max> and ((non-empty-array<literal-string&non-falsy-string,
         array{encrypted: bool}|float|int|string|false>)|float|int|string|false) results in an error.

$thisfile_asf_bitratemutualexclusionobject['stream_numbers'][$StreamNumberCounter] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
$offset += 2;
}
Expand Down Expand Up @@ -759,7 +766,7 @@ public function Analyze() {
$thisfile_asf_extendedcontentdescriptionobject['objectsize'] = $NextObjectSize;
$thisfile_asf_extendedcontentdescriptionobject['content_descriptors_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
$offset += 2;
for ($ExtendedContentDescriptorsCounter = 0; $ExtendedContentDescriptorsCounter < $thisfile_asf_extendedcontentdescriptionobject['content_descriptors_count']; $ExtendedContentDescriptorsCounter++) {
for ($ExtendedContentDescriptorsCounter = 0; $ExtendedContentDescriptorsCounter < (int) $thisfile_asf_extendedcontentdescriptionobject['content_descriptors_count']; $ExtendedContentDescriptorsCounter++) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive

  762    Comparison operation "<" between int<0, max> and ((non-empty-array<literal-string&non-falsy-string,
         array{encrypted?: bool}|float|int|string|false>)|float|int|string|false) results in an error.

// shortcut
$thisfile_asf_extendedcontentdescriptionobject['content_descriptors'][$ExtendedContentDescriptorsCounter] = array();
$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current = &$thisfile_asf_extendedcontentdescriptionobject['content_descriptors'][$ExtendedContentDescriptorsCounter];
Expand Down Expand Up @@ -957,7 +964,8 @@ public function Analyze() {
$thisfile_asf_streambitratepropertiesobject['objectsize'] = $NextObjectSize;
$thisfile_asf_streambitratepropertiesobject['bitrate_records_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
$offset += 2;
for ($BitrateRecordsCounter = 0; $BitrateRecordsCounter < $thisfile_asf_streambitratepropertiesobject['bitrate_records_count']; $BitrateRecordsCounter++) {
for ($BitrateRecordsCounter = 0; $BitrateRecordsCounter < (int) $thisfile_asf_streambitratepropertiesobject['bitrate_records_count']; $BitrateRecordsCounter++) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive

  960    Comparison operation "<" between int<0, max> and ((non-empty-array<literal-string&non-falsy-string,
         mixed>)|float|int|string|false) results in an error.

$thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter] = array();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  961    Cannot assign offset 'flags_raw' to string.

$thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['flags_raw'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
$offset += 2;
$thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['flags']['stream_number'] = $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['flags_raw'] & 0x007F;
Expand Down Expand Up @@ -1006,7 +1014,7 @@ public function Analyze() {
if (isset($thisfile_asf_streambitratepropertiesobject['bitrate_records_count'])) {
$ASFbitrateAudio = 0;
$ASFbitrateVideo = 0;
for ($BitrateRecordsCounter = 0; $BitrateRecordsCounter < $thisfile_asf_streambitratepropertiesobject['bitrate_records_count']; $BitrateRecordsCounter++) {
for ($BitrateRecordsCounter = 0; $BitrateRecordsCounter < (int) $thisfile_asf_streambitratepropertiesobject['bitrate_records_count']; $BitrateRecordsCounter++) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive

  1009   Comparison operation "<" between int<0, max> and ((non-empty-array<int<0,
         max>|(literal-string&non-falsy-string), mixed>)|float|int|string|false) results in an error.

if (isset($thisfile_asf_codeclistobject['codec_entries'][$BitrateRecordsCounter])) {
switch ($thisfile_asf_codeclistobject['codec_entries'][$BitrateRecordsCounter]['type_raw']) {
case 1:
Expand All @@ -1030,7 +1038,7 @@ public function Analyze() {
$thisfile_video['bitrate'] = $ASFbitrateVideo;
}
}
if (isset($thisfile_asf['stream_properties_object']) && is_array($thisfile_asf['stream_properties_object'])) {
if (isset($thisfile_asf['stream_properties_object'])) {
Copy link
Collaborator Author

@StudioMaX StudioMaX Feb 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1033   Right side of && is always true.


$thisfile_audio['bitrate'] = 0;
$thisfile_video['bitrate'] = 0;
Expand Down Expand Up @@ -1067,7 +1075,7 @@ public function Analyze() {
}

if (!empty($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'])) { // @phpstan-ignore-line
foreach ($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'] as $dummy => $dataarray) {
foreach ($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'] as $dummy => $dataarray) { // @phpstan-ignore-line
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive

  1070   Offset 'bitrate_records' does not exist on array<int<0, 127>, array<literal-string&non-falsy-string,
         array{encrypted: bool}|float|int|string|false>>.

if (isset($dataarray['flags']['stream_number']) && ($dataarray['flags']['stream_number'] == $streamnumber)) {
$thisfile_asf_audiomedia_currentstream['bitrate'] = $dataarray['bitrate'];
$thisfile_audio['bitrate'] += $dataarray['bitrate'];
Expand Down Expand Up @@ -1153,7 +1161,7 @@ public function Analyze() {
$thisfile_asf_videomedia_currentstream['format_data']['codec_data'] = substr($streamdata['type_specific_data'], $videomediaoffset);

if (!empty($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'])) { // @phpstan-ignore-line
foreach ($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'] as $dummy => $dataarray) {
foreach ($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'] as $dummy => $dataarray) { // @phpstan-ignore-line
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive

  1156   Offset 'bitrate_records' does not exist on array<int<0, 127>, array<literal-string&non-falsy-string,
         array{encrypted: bool}|float|int|string|false>>.

if (isset($dataarray['flags']['stream_number']) && ($dataarray['flags']['stream_number'] == $streamnumber)) {
$thisfile_asf_videomedia_currentstream['bitrate'] = $dataarray['bitrate'];
$thisfile_video['streams'][$streamnumber]['bitrate'] = $dataarray['bitrate'];
Expand Down Expand Up @@ -1266,10 +1274,13 @@ public function Analyze() {
$thisfile_asf_simpleindexobject['maximum_packet_count'] = getid3_lib::LittleEndian2Int(substr($SimpleIndexObjectData, $offset, 4));
$offset += 4;
$thisfile_asf_simpleindexobject['index_entries_count'] = getid3_lib::LittleEndian2Int(substr($SimpleIndexObjectData, $offset, 4));
/** @var int|float|false $totalIndexEntriesCount */
$totalIndexEntriesCount = $thisfile_asf_simpleindexobject['index_entries_count'];
$offset += 4;

$IndexEntriesData = $SimpleIndexObjectData.$this->fread(6 * $thisfile_asf_simpleindexobject['index_entries_count']);
for ($IndexEntriesCounter = 0; $IndexEntriesCounter < $thisfile_asf_simpleindexobject['index_entries_count']; $IndexEntriesCounter++) {
$IndexEntriesData = $SimpleIndexObjectData.$this->fread(6 * $totalIndexEntriesCount);
for ($IndexEntriesCounter = 0; $IndexEntriesCounter < $totalIndexEntriesCount; $IndexEntriesCounter++) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive

  1272   Comparison operation "<" between int<0, max> and ((array<literal-string&non-falsy-string,
         mixed>)|float|int|string|false) results in an error.

$thisfile_asf_simpleindexobject['index_entries'][$IndexEntriesCounter] = array();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1273   Cannot assign offset 'packet_number' to string.

$thisfile_asf_simpleindexobject['index_entries'][$IndexEntriesCounter]['packet_number'] = getid3_lib::LittleEndian2Int(substr($IndexEntriesData, $offset, 4));
$offset += 4;
$thisfile_asf_simpleindexobject['index_entries'][$IndexEntriesCounter]['packet_count'] = getid3_lib::LittleEndian2Int(substr($IndexEntriesData, $offset, 4));
Expand Down Expand Up @@ -1320,9 +1331,10 @@ public function Analyze() {
$offset += 4;

$ASFIndexObjectData .= $this->fread(4 * $thisfile_asf_asfindexobject['index_specifiers_count']);
for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) {
for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < (int) $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive

  1323   Comparison operation "<" between int<0, max> and ((array<literal-string&non-falsy-string,
         mixed>)|float|int|string|false) results in an error.

$IndexSpecifierStreamNumber = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 2));
$offset += 2;
$thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter] = array();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1326   Cannot assign offset 'stream_number' to string.

$thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['stream_number'] = $IndexSpecifierStreamNumber;
$thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['index_type'] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 2));
$offset += 2;
Expand All @@ -1331,17 +1343,19 @@ public function Analyze() {

$ASFIndexObjectData .= $this->fread(4);
$thisfile_asf_asfindexobject['index_entry_count'] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4));
/** @var int|float|false $totalIndexEntryCount */
$totalIndexEntryCount = $thisfile_asf_asfindexobject['index_entry_count'];
$offset += 4;

$ASFIndexObjectData .= $this->fread(8 * $thisfile_asf_asfindexobject['index_specifiers_count']);
for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) {
for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < (int) $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive

  1337   Comparison operation "<" between int<0, max> and ((array<int<0, max>|(literal-string&non-falsy-string),
         mixed>)|float|int|string|false) results in an error.

$thisfile_asf_asfindexobject['block_positions'][$IndexSpecifiersCounter] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 8));
$offset += 8;
}

$ASFIndexObjectData .= $this->fread(4 * $thisfile_asf_asfindexobject['index_specifiers_count'] * $thisfile_asf_asfindexobject['index_entry_count']);
for ($IndexEntryCounter = 0; $IndexEntryCounter < $thisfile_asf_asfindexobject['index_entry_count']; $IndexEntryCounter++) {
for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) {
for ($IndexEntryCounter = 0; $IndexEntryCounter < $totalIndexEntryCount; $IndexEntryCounter++) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive

  1343   Comparison operation "<" between int<0, max> and ((array<int<0, max>|(literal-string&non-falsy-string),
         mixed>)|float|int|string|false) results in an error.

for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < (int) $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive

  1344   Comparison operation "<" between int<0, max> and ((array<int<0, max>|(literal-string&non-falsy-string),
         mixed>)|float|int|string|false) results in an error.

$thisfile_asf_asfindexobject['offsets'][$IndexSpecifiersCounter][$IndexEntryCounter] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4));
$offset += 4;
}
Expand Down
Loading
Loading