Conditions | 3 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
40 | public function handle() |
||
41 | { |
||
42 | $path = 'resources/views/vendor/backpack/base/inc/sidebar_content.blade.php'; |
||
43 | $disk_name = config('backpack.base.root_disk_name'); |
||
44 | $disk = Storage::disk($disk_name); |
||
45 | $code = $this->argument('code'); |
||
46 | |||
47 | if ($disk->exists($path)) { |
||
48 | $contents = Storage::disk($disk_name)->get($path); |
||
49 | |||
50 | if ($disk->put($path, $contents.PHP_EOL.$code)) { |
||
51 | $this->info('Successfully added code to sidebar_content file.'); |
||
52 | } else { |
||
53 | $this->error('Could not write to sidebar_content file.'); |
||
54 | } |
||
55 | } else { |
||
56 | $this->error("The sidebar_content file does not exist. Make sure Backpack\Base is properly installed."); |
||
57 | } |
||
58 | } |
||
59 | } |
||
60 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.