PHP Style Change (Laravel Pint CI)

This commit is contained in:
HDVinnie
2023-08-31 09:22:36 +00:00
committed by HDVinne
parent 1348ffeaa8
commit 93a8a8d375
14 changed files with 20 additions and 6 deletions

View File

@@ -70,6 +70,7 @@ class AutoPreWarning extends Command
->where('torrent', '=', $pre->torrent->id)
->where('user_id', '=', $pre->user->id)
->first();
// Send Pre Warning PM If Actual Warning Doesnt Already Exsist
if ($exsist === null) {
$timeleft = config('hitrun.grace') - config('hitrun.prewarn');

View File

@@ -67,6 +67,7 @@ class AutoWarning extends Command
->where('torrent', '=', $hr->torrent->id)
->where('user_id', '=', $hr->user->id)
->first();
// Insert Warning Into Warnings Table if doesnt already exsist
if ($exsist === null) {
$warning = new Warning();

View File

@@ -16,6 +16,7 @@ namespace App\Console\Commands;
use App\Mail\TestEmail;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Mail;
use Exception;
/**
* @see \Tests\Todo\Unit\Console\Commands\TestMailSettingsTest
@@ -48,7 +49,7 @@ class TestMailSettings extends Command
try {
Mail::to($owner)->send(new TestEmail());
} catch (\Exception) {
} catch (Exception) {
$this->error('Failed!');
$this->alert('Email failed to send. Please review your mail configs in the .env file.');

View File

@@ -16,6 +16,7 @@ namespace App\Helpers;
use Illuminate\Support\Facades\Crypt;
use Illuminate\Support\Str;
use Illuminate\Validation\Validator;
use Exception;
class HiddenCaptcha
{
@@ -86,7 +87,7 @@ class HiddenCaptcha
// Get the token values
try {
$token = Crypt::decrypt($captcha);
} catch (\Exception) {
} catch (Exception) {
return false;
}

View File

@@ -15,6 +15,7 @@ namespace App\Helpers;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;
use Exception;
class SystemInformation
{
@@ -160,7 +161,7 @@ class SystemInformation
{
try {
return substr(sprintf('%o', fileperms(base_path($path))), -4);
} catch (\Exception) {
} catch (Exception) {
return trans('site.error');
}
}

View File

@@ -32,6 +32,7 @@ use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;
use Exception;
/**
* @see \Tests\Todo\Feature\Http\Controllers\TorrentControllerTest
@@ -116,7 +117,7 @@ class TorrentController extends BaseController
try {
$meta = Bencode::get_meta($decodedTorrent);
} catch (\Exception) {
} catch (Exception) {
return $this->sendError('Validation Error.', 'You Must Provide A Valid Torrent File For Upload!');
}
@@ -245,6 +246,7 @@ class TorrentController extends BaseController
// Save The Torrent
$torrent->save();
// Set torrent to featured
if ($torrent->featured == 1) {
$featuredTorrent = new FeaturedTorrent();

View File

@@ -108,6 +108,7 @@ class PostController extends Controller
$topic->notifyStaffers($user, $topic, $post);
} else {
$this->chatRepository->systemMessage(sprintf('[url=%s]%s[/url] has left a reply on topic [url=%s]%s[/url]', $profileUrl, $user->username, $postUrl, $topic->name));
// Notify All Subscribers Of New Reply
if ($topic->first_post_user_id != $user->id) {
$topic->notifyStarter($user, $topic, $post);

View File

@@ -40,7 +40,7 @@ class HomeController extends Controller
// SSL Info
try {
$certificate = $request->secure() ? SslCertificate::createForHostName(config('app.url')) : '';
} catch (\Exception) {
} catch (Exception) {
$certificate = '';
}

View File

@@ -45,6 +45,7 @@ class TorrentDownloadController extends Controller
}
$torrent = Torrent::withoutGlobalScope(ApprovedScope::class)->findOrFail($id);
$hasHistory = $user->history()->where([['torrent_id', '=', $torrent->id], ['seeder', '=', 1]])->exists();
// User's ratio is too low
if ($user->ratio < config('other.ratio') && ! ($torrent->user_id === $user->id || $hasHistory)) {
return to_route('torrents.show', ['id' => $torrent->id])

View File

@@ -22,6 +22,7 @@ use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Request;
use Illuminate\Validation\Rule;
use Closure;
use Exception;
class StoreTorrentRequest extends FormRequest
{
@@ -61,7 +62,7 @@ class StoreTorrentRequest extends FormRequest
try {
$meta = Bencode::get_meta($decodedTorrent);
} catch (\Exception) {
} catch (Exception) {
$fail('You Must Provide A Valid Torrent File For Upload!');
}

View File

@@ -167,6 +167,7 @@ class ProcessAnnounce implements ShouldQueue
'downloaded' => DB::raw('downloaded + '.(int) $modDownloaded),
]);
}
// End User Update
break;
default:

View File

@@ -59,6 +59,7 @@ class Article extends Model
public function getBrief(int $length = 20, bool $ellipses = true, bool $stripHtml = false): string
{
$input = $this->content;
//strip tags, if desired
if ($stripHtml) {
$input = strip_tags($input);

View File

@@ -85,6 +85,7 @@ class Peer extends Model
{
if (config('announce.connectable_check')) {
$tmp_ip = inet_ntop(pack('A'.\strlen($this->ip), $this->ip));
// IPv6 Check
if (filter_var($tmp_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
$tmp_ip = '['.$tmp_ip.']';

View File

@@ -128,6 +128,7 @@ class Post extends Model
public function getBrief(int $length = 100, bool $ellipses = true, bool $stripHtml = false): string
{
$input = $this->content;
//strip tags, if desired
if ($stripHtml) {
$input = strip_tags($input);