Skip to content

Commit 721b09e

Browse files
authored
Merge pull request #1260 from hydephp/remove-deprecated-code
Remove deprecated `SourceFile::withoutDirectoryPrefix ` method only used in one test
2 parents 85961bc + 726b555 commit 721b09e

File tree

3 files changed

+1
-19
lines changed

3 files changed

+1
-19
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This serves two purposes:
2727
- Removed `RenderData:.getCurrentPage` method deprecated in v1.0.0-RC.2
2828
- Removed `RenderData:.getCurrentRoute` method deprecated in v1.0.0-RC.2
2929
- Removed deprecated `HydePage::$canonicalUrl` property (replaced with `HydePage::getCanonicalUrl()`).
30+
- Removed deprecated `SourceFile::withoutDirectoryPrefix` method only used in one test.
3031

3132
### Fixed
3233
- Fixed the blog post article view where metadata assembly used legacy hard-coded paths instead of dynamic path information.

packages/framework/src/Support/Filesystem/SourceFile.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Hyde\Support\Filesystem;
66

77
use Hyde\Pages\Concerns\HydePage;
8-
use Illuminate\Support\Str;
98

109
/**
1110
* File abstraction for a project source file.
@@ -40,11 +39,4 @@ public function toArray(): array
4039
'pageClass' => $this->pageClass,
4140
]);
4241
}
43-
44-
/** @deprecated This method is not used anywhere other than tests and may be removed */
45-
public function withoutDirectoryPrefix(): string
46-
{
47-
// Works like basename, but keeps subdirectory names.
48-
return Str::after($this->path, $this->pageClass::sourceDirectory().'/');
49-
}
5042
}

packages/framework/tests/Feature/Support/SourceFileTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,4 @@ public function test_to_array_with_file_in_subdirectory()
121121
Filesystem::unlink('foo/bar.txt');
122122
rmdir(Hyde::path('foo'));
123123
}
124-
125-
public function test_without_directory_prefix_retains_subdirectories()
126-
{
127-
$this->assertSame('foo/bar/baz.txt',
128-
SourceFile::make('foo/bar/baz.txt', MarkdownPage::class)->withoutDirectoryPrefix()
129-
);
130-
131-
$this->assertSame('foo/bar.txt',
132-
SourceFile::make('_pages/foo/bar.txt', MarkdownPage::class)->withoutDirectoryPrefix()
133-
);
134-
}
135124
}

0 commit comments

Comments
 (0)