Skip to content

Commit

Permalink
feat: install laravel-pint
Browse files Browse the repository at this point in the history
Processed the project files.

refs: https://app.clickup.com/t/86c0x8ucu
  • Loading branch information
ulin-evgeny committed Nov 15, 2024
1 parent ca6fa58 commit 7f93718
Show file tree
Hide file tree
Showing 28 changed files with 154 additions and 152 deletions.
6 changes: 3 additions & 3 deletions app/Console/Commands/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ protected function fillReadme(): void
$type = $this->choice(
question: 'What type of application will your API serve?',
choices: ['Mobile', 'Web', 'Multiplatform'],
default: 'Multiplatform'
default: 'Multiplatform',
);

$this->setReadmeValue($file, 'type', $type);
Expand All @@ -162,12 +162,12 @@ 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,
['later', 'no'],
$defaultAnswer
$defaultAnswer,
);

if ($link === 'later') {
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 @@ -8,15 +8,15 @@
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 Illuminate\Http\Response;
use Illuminate\Support\Facades\Password;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
use PHPOpenSourceSaver\JWTAuth\Exceptions\JWTException;
use PHPOpenSourceSaver\JWTAuth\JWTAuth;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
use Symfony\Component\HttpKernel\Exception\UnprocessableEntityHttpException;

class AuthController extends Controller
Expand Down
4 changes: 2 additions & 2 deletions 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 All @@ -23,7 +23,7 @@ public function update(UpdateSettingRequest $request, SettingService $service, s
{
$service->update(
['name' => $key],
['value' => $request->all()]
['value' => $request->all()],
);

return response('', Response::HTTP_NO_CONTENT);
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
13 changes: 7 additions & 6 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

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
{
Expand All @@ -15,13 +15,14 @@ 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
5 changes: 2 additions & 3 deletions app/Repositories/UserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
namespace App\Repositories;

use App\Models\User;
use Carbon\Carbon;
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
15 changes: 7 additions & 8 deletions app/Services/UserService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

/**
* @property UserRepository $repository
*
* @mixin UserRepository
*/
class UserService extends EntityService
Expand Down Expand Up @@ -54,21 +55,19 @@ public function forgotPassword(string $email): string
{
return Password::sendResetLink(
credentials: ['email' => $email],
callback: fn ($user, $token) =>
Mail::to($user->email)->send(new ForgotPasswordMail(['hash' => $token]))
callback: fn ($user, $token) => Mail::to($user->email)->send(new ForgotPasswordMail(['hash' => $token])),
);
}

public function restorePassword(array $credentials): string
{
return Password::reset(
credentials: $credentials,
callback: fn (User $user, string $password) =>
$this->repository
->force()
->update($user->id, [
'password' => Hash::make($password),
])
callback: fn (User $user, string $password) => $this->repository
->force()
->update($user->id, [
'password' => Hash::make($password),
]),
);
}
}
4 changes: 2 additions & 2 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
use Illuminate\Session\TokenMismatchException;
use Illuminate\Validation\ValidationException;
use Illuminate\View\Middleware\ShareErrorsFromSession;
use PHPUnit\Framework\ExpectationFailedException;
use RonasIT\AutoDoc\Http\Middleware\AutoDocMiddleware;
use Symfony\Component\HttpKernel\Exception\HttpException;
use PHPUnit\Framework\ExpectationFailedException;

return Application::configure(basePath: dirname(__DIR__))
->withRouting(
Expand All @@ -37,7 +37,7 @@
commands: __DIR__ . '/../routes/console.php',
channels: __DIR__ . '/../routes/channels.php',
health: '/status',
apiPrefix: ''
apiPrefix: '',
)
->withMiddleware(function (Middleware $middleware) {
$middleware->use([
Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@

'previous_keys' => [
...array_filter(
explode(',', env('APP_PREVIOUS_KEYS', ''))
explode(',', env('APP_PREVIOUS_KEYS', '')),
),
],

Expand Down
22 changes: 11 additions & 11 deletions config/ide-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
|
*/

'filename' => '_ide_helper',
'format' => 'php',
'filename' => '_ide_helper',
'format' => 'php',
'meta_filename' => '.phpstorm.meta.php',

/*
Expand Down Expand Up @@ -83,13 +83,13 @@

'magic' => [
'Log' => [
'debug' => 'Monolog\Logger::addDebug',
'info' => 'Monolog\Logger::addInfo',
'notice' => 'Monolog\Logger::addNotice',
'warning' => 'Monolog\Logger::addWarning',
'error' => 'Monolog\Logger::addError',
'critical' => 'Monolog\Logger::addCritical',
'alert' => 'Monolog\Logger::addAlert',
'debug' => 'Monolog\Logger::addDebug',
'info' => 'Monolog\Logger::addInfo',
'notice' => 'Monolog\Logger::addNotice',
'warning' => 'Monolog\Logger::addWarning',
'error' => 'Monolog\Logger::addError',
'critical' => 'Monolog\Logger::addCritical',
'alert' => 'Monolog\Logger::addAlert',
'emergency' => 'Monolog\Logger::addEmergency',
],
],
Expand Down Expand Up @@ -172,8 +172,8 @@
| Cast the given "real type" to the given "type".
|
*/
'type_overrides' => [
'type_overrides' => [
'integer' => 'int',
'boolean' => 'bool',
],
],
];
2 changes: 1 addition & 1 deletion config/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@

'cookie' => env(
'SESSION_COOKIE',
Str::slug(env('APP_NAME', 'laravel'), '_') . '_session'
Str::slug(env('APP_NAME', 'laravel'), '_') . '_session',
),

/*
Expand Down
3 changes: 2 additions & 1 deletion database/migrations/0001_01_01_000000_create_roles_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
use Illuminate\Support\Facades\Schema;
use RonasIT\Support\Traits\MigrationTrait;

return new class () extends Migration {
return new class extends Migration
{
use MigrationTrait;

public function up(): void
Expand Down
3 changes: 2 additions & 1 deletion database/migrations/0001_01_01_000001_create_users_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class () extends Migration {
return new class extends Migration
{
public function up(): void
{
Schema::create('users', function (Blueprint $table) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class () extends Migration {
return new class extends Migration
{
public function up(): void
{
Schema::create('settings', function (Blueprint $table) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class () extends Migration {
return new class extends Migration
{
public function up(): void
{
Schema::create('failed_jobs', function (Blueprint $table) {
Expand Down
Loading

0 comments on commit 7f93718

Please sign in to comment.