| 1 | <?php |
||
| 8 | class UtilFactory |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * A instance of the appropriate System class |
||
| 12 | * |
||
| 13 | * @var \League\CLImate\Util\System\System |
||
| 14 | */ |
||
| 15 | |||
| 16 | public $system; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * A instance of the Cursor class |
||
| 20 | * |
||
| 21 | * @var \League\CLImate\Util\Cursor |
||
| 22 | */ |
||
| 23 | public $cursor; |
||
| 24 | |||
| 25 | 948 | public function __construct(System $system = null, Cursor $cursor = null) |
|
| 30 | |||
| 31 | /** |
||
| 32 | * Get the width of the terminal |
||
| 33 | * |
||
| 34 | * @return integer |
||
| 35 | */ |
||
| 36 | |||
| 37 | 96 | public function width() |
|
| 41 | |||
| 42 | /** |
||
| 43 | * Get the height of the terminal |
||
| 44 | * |
||
| 45 | * @return integer |
||
| 46 | */ |
||
| 47 | |||
| 48 | public function height() |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Determine if the value is numeric, fallback to a default if not |
||
| 55 | * |
||
| 56 | * @param integer|null $dimension |
||
| 57 | * @param integer $default |
||
| 58 | * |
||
| 59 | * @return integer |
||
| 60 | */ |
||
| 61 | |||
| 62 | 96 | protected function getDimension($dimension, $default) |
|
| 66 | } |
||
| 67 |