Skip to content

Commit 7f33c15

Browse files
committed
Refactor: Run php-cs-fixer to make coding style consistent
1 parent 273c15e commit 7f33c15

29 files changed

+157
-153
lines changed

src/BackupEntryInterface.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
* Interface for generic Fuelio file entries
99
* @author Kamil Kamiński
1010
*/
11-
interface BackupEntryInterface {
11+
interface BackupEntryInterface
12+
{
1213
/**
1314
* Returns array for fputcsv
1415
* @return array<null|int|string|float>

src/Card/AcarCard.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,24 @@ public function getClass(): string
1414
{
1515
return '';
1616
}
17-
17+
1818
public function getTitle(): string
1919
{
2020
return 'aCar ABP Converter for Fuelio';
2121
}
22-
22+
2323
public function getMenu(): array
2424
{
2525
return [];
2626
}
27-
27+
2828
public function getActions(): array
2929
{
3030
return [
3131
['Help', 'popup', 'https://github.com/Programistyk/FuelioImport/wiki/Converters---aCar']
3232
];
3333
}
34-
34+
3535
public function getSupporting(): string
3636
{
3737
return '<p>You can upload an .abp backup file from your aCar and we will convert it into Fuelio\'s CSV format. Just tap this card, or drop a file onto it.</p><p>You can also import backups from aCar free version. Use Help button below to read more.</p>';

src/Card/DrivvoCard.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace FuelioImporter\Card;
34

45
use FuelioImporter\Form\DrivvoForm;

src/Card/FuellogCard.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace FuelioImporter\Card;
34

45
use FuelioImporter\Form\FuelLogForm;
@@ -38,4 +39,4 @@ public function getForm(): FormInterface
3839
{
3940
return new FuelLogForm();
4041
}
41-
}
42+
}

src/Card/MotostatCard.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,25 @@ public function getTitle(): string
1313
{
1414
return 'Motostat';
1515
}
16-
16+
1717
public function getClass(): string
1818
{
1919
return '';
2020
}
21-
21+
2222
public function getActions(): array
2323
{
2424
return [
2525
['Motostat', 'popup', 'https://www.motostat.pl/member/vehicles'],
2626
['Help', 'popup', 'https://github.com/Programistyk/FuelioImport/wiki/Converters---Motostat'],
2727
];
2828
}
29-
29+
3030
public function getMenu(): array
3131
{
3232
return [];
3333
}
34-
34+
3535
public function getSupporting(): string
3636
{
3737
return '<p>You can upload your <span class="">motostat.csv</span> file here and we will convert it into Fuelio\'s CSV format. Just tap this card or drop file onto it.</p><p>To export your car data, open Motostat, select your car and click on "Export". Make sure to select both checkboxes!';

src/CardInterface.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,29 @@
1212
* @todo Add file input accept= argument support
1313
* @author Kamil Kamiński
1414
*/
15-
interface CardInterface {
15+
interface CardInterface
16+
{
1617
/**
1718
* Returns card CSS class
1819
*/
1920
public function getClass(): string;
20-
21+
2122
/**
2223
* Returns card title
2324
*/
2425
public function getTitle(): string;
25-
26+
2627
/**
2728
* Returns card supporting text
2829
*/
2930
public function getSupporting(): string;
30-
31+
3132
/**
3233
* Returns action items
3334
* @return list<array<string>> Array of action menu entries
3435
*/
3536
public function getActions(): array;
36-
37+
3738
/**
3839
* Returns card menu items
3940
* @return list<array<string>> Array of card menu entries

src/ConverterProvider.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010

1111
/**
1212
* Converters provider
13-
*
13+
*
1414
* Provides interface for converting plugins detection and loading
1515
* @author Kamil Kamiński
1616
* @implements IteratorAggregate<string, ProviderInterface>
1717
*/
18-
class ConverterProvider implements IteratorAggregate {
19-
18+
class ConverterProvider implements IteratorAggregate
19+
{
2020
/** @var array<string,ProviderInterface> Internal storage of found providers */
2121
protected array $providers = [];
2222
/** @var boolean $classes_loaded Flag for autodetecting available plugins */
@@ -34,7 +34,7 @@ public function getIterator(): ArrayIterator
3434

3535
return new ArrayIterator($this->providers);
3636
}
37-
37+
3838
/**
3939
* Returns converter by its name
4040
* @param string $name Converter name
@@ -54,7 +54,7 @@ public function get(string $name): ProviderInterface
5454

5555
/**
5656
* Initializes classes and propagates $providers array
57-
*
57+
*
5858
* This method reads all files in namespace FuelioImporter\Providers
5959
* classes implementing IConverter interface
6060
*/
@@ -68,20 +68,19 @@ public function initialize(): void
6868
* Autoloader here will do the job searching for valid file
6969
* it should not misbehave as we are using FuelioImporter namespace
7070
*/
71-
71+
7272
$classname = 'FuelioImporter\\Providers\\' . ucfirst($spl_file->getBasename('.php'));
73-
73+
7474
if (!class_exists($classname, true)) {
7575
continue;
7676
}
7777

78-
if (is_subclass_of($classname, ProviderInterface::class, true))
79-
{
78+
if (is_subclass_of($classname, ProviderInterface::class, true)) {
8079
$instance = new $classname();
8180
if (isset($this->providers[$instance->getName()])) {
8281
throw new ProviderExistsException();
8382
}
84-
83+
8584
$this->providers[$instance->getName()] = $instance;
8685
}
8786
}

src/Cost.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,62 +44,62 @@ class Cost implements BackupEntryInterface
4444
protected int $is_income = 0;
4545
/** @var integer Unique cost id */
4646
protected int $unique_id;
47-
47+
4848
public function setTitle(string $sTitle): void
4949
{
5050
if (empty($sTitle)) {
5151
$sTitle = 'No title';
5252
}
5353
$this->title = $sTitle;
5454
}
55-
55+
5656
public function setDate(string $sDate): void
5757
{
5858
$dt = new \DateTime($sDate);
5959
$this->date = $dt->format(FuelioBackupBuilder::DATE_FORMAT);
6060
}
61-
61+
6262
public function setOdo(int $iOdo): void
6363
{
6464
$this->odo = $iOdo;
6565
}
66-
66+
6767
public function setCostCategoryId(int $iId): void
6868
{
6969
$this->cost_category_id = $iId;
7070
}
71-
71+
7272
public function setNotes(string $sNotes): void
7373
{
7474
$this->notes = $sNotes;
7575
}
76-
76+
7777
public function setCost(float $dCost): void
7878
{
7979
$this->cost = $dCost;
8080
$this->setIsIncome($dCost < 0);
8181
}
82-
82+
8383
public function setFlag(int $flag): void
8484
{
8585
$this->flag = $flag;
8686
}
87-
87+
8888
public function setIdR(int $iId): void
8989
{
9090
$this->idR = $iId;
9191
}
92-
92+
9393
public function setRead(bool $bRead): void
9494
{
9595
$this->read = (int) $bRead;
9696
}
97-
97+
9898
public function setReminderOdo(int $iOdo): void
9999
{
100100
$this->remindOdo = $iOdo;
101101
}
102-
102+
103103
public function setReminderDate(string $sDate): void
104104
{
105105
$dt = new \DateTime($sDate);
@@ -111,7 +111,7 @@ public function setRepeatOdo(int $iOdo): void
111111
$this->repeat_odo = $iOdo;
112112
}
113113

114-
public function setRepeatMonths(int $sMonths):void
114+
public function setRepeatMonths(int $sMonths): void
115115
{
116116
$this->repeat_months = $sMonths;
117117
}
@@ -130,10 +130,10 @@ public function getCostDate(): string
130130
{
131131
return $this->date;
132132
}
133-
133+
134134
public function getData(): array
135135
{
136-
$vars = get_object_vars($this);
136+
$vars = get_object_vars($this);
137137
return array_values($vars);
138138
}
139139
}

src/CostCategory.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ class CostCategory implements BackupEntryInterface
1818
private int $priority;
1919
/** @var string Category color, #rrggbb format **/
2020
private string $color;
21-
21+
2222
public function __construct(int $type_id, string $name, int $priority = 0, string $color = '')
2323
{
2424
$this->type_id = $type_id;
2525
$this->name = $name;
2626
$this->priority = $priority;
2727
$this->color = $color;
2828
}
29-
29+
3030
public function getTypeId(): int
3131
{
3232
return $this->type_id;
@@ -36,7 +36,7 @@ public function setTypeId(int $typeId): void
3636
{
3737
$this->type_id = $typeId;
3838
}
39-
39+
4040
public function getName(): string
4141
{
4242
return $this->name;
@@ -51,10 +51,10 @@ public function getColor(): string
5151
{
5252
return $this->color;
5353
}
54-
54+
5555
public function getData(): array
5656
{
57-
$vars = get_object_vars($this);
57+
$vars = get_object_vars($this);
5858
return array_values($vars);
5959
}
60-
}
60+
}

src/Form/AbstractForm.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
* @package FuelioImporter\Form
1212
* @author Kamil Kamiński
1313
*/
14-
abstract class AbstractForm implements FormInterface {
14+
abstract class AbstractForm implements FormInterface
15+
{
1516
/**
1617
* @var FormFieldInterface[] Internal array of form fields
1718
*/
@@ -72,7 +73,7 @@ public function offsetUnset($offset): void
7273
public function getData(): ?iterable
7374
{
7475
$out = [];
75-
foreach($this->fields as $name => $field) {
76+
foreach ($this->fields as $name => $field) {
7677
$data = null;
7778
if ($field->isValid()) {
7879
$data = $field->getValue();

0 commit comments

Comments
 (0)