Skip to content

Commit d1c2468

Browse files
committed
Fix code style
1 parent 8355302 commit d1c2468

12 files changed

+83
-19
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
"@cs",
5959
"@test"
6060
],
61-
"cs": "php-cs-fixer fix src -v --diff --dry-run",
62-
"cs-fix": "php-cs-fixer fix src -v --diff",
61+
"cs": "php-cs-fixer fix -v --diff --dry-run",
62+
"cs-fix": "php-cs-fixer fix -v --diff",
6363
"test": "vendor/bin/phpunit",
6464
"analyse": "php vendor/bin/phpstan.phar analyse --no-interaction"
6565
},

tests/ClassGeneratorTest.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/json-schema-to-php-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\JsonSchemaToPhpAst;
@@ -69,7 +75,7 @@ public function setUp(): void
6975
*/
7076
public function it_generates_classes_of_objects(): void
7177
{
72-
$json = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'schema_with_objects.json');
78+
$json = \file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'schema_with_objects.json');
7379
$decodedJson = \json_decode($json, true, 512, \JSON_BIGINT_AS_STRING | \JSON_THROW_ON_ERROR);
7480

7581
$typeSet = Type::fromDefinition($decodedJson);
@@ -82,8 +88,8 @@ public function it_generates_classes_of_objects(): void
8288

8389
$this->assertCount(7, $classBuilderCollection);
8490

85-
$filter = function(string $className) {
86-
return function(ClassBuilder $classBuilder) use ($className) {
91+
$filter = function (string $className) {
92+
return function (ClassBuilder $classBuilder) use ($className) {
8793
return $classBuilder->getName() === $className;
8894
};
8995
};
@@ -102,7 +108,7 @@ public function it_generates_classes_of_objects(): void
102108
*/
103109
public function it_generates_files(): void
104110
{
105-
$json = file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'schema_with_objects.json');
111+
$json = \file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'schema_with_objects.json');
106112
$decodedJson = \json_decode($json, true, 512, \JSON_BIGINT_AS_STRING | \JSON_THROW_ON_ERROR);
107113

108114
$typeSet = Type::fromDefinition($decodedJson);
@@ -339,7 +345,6 @@ public function shippingAddresses() : ShippingAddresses
339345
$this->assertSame($expected, $code);
340346
}
341347

342-
343348
private function assertShippingAddressesFile(string $code): void
344349
{
345350
$expected = <<<'PHP'

tests/Common/IteratorFactoryTest.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/json-schema-to-php-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\JsonSchemaToPhpAst\Common;
@@ -13,7 +19,7 @@ final class IteratorFactoryTest extends BaseTestCase
1319
{
1420
private IteratorFactory $iteratorFactory;
1521

16-
public function setUp() : void
22+
public function setUp(): void
1723
{
1824
parent::setUp();
1925
$this->iteratorFactory = new IteratorFactory($this->parser, true, $this->propertyNameFilter);
@@ -22,15 +28,15 @@ public function setUp() : void
2228
/**
2329
* @test
2430
*/
25-
public function it_generates_code_from_native() : void
31+
public function it_generates_code_from_native(): void
2632
{
2733
$this->assertCode($this->iteratorFactory->nodeVisitorsFromNative('reasonTypes', 'ReasonType'));
2834
}
2935

3036
/**
3137
* @test
3238
*/
33-
public function it_generates_code_from_native_with_class_builder() : void
39+
public function it_generates_code_from_native_with_class_builder(): void
3440
{
3541
$this->assertCode(
3642
$this->iteratorFactory->classBuilderFromNative('reasonTypes', 'ReasonType')

tests/ValueObject/ArrayFactoryTest.php

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/json-schema-to-php-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\JsonSchemaToPhpAst\ValueObject;
@@ -30,8 +36,8 @@ public function setUp(): void
3036
*/
3137
public function it_generates_code_from_native(): void
3238
{
33-
$definition = json_decode(
34-
file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'schema_with_array_type_ref.json'),
39+
$definition = \json_decode(
40+
\file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'schema_with_array_type_ref.json'),
3541
true
3642
);
3743

@@ -52,8 +58,8 @@ public function it_generates_code_from_native(): void
5258
*/
5359
public function it_generates_code_from_definition(): void
5460
{
55-
$definition = json_decode(
56-
file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'schema_with_array_type_ref.json'),
61+
$definition = \json_decode(
62+
\file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'schema_with_array_type_ref.json'),
5763
true
5864
);
5965

@@ -72,8 +78,8 @@ public function it_generates_code_from_definition(): void
7278
*/
7379
public function it_generates_code_via_value_object_factory(): void
7480
{
75-
$definition = json_decode(
76-
file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'schema_with_array_type_ref.json'),
81+
$definition = \json_decode(
82+
\file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'schema_with_array_type_ref.json'),
7783
true
7884
);
7985

@@ -89,8 +95,8 @@ public function it_generates_code_via_value_object_factory(): void
8995
*/
9096
public function it_generates_code_via_value_object_factory_with_class_builder(): void
9197
{
92-
$definition = json_decode(
93-
file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'schema_with_array_type_ref.json'),
98+
$definition = \json_decode(
99+
\file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR . 'schema_with_array_type_ref.json'),
94100
true
95101
);
96102

tests/ValueObject/BaseTestCase.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/json-schema-to-php-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\JsonSchemaToPhpAst\ValueObject;
612

7-
use Laminas\Filter;
813
use OpenCodeModeling\Filter\FilterFactory;
914
use OpenCodeModeling\JsonSchemaToPhpAst\ValueObjectFactory;
1015
use PhpParser\Parser;

tests/ValueObject/BooleanFactoryTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/json-schema-to-php-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\JsonSchemaToPhpAst\ValueObject;

tests/ValueObject/DateTimeFactoryTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/json-schema-to-php-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\JsonSchemaToPhpAst\ValueObject;

tests/ValueObject/EnumFactoryTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/json-schema-to-php-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\JsonSchemaToPhpAst\ValueObject;

tests/ValueObject/IntegerFactoryTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/json-schema-to-php-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\JsonSchemaToPhpAst\ValueObject;

tests/ValueObject/NumberFactoryTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<?php
22

3+
/**
4+
* @see https://github.com/open-code-modeling/json-schema-to-php-ast for the canonical source repository
5+
* @copyright https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/COPYRIGHT.md
6+
* @license https://github.com/open-code-modeling/json-schema-to-php-ast/blob/master/LICENSE.md MIT License
7+
*/
8+
39
declare(strict_types=1);
410

511
namespace OpenCodeModelingTest\JsonSchemaToPhpAst\ValueObject;

0 commit comments

Comments
 (0)