Skip to content

Commit aab1e13

Browse files
committed
tests: PhpLiteral -> Literal
1 parent 605a107 commit aab1e13

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

tests/PhpGenerator/ClassType.attributes.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
declare(strict_types=1);
88

99
use Nette\PhpGenerator\ClassType;
10-
use Nette\PhpGenerator\PhpLiteral;
10+
use Nette\PhpGenerator\Literal;
1111

1212

1313
require __DIR__ . '/../bootstrap.php';
@@ -18,7 +18,7 @@ $class = new ClassType('Example');
1818
$class
1919
->addComment('Description of class.')
2020
->addAttribute('ExampleAttribute')
21-
->addAttribute('WithArgument', [new PhpLiteral('Foo::BAR')])
21+
->addAttribute('WithArgument', [new Literal('Foo::BAR')])
2222
->addAttribute('NamedArguments', ['foo' => 'bar', 'bar' => [1, 2, 3]]);
2323

2424
$class->addConstant('FOO', 123)

tests/PhpGenerator/ClassType.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
declare(strict_types=1);
88

99
use Nette\PhpGenerator\ClassType;
10-
use Nette\PhpGenerator\PhpLiteral;
10+
use Nette\PhpGenerator\Literal;
1111
use Nette\PhpGenerator\Type;
1212
use Tester\Assert;
1313

