some cleanup as-per phpstan

This commit is contained in:
Nabeel Shahzad
2018-04-23 08:46:28 -05:00
parent 2319a8c9f4
commit cff7e2c4da
14 changed files with 789 additions and 36 deletions

View File

@@ -24,6 +24,26 @@ class ImportExport
*/
public static $columns = [];
/**
* @param mixed $row
* @return array
*/
public function export($row): array
{
throw new \RuntimeException('export not implemented');
}
/**
* @param array $row
* @param mixed $index
* @return bool
* @throws \RuntimeException
*/
public function import(array $row, $index): bool
{
throw new \RuntimeException('import not implemented');
}
/**
* Get the airline from the ICAO. Create it if it doesn't exist
* @param $code

View File

@@ -8,13 +8,14 @@ use App\Models\Traits\ExpensableTrait;
/**
* Class Subfleet
* @property int id
* @property string type
* @property string name
* @property string ground_handling_multiplier
* @property Fare[] fares
* @property float cost_block_hour
* @property float cost_delay_minute
* @property int id
* @property string type
* @property string name
* @property string ground_handling_multiplier
* @property Fare[] fares
* @property float cost_block_hour
* @property float cost_delay_minute
* @property Airline airline
* @package App\Models
*/
class Subfleet extends Model

View File

@@ -29,7 +29,7 @@ class AircraftExporter extends ImportExport
* @param Aircraft $aircraft
* @return array
*/
public function export(Aircraft $aircraft): array
public function export($aircraft): array
{
$ret = [];
foreach(self::$columns as $column) {

View File

@@ -27,7 +27,7 @@ class AirportExporter extends ImportExport
* @param Airport $airport
* @return array
*/
public function export(Airport $airport): array
public function export($airport): array
{
$ret = [];
foreach(self::$columns as $column) {

View File

@@ -30,7 +30,7 @@ class ExpenseExporter extends ImportExport
* @param Expense $expense
* @return array
*/
public function export(Expense $expense): array
public function export($expense): array
{
$ret = [];

View File

@@ -27,7 +27,7 @@ class FareExporter extends ImportExport
* @param Fare $fare
* @return array
*/
public function export(Fare $fare): array
public function export($fare): array
{
$ret = [];
foreach(self::$columns as $column) {

View File

@@ -28,7 +28,7 @@ class FlightExporter extends ImportExport
* @param Flight $flight
* @return array
*/
public function export(Flight $flight): array
public function export($flight): array
{
$ret = [];
foreach(self::$columns as $column) {

View File

@@ -29,7 +29,7 @@ class SubfleetExporter extends ImportExport
* @param Subfleet $subfleet
* @return array
*/
public function export(Subfleet $subfleet): array
public function export($subfleet): array
{
$ret = [];
foreach(self::$columns as $column) {

View File

@@ -20,7 +20,7 @@ class Money
public static $subunit_multiplier;
/**
* @param $amount
* @param mixed $amount
* @return MoneyBase
* @throws \UnexpectedValueException
* @throws \InvalidArgumentException
@@ -32,7 +32,7 @@ class Money
/**
* Create from a dollar amount
* @param $amount
* @param mixed $amount
* @return Money
* @throws \UnexpectedValueException
* @throws \InvalidArgumentException
@@ -46,7 +46,7 @@ class Money
/**
* Convert a whole unit into it's subunit, e,g: dollar to cents
* @param $amount
* @param mixed $amount
* @return float|int
*/
public static function convertToSubunit($amount)
@@ -72,7 +72,7 @@ class Money
/**
* Money constructor.
* @param $amount
* @param mixed $amount
* @throws \UnexpectedValueException
* @throws \InvalidArgumentException
*/
@@ -143,7 +143,7 @@ class Money
/**
* Add an amount
* @param $amount
* @param mixed $amount
* @return Money
* @throws \UnexpectedValueException
* @throws \InvalidArgumentException
@@ -160,7 +160,7 @@ class Money
}
/**
* @param $percent
* @param mixed $percent
* @return $this
* @throws \OutOfBoundsException
* @throws \InvalidArgumentException