Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 12 |
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 = Storage::disk('root'); |
||
44 | $code = $this->argument('code'); |
||
45 | |||
46 | if ($disk->exists($path)) { |
||
47 | $contents = Storage::disk('root')->get($path); |
||
48 | |||
49 | if ($disk->put($path, $contents.PHP_EOL.$code)) { |
||
50 | $this->info('Successfully added code to sidebar_content file.'); |
||
51 | } else { |
||
52 | $this->error('Could not write to sidebar_content file.'); |
||
53 | } |
||
54 | } else { |
||
55 | $this->error("The sidebar_content file does not exist. Make sure Backpack\Base is properly installed."); |
||
56 | } |
||
57 | } |
||
58 | } |
||
59 |
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.