Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
8 / 8
CRAP
100.00% covered (success)
100.00%
1 / 1
ForwardsFilesystem
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
8 / 8
8
100.00% covered (success)
100.00%
1 / 1
 filesystem
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 path
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 vendorPath
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 mediaPath
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 sitePath
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 siteMediaPath
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 pathToAbsolute
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 pathToRelative
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Hyde\Foundation\Concerns;
6
7use Hyde\Foundation\Kernel\Filesystem;
8
9/**
10 * @internal Single-use trait for the HydeKernel class.
11 *
12 * @see \Hyde\Foundation\HydeKernel
13 */
14trait 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 $package = 'framework'): string
27    {
28        return $this->filesystem->vendorPath($path, $package);
29    }
30
31    public function mediaPath(string $path = ''): string
32    {
33        return $this->filesystem->mediaPath($path);
34    }
35
36    public function sitePath(string $path = ''): string
37    {
38        return $this->filesystem->sitePath($path);
39    }
40
41    public function siteMediaPath(string $path = ''): string
42    {
43        return $this->filesystem->siteMediaPath($path);
44    }
45
46    public function pathToAbsolute(string|array $path): string|array
47    {
48        return $this->filesystem->pathToAbsolute($path);
49    }
50
51    public function pathToRelative(string $path): string
52    {
53        return $this->filesystem->pathToRelative($path);
54    }
55}