Passed
Push — master ( 9a172a...9c608c )
by Joe Nilson
03:46 queued 13s
created

EditProducto::execAfterAction()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
cc 1
eloc 1
c 1
b 1
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
namespace FacturaScripts\Plugins\fsRepublicaDominicana\Extension\Controller;
3
4
use Closure;
5
use FacturaScripts\Core\Base\DataBase\DataBaseWhere;
0 ignored issues
show
Bug introduced by
The type FacturaScripts\Core\Base\DataBase\DataBaseWhere 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
7
class EditProducto
8
{
9
    public function createViews(): Closure
10
    {
11
        return function () {
12
            // tu código aquí
13
            // createViews() se ejecuta una vez realizado el createViews() del controlador.
14
            parent::createViews();
15
            $this->addListView('ListImpuestoProducto', 'ImpuestoProducto', 'taxes', 'fas fa-money-check-alt');
0 ignored issues
show
Bug introduced by
The method addListView() does not exist on FacturaScripts\Plugins\f...Controller\EditProducto. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
            $this->/** @scrutinizer ignore-call */ 
16
                   addListView('ListImpuestoProducto', 'ImpuestoProducto', 'taxes', 'fas fa-money-check-alt');

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...
16
        };
17
    }
18
19
    public function execAfterAction(): Closure
20
    {
21
        return function ($action) {
0 ignored issues
show
Unused Code introduced by
The parameter $action is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

21
        return function (/** @scrutinizer ignore-unused */ $action) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
22
            // tu código aquí
23
            // execAfterAction() se ejecuta tras el execAfterAction() del controlador.
24
        };
25
    }
26
27
    public function execPreviousAction(): Closure
28
    {
29
        return function ($action) {
0 ignored issues
show
Unused Code introduced by
The parameter $action is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

29
        return function (/** @scrutinizer ignore-unused */ $action) {

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
30
            // tu código aquí
31
            // execPreviousAction() se ejecuta después del execPreviousAction() del controlador.
32
            // Si devolvemos false detenemos la ejecución del controlador.
33
        };
34
    }
35
36
    public function loadData(): Closure
37
    {
38
        return function ($viewName, $view) {
39
            // tu código aquí
40
            // loadData() se ejecuta tras el loadData() del controlador. Recibe los parámetros $viewName y $view.
41
            switch ($viewName) {
42
                case 'ListImpuestoProducto':
43
                    $where = [new DataBaseWhere('idproducto', $this->getModel()->primaryColumnValue())];
0 ignored issues
show
Bug introduced by
The method getModel() does not exist on FacturaScripts\Plugins\f...Controller\EditProducto. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

43
                    $where = [new DataBaseWhere('idproducto', $this->/** @scrutinizer ignore-call */ getModel()->primaryColumnValue())];

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...
44
                    $view->loadData('', $where);
45
                    break;
46
47
                default:
48
                    parent::loadData($viewName, $view);
49
                    break;
50
            }
51
        };
52
    }
53
}
54