Skip to content

Commit

Permalink
Manually proxy and deprecate legacy facade methods
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
caendesilva committed Jul 26, 2024
1 parent 2004a4e commit 650d5a7
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 47 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<section id="hyde-kernel-filesystem-methods">

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

#### `filesystem()`

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

#### `mediaPath()`

No description provided.

```php
Hyde::mediaPath(string $path): string
```

#### `siteMediaPath()`

No description provided.

```php
Hyde::siteMediaPath(string $path): string
```

#### `sitePath()`

No description provided.
Expand Down
10 changes: 0 additions & 10 deletions packages/framework/src/Foundation/Concerns/ForwardsFilesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ public function vendorPath(string $path = '', string $package = 'framework'): st
return $this->filesystem->vendorPath($path, $package);
}

public function mediaPath(string $path = ''): string
{
return $this->filesystem->mediaPath($path);
}

public function siteMediaPath(string $path = ''): string
{
return $this->filesystem->siteMediaPath($path);
}

public function sitePath(string $path = ''): string
{
return $this->filesystem->sitePath($path);
Expand Down
17 changes: 0 additions & 17 deletions packages/framework/src/Foundation/Kernel/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Hyde\Hyde;
use Hyde\Foundation\HydeKernel;
use Hyde\Foundation\PharSupport;
use Hyde\Support\Filesystem\MediaFile;
use Illuminate\Support\Collection;

use function collect;
Expand Down Expand Up @@ -92,22 +91,6 @@ public function pathToRelative(string $path): string
: $path);
}

/**
* Get the absolute path to the media source directory, or a file within it.
*/
public function mediaPath(string $path = ''): string
{
return MediaFile::sourcePath($path);
}

/**
* Get the absolute path to the compiled site's media directory, or a file within it.
*/
public function siteMediaPath(string $path = ''): string
{
return MediaFile::outputPath($path);
}

/**
* Get the absolute path to the compiled site directory, or a file within it.
*/
Expand Down
2 changes: 0 additions & 2 deletions packages/framework/src/Hyde.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
* @method static string pathToAbsolute(string $path)
* @method static string pathToRelative(string $path)
* @method static string sitePath(string $path = '')
* @method static string mediaPath(string $path = '')
* @method static string siteMediaPath(string $path = '')
* @method static string formatLink(string $destination)
* @method static string relativeLink(string $destination)
* @method static string mediaLink(string $destination, bool $validate = false)
Expand Down
23 changes: 22 additions & 1 deletion packages/framework/src/Support/V1Compatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,33 @@

namespace Hyde\Support;

use JetBrains\PhpStorm\Deprecated;
use Hyde\Support\Filesystem\MediaFile;

/**
* @internal Hyde Facade support to aid in the v1 to v2 transition.
*
* @deprecated All code here is deprecated, and exists to help you transition.
*/
trait V1Compatibility
{
//
/**
* @deprecated Use MediaFile::sourcePath() instead.
* @see \Hyde\Support\Filesystem\MediaFile::sourcePath()
*/
#[Deprecated(reason: 'Use MediaFile::sourcePath() instead', replacement: '\Hyde\Support\Filesystem\MediaFile::sourcePath()')]
public static function mediaPath(string $path = ''): string
{
return MediaFile::sourcePath($path);
}

/**
* @deprecated Use MediaFile::outputPath() instead.
* @see \Hyde\Support\Filesystem\MediaFile::outputPath()
*/
#[Deprecated(reason: 'Use MediaFile::outputPath() instead', replacement: '\Hyde\Support\Filesystem\MediaFile::outputPath()')]
public static function siteMediaPath(string $path = ''): string
{
return MediaFile::outputPath($path);
}
}

1 comment on commit 650d5a7

@caendesilva
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means they are lost from the HydeKernel which could be a problem to review before merge.

Please sign in to comment.