spatie /
code-outliner
| 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
Loading history...
|
|||
| 29 | } |
||
| 30 | } |
||
| 31 |