Skip to content

Commit 650d5a7

Browse files
committed
Manually proxy and deprecate legacy facade methods
This is so we can get an overview of the outdated methods that are inconsistently named This means they are lost from the HydeKernel which could be a problem to review before merge.
1 parent 2004a4e commit 650d5a7

File tree

5 files changed

+23
-47
lines changed

5 files changed

+23
-47
lines changed

docs/_data/partials/hyde-pages-api/hyde-kernel-filesystem-methods.md

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<section id="hyde-kernel-filesystem-methods">
22

33
<!-- Start generated docs for Hyde\Foundation\Concerns\ForwardsFilesystem -->
4-
<!-- Generated by HydePHP DocGen script at 2024-07-26 14:30:44 in 0.13ms -->
4+
<!-- Generated by HydePHP DocGen script at 2024-07-26 15:15:12 in 0.09ms -->
55

66
#### `filesystem()`
77

@@ -27,22 +27,6 @@ No description provided.
2727
Hyde::vendorPath(string $path, string $package): string
2828
```
2929

30-
#### `mediaPath()`
31-
32-
No description provided.
33-
34-
```php
35-
Hyde::mediaPath(string $path): string
36-
```
37-
38-
#### `siteMediaPath()`
39-
40-
No description provided.
41-
42-
```php
43-
Hyde::siteMediaPath(string $path): string
44-
```
45-
4630
#### `sitePath()`
4731

4832
No description provided.

packages/framework/src/Foundation/Concerns/ForwardsFilesystem.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@ public function vendorPath(string $path = '', string $package = 'framework'): st
2828
return $this->filesystem->vendorPath($path, $package);
2929
}
3030

31-
public function mediaPath(string $path = ''): string
32-
{
33-
return $this->filesystem->mediaPath($path);
34-
}
35-
36-
public function siteMediaPath(string $path = ''): string
37-
{
38-
return $this->filesystem->siteMediaPath($path);
39-
}
40-
4131
public function sitePath(string $path = ''): string
4232
{
4333
return $this->filesystem->sitePath($path);

packages/framework/src/Foundation/Kernel/Filesystem.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Hyde\Hyde;
88
use Hyde\Foundation\HydeKernel;
99
use Hyde\Foundation\PharSupport;
10-
use Hyde\Support\Filesystem\MediaFile;
1110
use Illuminate\Support\Collection;
1211

1312
use function collect;
@@ -92,22 +91,6 @@ public function pathToRelative(string $path): string
9291
: $path);
9392
}
9493

95-
/**
96-
* Get the absolute path to the media source directory, or a file within it.
97-
*/
98-
public function mediaPath(string $path = ''): string
99-
{
100-
return MediaFile::sourcePath($path);
101-
}
102-
103-
/**
104-
* Get the absolute path to the compiled site's media directory, or a file within it.
105-
*/
106-
public function siteMediaPath(string $path = ''): string
107-
{
108-
return MediaFile::outputPath($path);
109-
}
110-
11194
/**
11295
* Get the absolute path to the compiled site directory, or a file within it.
11396
*/

packages/framework/src/Hyde.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
* @method static string pathToAbsolute(string $path)
3535
* @method static string pathToRelative(string $path)
3636
* @method static string sitePath(string $path = '')
37-
* @method static string mediaPath(string $path = '')
38-
* @method static string siteMediaPath(string $path = '')
3937
* @method static string formatLink(string $destination)
4038
* @method static string relativeLink(string $destination)
4139
* @method static string mediaLink(string $destination, bool $validate = false)

packages/framework/src/Support/V1Compatibility.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,33 @@
44

55
namespace Hyde\Support;
66

7+
use JetBrains\PhpStorm\Deprecated;
8+
use Hyde\Support\Filesystem\MediaFile;
9+
710
/**
811
* @internal Hyde Facade support to aid in the v1 to v2 transition.
912
*
1013
* @deprecated All code here is deprecated, and exists to help you transition.
1114
*/
1215
trait V1Compatibility
1316
{
14-
//
17+
/**
18+
* @deprecated Use MediaFile::sourcePath() instead.
19+
* @see \Hyde\Support\Filesystem\MediaFile::sourcePath()
20+
*/
21+
#[Deprecated(reason: 'Use MediaFile::sourcePath() instead', replacement: '\Hyde\Support\Filesystem\MediaFile::sourcePath()')]
22+
public static function mediaPath(string $path = ''): string
23+
{
24+
return MediaFile::sourcePath($path);
25+
}
26+
27+
/**
28+
* @deprecated Use MediaFile::outputPath() instead.
29+
* @see \Hyde\Support\Filesystem\MediaFile::outputPath()
30+
*/
31+
#[Deprecated(reason: 'Use MediaFile::outputPath() instead', replacement: '\Hyde\Support\Filesystem\MediaFile::outputPath()')]
32+
public static function siteMediaPath(string $path = ''): string
33+
{
34+
return MediaFile::outputPath($path);
35+
}
1536
}

0 commit comments

Comments
 (0)