File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace BlameButton \Laravel \Changelog ;
4
4
5
+ use BlameButton \Laravel \Changelog \Exceptions \ChangelogNotFoundException ;
5
6
use Illuminate \Support \Facades \Storage ;
6
7
7
8
class Changelog
8
9
{
9
- // Build your next great package.
10
-
11
10
private function getFile (): string
12
11
{
13
12
return config ('config.file ' , base_path ('CHANGELOG.md ' ));
14
13
}
15
14
16
- public function raw (): ? string
15
+ public function raw (): string
17
16
{
18
17
$ file = $ this ->getFile ();
18
+
19
19
if (!Storage::exists ($ file )) {
20
- return null ;
20
+ throw new ChangelogNotFoundException () ;
21
21
}
22
22
23
23
return Storage::get ($ file );
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace BlameButton \Laravel \Changelog \Exceptions ;
4
+
5
+ use RuntimeException ;
6
+
7
+ class ChangelogNotFoundException extends RuntimeException
8
+ {
9
+
10
+ }
You can’t perform that action at this time.
0 commit comments