@@ 23-55 (lines=33) @@ | ||
20 | * @category PHPExif |
|
21 | * @package Common |
|
22 | */ |
|
23 | class Height extends MeasuredObject |
|
24 | { |
|
25 | /** |
|
26 | * Creates a new instance from given Height object |
|
27 | * |
|
28 | * @param Height $height |
|
29 | * |
|
30 | * @return Height |
|
31 | */ |
|
32 | public static function fromHeight(Height $height) |
|
33 | { |
|
34 | return new self( |
|
35 | $height->getValue(), |
|
36 | (clone $height->getUnit()) |
|
37 | ); |
|
38 | } |
|
39 | ||
40 | /** |
|
41 | * Creates new instance from given value and |
|
42 | * adds a "px" Unit |
|
43 | * |
|
44 | * @param mixed $value |
|
45 | * |
|
46 | * @return Height |
|
47 | */ |
|
48 | public static function pixels($value) |
|
49 | { |
|
50 | return new self( |
|
51 | $value, |
|
52 | new Unit('px') |
|
53 | ); |
|
54 | } |
|
55 | } |
|
56 |
@@ 23-55 (lines=33) @@ | ||
20 | * @category PHPExif |
|
21 | * @package Common |
|
22 | */ |
|
23 | class Width extends MeasuredObject |
|
24 | { |
|
25 | /** |
|
26 | * Creates a new instance from given Width object |
|
27 | * |
|
28 | * @param Width $width |
|
29 | * |
|
30 | * @return Width |
|
31 | */ |
|
32 | public static function fromWidth(Width $width) |
|
33 | { |
|
34 | return new self( |
|
35 | $width->getValue(), |
|
36 | (clone $width->getUnit()) |
|
37 | ); |
|
38 | } |
|
39 | ||
40 | /** |
|
41 | * Creates new instance from given value and |
|
42 | * adds a "px" Unit |
|
43 | * |
|
44 | * @param mixed $value |
|
45 | * |
|
46 | * @return Width |
|
47 | */ |
|
48 | public static function pixels($value) |
|
49 | { |
|
50 | return new self( |
|
51 | $value, |
|
52 | new Unit('px') |
|
53 | ); |
|
54 | } |
|
55 | } |
|
56 |