Skip to content

Commit 7b7412f

Browse files
committed
QA: WS / coding standards adjustments
1 parent fa1a94b commit 7b7412f

9 files changed

+13
-12
lines changed

src/test/php/lang/ast/unittest/emit/AnnotationsTest.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function param() {
9595
#[Test]
9696
public function params() {
9797
$t= $this->type('class <T> { public function fixture(#[Inject(["name" => "a"])] $a, #[Inject] $b) { } }');
98-
$m=$t->getMethod('fixture');
98+
$m= $t->getMethod('fixture');
9999
Assert::equals(
100100
[['inject' => ['name' => 'a']], ['inject' => null]],
101101
[$m->getParameter(0)->getAnnotations(), $m->getParameter(1)->getAnnotations()]

src/test/php/lang/ast/unittest/emit/ArgumentPromotionTest.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ public function run() {
7575
#[Test]
7676
public function type_information() {
7777
$t= $this->type('class <T> {
78-
public function __construct(private int $id, private string $name) {
79-
}
78+
public function __construct(private int $id, private string $name) { }
8079
}');
8180
Assert::equals(
8281
[Primitive::$INT, Primitive::$STRING],

src/test/php/lang/ast/unittest/emit/ArgumentUnpackingTest.class.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php namespace lang\ast\unittest\emit;
22

3-
use lang\Primitive;
43
use unittest\{Assert, Test};
54

65
/**

src/test/php/lang/ast/unittest/emit/ArrayTypesTest.class.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php namespace lang\ast\unittest\emit;
22

33
use unittest\{Assert, Test};
4+
45
/**
56
* Array types
67
*

src/test/php/lang/ast/unittest/emit/CastingTest.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class CastingTest extends EmittingTest {
88
/** @return string */
99
public function test() { return 'Test'; }
1010

11-
#[Test, Values([0, 1, -1, 0.5, -1.5, "", "test", true, false])]
11+
#[Test, Values([0, 1, -1, 0.5, -1.5, '', 'test', true, false])]
1212
public function string_cast($value) {
1313
Assert::equals((string)$value, $this->run(
1414
'class <T> {
@@ -20,7 +20,7 @@ public function run($value) {
2020
));
2121
}
2222

23-
#[Test, Values(["0", "1", "-1", "6100", "", 0.5, -1.5, 0, 1, -1, true, false])]
23+
#[Test, Values(['0', '1', '-1', '6100', '', 0.5, -1.5, 0, 1, -1, true, false])]
2424
public function int_cast($value) {
2525
Assert::equals((int)$value, $this->run(
2626
'class <T> {
@@ -32,7 +32,7 @@ public function run($value) {
3232
));
3333
}
3434

35-
#[Test, Values([[[]], [[0, 1, 2]], [['key' => 'value']], null, false, true, 1, 1.5, "", "test"])]
35+
#[Test, Values([[[]], [[0, 1, 2]], [['key' => 'value']], null, false, true, 1, 1.5, '', 'test'])]
3636
public function array_cast($value) {
3737
Assert::equals((array)$value, $this->run(
3838
'class <T> {

src/test/php/lang/ast/unittest/emit/MultipleCatchTest.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ public function run($t) {
1717
try {
1818
throw new $t("test");
1919
} catch (\\lang\\IllegalArgumentException | \\lang\\IllegalStateException $e) {
20-
return "caught ".get_class($e);
20+
return "Caught ".get_class($e);
2121
}
2222
}
2323
}');
2424

25-
Assert::equals('caught '.$type, $t->newInstance()->run($type));
25+
Assert::equals('Caught '.$type, $t->newInstance()->run($type));
2626
}
2727
}

src/test/php/lang/ast/unittest/emit/PrecedenceTest.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class PrecedenceTest extends EmittingTest {
66

7-
#[Test, Values([['2 + 3 * 4', 14], ['2 + 8 / 4', 4], ['2 + 3 ** 2', 11], ['2 + 5 % 2', 3],])]
7+
#[Test, Values([['2 + 3 * 4', 14], ['2 + 8 / 4', 4], ['2 + 3 ** 2', 11], ['2 + 5 % 2', 3]])]
88
public function mathematical($input, $result) {
99
Assert::equals($result, $this->run(
1010
'class <T> {
@@ -24,7 +24,7 @@ public function run() {
2424
}
2525
}'
2626
);
27-
Assert::equals('('.$t->getName().')', $t->newInstance()->run());
27+
Assert::equals('('.$t->literal().')', $t->newInstance()->run());
2828
}
2929

3030
#[Test]
@@ -38,6 +38,6 @@ public function run() {
3838
}
3939
}'
4040
);
41-
Assert::equals(2, $t->newinstance()->run());
41+
Assert::equals(2, $t->newInstance()->run());
4242
}
4343
}

src/test/php/lang/ast/unittest/emit/UsingTest.class.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php namespace lang\ast\unittest\emit;
22

33
use unittest\{Assert, Test};
4+
45
/**
56
* Using statement and disposables
67
*

src/test/php/lang/ast/unittest/emit/YieldTest.class.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php namespace lang\ast\unittest\emit;
22

33
use unittest\{Assert, Test};
4+
45
/** @see http://php.net/manual/en/language.generators.syntax.php */
56
class YieldTest extends EmittingTest {
67

0 commit comments

Comments
 (0)