Completed
Pull Request — master (#16)
by Julius
02:27
created

AppController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A index() 0 4 1
1
<?php
2
/**
3
 * @copyright Copyright (c) 2016 Julius Härtl <[email protected]>
4
 *
5
 * @author Julius Härtl <[email protected]>
6
 *
7
 * @license GNU AGPL version 3 or any later version
8
 *
9
 *  This program is free software: you can redistribute it and/or modify
10
 *  it under the terms of the GNU Affero General Public License as
11
 *  published by the Free Software Foundation, either version 3 of the
12
 *  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 Affero General Public License for more details.
18
 *
19
 *  You should have received a copy of the GNU Affero General Public License
20
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
 *
22
 */
23
24
namespace OCA\AppOrder\Controller;
25
26
use \OCP\AppFramework\Controller;
27
use OCP\AppFramework\Http\RedirectResponse;
28
use \OCP\AppFramework\Http\TemplateResponse;
29
use \OCP\IRequest;
30
use \OCP\INavigationManager;
31
use \OCA\AppOrder\Service\ConfigService;
32
use OCA\AppOrder\Util;
33
34
class AppController extends Controller {
35
36
    private $userId;
37
    private $appConfig;
38
    private $navigationManager;
39
	private $util;
40
41
    public function __construct($appName, IRequest $request, ConfigService $appConfig, INavigationManager $navigationManager, Util $util, $userId) {
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 80 characters; contains 148 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
42
        parent::__construct($appName, $request);
43
        $this->userId = $userId;
44
        $this->appConfig = $appConfig;
45
        $this->navigationManager = $navigationManager;
46
		$this->util = $util;
47
    }
48
49
	/**
50
	 * @NoCSRFRequired
51
	 * @return RedirectResponse
52
	 */
53
    public function index() {
54
		$firstPage = json_decode($this->util->getAppOrder())[0];
55
        return new RedirectResponse($firstPage);
56
    }
57
58
}
59