public function __construct($debug) { if (!Validator::isBool($debug)) { throw new IllegalArgumentException(); } $this->debug = $debug; }
public function factorySetLengthRight($lengthRight) { if (!Validator::isNumber($lengthRight)) { throw new IllegalArgumentException(); } return new Rectangle($this->pointLeftUp, $this->lengthDown, $lengthRight); }
public function __construct($double = 0.0) { parent::__construct(); if (!Validator::isDouble($double)) { throw new IllegalArgumentException(); } $this->double = $double; }
public function __construct($integer) { parent::__construct(); if (!Validator::isInt($integer)) { throw new IllegalArgumentException(); } $this->integer = $integer; }
public function __construct($boolean) { parent::__construct(); if (!Validator::isBool($boolean)) { throw new IllegalArgumentException(); } $this->boolean = $boolean; }
public function __construct($x, $y, $z) { parent::__construct($x, $y); if (!Validator::isNumber($z)) { throw new IllegalArgumentException(); } $this->z = $z; }
public function __construct($char = '') { parent::__construct(); if (!Validator::isChar($char)) { throw new IllegalArgumentException(); } $this->char = $char; }
public function __construct($x, $y) { parent::__construct(); if (!Validator::isNumber($x) || !Validator::isNumber($y)) { throw new IllegalArgumentException(); } $this->x = $x; $this->y = $y; }
public function deepClone(&$object) { foreach ($object as &$val) { if (Validator::isObject($val)) { $val = clone $val; } elseif (Validator::isArray($val)) { $this->deepClone($val); } } }
public function __construct(Point $pointLefUp, $length) { parent::__construct(); if (!Validator::isNumber($length)) { throw new IllegalArgumentException(); } $this->pointLeftUp = $pointLefUp; $this->pointLeftDown = new Point($this->pointLeftUp->getX(), $this->pointLeftUp->getY() - $length); $this->pointRightDown = new Point($this->pointLeftUp->getX() + $length, $this->pointLeftUp->getY() - $length); $this->pointRightUp = new Point($this->pointLeftUp->getX(), $this->pointLeftUp->getY() + $length); $this->length = $length; }
public function __construct($width = 400, $height = 200) { parent::__construct(); if (!Validator::isNumber($width) || Validator::isNumber($height)) { throw new IllegalArgumentException(); } $this->captcha = new Images($width, $height); $this->captcha->setBackgroundColor(new Color(0, 0, 0)); $this->captcha->setTextColor(new Color(255, 255, 255)); $string = new StringW(Hash::r()); $this->text = $string->subString(0, Math::randomInterval(6, 8)); $this->captcha->setText(Math::randomInterval(2, 6), new Point(0, 0), $string, FALSE); }
public static function checkColor($red = 0, $green = 0, $blue = 0) { if (!Validator::isNumber($red) || !Validator::isNumber($green) || !Validator::isNumber($blue)) { throw new IllegalArgumentException(); } if ($red < 0 || $red > 255) { throw new RedColorException(); } if ($green < 0 || $green > 255) { throw new GreenColorException(); } if ($blue < 0 || $blue > 255) { throw new BlueColorException(); } return TRUE; }
public function setSubject($subject) { if (!Validator::isEmpty($subject)) { throw new IllegalArgumentException('Prázdný text předmětu'); } $this->subject = (string) $subject; return $this; }
public function numberSub($number) { if (!Validator::isNumber($number)) { throw new IllegalArgumentException(); } $newMatrix = []; for ($i = 0; $i < $this->getMatrixSizeA(); $i++) { for ($j = 0; $j < $this->getMatrixSizeB(); $j++) { $newMatrix[$i][$j] = $this->getMatrix()[$i][$j] / $number; } } return new Matrix($newMatrix); }
public final function moveUploaded($to) { if (!Validator::isDir($to)) { throw new IllegalArgumentException(); } return move_uploaded_file($this->filePath, $to); }
public function toPNG() { if (Validator::isResource($this->imageResource)) { throw new RuntimeException(); } imagepng($this->imageResource); imagedestroy($this->imageResource); }
public function charAt($x) { if (!Validator::isNumber($x) || $x < 0 || $x > mb_strlen($this->string, 'UTF-8') - 1) { throw new IllegalArgumentException(); } return new Character($this->string[$x]); }
public static final function isIPv6($ip) { return Validator::validateIPv6UsingFilter($ip); }
public static function validateDepend($depends) { if (!Validator::isArray($depends) || !Validator::isObject($depends)) { throw new IllegalArgumentException(); } }