@@ -29,6 +29,12 @@ 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+ * @throws FileNotFoundException If the file does not exist in the media source directory.
37+ */
3238 public function __construct (string $ path )
3339 {
3440 parent ::__construct ($ this ->getNormalizedPath ($ path ));
@@ -90,6 +96,11 @@ public function getIdentifier(): string
9096 return Str::after ($ this ->getPath (), Hyde::getMediaDirectory ().'/ ' );
9197 }
9298
99+ /**
100+ * Get the file information as an array.
101+ *
102+ * @return array<string, mixed> The file information
103+ */
93104 public function toArray (): array
94105 {
95106 return array_merge (parent ::toArray (), [
@@ -99,16 +110,31 @@ public function toArray(): array
99110 ]);
100111 }
101112
113+ /**
114+ * Get the content length of the file.
115+ *
116+ * @return int The content length in bytes
117+ */
102118 public function getContentLength (): int
103119 {
104120 return $ this ->length ;
105121 }
106122
123+ /**
124+ * Get the MIME type of the file.
125+ *
126+ * @return string The MIME type
127+ */
107128 public function getMimeType (): string
108129 {
109130 return $ this ->mimeType ;
110131 }
111132
133+ /**
134+ * Get the hash of the file.
135+ *
136+ * @return string The file hash
137+ */
112138 public function getHash (): string
113139 {
114140 return $ this ->hash ;
0 commit comments