@@ -29,6 +29,13 @@ class MediaFile extends ProjectFile
2929 public readonly string $ mimeType ;
3030 public readonly string $ hash ;
3131
32+ /**
33+ * Create a new MediaFile instance.
34+ *
35+ * @param string $path The file path relative to the project root or media source directory.
36+ *
37+ * @throws FileNotFoundException If the file does not exist in the media source directory.
38+ */
3239 public function __construct (string $ path )
3340 {
3441 parent ::__construct ($ this ->getNormalizedPath ($ path ));
@@ -90,6 +97,11 @@ public function getIdentifier(): string
9097 return Str::after ($ this ->getPath (), Hyde::getMediaDirectory ().'/ ' );
9198 }
9299
100+ /**
101+ * Get the file information as an array.
102+ *
103+ * @return array<string, mixed> The file information
104+ */
93105 public function toArray (): array
94106 {
95107 return array_merge (parent ::toArray (), [
@@ -99,16 +111,31 @@ public function toArray(): array
99111 ]);
100112 }
101113
114+ /**
115+ * Get the content length of the file.
116+ *
117+ * @return int The content length in bytes
118+ */
102119 public function getContentLength (): int
103120 {
104121 return $ this ->length ;
105122 }
106123
124+ /**
125+ * Get the MIME type of the file.
126+ *
127+ * @return string The MIME type
128+ */
107129 public function getMimeType (): string
108130 {
109131 return $ this ->mimeType ;
110132 }
111133
134+ /**
135+ * Get the hash of the file.
136+ *
137+ * @return string The file hash
138+ */
112139 public function getHash (): string
113140 {
114141 return $ this ->hash ;
0 commit comments