1 | <?php |
||
15 | abstract class AbstractFile implements FileInterface |
||
16 | { |
||
17 | /** |
||
18 | * File name. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $name; |
||
23 | |||
24 | /** |
||
25 | * File mime type. |
||
26 | * |
||
27 | * @var MimeTypeInterface |
||
28 | */ |
||
29 | protected $mimeType; |
||
30 | |||
31 | /** |
||
32 | * File size. |
||
33 | * |
||
34 | * @var SizeInterface |
||
35 | */ |
||
36 | protected $size; |
||
37 | |||
38 | /** |
||
39 | * File tmp path name. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $tmpName; |
||
44 | |||
45 | /** |
||
46 | * AbstractFile constructor. |
||
47 | * |
||
48 | * @param string $name |
||
49 | * @param MimeTypeInterface $mimeType |
||
50 | * @param SizeInterface $size |
||
51 | * @param string $tmpName |
||
52 | */ |
||
53 | 27 | public function __construct($name, MimeTypeInterface $mimeType, SizeInterface $size, $tmpName) |
|
73 | |||
74 | /** |
||
75 | * Obtain File name. |
||
76 | * |
||
77 | * @return string |
||
78 | */ |
||
79 | 6 | public function getName() |
|
83 | |||
84 | /** |
||
85 | * Obtain File mime type. |
||
86 | * |
||
87 | * @return string |
||
88 | */ |
||
89 | 9 | public function getMimeType() |
|
93 | |||
94 | /** |
||
95 | * Obtain File size in kb. |
||
96 | * |
||
97 | * @return int |
||
98 | */ |
||
99 | 6 | public function getSize() |
|
103 | |||
104 | /** |
||
105 | * Obtain File tmp path name. |
||
106 | * |
||
107 | * @return string |
||
108 | */ |
||
109 | 6 | public function getTmpName() |
|
113 | |||
114 | /** |
||
115 | * Specify data which should be serialized to JSON. |
||
116 | * |
||
117 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
||
118 | * |
||
119 | * @return mixed data which can be serialized by <b>json_encode</b>, |
||
120 | * which is a value of any type other than a resource. |
||
121 | * |
||
122 | * @since 5.4.0 |
||
123 | */ |
||
124 | 3 | public function jsonSerialize() |
|
132 | } |
||
133 |