Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvanassche authored and github-actions[bot] committed Oct 4, 2024
1 parent 2a81539 commit 130c244
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions tests/Actions/TranspileTypeToTypeScriptActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
use phpDocumentor\Reflection\Types\Self_;
use phpDocumentor\Reflection\Types\Static_;
use phpDocumentor\Reflection\Types\This;
use function PHPUnit\Framework\assertContains;
use function PHPUnit\Framework\assertEquals;
use function Spatie\Snapshots\assertMatchesSnapshot;
use Spatie\TypeScriptTransformer\Actions\TranspileTypeToTypeScriptAction;

use Spatie\TypeScriptTransformer\Structures\MissingSymbolsCollection;
use Spatie\TypeScriptTransformer\Tests\FakeClasses\Enum\RegularEnum;
use Spatie\TypeScriptTransformer\Types\StructType;

use function PHPUnit\Framework\assertContains;
use function PHPUnit\Framework\assertEquals;
use function Spatie\Snapshots\assertMatchesSnapshot;

beforeEach(function () {
$this->missingSymbols = new MissingSymbolsCollection();

Expand Down
20 changes: 10 additions & 10 deletions tests/Transformers/DtoTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

use phpDocumentor\Reflection\Type;
use phpDocumentor\Reflection\Types\String_;
use function PHPUnit\Framework\assertEquals;
use function Spatie\Snapshots\assertMatchesSnapshot;
use function Spatie\Snapshots\assertMatchesTextSnapshot;
use Spatie\TypeScriptTransformer\Attributes\Hidden;
use Spatie\TypeScriptTransformer\Attributes\LiteralTypeScriptType;
use Spatie\TypeScriptTransformer\Attributes\Optional;
Expand All @@ -13,14 +16,11 @@
use Spatie\TypeScriptTransformer\Tests\FakeClasses\Integration\Enum;
use Spatie\TypeScriptTransformer\Tests\FakeClasses\Integration\LevelUp\YetAnotherDto;
use Spatie\TypeScriptTransformer\Tests\FakeClasses\Integration\OtherDto;

use Spatie\TypeScriptTransformer\Transformers\DtoTransformer;
use Spatie\TypeScriptTransformer\TypeProcessors\TypeProcessor;
use Spatie\TypeScriptTransformer\TypeScriptTransformerConfig;

use function PHPUnit\Framework\assertEquals;
use function Spatie\Snapshots\assertMatchesSnapshot;
use function Spatie\Snapshots\assertMatchesTextSnapshot;

beforeEach(function () {
$config = TypeScriptTransformerConfig::create()
->defaultTypeReplacements([
Expand Down Expand Up @@ -49,10 +49,10 @@
it('a type processor can remove properties', function () {
$config = TypeScriptTransformerConfig::create();

$transformer = new class ($config) extends DtoTransformer {
$transformer = new class($config) extends DtoTransformer {
protected function typeProcessors(): array
{
$onlyStringPropertiesProcessor = new class () implements TypeProcessor {
$onlyStringPropertiesProcessor = new class() implements TypeProcessor {
public function process(
Type $type,
ReflectionProperty | ReflectionParameter | ReflectionMethod $reflection,
Expand All @@ -75,7 +75,7 @@ public function process(
});

it('will take transform as typescript attributes into account', function () {
$class = new class () {
$class = new class() {
#[TypeScriptType('int')]
public $int;

Expand Down Expand Up @@ -103,7 +103,7 @@ public function process(
});

it('transforms properties to optional ones when using optional attribute', function () {
$class = new class () {
$class = new class() {
#[Optional]
public string $string;
};
Expand Down Expand Up @@ -134,7 +134,7 @@ class DummyOptionalDto


it('transforms properties to hidden ones when using hidden attribute', function () {
$class = new class () {
$class = new class() {
public string $visible;
#[Hidden]
public string $hidden;
Expand All @@ -149,7 +149,7 @@ class DummyOptionalDto
});

it('transforms nullable properties to optional ones according to config', function () {
$class = new class () {
$class = new class() {
public ?string $string;
};

Expand Down
8 changes: 4 additions & 4 deletions tests/Transformers/InterfaceTransformerTest.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

use Spatie\TypeScriptTransformer\Tests\Fakes\FakeInterface;
use Spatie\TypeScriptTransformer\Transformers\InterfaceTransformer;
use Spatie\TypeScriptTransformer\TypeScriptTransformerConfig;

use function PHPUnit\Framework\assertNotNull;
use function PHPUnit\Framework\assertNull;
use function Spatie\Snapshots\assertMatchesTextSnapshot;

use Spatie\TypeScriptTransformer\Tests\Fakes\FakeInterface;
use Spatie\TypeScriptTransformer\Transformers\InterfaceTransformer;
use Spatie\TypeScriptTransformer\TypeScriptTransformerConfig;

it('will only convert interfaces', function () {
$transformer = new InterfaceTransformer(
TypeScriptTransformerConfig::create()
Expand Down

0 comments on commit 130c244

Please sign in to comment.