| Total Complexity | 3 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php declare(strict_types=1); |
||
| 13 | trait NodeGravityTrait { |
||
| 14 | /** |
||
| 15 | * Returns the gravityScore from this node |
||
| 16 | * |
||
| 17 | * @param Element $node |
||
| 18 | * |
||
| 19 | * @return float |
||
| 20 | */ |
||
| 21 | private function getScore(Element $node): float { |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Adds a score to the gravityScore Attribute we put on divs |
||
| 27 | * we'll get the current score then add the score we're passing in to the current |
||
| 28 | * |
||
| 29 | * @param Element $node |
||
| 30 | * @param float $addToScore |
||
| 31 | */ |
||
| 32 | private function updateScore(Element $node, float $addToScore): void { |
||
| 33 | $currentScore = (float)$node->attr('gravityScore'); |
||
| 34 | |||
| 35 | $node->attr('gravityScore', (string)($currentScore + $addToScore)); |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Stores how many decent nodes are under a parent node |
||
| 40 | * |
||
| 41 | * @param Element $node |
||
| 42 | * @param int $addToCount |
||
| 43 | */ |
||
| 44 | private function updateNodeCount(Element $node, int $addToCount): void { |
||
| 48 | } |
||
| 49 | } |
||
| 50 |