Completed
Push — master ( 355225...679235 )
by Zlatin
01:59
created

PaginationArrayAdapter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

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
10 1
    public function getCounter($query)
11
    {
12 1
        return count($query);
13
    }
14
15 1
    public function getItems($query, $current, $limit)
16
    {
17 1
        return array_slice($query, $current * $limit - $limit, $limit);
18
    }
19
20
}
21