1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Hyde\Foundation\Concerns; |
6
|
|
|
|
7
|
|
|
use Hyde\Foundation\Filesystem; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* @internal Single-use trait for the HydeKernel class. |
11
|
|
|
* |
12
|
|
|
* @see \Hyde\Foundation\HydeKernel |
13
|
|
|
*/ |
14
|
|
|
trait ForwardsFilesystem |
15
|
|
|
{ |
16
|
|
|
public function filesystem(): Filesystem |
17
|
|
|
{ |
18
|
|
|
return $this->filesystem; |
19
|
|
|
} |
20
|
|
|
|
21
|
|
|
public function path(string $path = ''): string |
22
|
|
|
{ |
23
|
|
|
return $this->filesystem->path($path); |
24
|
|
|
} |
25
|
|
|
|
26
|
|
|
public function vendorPath(string $path = ''): string |
27
|
|
|
{ |
28
|
|
|
return $this->filesystem->vendorPath($path); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
public function copy(string $from, string $to): bool |
32
|
|
|
{ |
33
|
|
|
return $this->filesystem->copy($from, $to); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
public function touch(string|array $path): bool |
37
|
|
|
{ |
38
|
|
|
return $this->filesystem->touch($path); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
public function unlink(string|array $path): bool |
42
|
|
|
{ |
43
|
|
|
return $this->filesystem->unlink($path); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function getModelSourcePath(string $model, string $path = ''): string |
47
|
|
|
{ |
48
|
|
|
return $this->filesystem->getModelSourcePath($model, $path); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
public function getBladePagePath(string $path = ''): string |
52
|
|
|
{ |
53
|
|
|
return $this->filesystem->getBladePagePath($path); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
public function getMarkdownPagePath(string $path = ''): string |
57
|
|
|
{ |
58
|
|
|
return $this->filesystem->getMarkdownPagePath($path); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
public function getMarkdownPostPath(string $path = ''): string |
62
|
|
|
{ |
63
|
|
|
return $this->filesystem->getMarkdownPostPath($path); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
public function getDocumentationPagePath(string $path = ''): string |
67
|
|
|
{ |
68
|
|
|
return $this->filesystem->getDocumentationPagePath($path); |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
public function sitePath(string $path = ''): string |
72
|
|
|
{ |
73
|
|
|
return $this->filesystem->sitePath($path); |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
public function pathToAbsolute(string|array $path): string|array |
77
|
|
|
{ |
78
|
|
|
return $this->filesystem->pathToAbsolute($path); |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
public function pathToRelative(string $path): string |
82
|
|
|
{ |
83
|
|
|
return $this->filesystem->pathToRelative($path); |
84
|
|
|
} |
85
|
|
|
} |
86
|
|
|
|