File tree Expand file tree Collapse file tree 5 files changed +12
-14
lines changed
docs/_data/partials/hyde-pages-api Expand file tree Collapse file tree 5 files changed +12
-14
lines changed Original file line number Diff line number Diff line change 11<section id =" hyde-kernel-hyperlink-methods " >
22
33<!-- Start generated docs for Hyde\Foundation\Concerns\ForwardsHyperlinks -->
4- <!-- Generated by HydePHP DocGen script at 2024-07-26 18:20:22 in 0.13ms -->
4+ <!-- Generated by HydePHP DocGen script at 2024-07-26 18:57:46 in 0.11ms -->
55
66#### ` formatLink() `
77
@@ -24,7 +24,7 @@ Hyde::relativeLink(string $destination): string
2424No description provided.
2525
2626``` php
27- Hyde::mediaLink(string $destination, bool $validate ): string
27+ Hyde::mediaLink(string $destination): string
2828```
2929
3030#### ` asset() `
Original file line number Diff line number Diff line change @@ -23,9 +23,9 @@ public function relativeLink(string $destination): string
2323 return $ this ->hyperlinks ->relativeLink ($ destination );
2424 }
2525
26- public function mediaLink (string $ destination, bool $ validate = false ): string
26+ public function mediaLink (string $ destination ): string
2727 {
28- return $ this ->hyperlinks ->mediaLink ($ destination, $ validate );
28+ return $ this ->hyperlinks ->mediaLink ($ destination );
2929 }
3030
3131 public function asset (string $ name ): string
Original file line number Diff line number Diff line change @@ -93,9 +93,9 @@ public function relativeLink(string $destination): string
9393 * An exception will be thrown if the file does not exist in the _media directory,
9494 * and the second argument is set to true.
9595 */
96- public function mediaLink (string $ destination, bool $ validate = false ): string
96+ public function mediaLink (string $ destination ): string
9797 {
98- if ($ validate && ! file_exists ($ sourcePath = "{$ this ->kernel ->getMediaDirectory ()}/ $ destination " )) {
98+ if (false && ! file_exists ($ sourcePath = "{$ this ->kernel ->getMediaDirectory ()}/ $ destination " )) {
9999 throw new FileNotFoundException ($ sourcePath );
100100 }
101101
Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ public static function siteMediaPath(string $path = ''): string
3737 return MediaFile::outputPath ($ path );
3838 }
3939
40- public static function mediaLink (string $ destination, bool $ validate = false ): string
40+ public static function mediaLink (string $ destination ): string
4141 {
42- return HydeKernel::getInstance ()->mediaLink ($ destination, $ validate );
42+ return HydeKernel::getInstance ()->mediaLink ($ destination );
4343 }
4444}
Original file line number Diff line number Diff line change 77use Hyde \Foundation \HydeKernel ;
88use Hyde \Foundation \Facades \Routes ;
99use Hyde \Foundation \Kernel \Hyperlinks ;
10- use Hyde \Framework \Exceptions \FileNotFoundException ;
1110use Hyde \Hyde ;
1211use Hyde \Testing \TestCase ;
1312
@@ -105,16 +104,15 @@ public function testMediaLinkHelperUsesConfiguredMediaDirectory()
105104 $ this ->assertSame ('assets/foo ' , $ this ->class ->mediaLink ('foo ' ));
106105 }
107106
108- public function testMediaLinkHelperWithValidationAndExistingFile ()
107+ public function testMediaLinkHelperWithExistingFile ()
109108 {
110109 $ this ->file ('_media/foo ' );
111- $ this ->assertSame ('media/foo ' , $ this ->class ->mediaLink ('foo ' , true ));
110+ $ this ->assertSame ('media/foo ' , $ this ->class ->mediaLink ('foo ' ));
112111 }
113112
114- public function testMediaLinkHelperWithValidationAndNonExistingFile ()
113+ public function testMediaLinkHelperWithNonExistingFile ()
115114 {
116- $ this ->expectException (FileNotFoundException::class);
117- $ this ->class ->mediaLink ('foo ' , true );
115+ $ this ->assertSame ('media/foo ' , $ this ->class ->mediaLink ('foo ' ));
118116 }
119117
120118 public function testRouteHelper ()
You can’t perform that action at this time.
0 commit comments