Carbon_Pagination_Item_Direction_Backward_Page   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 6
Bugs 0 Features 0
Metric Value
c 6
b 0
f 0
dl 0
loc 15
ccs 4
cts 4
cp 1
rs 10
wmc 1
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A get_direction_disabled() 0 5 1
1
<?php
2
/**
3
 * The Carbon Pagination direction backward page item class.
4
 * Used for prev & first items.
5
 * Should be extended by each one of them.
6
 *
7
 * @abstract
8
 *
9
 * @uses Carbon_Pagination_Item_Direction_Page
10
 */
11
abstract class Carbon_Pagination_Item_Direction_Backward_Page extends Carbon_Pagination_Item_Direction_Page {
12
13
	/**
14
	 * If we're on the first page, the first and prev items
15
	 * should be disabled.
16
	 *
17
	 * @return bool $result The condition result.
18
	 */
19 3
	public function get_direction_disabled() {
20 3
		$pagination = $this->get_collection()->get_pagination();
21 3
		$result = $pagination->get_current_page() <= 1;
22 3
		return $result;
23
	}
24
25
}