Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
Install ralavel pint for formatter
Browse files Browse the repository at this point in the history
Signed-off-by: Lloric Mayuga Garcia <[email protected]>
  • Loading branch information
lloricode committed Oct 16, 2022
1 parent 00c0b18 commit bad5a7a
Show file tree
Hide file tree
Showing 98 changed files with 579 additions and 286 deletions.
2 changes: 2 additions & 0 deletions app/Auth/PassportSocialResolver.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Auth;

use App\Repositories\Auth\User\UserRepository;
Expand Down
20 changes: 9 additions & 11 deletions app/Console/Commands/GenerateDocumentationCommand.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

declare(strict_types=1);
/**
* Created by PhpStorm.
* User: Lloric Mayuga Garcia <[email protected]>
Expand All @@ -14,7 +16,6 @@

class GenerateDocumentationCommand extends Command
{

protected const APIDOCS_FILENAME = 'apidoc.json';

protected array $docInputs = [
Expand All @@ -28,14 +29,14 @@ class GenerateDocumentationCommand extends Command
*
* @var string
*/
protected $signature = "apidocs {--vrbs : Verbose of apidoc}";
protected $signature = 'apidocs {--vrbs : Verbose of apidoc}';

/**
* The console command description.
*
* @var string
*/
protected $description = "Generate API Blueprint Documentation.";
protected $description = 'Generate API Blueprint Documentation.';

public function __construct()
{
Expand All @@ -49,16 +50,13 @@ public function __construct()
];
}

/**
* Execute the console command.
*
*/
/** Execute the console command. */
public function handle()
{
$this->info('Generating API Blueprint Documentation ...');

$path = $this->config['output'].$this->config['url'].'/generated-markdown';
if (!file_exists($path)) {
if ( ! file_exists($path)) {
app('files')->makeDirectory($path, $mode = 0777, true, true);
}

Expand All @@ -80,7 +78,7 @@ private function generateHeader($path, $fileName)
$replacer('{{api.domain.dev}}', config('app.url'));
$replacer(
'{{accept-header}}',
"application/json"
'application/json'
);
$replacer('{{rate-limit-expires}}', config('setting.api.throttle.expires'));
$replacer('{{rate-limit-attempts}}', config('setting.api.throttle.limit'));
Expand Down Expand Up @@ -139,7 +137,7 @@ private function generateAPIDocsTask()
// execute the command
$process->run();

if (!$process->isSuccessful()) {
if ( ! $process->isSuccessful()) {
throw new ProcessFailedException($process);
}
// $this->info('Result: ' . $process->getOutput());
Expand All @@ -150,4 +148,4 @@ private function getJsonConfigurationPath()
$template = str_replace(base_path(), '', $this->config['documentFilePath']);
return substr($template, 1, strlen($template) - 1).'config/';
}
}
}
6 changes: 4 additions & 2 deletions app/Console/Commands/Inspiring.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?php

declare(strict_types=1);

namespace App\Console\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Collection;

class Inspiring extends Command
{
protected $signature = "inspire";
protected $signature = 'inspire';

private static function quote()
{
Expand Down Expand Up @@ -50,4 +52,4 @@ public function handle()

$this->comment("\n".self::quote()."\n");
}
}
}
4 changes: 3 additions & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Console;

use App\Console\Commands\GenerateDocumentationCommand;
Expand Down Expand Up @@ -27,6 +29,6 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
//

}
}
2 changes: 2 additions & 0 deletions app/Events/Event.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Events;

use Illuminate\Queue\SerializesModels;
Expand Down
13 changes: 8 additions & 5 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Exceptions;

use Illuminate\Auth\Access\AuthorizationException;
Expand All @@ -14,6 +16,7 @@
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Throwable;
use Exception;

