Skip to content

Commit 1c46069

Browse files
rubenvanasschegithub-actions[bot]
authored andcommitted
Fix styling
1 parent 84bcb18 commit 1c46069

12 files changed

+38
-43
lines changed

src/Actions/VisitTypeScriptTreeAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class VisitTypeScriptTreeAction
1111
public function execute(
1212
TypeScriptNode $typeScriptNode,
1313
Closure $walker,
14-
?array $allowedNodes = null
14+
array $allowedNodes = null
1515
): void {
1616
// TODO: would be cool to replace nodes, remove them etc
1717
// Problem: nodes are sometimes structured in different properties which makes this complicated

src/Laravel/LaravelDefaultTypesProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ protected function lengthAwarePaginator(): Transformed
9494
new TypeScriptProperty('data', new TypeScriptGeneric(
9595
new TypeScriptIdentifier('Array'),
9696
[new TypeScriptIdentifier('T')],
97-
),),
97+
), ),
9898
new TypeScriptProperty('links', new TypeScriptObject([
9999
new TypeScriptProperty('url', new TypeScriptUnion([
100100
new TypeScriptIdentifier('string'),

src/Laravel/RouterGenerator.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use Spatie\TypeScriptTransformer\TypeScript\TypeScriptGenericTypeVariable;
2121
use Spatie\TypeScriptTransformer\TypeScript\TypeScriptIdentifier;
2222
use Spatie\TypeScriptTransformer\TypeScript\TypeScriptIndexedAccess;
23-
use Spatie\TypeScriptTransformer\TypeScript\TypeScriptInterface;
2423
use Spatie\TypeScriptTransformer\TypeScript\TypeScriptObject;
2524
use Spatie\TypeScriptTransformer\TypeScript\TypeScriptOperator;
2625
use Spatie\TypeScriptTransformer\TypeScript\TypeScriptParameter;
@@ -121,7 +120,7 @@ public function provide(): array
121120
new TypeScriptParameter('params', new TypeScriptIdentifier('TParams'), isOptional: true),
122121
],
123122
new TypeScriptString(),
124-
new TypeScriptRaw("let routes = JSON.parse('".json_encode($controllers->toJsObject(), flags: JSON_UNESCAPED_SLASHES). "')")
123+
new TypeScriptRaw("let routes = JSON.parse('".json_encode($controllers->toJsObject(), flags: JSON_UNESCAPED_SLASHES)."')")
125124
),
126125
null,
127126
'route',

src/Laravel/Routes/InvokableRouteController.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Spatie\TypeScriptTransformer\Laravel\Routes;
44

5-
use PHPUnit\Runner\Extension\ParameterCollection;
65
use Spatie\TypeScriptTransformer\TypeScript\TypeScriptNode;
76
use Spatie\TypeScriptTransformer\TypeScript\TypeScriptObject;
87
use Spatie\TypeScriptTransformer\TypeScript\TypeScriptProperty;
@@ -11,14 +10,13 @@
1110
class InvokableRouteController implements RouterStructure
1211
{
1312
/**
14-
* @param array<string> $methods
13+
* @param array<string> $methods
1514
*/
1615
public function __construct(
1716
public RouteParameterCollection $parameters,
1817
public array $methods,
1918
public string $url,
20-
)
21-
{
19+
) {
2220
}
2321

2422
public function toTypeScriptNode(): TypeScriptNode
@@ -33,7 +31,7 @@ public function toJsObject(): array
3331
{
3432
return [
3533
'url' => $this->url,
36-
'methods' => array_values($this->methods)
34+
'methods' => array_values($this->methods),
3735
];
3836
}
3937
}

src/Laravel/Routes/RouteController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class RouteController implements RouterStructure
1010
{
1111
/**
12-
* @param array<string, RouteControllerAction> $actions
12+
* @param array<string, RouteControllerAction> $actions
1313
*/
1414
public function __construct(
1515
public array $actions,

src/Laravel/Routes/RouteControllerAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class RouteControllerAction implements RouterStructure
1111
{
1212
/**
13-
* @param array<string> $methods
13+
* @param array<string> $methods
1414
*/
1515
public function __construct(
1616
public string $name,

src/Laravel/Routes/RouteControllerCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class RouteControllerCollection implements RouterStructure
1010
{
1111
/**
12-
* @param array<string, RouteController|InvokableRouteController> $controllers
12+
* @param array<string, RouteController|InvokableRouteController> $controllers
1313
*/
1414
public function __construct(
1515
public array $controllers

src/Laravel/Routes/RouteParameterCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class RouteParameterCollection implements RouterStructure
99
{
1010
/**
11-
* @param array<RouteParameter> $parameters
11+
* @param array<RouteParameter> $parameters
1212
*/
1313
public function __construct(
1414
public array $parameters,

src/Laravel/SpatieLaravelDefaultTypesProvider.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,29 @@ public function provide(): array
2222
if (class_exists(\Spatie\LaravelOptions\Options::class)) {
2323
$types[] = new Transformed(
2424
new TypeScriptExport(new TypeScriptAlias(
25-
new TypeScriptGeneric(
26-
new TypeScriptIdentifier('Options'),
27-
[
28-
new TypeScriptGenericTypeVariable(
29-
new TypeScriptIdentifier('TValue'),
30-
default: new TypeScriptIdentifier('string'),
31-
),
32-
new TypeScriptGenericTypeVariable(
33-
new TypeScriptIdentifier('TLabel'),
34-
default: new TypeScriptIdentifier('string'),
35-
),
36-
]
37-
),
38-
new TypeScriptGeneric(
39-
new TypeScriptIdentifier('Array'),
40-
[
41-
new TypeScriptObject([
42-
new TypeScriptProperty('value', new TypeScriptGenericTypeVariable(new TypeScriptIdentifier('TValue'))),
43-
new TypeScriptProperty('label', new TypeScriptGenericTypeVariable(new TypeScriptIdentifier('TLabel'))),
44-
]),
45-
],
46-
)
25+
new TypeScriptGeneric(
26+
new TypeScriptIdentifier('Options'),
27+
[
28+
new TypeScriptGenericTypeVariable(
29+
new TypeScriptIdentifier('TValue'),
30+
default: new TypeScriptIdentifier('string'),
31+
),
32+
new TypeScriptGenericTypeVariable(
33+
new TypeScriptIdentifier('TLabel'),
34+
default: new TypeScriptIdentifier('string'),
35+
),
36+
]
37+
),
38+
new TypeScriptGeneric(
39+
new TypeScriptIdentifier('Array'),
40+
[
41+
new TypeScriptObject([
42+
new TypeScriptProperty('value', new TypeScriptGenericTypeVariable(new TypeScriptIdentifier('TValue'))),
43+
new TypeScriptProperty('label', new TypeScriptGenericTypeVariable(new TypeScriptIdentifier('TLabel'))),
44+
]),
45+
],
4746
)
47+
)
4848
),
4949
new ClassStringReference(\Spatie\LaravelOptions\Options::class),
5050
'Options',

src/Transformers/ClassTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function getTypeScriptNode(
8484

8585
protected function resolveTypeByAttribute(
8686
ReflectionClass $reflectionClass,
87-
?ReflectionProperty $property = null,
87+
ReflectionProperty $property = null,
8888
): ?TypeScriptNode {
8989
$subject = $property ?? $reflectionClass;
9090

0 commit comments

Comments
 (0)