| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | 4 | public static function getTagAttribute(string $string, string $tagname, string $source): array |
|
| 37 | { |
||
| 38 | 4 | $dom_document = new \DOMDocument(); |
|
| 39 | 4 | $dom_document->loadHTML($string); |
|
| 40 | |||
| 41 | 4 | return collect($dom_document->getElementsByTagName($tagname)) |
|
| 42 | 4 | ->map(function ($dom_element) use ($source) { |
|
| 43 | 3 | return $dom_element->getAttribute($source); |
|
| 44 | 4 | }) |
|
| 45 | 4 | ->toArray(); |
|
| 46 | } |
||
| 59 |