Passed
Push — master ( c98abf...91bafd )
by Jonathan
19:18
created

EditController::deleteRelation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 7
rs 10
1
<?php
2
3
namespace Uccello\Core\Http\Controllers\Group;
4
5
use Illuminate\Http\Request;
0 ignored issues
show
Bug introduced by
The type Illuminate\Http\Request was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Uccello\Core\Http\Controllers\Core\EditController as CoreEditController;
7
use Uccello\Core\Models\Domain;
8
use Uccello\Core\Models\Module;
9
use Illuminate\Support\Facades\Artisan;
0 ignored issues
show
Bug introduced by
The type Illuminate\Support\Facades\Artisan was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
10
11
class EditController extends CoreEditController
12
{
13
    /**
14
     * Add a relation between two records
15
     *
16
     * @param Domain|null $domain
17
     * @param Module $module
18
     * @param Request $request
19
     * @return integer|null
20
     */
21
    public function addRelation(?Domain $domain, Module $module, Request $request)
22
    {
23
        $result = parent::addRelation($domain, $module, $request);
24
25
        Artisan::call('cache:clear');
26
27
        return $result;
28
    }
29
30
    /**
31
     * Delete a relation between two records
32
     *
33
     * @param Domain|null $domain
34
     * @param Module $module
35
     * @param Request $request
36
     * @return integer|null
37
     */
38
    public function deleteRelation(?Domain $domain, Module $module, Request $request)
39
    {
40
        $result = parent::deleteRelation($domain, $module, $request);
41
42
        Artisan::call('cache:clear');
43
44
        return $result;
45
    }
46
}
47