Bump phpstan/phpstan from 1.11.2 to 1.11.8 in the development-patch-updates group (#6410)

This commit is contained in:
dependabot[bot]
2024-07-30 06:47:56 +00:00
committed by GitHub
parent df4ada81e5
commit 237677c028
5 changed files with 16 additions and 7 deletions

View File

@ -60,6 +60,8 @@ interface ResourcePack{
* @param int $start Offset to start reading the chunk from
* @param int $length Maximum length of data to return.
*
* @phpstan-param positive-int $length
*
* @return string byte-array
* @throws \InvalidArgumentException if the chunk does not exist
*/

View File

@ -154,6 +154,9 @@ class ZippedResourcePack implements ResourcePack{
}
public function getPackChunk(int $start, int $length) : string{
if($length < 1){
throw new \InvalidArgumentException("Pack length must be positive");
}
fseek($this->fileResource, $start);
if(feof($this->fileResource)){
throw new \InvalidArgumentException("Requested a resource pack chunk with invalid start offset");