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::getMaximumCharacterPositionDensity()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 9
rs 10
c 0
b 0
f 0
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