| 1 | <?php |
||
| 8 | class Font |
||
| 9 | { |
||
| 10 | /** @var string */ |
||
| 11 | protected $name; |
||
| 12 | |||
| 13 | /** @var string */ |
||
| 14 | protected $file; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Create a TTF font from the given $file. |
||
| 18 | * @param string $name |
||
| 19 | * @param string $file |
||
| 20 | * @throws \InvalidArgumentException |
||
| 21 | */ |
||
| 22 | 11 | function __construct($name, $file) |
|
| 31 | |||
| 32 | /** |
||
| 33 | * @param string $file |
||
| 34 | */ |
||
| 35 | public function setFile($file) |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @return string |
||
| 42 | */ |
||
| 43 | 10 | public function getFile() |
|
| 47 | |||
| 48 | /** |
||
| 49 | * @param string $name |
||
| 50 | */ |
||
| 51 | public function setName($name) |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @return string |
||
| 58 | */ |
||
| 59 | public function getName() |
||
| 63 | } |
||
| 64 |
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.