Skip to content

Commit

Permalink
fix: make Pint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
gere-lajos committed May 9, 2024
1 parent bfdbc84 commit 0493d00
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 13 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"illuminate/contracts": "^10.0||^11.0"
},
"require-dev": {
"laravel/pint": "^1.14",
"nunomaduro/collision": "^8.1.1||^7.10.0",
"larastan/larastan": "^2.9",
"laravel/pint": "^1.15",
"nunomaduro/collision": "^8.1.1||^7.10.0",
"orchestra/testbench": "^9.0.0||^8.22.0",
"pestphp/pest": "^2.34",
"pestphp/pest-plugin-arch": "^2.7",
Expand Down
1 change: 1 addition & 0 deletions src/Commands/LaravelWebTinkerInstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
class LaravelWebTinkerInstallCommand extends Command
{
public $signature = 'laravel-web-tinker:install';

public $description = 'Install the Laravel Web Tinker resources';

public function handle()
Expand Down
2 changes: 1 addition & 1 deletion src/Controllers/WebTinkerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace GereLajos\LaravelWebTinker\Controllers;

use Illuminate\Http\Request;
use GereLajos\LaravelWebTinker\LaravelWebTinker;
use Illuminate\Http\Request;

class WebTinkerController
{
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Middleware/Authorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function handle($request, $next)

protected function allowedToUseTinker(): bool
{
if (!config('web-tinker.enabled')) {
if (! config('web-tinker.enabled')) {
return false;
}

Expand Down
12 changes: 7 additions & 5 deletions src/LaravelWebTinker.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@

namespace GereLajos\LaravelWebTinker;

use GereLajos\LaravelWebTinker\OutputModifiers\OutputModifier;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Application;
use Illuminate\Support\Collection;
use Laravel\Tinker\ClassAliasAutoloader;
use Psy\Configuration;
use Psy\ExecutionLoopClosure;
use Psy\Shell;
use GereLajos\LaravelWebTinker\OutputModifiers\OutputModifier;
use Symfony\Component\Console\Output\BufferedOutput;

class LaravelWebTinker
{
/** @var \Symfony\Component\Console\Output\BufferedOutput */
protected $output;

/** @var \Psy\Shell */
protected $shell;

/** @var \GereLajos\LaravelWebTinker\OutputModifiers\OutputModifier */
protected $outputModifier;

Expand Down Expand Up @@ -49,7 +51,7 @@ protected function createShell(BufferedOutput $output): Shell
{
$config = new Configuration([
'updateCheck' => 'never',
'configFile' => config('web-tinker.config_file') !== null ? base_path() . '/' . config('web-tinker.config_file') : null,
'configFile' => config('web-tinker.config_file') !== null ? base_path().'/'.config('web-tinker.config_file') : null,
]);

$config->setHistoryFile(defined('PHP_WINDOWS_VERSION_BUILD') ? 'null' : '/dev/null');
Expand All @@ -75,16 +77,16 @@ protected function createShell(BufferedOutput $output): Shell

public function removeComments(string $code): string
{
$tokens = collect(token_get_all("<?php\n" . $code . '?>'));
$tokens = collect(token_get_all("<?php\n".$code.'?>'));

return $tokens->reduce(function ($carry, $token) {
if (is_string($token)) {
return $carry . $token;
return $carry.$token;
}

$text = $this->ignoreCommentsAndPhpTags($token);

return $carry . $text;
return $carry.$text;
}, '');
}

Expand Down
2 changes: 1 addition & 1 deletion src/OutputModifiers/PrefixDateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ class PrefixDateTime implements OutputModifier
{
public function modify(string $output = ''): string
{
return '<span style="color:rgba(255,255,255,0.2);font-style:italic">' . now()->format('Y-m-d H:i:s') . '</span><br>' . $output;
return '<span style="color:rgba(255,255,255,0.2);font-style:italic">'.now()->format('Y-m-d H:i:s').'</span><br>'.$output;
}
}
2 changes: 1 addition & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

use Gere Lajos\LaravelWebTinker\Tests\TestCase;
use GereLajos\LaravelWebTinker\Tests\TestCase;

uses(TestCase::class)->in(__DIR__);
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Gere Lajos\LaravelWebTinker\Tests;
namespace GereLajos\LaravelWebTinker\Tests;

use GereLajos\LaravelWebTinker\LaravelWebTinkerServiceProvider;
use Illuminate\Database\Eloquent\Factories\Factory;
use Orchestra\Testbench\TestCase as Orchestra;
use Gere Lajos\LaravelWebTinker\LaravelWebTinkerServiceProvider;

class TestCase extends Orchestra
{
Expand Down

0 comments on commit 0493d00

Please sign in to comment.