@@ -46,7 +46,7 @@ Assert::same(['ObjectTrait' => [], 'AnotherTrait' => ['sayHello as protected']],
4646
Assert::count(2, $class->getConstants());
4747
Assert::type(Nette\PhpGenerator\Constant::class, $class->getConstants()['ROLE']);
4848

49-
$class->addConstant('FORCE_ARRAY', new PhpLiteral('Nette\Utils\Json::FORCE_ARRAY'))
49+
$class->addConstant('FORCE_ARRAY', new Literal('Nette\Utils\Json::FORCE_ARRAY'))
5050
->setVisibility('private')
5151
->addComment('Commented');
5252

@@ -55,7 +55,7 @@ $class->addProperty('handle')
5555
->addComment('@var resource orignal file handle');
5656

5757
$class->addProperty('order')
58-
->setValue(new PhpLiteral('RecursiveIteratorIterator::SELF_FIRST'));
58+
->setValue(new Literal('RecursiveIteratorIterator::SELF_FIRST'));
5959

6060
$class->addProperty('typed1')
6161
->setType(Type::ARRAY);
@@ -103,7 +103,7 @@ $m = $class->addMethod('getSections')
103103
->setReturnReference(true)
104104
->addBody('$mode = ?;', [123])
105105
->addBody('return self::$sections;');
106-
$m->addParameter('mode', new PhpLiteral('self::ORDER'));
106+
$m->addParameter('mode', new Literal('self::ORDER'));
107107

108108
Assert::false($m->isFinal());
109109
Assert::true($m->isStatic());

tests/PhpGenerator/Dumper.dump().phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
declare(strict_types=1);
88

99
use Nette\PhpGenerator\Dumper;
10-
use Nette\PhpGenerator\PhpLiteral;
10+
use Nette\PhpGenerator\Literal;
1111
use Tester\Assert;
1212

1313

@@ -43,7 +43,7 @@ Assert::same('\'He\ll\\\\\o \\\'wor\\\\\\\'ld\\\\\'', $dumper->dump('He\ll\\\o \
4343

4444

4545
// literal
46-
Assert::same('[$s]', $dumper->dump([new PhpLiteral('$s')]));
46+
Assert::same('[$s]', $dumper->dump([new Literal('$s')]));
4747
same('[
4848
function () {
4949
return 1;

tests/PhpGenerator/Dumper.dump().wrap.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
declare(strict_types=1);
88

99
use Nette\PhpGenerator\Dumper;
10-
use Nette\PhpGenerator\PhpLiteral;
10+
use Nette\PhpGenerator\Literal;
1111

1212

1313
require __DIR__ . '/../bootstrap.php';
@@ -38,8 +38,8 @@ same(
3838
],
3939
]",
4040
$dumper->dump([
41-
'single' => new PhpLiteral('1 + 2'),
42-
'multi' => new PhpLiteral("[\n\t1,\n]\n"),
41+
'single' => new Literal('1 + 2'),
42+
'multi' => new Literal("[\n\t1,\n]\n"),
4343
])
4444
);
4545

tests/PhpGenerator/Printer.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
use Nette\PhpGenerator\ClassType;
6-
use Nette\PhpGenerator\PhpLiteral;
6+
use Nette\PhpGenerator\Literal;
77
use Nette\PhpGenerator\Printer;
88
use Tester\Assert;
99

@@ -22,7 +22,7 @@ $class = (new ClassType('Example'))
2222
->addTrait('AnotherTrait', ['sayHello as protected'])
2323
->addComment("Description of class.\nThis is example\n");
2424

25-
$class->addConstant('FORCE_ARRAY', new PhpLiteral('Nette\Utils\Json::FORCE_ARRAY'))
25+
$class->addConstant('FORCE_ARRAY', new Literal('Nette\Utils\Json::FORCE_ARRAY'))
2626
->setPrivate()
2727
->addComment('Commented');
2828

@@ -34,7 +34,7 @@ $class->addProperty('handle')
3434
->addComment('@var resource orignal file handle');
3535

3636
$class->addProperty('order')
37-
->setValue(new PhpLiteral('RecursiveIteratorIterator::SELF_FIRST'));
37+
->setValue(new Literal('RecursiveIteratorIterator::SELF_FIRST'));
3838

3939
$class->addProperty('multilineLong', ['aaaaaaaa' => 1, 'bbbbbbbb' => 2, 'cccccccc' => 3, 'dddddddd' => 4, 'eeeeeeee' => 5, 'ffffffff' => 6]);
4040
$class->addProperty('short', ['aaaaaaaa' => 1, 'bbbbbbbb' => 2, 'cccccccc' => 3, 'dddddddd' => 4, 'eeeeeeee' => 5, 'ffffffff' => 6]);

tests/PhpGenerator/PsrPrinter.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
use Nette\PhpGenerator\ClassType;
6-
use Nette\PhpGenerator\PhpLiteral;
6+
use Nette\PhpGenerator\Literal;
77
use Nette\PhpGenerator\PsrPrinter;
88

99

@@ -21,7 +21,7 @@ $class = (new ClassType('Example'))
2121
->addTrait('AnotherTrait', ['sayHello as protected'])
2222
->addComment("Description of class.\nThis is example\n");
2323

24-
$class->addConstant('FORCE_ARRAY', new PhpLiteral('Nette\Utils\Json::FORCE_ARRAY'))
24+
$class->addConstant('FORCE_ARRAY', new Literal('Nette\Utils\Json::FORCE_ARRAY'))
2525
->setVisibility('private')
2626
->addComment('Commented');
2727

@@ -33,7 +33,7 @@ $class->addProperty('handle')
3333
->addComment('@var resource orignal file handle');
3434

3535
$class->addProperty('order')
36-
->setValue(new PhpLiteral('RecursiveIteratorIterator::SELF_FIRST'));
36+
->setValue(new Literal('RecursiveIteratorIterator::SELF_FIRST'));
3737

3838
$class->addProperty('multilineLong', ['aaaaaaaa' => 1, 'bbbbbbbb' => 2, 'cccccccc' => 3, 'dddddddd' => 4, 'eeeeeeee' => 5, 'ffffffff' => 6]);
3939
$class->addProperty('short', ['aaaaaaaa' => 1, 'bbbbbbbb' => 2, 'cccccccc' => 3, 'dddddddd' => 4, 'eeeeeeee' => 5, 'ffffffff' => 6]);

0 commit comments

Comments
 (0)