| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 51 | public static function createFromArray(array $data): Tweets |
||
| 52 | { |
||
| 53 | $message = ''; |
||
| 54 | $tweets = []; |
||
| 55 | |||
| 56 | if (isset($data['tweets'])) { |
||
| 57 | foreach ($data['tweets'] as $item) { |
||
| 58 | $tweets[] = Tweet::createFromArray($item); |
||
| 59 | } |
||
| 60 | } |
||
| 61 | |||
| 62 | if (isset($data['message'])) { |
||
| 63 | $message = $data['message']; |
||
| 64 | } |
||
| 65 | |||
| 66 | return new self($message, $tweets); |
||
| 67 | } |
||
| 68 | |||
| 85 |