| Conditions | 2 |
| Paths | 2 |
| Total Lines | 39 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public function run() |
||
| 16 | { |
||
| 17 | $events = '[ |
||
| 18 | { |
||
| 19 | "_key": "first-men-invase-westeros", |
||
| 20 | "name": "First men invade Westeros", |
||
| 21 | "type": "invasion", |
||
| 22 | "age": "The Dawn Age", |
||
| 23 | "timeline": { |
||
| 24 | "starts_at": -12000.0, |
||
| 25 | "ends_at": -10000.0 |
||
| 26 | } |
||
| 27 | }, |
||
| 28 | { |
||
| 29 | "_key": "the-long-night", |
||
| 30 | "name": "The Long Night", |
||
| 31 | "type": "war", |
||
| 32 | "age": "The Age of Heroes", |
||
| 33 | "timeline": { |
||
| 34 | "starts_at": -8000.0, |
||
| 35 | "ends_at": -7900.0 |
||
| 36 | } |
||
| 37 | }, |
||
| 38 | { |
||
| 39 | "_key": "aegon-the-conqueror-invades-westeros", |
||
| 40 | "name": "Aegon the Conqueror invades Westeros", |
||
| 41 | "type": "invasion", |
||
| 42 | "age": "The Targaryen Conquest", |
||
| 43 | "timeline": { |
||
| 44 | "starts_at": -2.0, |
||
| 45 | "ends_at": 0.0 |
||
| 46 | } |
||
| 47 | } |
||
| 48 | ]'; |
||
| 49 | |||
| 50 | $events = json_decode($events, JSON_OBJECT_AS_ARRAY); |
||
|
|
|||
| 51 | |||
| 52 | foreach ($events as $event) { |
||
| 53 | Event::insertOrIgnore($event); |
||
| 54 | } |
||
| 57 |