Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Commit

Permalink
Merge pull request #134 from FSVAOS/analysis-zel9mP
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
BossOfGames authored Jul 26, 2018
2 parents 1146ee4 + 00348c9 commit 7a1c44d
Show file tree
Hide file tree
Showing 144 changed files with 1,906 additions and 1,948 deletions.
8 changes: 4 additions & 4 deletions app/Classes/AircraftListExcel.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
* Created by PhpStorm.
* User: taylorbroad
* Date: 1/6/17
* Time: 3:48 AM
* Time: 3:48 AM.
*/

namespace App\Classes;


class AircraftListExcel extends \Maatwebsite\Excel\Files\ExcelFile
{
protected $delimiter = ',';
Expand All @@ -17,10 +16,11 @@ class AircraftListExcel extends \Maatwebsite\Excel\Files\ExcelFile

public function getFile()
{
return storage_path('Imports'). '/fleet.csv';
return storage_path('Imports').'/fleet.csv';
}

public function getFilters()
{
return parent::getFilters(); // TODO: Change the autogenerated stub
}
}
}
25 changes: 15 additions & 10 deletions app/Classes/OTF_DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
* Created by PhpStorm.
* User: taylorbroad
* Date: 3/8/17
* Time: 2:16 AM
* Time: 2:16 AM.
*
* Original file by Luke Evers
*/

namespace App\Classes;

use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Config;

class OTF_DB {
class OTF_DB
{
/**
* The name of the database we're connecting to on the fly.
*
* @var string $database
* @var string
*/
protected $database;
/**
Expand All @@ -26,30 +27,32 @@ class OTF_DB {
* @var \Illuminate\Database\Connection
*/
protected $connection;

/**
* Create a new on the fly database connection.
*
* @param array $options
*
* @return void
*/
public function __construct($options = null)
{
// Set the database
$database = $options['database'];
$database = $options['database'];
$this->database = $database;
// Figure out the driver and get the default configuration for the driver
$driver = isset($options['driver']) ? $options['driver'] : Config::get("database.default");
$driver = isset($options['driver']) ? $options['driver'] : Config::get('database.default');
$default = Config::get("database.connections.$driver");
// Loop through our default array and update options if we have non-defaults
foreach($default as $item => $value)
{
foreach ($default as $item => $value) {
$default[$item] = isset($options[$item]) ? $options[$item] : $default[$item];
}
// Set the temporary configuration
Config::set("database.connections.$database", $default);
// Create the connection
$this->connection = DB::connection($database);
}

/**
* Get the on the fly connection.
*
Expand All @@ -59,14 +62,16 @@ public function getConnection()
{
return $this->connection;
}

/**
* Get a table from the on the fly connection.
*
* @var string $table
* @var string
*
* @return \Illuminate\Database\Query\Builder
*/
public function getTable($table = null)
{
return $this->getConnection()->table($table);
}
}
}
10 changes: 4 additions & 6 deletions app/Classes/VAOSData.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@
* Created by PhpStorm.
* User: taylorbroad
* Date: 10/23/16
* Time: 10:16 PM
* Time: 10:16 PM.
*/


namespace App\Classes;

/**
* VAOSData Helper for Central System Data
* @package App\Classes
* VAOSData Helper for Central System Data.
*/
class VAOSData
{
function __construct()
public function __construct()
{
}
}
}
26 changes: 13 additions & 13 deletions app/Classes/VAOSHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
* Created by PhpStorm.
* User: taylorbroad
* Date: 11/26/16
* Time: 2:25 AM
* Time: 2:25 AM.
*/

namespace App\Classes;


class VAOSHelpers
{
/**
Expand All @@ -17,23 +16,24 @@ class VAOSHelpers
* @param $lat2
* @param $lon2
* @param $unit
*
* @return float
*/
static function getDistance($lat1, $lon1, $lat2, $lon2, $unit) {

public static function getDistance($lat1, $lon1, $lat2, $lon2, $unit)
{
$theta = $lon1 - $lon2;
$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));
$dist = acos($dist);
$dist = rad2deg($dist);
$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));
$dist = acos($dist);
$dist = rad2deg($dist);
$miles = $dist * 60 * 1.1515;
$unit = strtoupper($unit);
$unit = strtoupper($unit);

if ($unit == "K") {
return ($miles * 1.609344);
} else if ($unit == "N") {
return ($miles * 0.8684);
if ($unit == 'K') {
return $miles * 1.609344;
} elseif ($unit == 'N') {
return $miles * 0.8684;
} else {
return $miles;
}
}
}
}
Loading

0 comments on commit 7a1c44d

Please sign in to comment.