mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Add some missing @throws annotations
This commit is contained in:
@ -73,6 +73,7 @@ interface ResourcePack{
|
||||
* @param int $length Maximum length of data to return.
|
||||
*
|
||||
* @return string byte-array
|
||||
* @throws \InvalidArgumentException if the chunk does not exist
|
||||
*/
|
||||
public function getPackChunk(int $start, int $length) : string;
|
||||
}
|
||||
|
@ -75,6 +75,7 @@ class ZippedResourcePack implements ResourcePack{
|
||||
|
||||
/**
|
||||
* @param string $zipPath Path to the resource pack zip
|
||||
* @throws ResourcePackException
|
||||
*/
|
||||
public function __construct(string $zipPath){
|
||||
$this->path = $zipPath;
|
||||
@ -148,7 +149,7 @@ class ZippedResourcePack implements ResourcePack{
|
||||
public function getPackChunk(int $start, int $length) : string{
|
||||
fseek($this->fileResource, $start);
|
||||
if(feof($this->fileResource)){
|
||||
throw new \RuntimeException("Requested a resource pack chunk with invalid start offset");
|
||||
throw new \InvalidArgumentException("Requested a resource pack chunk with invalid start offset");
|
||||
}
|
||||
return fread($this->fileResource, $length);
|
||||
}
|
||||
|
Reference in New Issue
Block a user