PaginationArrayAdapter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 12
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCounter() 0 4 1
A getItems() 0 4 1
1
<?php
2
3
namespace Pagination\Adapter;
4
5
use Pagination\Interfaces\IAdapterInterface;
6
7
class PaginationArrayAdapter implements IAdapterInterface
8
{
9 1
    public function getCounter($query)
10
    {
11 1
        return count($query);
12
    }
13
14 1
    public function getItems($query, $current, $limit)
15
    {
16 1
        return array_slice($query, $current * $limit - $limit, $limit);
17
    }
18
}
19