Skip to content

Commit

Permalink
Fix code styling
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints authored and github-actions[bot] committed Aug 2, 2024
1 parent 5561c62 commit ff74fe7
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 39 deletions.
3 changes: 1 addition & 2 deletions src/Events/ViewMatched.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ class ViewMatched
public function __construct(
public MatchedView $matchedView,
public MountPath $mountPath,
) {
}
) {}
}
4 changes: 1 addition & 3 deletions src/PathBasedMiddlewareList.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ class PathBasedMiddlewareList
/**
* Create a new path based middleware list instance.
*/
public function __construct(public array $middleware)
{
}
public function __construct(public array $middleware) {}

/**
* Find the middleware that match the given matched view's path.
Expand Down
3 changes: 1 addition & 2 deletions src/PendingRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ public function __construct(
protected string $uri,
protected array $middleware,
protected ?string $domain = null,
) {
}
) {}

/**
* Set the domain for the route.
Expand Down
4 changes: 1 addition & 3 deletions src/Pipeline/ContinueIterating.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ class ContinueIterating
/**
* Create a new continue iterating instance.
*/
public function __construct(public State $state)
{
}
public function __construct(public State $state) {}
}
6 changes: 2 additions & 4 deletions src/Pipeline/EnsureMatchesDomain.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ class EnsureMatchesDomain
/**
* Create a new pipeline step instance.
*/
public function __construct(protected Request $request, protected MountPath $mountPath)
{
}
public function __construct(protected Request $request, protected MountPath $mountPath) {}

/**
* Invoke the routing pipeline handler.
Expand All @@ -29,7 +27,7 @@ public function __invoke(State $state, Closure $next): mixed
$route = $this->route();

if ($this->matchesDomain($route) === false) {
return new StopIterating();
return new StopIterating;
}

$state->data = array_merge($route->parameters(), $state->data);
Expand Down
4 changes: 1 addition & 3 deletions src/Pipeline/PotentiallyBindablePathSegment.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ class PotentiallyBindablePathSegment
/**
* Create a new potentially bindable path segment instance.
*/
public function __construct(public string $value)
{
}
public function __construct(public string $value) {}

/**
* Determine if the segment is bindable.
Expand Down
4 changes: 1 addition & 3 deletions src/Pipeline/TransformModelBindings.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ class TransformModelBindings
/**
* Create a new pipeline step instance.
*/
public function __construct(protected Request $request)
{
}
public function __construct(protected Request $request) {}

/**
* Invoke the routing pipeline handler.
Expand Down
3 changes: 1 addition & 2 deletions src/RequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public function __construct(
protected array $mountPaths,
protected ?Closure $renderUsing = null,
protected ?Closure $onViewMatch = null,
) {
}
) {}

/**
* Handle the incoming request using Folio.
Expand Down
4 changes: 1 addition & 3 deletions src/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ class Router
/**
* Create a new router instance.
*/
public function __construct(protected MountPath $mountPath)
{
}
public function __construct(protected MountPath $mountPath) {}

/**
* Match the given URI to a view via page based routing.
Expand Down
20 changes: 10 additions & 10 deletions tests/Feature/Console/ListCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
});

it('may have routes', function () {
$output = new BufferedOutput();
$output = new BufferedOutput;

Folio::route(__DIR__.'/../resources/views/pages');
$exitCode = Artisan::call('folio:list', [], $output);
Expand Down Expand Up @@ -53,7 +53,7 @@
});

it('has the `--json` option', function () {
$output = new BufferedOutput();
$output = new BufferedOutput;

Folio::route(__DIR__.'/../resources/views/pages');
$exitCode = Artisan::call('folio:list', [
Expand All @@ -67,7 +67,7 @@
});

it('has the `--path` option', function () {
$output = new BufferedOutput();
$output = new BufferedOutput;

Folio::route(__DIR__.'/../resources/views/pages');
$exitCode = Artisan::call('folio:list', [
Expand All @@ -91,7 +91,7 @@
});

it('has the `--name` option', function () {
$output = new BufferedOutput();
$output = new BufferedOutput;

Folio::route(__DIR__.'/../resources/views/pages');
$exitCode = Artisan::call('folio:list', [
Expand All @@ -111,7 +111,7 @@
});

it('has the `--except-path` option', function () {
$output = new BufferedOutput();
$output = new BufferedOutput;

Folio::route(__DIR__.'/../resources/views/pages');
$exitCode = Artisan::call('folio:list', [
Expand Down Expand Up @@ -142,7 +142,7 @@
});

it('may not find routes with `--path` or `--except-path`', function () {
$output = new BufferedOutput();
$output = new BufferedOutput;

Folio::route(__DIR__.'/../resources/views/pages');
$exitCode = Artisan::call('folio:list', [
Expand All @@ -160,7 +160,7 @@
});

it('has the `--sort` option', function () {
$output = new BufferedOutput();
$output = new BufferedOutput;

Folio::route(__DIR__.'/../resources/views/pages');
$exitCode = Artisan::call('folio:list', [
Expand All @@ -185,7 +185,7 @@
});

it('has the `--reverse` option', function () {
$output = new BufferedOutput();
$output = new BufferedOutput;

Folio::route(__DIR__.'/../resources/views/pages');
$exitCode = Artisan::call('folio:list', [
Expand All @@ -210,7 +210,7 @@
});

test('multiple mounted directories', function () {
$output = new BufferedOutput();
$output = new BufferedOutput;

Folio::path(__DIR__.'/../resources/views/pages');
Folio::path(__DIR__.'/../resources/views/more-pages');
Expand Down Expand Up @@ -250,7 +250,7 @@
});

it('prefixes URIs', function (string $uri) {
$output = new BufferedOutput();
$output = new BufferedOutput;

Folio::path(__DIR__.'/../resources/views/more-pages')->uri($uri);

Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/MiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function ($request, $next) {
});

test('terminate method is invoked using application container', function () {
$this->app->bind(Dependency::class, fn () => new Dependency());
$this->app->bind(Dependency::class, fn () => new Dependency);

$this->get('/users/Taylor');

Expand Down
4 changes: 1 addition & 3 deletions tests/Unit/ModelBindingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,7 @@ class FolioModelBindingTestClass implements UrlRoutable
{
public $trashed = false;

public function __construct(public mixed $value = null, public mixed $field = null, public mixed $childType = null)
{
}
public function __construct(public mixed $value = null, public mixed $field = null, public mixed $childType = null) {}

public function getRouteKey()
{
Expand Down

0 comments on commit ff74fe7

Please sign in to comment.