1 | <?php |
||
8 | class Icon |
||
9 | { |
||
10 | /** |
||
11 | * @var String $name : The name of the icon without the path or the extension. |
||
12 | */ |
||
13 | private $name; |
||
14 | /** |
||
15 | * @var String $filePath : The file path of the icon understandable by HTPP protocol. If it is a builtin icon, then it is in the 'img' directory of the project. |
||
16 | */ |
||
17 | private $filePath; |
||
18 | /** |
||
19 | * @var int $size : The size of the file. |
||
20 | */ |
||
21 | private $size; |
||
22 | /** |
||
23 | * @var String $extension : The extension of the icon file without the leading dot. If it is a builtin icon, then it is 'png'. |
||
24 | */ |
||
25 | private $extension; |
||
26 | |||
27 | /** |
||
28 | * The constructor. Use setIcon method. |
||
29 | * |
||
30 | * @param String $name : The name of the icon without the path or the extension. |
||
31 | * @param String $filePath : The file path of the icon. If it is a builtin icon, then it is in the 'img' directory of the project. |
||
32 | * @param int $size : The size of the file. |
||
33 | * @param String $extension : The extension of the icon file without the leading dot. If it is a builtin icon, then it is 'png'. |
||
34 | */ |
||
35 | public function __construct($name = null, $extension = null, $filePath = null, $size = null) { |
||
40 | |||
41 | /** |
||
42 | * Fill all the instance attributes according to the given parameters. |
||
43 | * If only the name is given , then it will assume that a builtin icon is beeing used so the aother attributes will be filled following this logic. |
||
44 | * |
||
45 | * @param String $name : The name of the icon without the path or the extension. |
||
46 | * @param String $filePath : The file path of the icon. If it is a builtin icon, then it is in the 'img' directory of the project. |
||
47 | * @param int $size : The size of the file. |
||
48 | * @param String $extension : The extension of the icon file without the leading dot. If it is a builtin icon, then it is 'png'. |
||
49 | */ |
||
50 | public function setIcon($name, $extension = null, $filePath = null, $size = null) { |
||
61 | |||
62 | /** |
||
63 | * Return icon name. |
||
64 | * |
||
65 | * @return String : the icon name. |
||
66 | */ |
||
67 | public function getName() { |
||
70 | |||
71 | /** |
||
72 | * Return icon extension. |
||
73 | * |
||
74 | * @return String : the icon extension. |
||
75 | */ |
||
76 | public function getExtension() { |
||
79 | |||
80 | |||
81 | /** |
||
82 | * Return icon file path. |
||
83 | * |
||
84 | * @return String : the icon path. |
||
85 | */ |
||
86 | public function getFilePath() { |
||
89 | |||
90 | /** |
||
91 | * Return icon name. |
||
92 | * |
||
93 | * @return int : the icon size. |
||
94 | */ |
||
95 | public function getSize() { |
||
98 | |||
99 | /** |
||
100 | * Magic to String method. |
||
101 | * |
||
102 | * @return String |
||
103 | */ |
||
104 | public function __toString() { |
||
107 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.