PluginController::uninstall()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 8
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
1
<?php namespace Mascame\Artificer\Http\Controllers;
2
3
use App;
4
use Mascame\Arrayer\Builder;
5
use Mascame\Artificer\Options\AdminOption;
6
use Redirect;
7
use View;
8
9
class PluginController extends BaseController
10
{
11
12
    public function plugins()
13
    {
14
        return View::make($this->getView('plugins'))
15
            ->with('plugins', App::make('ArtificerPluginManager')->getAll());
16
    }
17
18
    public function install($plugin)
19
    {
20
        $plugin = $this->getPluginSlug($plugin);
21
22
        App::make('ArtificerPluginManager')->installer()->install($plugin);
23
24
        return \Redirect::route('admin.plugins');
0 ignored issues
show
Bug introduced by
The method route() does not seem to exist on object<redirect>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
25
    }
26
27
    public function uninstall($plugin)
28
    {
29
        $plugin = $this->getPluginSlug($plugin);
30
31
        App::make('ArtificerPluginManager')->installer()->uninstall($plugin);
32
33
        return \Redirect::route('admin.plugins');
0 ignored issues
show
Bug introduced by
The method route() does not seem to exist on object<redirect>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
34
    }
35
36
    protected function getPluginSlug($plugin) {
37
        return \App::make('ArtificerPluginManager')->getFromSlug($plugin)->namespace;
38
    }
39
40
}