Skip to content

Commit

Permalink
Revert "style: correct code style."
Browse files Browse the repository at this point in the history
This reverts commit ecafd32.
  • Loading branch information
Konstantin Lapkovsky committed Dec 13, 2023
1 parent ecafd32 commit 1d84a44
Show file tree
Hide file tree
Showing 12 changed files with 167 additions and 153 deletions.
2 changes: 1 addition & 1 deletion src/AutoDocServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class AutoDocServiceProvider extends ServiceProvider
{
public function boot(): void
public function boot()
{
$this->mergeConfigFrom(__DIR__ . '/../config/auto-doc.php', 'auto-doc');

Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/BaseDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

abstract class BaseDriver implements SwaggerDriverInterface
{
protected string $tempFilePath;
protected $tempFilePath;

public function __construct()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/LocalDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class LocalDriver extends BaseDriver
{
protected string $prodFilePath;
protected $prodFilePath;

public function __construct()
{
Expand Down
4 changes: 2 additions & 2 deletions src/Drivers/RemoteDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

class RemoteDriver extends BaseDriver
{
protected string $key;
protected string $remoteUrl;
protected $key;
protected $remoteUrl;

public function __construct()
{
Expand Down
5 changes: 2 additions & 3 deletions src/Drivers/StorageDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
namespace RonasIT\Support\AutoDoc\Drivers;

use Illuminate\Contracts\Filesystem\FileNotFoundException;
use Illuminate\Contracts\Filesystem\Filesystem;
use Illuminate\Support\Facades\Storage;
use RonasIT\Support\AutoDoc\Exceptions\MissedProductionFilePathException;

class StorageDriver extends BaseDriver
{
protected Filesystem $disk;
protected string $prodFilePath;
protected $disk;
protected $prodFilePath;

public function __construct()
{
Expand Down
13 changes: 5 additions & 8 deletions src/Http/Controllers/AutoDocController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,30 @@

namespace RonasIT\Support\AutoDoc\Http\Controllers;

use Illuminate\Contracts\View\View;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Controller as BaseController;
use RonasIT\Support\AutoDoc\Services\SwaggerService;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

class AutoDocController extends BaseController
{
protected SwaggerService $service;
protected string $documentationViewer;
protected $service;
protected $documentationViewer;

public function __construct()
{
$this->service = app(SwaggerService::class);
$this->documentationViewer = config('auto-doc.documentation_viewer');
}

public function documentation(): JsonResponse
public function documentation()
{
$documentation = $this->service->getDocFileContent();

return response()->json($documentation);
}

public function index(): View|Response
public function index()
{
$currentEnvironment = config('app.env');

Expand All @@ -39,7 +36,7 @@ public function index(): View|Response
return response('Forbidden.', 403);
}

public function getFile(Request $request, $file): Response
public function getFile(Request $request, $file)
{
$filePath = __DIR__ . "/../../../resources/assets/{$this->documentationViewer}/" . $file;

Expand Down
2 changes: 1 addition & 1 deletion src/Http/Middleware/AutoDocMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function handle($request, Closure $next)
{
$response = $next($request);

if ((config('app.env') === 'testing') && !self::$skipped && !empty($request->route())) {
if ((config('app.env') == 'testing') && !self::$skipped && !empty($request->route())) {
app(SwaggerService::class)->addData($request, $response);
}

Expand Down
8 changes: 5 additions & 3 deletions src/Interfaces/SwaggerDriverInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ interface SwaggerDriverInterface
{
/**
* Save temporary data
*
* @param array $data
*/
public function saveTmpData(array $data): void;
public function saveTmpData($data);

/**
* Get temporary data
*/
public function getTmpData(): void;
public function getTmpData();

/**
* Save production data
*/
public function saveData(): void;
public function saveData();

/**
* Get production documentation
Expand Down
Loading

0 comments on commit 1d84a44

Please sign in to comment.