mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 01:39:52 +00:00
Merge branch 'stable'
This commit is contained in:
commit
0b423c5b96
@ -35,6 +35,9 @@ class SkinImage{
|
|||||||
private $data;
|
private $data;
|
||||||
|
|
||||||
public function __construct(int $height, int $width, string $data){
|
public function __construct(int $height, int $width, string $data){
|
||||||
|
if($height < 0 or $width < 0){
|
||||||
|
throw new \InvalidArgumentException("Height and width cannot be negative");
|
||||||
|
}
|
||||||
if(($expected = $height * $width * 4) !== ($actual = strlen($data))){
|
if(($expected = $height * $width * 4) !== ($actual = strlen($data))){
|
||||||
throw new \InvalidArgumentException("Data should be exactly $expected bytes, got $actual bytes");
|
throw new \InvalidArgumentException("Data should be exactly $expected bytes, got $actual bytes");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user