Skip to content

Commit 00fa0c8

Browse files
committed
* Little apigen documentation
1 parent a10b03f commit 00fa0c8

File tree

9 files changed

+113
-20
lines changed

9 files changed

+113
-20
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/nbproject/private/
2-
/view/analytics.html
2+
/view/analytics.html
3+
/doc/

apigen.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
source:
2+
- lib
3+
4+
destination: doc
5+
templateTheme: bootstrap

lib/fuelioimporter/cost.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ public function setCost($dCost)
5353

5454
public function setFlag($flag)
5555
{
56-
$this->flag = $flag; // TODO: What is "flag"?
56+
$this->flag = $flag; // @TODO: What is "flag"?
5757
}
5858

5959
public function setIdR($iId)
6060
{
61-
$this->idR = $iId; // TODO: What is Id R? Isn't it "internal"
61+
$this->idR = $iId; // @TODO: What is Id R? Isn't it "internal"
6262
}
6363

6464
public function setRead($bRead)

lib/fuelioimporter/fuellogentry.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function setGeoCoords($dLatitude, $dLongitude) {
5050
$this->longitude = $dLongitude;
5151

5252
// Fuelio requires city name to display geo data on map
53-
if (empty($this->city))
53+
if (!empty($dLatitude) && empty($this->city))
5454
{
5555
$this->setCity('GPS');
5656
}

lib/fuelioimporter/ibackupentry.class.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
namespace FuelioImporter;
44

5+
/**
6+
* Interface for generic Fuelio file entries
7+
* @author Kamil Kamiński
8+
*/
59
interface IBackupEntry {
6-
// Returns fputcsv array
10+
/**
11+
* Returns array for fputcsv
12+
* @return array
13+
*/
714
public function getData();
815
}
Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,59 @@
11
<?php
22

33
namespace FuelioImporter;
4-
use SplFileObject;
4+
use \SplFileObject;
55

6+
/**
7+
* Interface for converters
8+
* @author Kamil Kamiński
9+
*/
610
interface IConverter {
7-
// Internal name of converter (as in hashtags)
11+
/**
12+
* Internal name of converter (as in hashtags)
13+
* @return string
14+
*/
815
public function getName();
9-
// Full name of converter
16+
17+
/**
18+
* Full name of converter
19+
* @return string
20+
*/
1021
public function getTitle();
11-
// Array of errors during conversion
22+
23+
/**
24+
* Array of errors during conversion
25+
* @return array
26+
*/
1227
public function getErrors();
13-
// Array of warnings
28+
29+
/**
30+
* Array of warnings
31+
* @return array()
32+
*/
1433
public function getWarnings();
15-
// Method that processes given file returning SplTempFileObject
34+
35+
/**
36+
* Method that processes given file returning SplTempFileObject
37+
* @return FuelioImporter\FuelioBackupBuilder
38+
*/
1639
public function processFile(SplFileObject $stream);
17-
// Method returns a CardInterface for visual representation
40+
41+
/**
42+
* Method returns a CardInterface for visual representation
43+
* @return ICard
44+
*/
1845
public function getCard();
19-
// Optional stylesheet to include on page
46+
47+
/**
48+
* Optional stylesheet to include on page
49+
* @return string|null
50+
*/
2051
public function getStylesheetLocation();
21-
// Sets car name
52+
53+
/**
54+
* Sets car name
55+
*
56+
* @param string $name Car name
57+
*/
2258
public function setCarName($name);
2359
}

lib/fuelioimporter/providers/acarcard.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function getMenu() {
1818
}
1919

2020
public function getActions() {
21-
// todo: One day maybe we will use a proper class
21+
// @todo: One day maybe we will use a proper class
2222
return array(
2323
array('Help', 'popup', 'acarhelp.html')
2424
);

lib/fuelioimporter/providers/acarprovider.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function processVehicle(SimpleXMLElement $data, ZipArchive $in, FuelioBac
190190
* @throws \FuelioImporter\InvalidUnitException On unsupported unit
191191
*/
192192
protected function getFuelUnit() {
193-
// TODO: How does aCar mark US / UK gallons?
193+
// @TODO: How does aCar mark US / UK gallons?
194194
switch ($this->preferences['acar.volume-unit']) {
195195
case 'L':
196196
return Vehicle::LITRES;
@@ -222,7 +222,7 @@ protected function getDistanceUnit() {
222222
* @throws \FuelioImporter\InvalidUnitException
223223
*/
224224
protected function getConsumptionUnit() {
225-
// TODO: check the format behind other options:
225+
// @TODO: check the format behind other options:
226226
// mpg (us), mpg (imperial), gal/100mi (us), gal/100mi (imperial), km/L, km/gal (us), km/gal (imperial). mi/L
227227
switch ($this->preferences['acar.fuel-efficiency-unit']) {
228228

lib/fuelioimporter/vehicle.class.php

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,82 @@
44

55
use FuelioImporter\IBackupEntry;
66

7+
/**
8+
* Fuelio Vehicle data
9+
* @author Kamil Kamiński
10+
* @version 20150727
11+
*/
712
class Vehicle implements IBackupEntry {
813

9-
// Distance units
14+
/** Distance unit */
1015
const KILOMETERS = 0;
16+
/** Distance unit */
1117
const MILES = 1;
1218

13-
// Fuel units
19+
/** Fuel unit */
1420
const LITRES = 0;
21+
/** Fuel unit */
1522
const GALLONS_US = 1;
23+
/** Fuel unit */
1624
const GALLONS_UK = 2;
1725

18-
// Consumption units
26+
/** Consumption unit: l/100km */
1927
const L_PER_100KM = 0;
28+
/** Consumption unit: mpg (us) */
2029
const MPG_US = 1;
30+
/** Consumption unit: mpg (imp) */
2131
const MPG_UK = 2;
32+
/** Consumption unit: km/l */
2233
const KM_PER_L = 3;
34+
/** Consumption unit: km/gal (imp) */
2335
const KM_PER_GAL_US = 4;
36+
/** Consumption unit: km/gal (us) */
2437
const KM_PER_GAL_UK = 5;
2538

39+
/** @var string Car name */
2640
protected $name;
41+
42+
/** @var string Car description */
2743
protected $description;
44+
45+
/** @var integer Distance unit */
2846
protected $distance_unit;
47+
48+
/** @var integer Fuel unit */
2949
protected $fuel_unit;
50+
51+
/** @var integer Consuption unit */
3052
protected $consumption_unit;
53+
54+
/** @var string CSV date format, constant */
3155
protected $csv_date_format = 'dd.MM.yyyy';
56+
57+
/** @var string Vehicle Identification Number */
3258
protected $vin;
59+
60+
/** @var string Insurance policy number */
3361
protected $insurance;
62+
63+
/** @var string Plate number */
3464
protected $plate;
65+
66+
/** @var string Vehicle make */
3567
protected $make;
68+
69+
/** @var string Vehicle model */
3670
protected $model;
71+
72+
/** @var string Vehicle production year */
3773
protected $year;
3874

75+
/**
76+
* Default constructor
77+
* @param string $sName Car name
78+
* @param string $sDescription Car description
79+
* @param integer $iDistance_unit Distance unit constant
80+
* @param integer $iFuel_unit Fuel unit constant
81+
* @param integer $iConsumption_unit Consuption unit constant
82+
*/
3983
public function __construct($sName, $sDescription, $iDistance_unit = Vehicle::KILOMETERS, $iFuel_unit = Vehicle::LITRES, $iConsumption_unit = Vehicle::L_PER_100KM) {
4084
$this->setName($sName);
4185
$this->setDescription($sDescription);

0 commit comments

Comments
 (0)