Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @author Filip Procházka <[email protected]>
- *
- * @property float|int $width
- * @property float|int $height
- */
- class Size extends Nette\Object
- {
- /**
- * @var float|int
- */
- private $width;
- /**
- * @var float|int
- */
- private $height;
- /**
- * @param float|int $width
- * @param float|int $height
- */
- public function __construct($width, $height)
- {
- $this->width = $width;
- $this->height = $height;
- }
- /**
- * @return float|int
- */
- public function getHeight()
- {
- return $this->height;
- }
- /**
- * @return float|int
- */
- public function getWidth()
- {
- return $this->width;
- }
- /**
- * @param string $file
- *
- * @return Size
- */
- public static function fromFile($file)
- {
- list($width, $height) = @getimagesize($file);
- return new Size($width, $height);
- }
- }
- /**
- * @author Filip Procházka <[email protected]>
- */
- class Point extends Nette\Object
- {
- /**
- * @var float|int
- */
- public $lon;
- /**
- * @var float|int
- */
- public $lat;
- /**
- * @param float|int $lon
- * @param float|int $lat
- */
- public function __construct($lon, $lat)
- {
- $this->lon = $lon;
- $this->lat = $lat;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment