Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
17 | 15 | public function setFile( |
|
18 | $file, |
||
19 | string $contentDisposition = null, |
||
20 | bool $autoEtag = false, |
||
21 | bool $autoLastModified = true |
||
22 | ) { |
||
23 | // Wrap the file in our own \Swis\Laravel\Encrypted\File class. |
||
24 | 15 | if (!$file instanceof File) { |
|
25 | 15 | if ($file instanceof \SplFileInfo) { |
|
26 | 3 | $file = new File($file->getPathname()); |
|
27 | } else { |
||
28 | 12 | $file = new File((string) $file); |
|
29 | } |
||
30 | } |
||
31 | |||
32 | 15 | return parent::setFile($file, $contentDisposition, $autoEtag, $autoLastModified); |
|
33 | } |
||
67 |