Passed
Push — master ( 0db885...0de6e6 )
by Petr
08:07
created

THelpingText   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 13
ccs 7
cts 7
cp 1
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A getFilledText() 0 9 3
1
<?php
2
3
namespace kalanis\kw_paging\Traits;
4
5
6
use kalanis\kw_paging\Interfaces\IPositions;
7
8
9
/**
10
 * Trait THelpingText
11
 * @package kalanis\kw_paging\Render\SimplifiedPager
12
 * Trait for render simple helping text about
13
 */
14
trait THelpingText
15
{
16
    use TLang;
17
18 14
    public function getFilledText(?IPositions $positions): string
19
    {
20 14
        if (!$this->kpgLang || !$positions) {
21 1
            return '';
22
        }
23 14
        return $this->getKpgLang()->kpgShowResults(
24 14
            $positions->getPager()->getOffset() + 1,
25 14
            min($positions->getPager()->getOffset() + $positions->getPager()->getLimit(), $positions->getPager()->getMaxResults()),
26 14
            $positions->getPager()->getMaxResults()
27
        );
28
    }
29
}
30