Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
tonysm authored and github-actions[bot] committed Aug 25, 2024
1 parent c685680 commit 8b7f8c7
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 15 deletions.
4 changes: 1 addition & 3 deletions src/Broadcasting/Limiter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

class Limiter
{
public function __construct(protected array $keys = [], protected int $delay = 500)
{
}
public function __construct(protected array $keys = [], protected int $delay = 500) {}

public function clear(): void
{
Expand Down
2 changes: 1 addition & 1 deletion src/Broadcasting/Rendering.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static function forContent(View|HtmlString|string $content)

public static function empty(): self
{
return new self();
return new self;
}

public static function forModel(Model $model): self
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/TurboInstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,6 @@ private function existingLayoutFiles()

private function phpBinary()
{
return (new PhpExecutableFinder())->find(false) ?: 'php';
return (new PhpExecutableFinder)->find(false) ?: 'php';
}
}
2 changes: 1 addition & 1 deletion src/Models/Broadcasts.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trait Broadcasts

public static function bootBroadcasts()
{
static::observe(new ModelObserver());
static::observe(new ModelObserver);
}

public static function withoutTurboStreamBroadcasts(callable $callback)
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Naming/Name.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static function forModel(object $model)

public static function build(string $className)
{
$name = new static();
$name = new static;

$name->className = $className;
$name->classNameWithoutRootNamespace = static::removeRootNamespaces($className);
Expand Down
2 changes: 1 addition & 1 deletion src/Testing/ConvertTestResponseToTurboStreamCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ConvertTestResponseToTurboStreamCollection
public function __invoke(TestResponse $response): Collection
{
libxml_use_internal_errors(true);
$document = tap(new DOMDocument())->loadHTML($response->content());
$document = tap(new DOMDocument)->loadHTML($response->content());
$elements = $document->getElementsByTagName('turbo-stream');

$streams = collect();
Expand Down
2 changes: 1 addition & 1 deletion src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function turbo_stream($model = null, ?string $action = null): MultiplePendingTur
}

if ($model === null) {
return new PendingTurboStreamResponse();
return new PendingTurboStreamResponse;
}

return PendingTurboStreamResponse::forModel($model, $action);
Expand Down
2 changes: 1 addition & 1 deletion tests/Broadcasting/LimiterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function debounces()
{
$this->freezeTime();

$debouncer = new Limiter();
$debouncer = new Limiter;

$this->assertFalse($debouncer->shouldLimit('my-key'));
$this->assertTrue($debouncer->shouldLimit('my-key'));
Expand Down
4 changes: 2 additions & 2 deletions tests/Http/ResponseMacrosTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public function append_shorthand_passing_string()
$response = response()
->turboStream()
->append('some_dom_id', 'Hello World')
->toResponse(new Request());
->toResponse(new Request);

$expected = <<<'HTML'
<turbo-stream target="some_dom_id" action="append">
Expand Down Expand Up @@ -944,7 +944,7 @@ public function builds_multiple_turbo_stream_responses()
response()->turboStream()->append($article)->target('append-target-id'),
response()->turboStream()->prepend($article)->target('prepend-target-id'),
response()->turboStream()->remove($article)->target('remove-target-id'),
])->toResponse(new Request());
])->toResponse(new Request);

$expected = collect([
view('turbo-laravel::turbo-stream', [
Expand Down
6 changes: 3 additions & 3 deletions tests/Views/ViewHelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function renders_dom_id()

$renderedDomId = Blade::render('<div id="@domid($article)"></div>', ['article' => $article]);
$renderedDomIdWithPrefix = Blade::render('<div id="@domid($article, "favorites")"></div>', ['article' => $article]);
$rendersDomIdOfNewModel = Blade::render('<div id="@domid($article)"></div>', ['article' => new Article()]);
$rendersDomIdOfNewModel = Blade::render('<div id="@domid($article)"></div>', ['article' => new Article]);

$this->assertEquals('<div id="article_'.$article->id.'"></div>', trim($renderedDomId));
$this->assertEquals('<div id="favorites_article_'.$article->id.'"></div>', trim($renderedDomIdWithPrefix));
Expand All @@ -80,7 +80,7 @@ public function renders_dom_class()

$renderedDomClass = Blade::render('<div class="@domclass($article)"></div>', ['article' => $article]);
$renderedDomClassWithPrefix = Blade::render('<div class="@domclass($article, "favorites")"></div>', ['article' => $article]);
$rendersDomClassOfNewModel = Blade::render('<div class="@domclass($article)"></div>', ['article' => new Article()]);
$rendersDomClassOfNewModel = Blade::render('<div class="@domclass($article)"></div>', ['article' => new Article]);

$this->assertEquals('<div class="article"></div>', trim($renderedDomClass));
$this->assertEquals('<div class="favorites_article"></div>', trim($renderedDomClassWithPrefix));
Expand Down Expand Up @@ -113,7 +113,7 @@ public function generates_model_ids_for_models_in_nested_folders()

$this->assertEquals('user_profile_'.$profile->id, dom_id($profile));
$this->assertEquals('posts_user_profile_'.$profile->id, dom_id($profile, 'posts'));
$this->assertEquals('create_user_profile', dom_id(new Profile()));
$this->assertEquals('create_user_profile', dom_id(new Profile));
}

/** @test */
Expand Down

0 comments on commit 8b7f8c7

Please sign in to comment.