#355 Calculate distance button (#366)

* #355 Calculate distance button in add/edit Flight page

* Styling

* Move add/edit flight logic out of controller and into service layer

* Styling

* Formatting

* Run styleci against modules dir

* Styleci config

* Style fixes in /modules
This commit is contained in:
Nabeel S
2019-08-26 12:32:46 -04:00
committed by GitHub
parent 25999d55a3
commit bbec276da8
57 changed files with 9819 additions and 7522 deletions

View File

@@ -2,20 +2,19 @@
namespace Modules\Installer\Services;
use App\Contracts\Service;
class RequirementsService extends Service
{
/**
* Check the PHP version that it meets the minimum requirement
*
* @return array
*/
public function checkPHPVersion(): array
{
$passed = false;
if(version_compare(PHP_VERSION, config('installer.php.version')) >= 0) {
if (version_compare(PHP_VERSION, config('installer.php.version')) >= 0) {
$passed = true;
}
@@ -24,19 +23,20 @@ class RequirementsService extends Service
/**
* Make sure the minimal extensions required are loaded
*
* @return array
*/
public function checkExtensions(): array
{
$extensions = [];
foreach(config('installer.extensions') as $ext) {
foreach (config('installer.extensions') as $ext) {
$pass = true;
if(!\extension_loaded($ext)) {
if (!\extension_loaded($ext)) {
$pass = false;
}
$extensions[] = [
'ext' => $ext,
'ext' => $ext,
'passed' => $pass,
];
}
@@ -47,6 +47,7 @@ class RequirementsService extends Service
/**
* Check the permissions for the directories specified
* Make sure they exist and are writable
*
* @return array
*/
public function checkPermissions(): array
@@ -54,21 +55,20 @@ class RequirementsService extends Service
clearstatcache();
$directories = [];
foreach (config('installer.permissions') as $dir)
{
foreach (config('installer.permissions') as $dir) {
$pass = true;
$path = base_path($dir);
if(!file_exists($path)) {
if (!file_exists($path)) {
$pass = false;
}
if(!is_writable($path)) {
if (!is_writable($path)) {
$pass = false;
}
$directories[] = [
'dir' => $dir,
'dir' => $dir,
'passed' => $pass,
];
}