GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Page   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getMaximumCharacterPositionDensity() 0 9 2
A offsetGet() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
namespace Spatie\CodeOutline\Elements;
4
5
use Spatie\Typed\Collection;
6
use Spatie\Typed\T;
7
8
class Page extends Collection
9
{
10
    public function __construct()
11
    {
12
        parent::__construct(T::generic(Line::class));
13
    }
14
15
    public function getMaximumCharacterPositionDensity(): int
16
    {
17
        $maximumDensityForLine = [];
18
19
        foreach ($this as $line) {
20
            $maximumDensityForLine[] = $line->getMaximumCharacterPositionDensity();
21
        }
22
23
        return max($maximumDensityForLine);
24
    }
25
26
    public function offsetGet($offset): Line
27
    {
28
        return parent::offsetGet($offset);
0 ignored issues
show
Bug Best Practice introduced by
The expression return parent::offsetGet($offset) could return the type null which is incompatible with the type-hinted return Spatie\CodeOutline\Elements\Line. Consider adding an additional type-check to rule them out.
Loading history...
29
    }
30
}
31