php-binary-reader
php-binary-reader copied to clipboard
Not all return types in comments seem correct in BinaryReader.php
Most of the functions specify return type int. While I believe the ones reading from $this->byteReader are returning string. $this->byteReader->read uses fread which returns a string (as mentioned in the comments for $this->byteReader->read).
https://github.com/mdurrant/php-binary-reader/blob/8901cbf62745943a89fcecb21bdbf33e6c75e491/src/BinaryReader.php#L166-L173
Conversely, getUInt16 has return type string in the comments. This should probably be int.
https://github.com/mdurrant/php-binary-reader/blob/8901cbf62745943a89fcecb21bdbf33e6c75e491/src/BinaryReader.php#L191-L205
I think some other functions have similar problems.