Code Duplication    Length = 10-11 lines in 3 locations

app/presenters/ItemPresenter.php 2 locations

@@ 60-69 (lines=10) @@
57
        }
58
    }
59
60
    public function actionCreate($driver, $database, $type, $table)
61
    {
62
        if (!$this->driver->permissions()->canCreateItem($database, $type, $table)) {
63
            throw new ForbiddenRequestException('Create item is not allowed');
64
        }
65
        $this->template->driver = $driver;
66
        $this->database = $database;
67
        $this->template->type = $this->type = $type;
68
        $this->table = $table;
69
    }
70
71
    public function actionEdit($driver, $database, $type, $table, $item)
72
    {
@@ 71-81 (lines=11) @@
68
        $this->table = $table;
69
    }
70
71
    public function actionEdit($driver, $database, $type, $table, $item)
72
    {
73
        if (!$this->driver->permissions()->canEditItem($database, $type, $table, $item)) {
74
            throw new ForbiddenRequestException('Edit item is not allowed');
75
        }
76
        $this->template->driver = $driver;
77
        $this->database = $database;
78
        $this->template->type = $this->type = $type;
79
        $this->table = $table;
80
        $this->item = $item;
81
    }
82
83
    public function handleDelete($driver, $database, $type, $table, $item)
84
    {

app/presenters/TablePresenter.php 1 location

@@ 43-52 (lines=10) @@
40
        $this->template->type = $this->type = $type;
41
    }
42
43
    public function actionEdit($driver, $database, $type, $table)
44
    {
45
        if (!$this->driver->permissions()->canEditTable($database, $type, $table)) {
46
            throw new ForbiddenRequestException('Edit table is not allowed');
47
        }
48
        $this->template->driver = $driver;
49
        $this->database = $database;
50
        $this->template->type = $this->type = $type;
51
        $this->table = $table;
52
    }
53
54
    public function handleDelete($driver, $database, $type, $table)
55
    {