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

Commit

Permalink
Fix all coding issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Thavarshan committed Jun 22, 2021
1 parent 13a26ff commit 5ba255a
Show file tree
Hide file tree
Showing 34 changed files with 3,169 additions and 1,202 deletions.
5 changes: 3 additions & 2 deletions app/Actions/API/CreateNewApiToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Actions\API;

use InvalidArgumentException;
use Emberfuse\Blaze\API\Permission;
use Emberfuse\Blaze\Contracts\Actions\CreatesNewApiTokens;
use InvalidArgumentException;

class CreateNewApiToken implements CreatesNewApiTokens
{
Expand All @@ -18,7 +18,8 @@ class CreateNewApiToken implements CreatesNewApiTokens
public function create(array $data, ?array $options = null)
{
$token = optional($options['user'])->createToken(
$data['name'], Permission::validPermissions($data['permissions'] ?? [])
$data['name'],
Permission::validPermissions($data['permissions'] ?? [])
);

if (! is_null($token)) {
Expand Down
4 changes: 2 additions & 2 deletions app/Actions/Auth/AuthenticateUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Actions\Auth;

use Illuminate\Http\Request;
use Emberfuse\Scorch\Scorch\Config;
use Emberfuse\Scorch\Contracts\Actions\AuthenticatesUsers;
use Emberfuse\Scorch\Scorch\Config;
use Illuminate\Http\Request;

class AuthenticateUser extends AuthAction implements AuthenticatesUsers
{
Expand Down
6 changes: 3 additions & 3 deletions app/Actions/Auth/CreateNewUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace App\Actions\Auth;

use App\Models\User;
use Emberfuse\Scorch\Contracts\Actions\CreatesNewUsers;
use Emberfuse\Scorch\Support\Traits\Fillable;
use Emberfuse\Scorch\Support\Util;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Emberfuse\Scorch\Support\Util;
use Emberfuse\Scorch\Support\Traits\Fillable;
use Emberfuse\Scorch\Contracts\Actions\CreatesNewUsers;

class CreateNewUser implements CreatesNewUsers
{
Expand Down
2 changes: 1 addition & 1 deletion app/Actions/Auth/DeleteUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace App\Actions\Auth;

use App\Models\User;
use Illuminate\Support\Facades\DB;
use Emberfuse\Scorch\Contracts\Actions\DeletesUsers;
use Illuminate\Support\Facades\DB;

class DeleteUser implements DeletesUsers
{
Expand Down
4 changes: 2 additions & 2 deletions app/Actions/Auth/LogoutUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Actions\Auth;

use Illuminate\Http\Request;
use Illuminate\Contracts\Session\Session;
use Emberfuse\Scorch\Contracts\Actions\LogsoutUsers;
use Illuminate\Contracts\Session\Session;
use Illuminate\Http\Request;

class LogoutUser extends AuthAction implements LogsoutUsers
{
Expand Down
9 changes: 5 additions & 4 deletions app/Actions/Auth/ResetUserPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace App\Actions\Auth;

use App\Actions\Auth\Traits\PasswordUpdater;
use Closure;
use Emberfuse\Scorch\Contracts\Actions\ResetsUserPasswords;
use Illuminate\Auth\Events\PasswordReset;
use App\Actions\Auth\Traits\PasswordUpdater;
use Illuminate\Contracts\Auth\StatefulGuard;
use Illuminate\Contracts\Auth\PasswordBroker;
use Emberfuse\Scorch\Contracts\Actions\ResetsUserPasswords;
use Illuminate\Contracts\Auth\StatefulGuard;

class ResetUserPassword implements ResetsUserPasswords
{
Expand Down Expand Up @@ -51,7 +51,8 @@ public function __construct(PasswordBroker $broker, StatefulGuard $guard)
public function reset(array $data)
{
return $this->broker->reset(
$data, $this->resetPasswordCallback($data['password'])
$data,
$this->resetPasswordCallback($data['password'])
);
}

Expand Down
4 changes: 2 additions & 2 deletions app/Actions/Auth/Traits/PasswordUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace App\Actions\Auth\Traits;

use Illuminate\Support\Str;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Support\Str;

trait PasswordUpdater
{
Expand Down
2 changes: 1 addition & 1 deletion app/Actions/Auth/UpdateUserPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Actions\Auth;

use App\Models\User;
use App\Actions\Auth\Traits\PasswordUpdater;
use App\Models\User;
use Emberfuse\Scorch\Contracts\Actions\UpdatesUserPasswords;

class UpdateUserPassword implements UpdatesUserPasswords
Expand Down
2 changes: 1 addition & 1 deletion app/Actions/Auth/UpdateUserProfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace App\Actions\Auth;

use App\Models\User;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Emberfuse\Scorch\Contracts\Actions\UpdatesUserProfiles;
use Illuminate\Contracts\Auth\MustVerifyEmail;

class UpdateUserProfile implements UpdatesUserProfiles
{
Expand Down
28 changes: 14 additions & 14 deletions app/Actions/Conversions/ConvertAudio.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace App\Actions\Conversions;

use App\Models\Conversion;
use Illuminate\Support\Str;
use CloudConvert\CloudConvert;
use CloudConvert\Models\Job;
use CloudConvert\Models\Task;
use CloudConvert\CloudConvert;
use Illuminate\Support\Str;

class ConvertAudio
{
Expand Down Expand Up @@ -75,18 +75,6 @@ public function process(Conversion $conversion): void
);
}

/**
* Create new job instance.
*
* @return \App\Actions\Conversions\ConvertAudio
*/
protected function createJob(): ConvertAudio
{
$this->job = (new Job())->setTag(Str::random());

return $this;
}

/**
* Configure task for job.
*
Expand Down Expand Up @@ -117,4 +105,16 @@ public function createTask(string $process): Task
{
return new Task($process, $this->processes[$process]);
}

/**
* Create new job instance.
*
* @return \App\Actions\Conversions\ConvertAudio
*/
protected function createJob(): ConvertAudio
{
$this->job = (new Job())->setTag(Str::random());

return $this;
}
}
2 changes: 1 addition & 1 deletion app/Actions/Conversions/DownloadConverted.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Actions\Conversions;

use CloudConvert\Models\Job;
use CloudConvert\CloudConvert;
use CloudConvert\Models\Job;
use Illuminate\Support\Facades\Storage;

class DownloadConverted
Expand Down
2 changes: 1 addition & 1 deletion app/Actions/Conversions/ProcessConversion.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace App\Actions\Conversions;

use Illuminate\Support\Facades\DB;
use App\Jobs\ProcessAudioConversion;
use Emberfuse\Scorch\Contracts\Actions\CreatesNewResources;
use Illuminate\Support\Facades\DB;

class ProcessConversion implements CreatesNewResources
{
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Emberfuse\Scorch\Console\RequestMakeCommand;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
Expand Down
6 changes: 3 additions & 3 deletions app/Events/ConversionStatusUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Events;

use App\Models\User;
use App\Models\Conversion;
use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
use App\Models\User;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class ConversionStatusUpdated
{
Expand Down
3 changes: 1 addition & 2 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Handler extends ExceptionHandler
* @var array
*/
protected $dontReport = [
//

];

/**
Expand All @@ -35,7 +35,6 @@ class Handler extends ExceptionHandler
public function register()
{
$this->reportable(function (Throwable $e) {
//
});
}
}
4 changes: 2 additions & 2 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace App\Http\Controllers;

use Emberfuse\Blaze\Http\Controllers\Controller as BaseController;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Emberfuse\Blaze\Http\Controllers\Controller as BaseController;

class Controller extends BaseController
{
Expand Down
11 changes: 6 additions & 5 deletions app/Http/Controllers/ConversionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace App\Http\Controllers;

use Inertia\Inertia;
use App\Models\Conversion;
use Illuminate\Http\Response;
use App\Actions\Conversions\ProcessConversion;
use App\Http\Requests\ConversionRequest;
use App\Http\Responses\ConversionResponse;
use App\Actions\Conversions\ProcessConversion;
use App\Models\Conversion;
use Illuminate\Http\Response;
use Inertia\Inertia;

class ConversionController extends Controller
{
Expand Down Expand Up @@ -52,6 +52,7 @@ public function show(Conversion $conversion)
{
return Response::download(
$conversion->download,
$conversion->audio_file_name);
$conversion->audio_file_name
);
}
}
1 change: 1 addition & 0 deletions app/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Authenticate extends Middleware
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
*
* @return string|null
*/
protected function redirectTo($request)
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/EncryptCookies.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ class EncryptCookies extends Middleware
* @var array
*/
protected $except = [
//

];
}
7 changes: 6 additions & 1 deletion app/Http/Middleware/HandleInertiaRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class HandleInertiaRequests extends Middleware
* The root template that's loaded on the first page visit.
*
* @see https://inertiajs.com/server-side-setup#root-template
*
* @var string
*/
protected $rootView = 'app';
Expand All @@ -19,7 +20,9 @@ class HandleInertiaRequests extends Middleware
* Determines the current asset version.
*
* @see https://inertiajs.com/asset-versioning
*
* @param \Illuminate\Http\Request $request
*
* @return string|null
*/
public function version(Request $request)
Expand All @@ -31,13 +34,15 @@ public function version(Request $request)
* Defines the props that are shared by default.
*
* @see https://inertiajs.com/shared-data
*
* @param \Illuminate\Http\Request $request
*
* @return array
*/
public function share(Request $request)
{
return array_merge(parent::share($request), [
//

]);
}
}
2 changes: 1 addition & 1 deletion app/Http/Middleware/PreventRequestsDuringMaintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ class PreventRequestsDuringMaintenance extends Middleware
* @var array
*/
protected $except = [
//

];
}
1 change: 1 addition & 0 deletions app/Http/Middleware/RedirectIfAuthenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class RedirectIfAuthenticated
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null ...$guards
*
* @return mixed
*/
public function handle(Request $request, Closure $next, ...$guards)
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/VerifyCsrfToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ class VerifyCsrfToken extends Middleware
* @var array
*/
protected $except = [
'webhook/cloudconvert'
'webhook/cloudconvert',
];
}
8 changes: 4 additions & 4 deletions app/Jobs/ProcessAudioConversion.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace App\Jobs;

use Throwable;
use App\Actions\Conversions\ConvertAudio;
use App\Models\Conversion;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use App\Actions\Conversions\ConvertAudio;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Throwable;

class ProcessAudioConversion implements ShouldQueue
{
Expand Down
6 changes: 3 additions & 3 deletions app/Models/Conversion.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
namespace App\Models;

use App\Events\ConversionStatusUpdated;
use App\Models\Concerns\InteractsWithFiles;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Traits\Tappable;
use App\Models\Concerns\InteractsWithFiles;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class Conversion extends Model
{
Expand Down
Loading

0 comments on commit 5ba255a

Please sign in to comment.