| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function __construct( Client $client, array $vehicle ) { |
||
| 22 | $this->client = $client; |
||
| 23 | |||
| 24 | $this->id = $vehicle['id']; |
||
| 25 | $this->url = $vehicle['url']; |
||
| 26 | $this->name = $vehicle['name']; |
||
| 27 | $this->image = $vehicle['image']; |
||
| 28 | |||
| 29 | if ( isset($vehicle['trend']) ) { |
||
| 30 | $input = $client->createTrendInputConversion(); |
||
| 31 | |||
| 32 | foreach ( $vehicle['trend'] as $fuelup) { |
||
| 33 | $this->trend[] = FuelUp::createFromTrend($this, $fuelup, $input); |
||
| 34 | } |
||
| 35 | |||
| 36 | // Sort by date DESC |
||
| 37 | usort($this->trend, array(FuelUp::class, 'dateCmp')); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 42 |