ContentsController::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 3
1
<?php
2
/*
3
 * This file is part of EC-CUBE
4
 *
5
 * Copyright(c) 2000-2015 LOCKON CO.,LTD. All Rights Reserved.
6
 *
7
 * http://www.lockon.co.jp/
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
 */
23
24
namespace Eccube\Controller\Admin\Content;
25
26
use Eccube\Application;
27
use Symfony\Component\HttpFoundation\Request;
28
29
/**
30
 * @deprecated 3.1 delete. use NewsController
31
 */
32
class ContentsController extends NewsController
33
{
34
    /**
35
     * @deprecated 3.1 delete. use NewsController
36
     */
37
    public function __construct()
38
    {
39
        parent::__construct();
40
    }
41
42
    /**
0 ignored issues
show
introduced by
Doc comment for parameter "$request" missing
Loading history...
43
     * (non-PHPdoc)
44
     * @see \Eccube\Controller\Admin\Content\NewsController::index()
45
     * @deprecated 3.1 delete. use NewsController
46
     * @param Application $app
47
     * @return \Symfony\Component\HttpFoundation\Response
48
     */
49
    public function index(Application $app, Request $request = null)
50
    {
51
        return parent::index($app, $request);
0 ignored issues
show
Bug introduced by
It seems like $request defined by parameter $request on line 49 can be null; however, Eccube\Controller\Admin\...NewsController::index() does not accept null, maybe add an additional type check?

It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.

We recommend to add an additional type check (or disallow null for the parameter):

function notNullable(stdClass $x) { }

// Unsafe
function withoutCheck(stdClass $x = null) {
    notNullable($x);
}

// Safe - Alternative 1: Adding Additional Type-Check
function withCheck(stdClass $x = null) {
    if ($x instanceof stdClass) {
        notNullable($x);
    }
}

// Safe - Alternative 2: Changing Parameter
function withNonNullableParam(stdClass $x) {
    notNullable($x);
}
Loading history...
52
    }
53
54
    /**
55
     * (non-PHPdoc)
56
     * @see \Eccube\Controller\Admin\Content\NewsController::edit()
57
     * @deprecated 3.1 delete. use NewsController
58
     * @param Application $app
59
     * @param Request $request
0 ignored issues
show
introduced by
Expected 5 spaces after parameter type; 1 found
Loading history...
60
     * @param integer $id
0 ignored issues
show
introduced by
Expected 5 spaces after parameter type; 1 found
Loading history...
61
     * @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
62
     */
63
    public function edit(Application $app, Request $request, $id = null)
64
    {
65
        return parent::edit($app, $request, $id);
66
    }
67
68
    /**
69
     * (non-PHPdoc)
70
     * @see \Eccube\Controller\Admin\Content\NewsController::up()
71
     * @param Application $app
72
     * @param Request $request
0 ignored issues
show
introduced by
Expected 5 spaces after parameter type; 1 found
Loading history...
73
     * @param integer $id
0 ignored issues
show
introduced by
Expected 5 spaces after parameter type; 1 found
Loading history...
74
     * @return \Symfony\Component\HttpFoundation\RedirectResponse
75
     */
76
    public function up(Application $app, Request $request, $id)
77
    {
78
        return parent::up($app, $request, $id);
79
    }
80
81
    /**
82
     * (non-PHPdoc)
83
     * @see \Eccube\Controller\Admin\Content\NewsController::down()
84
     * @param Application $app
85
     * @param Request $request
0 ignored issues
show
introduced by
Expected 5 spaces after parameter type; 1 found
Loading history...
86
     * @param integer $id
0 ignored issues
show
introduced by
Expected 5 spaces after parameter type; 1 found
Loading history...
87
     * @return \Symfony\Component\HttpFoundation\RedirectResponse
88
     */
89
    public function down(Application $app, Request $request, $id)
90
    {
91
        return parent::down($app, $request, $id);
92
    }
93
94
    /**
95
     * (non-PHPdoc)
96
     * @see \Eccube\Controller\Admin\Content\NewsController::delete()
97
     * @param Application $app
98
     * @param Request $request
0 ignored issues
show
introduced by
Expected 5 spaces after parameter type; 1 found
Loading history...
99
     * @param integer $id
0 ignored issues
show
introduced by
Expected 5 spaces after parameter type; 1 found
Loading history...
100
     * @return \Symfony\Component\HttpFoundation\RedirectResponse
101
     */
102
    public function delete(Application $app, Request $request, $id)
103
    {
104
        return parent::delete($app, $request, $id);
105
    }
106
}
107