Merge branch 'stable'

This commit is contained in:
Dylan K. Taylor 2020-01-22 15:16:10 +00:00
commit 0b423c5b96
2 changed files with 4 additions and 1 deletions

View File

@ -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");
} }

View File

@ -84,7 +84,7 @@ class Explosion{
} }
/** /**
* Calculates which blocks will be destroyed by this explosion. If explodeB() is called without calling this, no blocks * Calculates which blocks will be destroyed by this explosion. If explodeB() is called without calling this, no blocks
* will be destroyed. * will be destroyed.
*/ */
public function explodeA() : bool{ public function explodeA() : bool{