| 1 | <?php |
||
| 9 | class Font |
||
| 10 | { |
||
| 11 | /** @var string */ |
||
| 12 | protected $name; |
||
| 13 | |||
| 14 | /** @var string */ |
||
| 15 | protected $file; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Create a TTF font from the given $file. |
||
| 19 | * @param string $name |
||
| 20 | * @param string $file |
||
| 21 | * @throws \InvalidArgumentException |
||
| 22 | */ |
||
| 23 | 11 | function __construct($name, $file) |
|
| 29 | |||
| 30 | /** |
||
| 31 | * @param string $file |
||
| 32 | */ |
||
| 33 | public function setFile($file) |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @return string |
||
| 40 | */ |
||
| 41 | 10 | public function getFile() |
|
| 45 | |||
| 46 | /** |
||
| 47 | * @param string $name |
||
| 48 | */ |
||
| 49 | public function setName($name) |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return string |
||
| 56 | */ |
||
| 57 | public function getName() |
||
| 61 | } |
||
| 62 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.