Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup Utils #467 #547

Merged
merged 2 commits into from
Feb 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ php:
# - '7.3'
- '7.4'

env:
- DB=mysql
#env:
# - DB=mysql
# - DB=mariadb

cache:
Expand All @@ -23,8 +23,8 @@ cache:
services:
- mysql

addons:
mariadb: '10.2'
#addons:
# mariadb: '10.2'

install:
- php --version
Expand Down
7 changes: 5 additions & 2 deletions .travis/deploy_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,21 @@ if [ "$TRAVIS" = "true" ]; then
make clean

cd /tmp
ls -al $TRAVIS_BUILD_DIR/../

tar -czf $TAR_NAME -C $TRAVIS_BUILD_DIR/../
sha256sum $TAR_NAME >"$TAR_NAME.sha256"
tar2zip $TAR_NAME
sha256sum $ZIP_NAME >"$ZIP_NAME.sha256"

ls -al /tmp

echo "Uploading to S3"
mkdir -p $TRAVIS_BUILD_DIR/build
cd $TRAVIS_BUILD_DIR/build

mv "/tmp/$TAR_NAME" "/tmp/$ZIP_NAME" "/tmp/$TAR_NAME.sha256" .
artifacts upload --target-paths "/" $ZIP_NAME $TAR_NAME $TRAVIS_BUILD_DIR/VERSION $TAR_NAME.sha256
mv "/tmp/$TAR_NAME" "/tmp/$ZIP_NAME" "/tmp/$TAR_NAME.sha256" "/tmp/$ZIP_NAME.sha256".
artifacts upload --target-paths "/" $ZIP_NAME $TAR_NAME $TRAVIS_BUILD_DIR/VERSION $TAR_NAME.sha256 $ZIP_NAME.sha256

# Upload the version for a tagged release. Move to a version file in different
# tags. Within phpVMS, we have an option of which version to track in the admin
Expand Down
4 changes: 2 additions & 2 deletions app/Console/Commands/AcarsReplay.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Console\Commands;

use App\Contracts\Command;
use App\Facades\Utils;
use App\Support\Units\Time;
use GuzzleHttp\Client;
use Illuminate\Database\Eloquent\Collection;

Expand Down Expand Up @@ -64,7 +64,7 @@ public function __construct()
protected function startPirep($flight): string
{
// convert the planned flight time to be completely in minutes
$pft = Utils::hoursToMinutes(
$pft = Time::hoursToMinutes(
$flight->planned_hrsenroute,
$flight->planned_minenroute
);
Expand Down
2 changes: 1 addition & 1 deletion app/Contracts/Award.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace App\Contracts;

use App\Facades\Utils;
use App\Models\Award as AwardModel;
use App\Models\User;
use App\Models\UserAward;
use App\Support\Utils;
use Exception;
use Illuminate\Support\Facades\Log;

Expand Down
222 changes: 0 additions & 222 deletions app/Facades/Utils.php

This file was deleted.

3 changes: 1 addition & 2 deletions app/Http/Controllers/Admin/PirepController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Http\Controllers\Admin;

use App\Contracts\Controller;
use App\Facades\Utils;
use App\Http\Requests\CreatePirepRequest;
use App\Http\Requests\UpdatePirepRequest;
use App\Models\Enums\PirepSource;
Expand Down Expand Up @@ -260,7 +259,7 @@ public function store(CreatePirepRequest $request)

$hours = (int) $attrs['hours'];
$minutes = (int) $attrs['minutes'];
$pirep->flight_time = Utils::hoursToMinutes($hours) + $minutes;
$pirep->flight_time = Time::hoursToMinutes($hours) + $minutes;

$this->saveCustomFields($pirep, $request);
$this->saveFares($pirep, $request);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Http\Controllers\Admin;

use App\Contracts\Controller;
use App\Facades\Utils;
use App\Http\Requests\CreateUserRequest;
use App\Http\Requests\UpdateUserRequest;
use App\Models\Rank;
Expand All @@ -15,6 +14,7 @@
use App\Repositories\UserRepository;
use App\Services\UserService;
use App\Support\Timezonelist;
use App\Support\Utils;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
namespace App\Http\Controllers\Auth;

use App\Contracts\Controller;
use App\Facades\Utils;
use App\Models\Enums\UserState;
use App\Models\User;
use App\Repositories\AirlineRepository;
use App\Repositories\AirportRepository;
use App\Services\UserService;
use App\Support\Countries;
use App\Support\Timezonelist;
use App\Support\Utils;
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Http\Request;
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/Frontend/PirepController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Http\Controllers\Frontend;

use App\Contracts\Controller;
use App\Facades\Utils;
use App\Http\Requests\CreatePirepRequest;
use App\Http\Requests\UpdatePirepRequest;
use App\Models\Enums\PirepSource;
Expand Down Expand Up @@ -324,7 +323,7 @@ public function store(CreatePirepRequest $request)
// Any special fields
$hours = (int) $request->input('hours', 0);
$minutes = (int) $request->input('minutes', 0);
$pirep->flight_time = Utils::hoursToMinutes($hours) + $minutes;
$pirep->flight_time = Time::hoursToMinutes($hours) + $minutes;

// Set the correct fuel units
$pirep->block_fuel = new Fuel((float) $request->input('block_fuel'), setting('units.fuel'));
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Frontend/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
namespace App\Http\Controllers\Frontend;

use App\Contracts\Controller;
use App\Facades\Utils;
use App\Models\User;
use App\Repositories\AirlineRepository;
use App\Repositories\AirportRepository;
use App\Repositories\UserRepository;
use App\Support\Countries;
use App\Support\Timezonelist;
use App\Support\Utils;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
Expand Down
Loading