Skip to content

Commit 235c539

Browse files
author
Florian Krämer
committed
Improving documentation
1 parent 373ffcf commit 235c539

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

docs/The-File-Object.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Instead of calling `withFile()` you can also use `withResource()` to re-use an a
4949

5050
You'll also have to add the (uu)id to the file object if your intended path for the file should require it. The same applies to other data that might be relevant for your path.
5151

52-
## Serialization
52+
## Serialization & Saving the File Object
5353

5454
The file object is serializable to json, and you can call `toArray()` on it to turn it into an array that you can either save in the structure you get or continue transforming it into whatever structure your persistence layer expects.
5555

src/FileInterface.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ public function withFile(string $file): FileInterface;
204204
/**
205205
* Returns the path for the file in the storage system
206206
*
207+
* This is probably most of the time a *relative* and not an absolute path
208+
* to some root or container depending on the storage backend.
209+
*
207210
* @return string
208211
*/
209212
public function path(): string;
@@ -219,6 +222,9 @@ public function withPath(string $path): FileInterface;
219222
/**
220223
* Builds the path for this file
221224
*
225+
* Keep in mind that the path will depend on the path builder configuration!
226+
* The resulting path depends on the builder!
227+
*
222228
* @param \Phauthentic\Infrastructure\Storage\PathBuilder\PathBuilderInterface $pathBuilder Path Builder
223229
* @return $this
224230
*/
@@ -227,6 +233,9 @@ public function buildPath(PathBuilderInterface $pathBuilder): FileInterface;
227233
/**
228234
* Builds the URL for this file
229235
*
236+
* Keep in mind that the URL will depend on the URL builder configuration!
237+
* The resulting URL depends on the builder!
238+
*
230239
* @param \Phauthentic\Infrastructure\Storage\UrlBuilder\UrlBuilderInterface $urlBuilder URL Builder
231240
* @return \Phauthentic\Infrastructure\Storage\FileInterface
232241
*/
@@ -272,6 +281,9 @@ public function withUuid(string $uuid): FileInterface;
272281
/**
273282
* Filename
274283
*
284+
* Be aware that the filename doesn't have to match the name of the actual
285+
* file in the storage backend!
286+
*
275287
* @param string $filename Filename
276288
* @return \Phauthentic\Infrastructure\Storage\FileInterface
277289
*/

0 commit comments

Comments
 (0)