Skip to content

Commit

Permalink
Disabled some rules in Laravel Pint. Processed the code in accordance…
Browse files Browse the repository at this point in the history
… with the new rules.
  • Loading branch information
ulin-evgeny committed Jun 1, 2024
1 parent 6ebc6f7 commit 1764986
Show file tree
Hide file tree
Showing 28 changed files with 233 additions and 286 deletions.
2 changes: 1 addition & 1 deletion app/Console/Commands/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ protected function fillResources(): void
foreach (self::RESOURCES_ITEMS as $key => $title) {
$defaultAnswer = (in_array($key, self::DEFAULT_URLS)) ? $this->appUrl . "/{$key}" : 'later';
$text = "Are you going to use {$title}? "
. "Please enter a link or select `later` to do it later, otherwise select `no`.";
. 'Please enter a link or select `later` to do it later, otherwise select `no`.';

$link = $this->anticipate(
$text,
Expand Down
15 changes: 6 additions & 9 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace App\Exceptions;

use Illuminate\Validation\ValidationException;
use Illuminate\Session\TokenMismatchException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Auth\AuthenticationException;
use PHPUnit\Framework\ExpectationFailedException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Http\Response;
use Illuminate\Session\TokenMismatchException;
use Illuminate\Validation\ValidationException;
use PHPUnit\Framework\ExpectationFailedException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Throwable;

Expand Down Expand Up @@ -44,7 +44,6 @@ class Handler extends ExceptionHandler
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Throwable $exception
* @return void
*
* @throws \Exception
Expand All @@ -57,8 +56,7 @@ public function report(Throwable $exception)
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Throwable $exception
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*
* @throws \Throwable
Expand Down Expand Up @@ -91,8 +89,7 @@ public function render($request, Throwable $exception)
/**
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
protected function unauthenticated($request, AuthenticationException $exception)
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
use App\Http\Requests\Auth\RefreshTokenRequest;
use App\Http\Requests\Auth\RegisterUserRequest;
use App\Http\Requests\Auth\RestorePasswordRequest;
use App\Http\Resources\Auth\SuccessLoginResource;
use App\Http\Resources\Auth\RefreshTokenResource;
use Illuminate\Http\Response;
use App\Http\Resources\Auth\SuccessLoginResource;
use App\Services\UserService;
use App\Traits\TokenTrait;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
use Illuminate\Http\Response;
use PHPOpenSourceSaver\JWTAuth\Exceptions\JWTException;
use PHPOpenSourceSaver\JWTAuth\JWTAuth;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;

class AuthController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/SettingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
use App\Http\Requests\Setting\GetSettingRequest;
use App\Http\Requests\Setting\SearchSettingRequest;
use App\Http\Requests\Setting\UpdateSettingRequest;
use App\Http\Resources\Setting\SettingsCollectionResource;
use App\Http\Resources\Setting\SettingResource;
use App\Http\Resources\Setting\SettingsCollectionResource;
use App\Services\SettingService;
use Illuminate\Http\Response;

Expand Down
24 changes: 12 additions & 12 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
namespace App\Http;

use App\Http\Middleware\ClearVersion;
use Illuminate\Http\Middleware\HandleCors;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
use RonasIT\Support\AutoDoc\Http\Middleware\AutoDocMiddleware;
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode;
use Illuminate\Foundation\Http\Middleware\ValidatePostSize;
use App\Http\Middleware\TrimStrings;
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
use App\Http\Middleware\EncryptCookies;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;
use App\Http\Middleware\RedirectIfAuthenticated;
use App\Http\Middleware\TrimStrings;
use App\Http\Middleware\VerifyCsrfToken;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Auth\Middleware\Authenticate;
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
use Illuminate\Auth\Middleware\Authorize;
use App\Http\Middleware\RedirectIfAuthenticated;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode;
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
use Illuminate\Foundation\Http\Middleware\ValidatePostSize;
use Illuminate\Http\Middleware\HandleCors;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Routing\Middleware\ThrottleRequests;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;
use RonasIT\Support\AutoDoc\Http\Middleware\AutoDocMiddleware;

class Kernel extends HttpKernel
{
Expand Down
1 change: 0 additions & 1 deletion app/Http/Middleware/RedirectIfAuthenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class RedirectIfAuthenticated
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @return mixed
*/
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

class Role extends Model
{
use ModelTrait;
use HasFactory;
use ModelTrait;

public const ADMIN = 1;
public const USER = 2;
Expand Down
4 changes: 2 additions & 2 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

class User extends Authenticatable implements JWTSubject
{
use Notifiable;
use ModelTrait;
use HasFactory;
use ModelTrait;
use Notifiable;

protected $fillable = [
'name',
Expand Down
14 changes: 6 additions & 8 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,27 @@

use App\Enums\VersionEnum;
use Illuminate\Routing\Route;
use Illuminate\Routing\RouteRegistrar;
use Illuminate\Support\Facades\Route as RouteFacade;
use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\RouteRegistrar;

class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot(): void
{
/**
* Specify that the route version must be in the range of given values inclusive.
*
* @param VersionEnum|null $start
* @param VersionEnum|null $end
* @param string|null $param (default is 'version')
* @param Route|null $instance
* @param VersionEnum|null $start
* @param VersionEnum|null $end
* @param string|null $param (default is 'version')
* @param Route|null $instance
* @return Route|RouteRegistrar
*/
$versionRange = function (?VersionEnum $start, ?VersionEnum $end, ?string $param, Route $instance = null) {
$versionRange = function (?VersionEnum $start, ?VersionEnum $end, ?string $param, ?Route $instance = null) {
if (!$param) {
$param = 'version';
}
Expand Down
4 changes: 2 additions & 2 deletions app/Repositories/RoleRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
use RonasIT\Support\Repositories\BaseRepository;

/**
* @property Role $model
*/
* @property Role $model
*/
class RoleRepository extends BaseRepository
{
public function __construct()
Expand Down
4 changes: 2 additions & 2 deletions app/Repositories/SettingRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use RonasIT\Support\Repositories\BaseRepository;

/**
* @property Setting $model
*/
* @property Setting $model
*/
class SettingRepository extends BaseRepository
{
public function __construct()
Expand Down
4 changes: 2 additions & 2 deletions app/Repositories/UserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use RonasIT\Support\Repositories\BaseRepository;

/**
* @property User $model
*/
* @property User $model
*/
class UserRepository extends BaseRepository
{
public function __construct()
Expand Down
1 change: 1 addition & 0 deletions app/Services/RoleService.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/**
* @property RoleRepository $repository
*
* @mixin RoleRepository
*/
class RoleService extends EntityService
Expand Down
1 change: 1 addition & 0 deletions app/Services/SettingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @property SettingRepository $repository
*
* @mixin SettingRepository
*/
class SettingService extends EntityService
Expand Down
1 change: 1 addition & 0 deletions app/Services/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

/**
* @property UserRepository $repository
*
* @mixin UserRepository
*/
class UserService extends EntityService
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

$app = new Illuminate\Foundation\Application(
realpath(__DIR__.'/../')
realpath(__DIR__ . '/../')
);

/*
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
|
*/

require __DIR__.'/../vendor/autoload.php';
require __DIR__ . '/../vendor/autoload.php';
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"stop-on-failure": ["pre-commit"]
},
"pre-commit": [
"docker-compose up -d php && docker-compose exec -T php vendor/bin/php-cs-fixer fix && docker-compose exec -T php vendor/bin/tlint"
"docker-compose up -d php && docker-compose exec -T php vendor/bin/pint && docker-compose exec -T php vendor/bin/tlint"
]
}
},
Expand Down
Loading

0 comments on commit 1764986

Please sign in to comment.