Completed
Push — master ( c044d5...f8791f )
by Angus
03:19
created

History::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php defined('BASEPATH') or exit('No direct script access allowed');
2
3
class History extends Auth_Controller {
4
	public function __construct() {
5
		parent::__construct();
6
	}
7
8
	public function index(int $page = 1) {
9
		if($page === 0) redirect('user/history/1');
10
11
		$this->header_data['title'] = "History";
12
		$this->header_data['page']  = "history";
13
14
		$historyData = $this->History->userGetHistory($page);
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 20 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
15
		$this->body_data['historyData'] = $historyData['rows'];
16
		$this->body_data['currentPage'] = $page;
17
		$this->body_data['totalPages']  = $historyData['totalPages'];
18
19
		if($page > $this->body_data['totalPages']) redirect('user/history/1');
20
21
		$this->_render_page('User/History');
22
	}
23
}
24