class Handler extends ExceptionHandler
{
Expand All @@ -36,10 +39,10 @@ class Handler extends ExceptionHandler
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Throwable $exception
* @param Throwable $exception
* @return void
*
* @throws \Exception
* @throws Exception
*/
public function report(Throwable $exception)
{
Expand All @@ -50,10 +53,10 @@ public function report(Throwable $exception)
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Throwable $exception
* @param Throwable $exception
* @return \Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*
* @throws \Throwable
* @throws Throwable
*/
public function render($request, Throwable $exception)
{
Expand All @@ -69,7 +72,7 @@ public function render($request, Throwable $exception)
$exception->getMessage(),
$exception
);
} elseif (!config('app.debug') && $exception instanceof QueryException) {
} elseif ( ! config('app.debug') && $exception instanceof QueryException) {
$exception = new HttpException(Response::HTTP_UNPROCESSABLE_ENTITY, 'Something wrong with your query');
}

Expand Down
4 changes: 3 additions & 1 deletion app/Helper.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App;

use DB;
Expand All @@ -13,4 +15,4 @@ public static function isLatestMysqlVersion(): bool
return ($pdo->getAttribute(PDO::ATTR_DRIVER_NAME) === 'mysql') &&
version_compare($pdo->getAttribute(PDO::ATTR_SERVER_VERSION), '5.7.8', 'ge');
}
}
}
66 changes: 33 additions & 33 deletions app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace App\Http\Controllers;

use App\Transformers\BaseTransformer;
Expand All @@ -8,24 +10,23 @@

class Controller extends BaseController
{

/**
* @OA\Info(
* title=SWAGGER_LUME_TITLE,
* description="RESTful API template made from lumen",
* version="1.0",
* @OA\Contact(
* email="[email protected]",
* name="Lloric Mayuga Garcia"
* ),
* @OA\License(
* name="MIT",
* url="https://opensource.org/licenses/MIT"
* )
* title=SWAGGER_LUME_TITLE,
* description="RESTful API template made from lumen",
* version="1.0",
* @OA\Contact(
* email="[email protected]",
* name="Lloric Mayuga Garcia"
* ),
* @OA\License(
* name="MIT",
* url="https://opensource.org/licenses/MIT"
* )
* )
* @OA\Server(
* url=SWAGGER_LUME_CONST_HOST,
* description="API Server"
* url=SWAGGER_LUME_CONST_HOST,
* description="API Server"
* )
* @OA\Post(
* path="/oauth/token",
Expand Down Expand Up @@ -56,16 +57,16 @@ class Controller extends BaseController
* type="string"
* ),
* example={
* "grant_type": "password",
* "client_id": "2",
* "client_secret": "BZnwQmjc0LEi40jVKoW2ICX2LC1K4mG0NKfWBl8Z",
* "username": "[email protected]",
* "password": "secret"
* }
* "grant_type" : "password",
* "client_id" : "2",
* "client_secret" : "BZnwQmjc0LEi40jVKoW2ICX2LC1K4mG0NKfWBl8Z",
* "username" : "[email protected]",
* "password" : "secret"
* }
* )
* )
* ),
* @OA\Response(
* @OA\Response(
* response="200",
* description="ok",
* content={
Expand Down Expand Up @@ -94,10 +95,10 @@ class Controller extends BaseController
* description="Token type"
* ),
* example={
* "token_type": "bearer",
* "expires_in": 3600,
* "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJ...",
* "refresh_token": "def50200b10ed22a1dab8bb0d18..."
* "token_type" : "bearer",
* "expires_in" : 3600,
* "access_token" : "eyJ0eXAiOiJKV1QiLCJhbGciOiJ...",
* "refresh_token" : "def50200b10ed22a1dab8bb0d18..."
* }
* )
* )
Expand All @@ -123,16 +124,15 @@ class Controller extends BaseController
* )
*
* @OA\Schema(
* schema="Error",
* required={"message"},
* @OA\Property(
* property="message",
* type="string"
* )
* ),
* schema="Error",
* required={"message"},
* @OA\Property(
* property="message",
* type="string"
* )
* ),
*/


/**
* @param $data
* @param \App\Transformers\BaseTransformer $transformer
Expand Down
Loading

0 comments on commit bad5a7a

Please sign in to comment.