@@ -11,7 +11,7 @@ |
||
11 | 11 | /** |
12 | 12 | * Dependency constructor |
13 | 13 | */ |
14 | - public function __construct( $mail, $pass, $session = '' ) { |
|
14 | + public function __construct($mail, $pass, $session = '') { |
|
15 | 15 | $this->mail = $mail; |
16 | 16 | $this->pass = $pass; |
17 | 17 | $this->session = $session; |
@@ -17,4 +17,4 @@ |
||
17 | 17 | echo "\n\n"; |
18 | 18 | |
19 | 19 | echo "\n\n"; |
20 | -echo "To save this session, go to\n\n" . basename(__FILE__) . '?session=' . $client->auth->session; |
|
20 | +echo "To save this session, go to\n\n".basename(__FILE__).'?session='.$client->auth->session; |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require __DIR__ . '/env.php'; |
|
3 | +require __DIR__.'/env.php'; |
|
4 | 4 | |
5 | -require __DIR__ . '/vendor/autoload.php'; |
|
5 | +require __DIR__.'/vendor/autoload.php'; |
|
6 | 6 | |
7 | 7 | header('Content-type: text/plain; charset=utf-8'); |
8 | 8 |
@@ -5,11 +5,11 @@ discard block |
||
5 | 5 | $client = getTestClient(FUELLY_TEST_MAIL, FUELLY_TEST_PASS, @$_GET['session']); |
6 | 6 | |
7 | 7 | $client->ensureSession(); |
8 | -echo $client->auth->session . "\n\n\n"; |
|
8 | +echo $client->auth->session."\n\n\n"; |
|
9 | 9 | |
10 | 10 | echo "Vehicle:\n"; |
11 | 11 | $vehicles = $client->vehicles; |
12 | -$vehicle = $vehicles[ array_rand($vehicles) ]; |
|
12 | +$vehicle = $vehicles[array_rand($vehicles)]; |
|
13 | 13 | print_r($vehicle); |
14 | 14 | echo "\n\n"; |
15 | 15 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | 'amount' => 10, |
21 | 21 | 'note' => 'TEST TEST TEST', |
22 | 22 | )); |
23 | -if ( !empty($response->fuelup_id) ) { |
|
23 | +if (!empty($response->fuelup_id)) { |
|
24 | 24 | var_dump($response->fuelup_id); |
25 | 25 | } |
26 | 26 | else { |
@@ -5,11 +5,11 @@ |
||
5 | 5 | $client = getTestClient(FUELLY_TEST_MAIL, FUELLY_TEST_PASS, @$_GET['session']); |
6 | 6 | |
7 | 7 | $client->ensureSession(); |
8 | -echo $client->auth->session . "\n\n\n"; |
|
8 | +echo $client->auth->session."\n\n\n"; |
|
9 | 9 | |
10 | 10 | echo "Vehicle:\n"; |
11 | 11 | $vehicles = $client->vehicles; |
12 | -$vehicle = $vehicles[ array_rand($vehicles) ]; |
|
12 | +$vehicle = $vehicles[array_rand($vehicles)]; |
|
13 | 13 | print_r($vehicle); |
14 | 14 | echo "\n\n"; |
15 | 15 |
@@ -5,7 +5,7 @@ |
||
5 | 5 | $client = getTestClient(FUELLY_TEST_MAIL, FUELLY_TEST_PASS, @$_GET['session']); |
6 | 6 | |
7 | 7 | $client->ensureSession(); |
8 | -echo $client->auth->session . "\n\n\n"; |
|
8 | +echo $client->auth->session."\n\n\n"; |
|
9 | 9 | |
10 | 10 | echo "Vehicles:\n"; |
11 | 11 | $vehicles = $client->vehicles; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | /** |
18 | 18 | * |
19 | 19 | */ |
20 | - public static function createFromTrend( Vehicle $vehicle, array $fuelup, InputConversion $input = null ) { |
|
20 | + public static function createFromTrend(Vehicle $vehicle, array $fuelup, InputConversion $input = null) { |
|
21 | 21 | // Trend is always in real numbers, and only its natives are reliable so use those |
22 | 22 | $input or $input = $client->createTrendInputConversion(); |
23 | 23 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * |
31 | 31 | */ |
32 | - public static function createFromDetail( Vehicle $vehicle, array $fuelup, InputConversion $input = null ) { |
|
32 | + public static function createFromDetail(Vehicle $vehicle, array $fuelup, InputConversion $input = null) { |
|
33 | 33 | // @todo Parse date correctly |
34 | 34 | $date = DateTime::createFromFormat('d-m-y', $fuelup['fuelup_date']); |
35 | 35 | return new static($vehicle, $date, $fuelup['miles_last_fuelup'], $fuelup['amount']); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | /** |
39 | 39 | * |
40 | 40 | */ |
41 | - protected function __construct( Vehicle $vehicle, DateTime $date, $raw_distance, $raw_amount, InputConversion $input = null ) { |
|
41 | + protected function __construct(Vehicle $vehicle, DateTime $date, $raw_distance, $raw_amount, InputConversion $input = null) { |
|
42 | 42 | $this->vehicle = $vehicle; |
43 | 43 | |
44 | 44 | $input or $input = $vehicle->client->input; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | /** |
60 | 60 | * |
61 | 61 | */ |
62 | - public static function createMileage( Length $distance, Volume $amount ) { |
|
62 | + public static function createMileage(Length $distance, Volume $amount) { |
|
63 | 63 | // Since we don't know the original mileage from here, we'll construct a known unit from known values |
64 | 64 | return new Mileage($distance->to('km') / $amount->to('l'), 'kmpl'); |
65 | 65 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | /** |
68 | 68 | * |
69 | 69 | */ |
70 | - public static function dateCmp( FuelUp $a, FuelUp $b ) { |
|
70 | + public static function dateCmp(FuelUp $a, FuelUp $b) { |
|
71 | 71 | return $b->date->getTimestamp() - $a->date->getTimestamp(); |
72 | 72 | } |
73 | 73 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * |
20 | 20 | */ |
21 | - public function __construct( Client $client, array $vehicle ) { |
|
21 | + public function __construct(Client $client, array $vehicle) { |
|
22 | 22 | $this->client = $client; |
23 | 23 | |
24 | 24 | $this->id = $vehicle['id']; |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | $this->name = $vehicle['name']; |
27 | 27 | $this->image = $vehicle['image']; |
28 | 28 | |
29 | - if ( isset($vehicle['trend']) ) { |
|
29 | + if (isset($vehicle['trend'])) { |
|
30 | 30 | $input = $client->createTrendInputConversion(); |
31 | 31 | |
32 | - foreach ( $vehicle['trend'] as $fuelup) { |
|
32 | + foreach ($vehicle['trend'] as $fuelup) { |
|
33 | 33 | $this->trend[] = FuelUp::createFromTrend($this, $fuelup, $input); |
34 | 34 | } |
35 | 35 |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -spl_autoload_register(function( $class ) { |
|
3 | +spl_autoload_register(function($class) { |
|
4 | 4 | $ns = explode('\\', $class); |
5 | 5 | $lib = array_splice($ns, 0, 2); |
6 | - if ( $lib == array('rdx', 'fuelly') ) { |
|
7 | - if ( file_exists($file = __DIR__ . '/src/' . implode('/', $ns) . '.php') ) { |
|
6 | + if ($lib == array('rdx', 'fuelly')) { |
|
7 | + if (file_exists($file = __DIR__.'/src/'.implode('/', $ns).'.php')) { |
|
8 | 8 | include $file; |
9 | 9 | } |
10 | 10 | } |