HosipLan

Untitled

Sep 13th, 2012
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.22 KB | None | 0 0
  1. /**
  2.  * @author Filip Procházka <[email protected]>
  3.  *
  4.  * @property float|int $width
  5.  * @property float|int $height
  6.  */
  7. class Size extends Nette\Object
  8. {
  9.  
  10.     /**
  11.      * @var float|int
  12.      */
  13.     private $width;
  14.  
  15.     /**
  16.      * @var float|int
  17.      */
  18.     private $height;
  19.  
  20.  
  21.  
  22.     /**
  23.      * @param float|int $width
  24.      * @param float|int $height
  25.      */
  26.     public function __construct($width, $height)
  27.     {
  28.         $this->width = $width;
  29.         $this->height = $height;
  30.     }
  31.  
  32.  
  33.  
  34.     /**
  35.      * @return float|int
  36.      */
  37.     public function getHeight()
  38.     {
  39.         return $this->height;
  40.     }
  41.  
  42.  
  43.  
  44.     /**
  45.      * @return float|int
  46.      */
  47.     public function getWidth()
  48.     {
  49.         return $this->width;
  50.     }
  51.  
  52.  
  53.  
  54.     /**
  55.      * @param string $file
  56.      *
  57.      * @return Size
  58.      */
  59.     public static function fromFile($file)
  60.     {
  61.         list($width, $height) = @getimagesize($file);
  62.         return new Size($width, $height);
  63.     }
  64.  
  65. }
  66.  
  67. /**
  68.  * @author Filip Procházka <[email protected]>
  69.  */
  70. class Point extends Nette\Object
  71. {
  72.  
  73.     /**
  74.      * @var float|int
  75.      */
  76.     public $lon;
  77.  
  78.     /**
  79.      * @var float|int
  80.      */
  81.     public $lat;
  82.  
  83.  
  84.  
  85.     /**
  86.      * @param float|int $lon
  87.      * @param float|int $lat
  88.      */
  89.     public function __construct($lon, $lat)
  90.     {
  91.         $this->lon = $lon;
  92.         $this->lat = $lat;
  93.     }
  94.  
  95. }
Advertisement
Add Comment
Please, Sign In to add comment