Skip to content

Commit a6d6b4c

Browse files
committed
unify missing parentheses
1 parent 188ccea commit a6d6b4c

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

Tests/Encoder/JsonEncoderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class JsonEncoderTest extends \PHPUnit_Framework_TestCase
1919
{
2020
protected function setUp()
2121
{
22-
$this->encoder = new JsonEncoder;
22+
$this->encoder = new JsonEncoder();
2323
$this->serializer = new Serializer(array(new CustomNormalizer()), array('json' => new JsonEncoder()));
2424
}
2525

Tests/Encoder/XmlEncoderTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase
2424

2525
protected function setUp()
2626
{
27-
$this->encoder = new XmlEncoder;
27+
$this->encoder = new XmlEncoder();
2828
$serializer = new Serializer(array(new CustomNormalizer()), array('xml' => new XmlEncoder()));
2929
$this->encoder->setSerializer($serializer);
3030
}
3131

3232
public function testEncodeScalar()
3333
{
34-
$obj = new ScalarDummy;
34+
$obj = new ScalarDummy();
3535
$obj->xmlFoo = "foo";
3636

3737
$expected = '<?xml version="1.0"?>'."\n".
@@ -42,7 +42,7 @@ public function testEncodeScalar()
4242

4343
public function testSetRootNodeName()
4444
{
45-
$obj = new ScalarDummy;
45+
$obj = new ScalarDummy();
4646
$obj->xmlFoo = "foo";
4747

4848
$this->encoder->setRootNodeName('test');
@@ -63,7 +63,7 @@ public function testDocTypeIsNotAllowed()
6363

6464
public function testAttributes()
6565
{
66-
$obj = new ScalarDummy;
66+
$obj = new ScalarDummy();
6767
$obj->xmlFoo = array(
6868
'foo-bar' => array(
6969
'@id' => 1,
@@ -92,7 +92,7 @@ public function testAttributes()
9292

9393
public function testElementNameValid()
9494
{
95-
$obj = new ScalarDummy;
95+
$obj = new ScalarDummy();
9696
$obj->xmlFoo = array(
9797
'foo-bar' => 'a',
9898
'foo_bar' => 'a',
@@ -206,7 +206,7 @@ public function testEncode()
206206
public function testEncodeSerializerXmlRootNodeNameOption()
207207
{
208208
$options = array('xml_root_node_name' => 'test');
209-
$this->encoder = new XmlEncoder;
209+
$this->encoder = new XmlEncoder();
210210
$serializer = new Serializer(array(), array('xml' => new XmlEncoder()));
211211
$this->encoder->setSerializer($serializer);
212212

@@ -289,7 +289,7 @@ public function testDecodeArray()
289289

290290
public function testDecodeWithoutItemHash()
291291
{
292-
$obj = new ScalarDummy;
292+
$obj = new ScalarDummy();
293293
$obj->xmlFoo = array(
294294
'foo-bar' => array(
295295
'@key' => "value",
@@ -362,7 +362,7 @@ protected function getXmlSource()
362362

363363
protected function getObject()
364364
{
365-
$obj = new Dummy;
365+
$obj = new Dummy();
366366
$obj->foo = 'foo';
367367
$obj->bar = array('a', 'b');
368368
$obj->baz = array('key' => 'val', 'key2' => 'val', 'A B' => 'bar', 'item' => array(array('title' => 'title1'), array('title' => 'title2')), 'Barry' => array('FooBar' => array('Baz' => 'Ed', '@id' => 1)));

Tests/Normalizer/CustomNormalizerTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ class CustomNormalizerTest extends \PHPUnit_Framework_TestCase
1919
{
2020
protected function setUp()
2121
{
22-
$this->normalizer = new CustomNormalizer;
23-
$this->normalizer->setSerializer(new Serializer);
22+
$this->normalizer = new CustomNormalizer();
23+
$this->normalizer->setSerializer(new Serializer());
2424
}
2525

2626
public function testSerialize()
2727
{
28-
$obj = new ScalarDummy;
28+
$obj = new ScalarDummy();
2929
$obj->foo = 'foo';
3030
$obj->xmlFoo = 'xml';
3131
$this->assertEquals('foo', $this->normalizer->normalize($obj, 'json'));
@@ -34,18 +34,18 @@ public function testSerialize()
3434

3535
public function testDeserialize()
3636
{
37-
$obj = $this->normalizer->denormalize('foo', get_class(new ScalarDummy), 'xml');
37+
$obj = $this->normalizer->denormalize('foo', get_class(new ScalarDummy()), 'xml');
3838
$this->assertEquals('foo', $obj->xmlFoo);
3939
$this->assertNull($obj->foo);
4040

41-
$obj = $this->normalizer->denormalize('foo', get_class(new ScalarDummy), 'json');
41+
$obj = $this->normalizer->denormalize('foo', get_class(new ScalarDummy()), 'json');
4242
$this->assertEquals('foo', $obj->foo);
4343
$this->assertNull($obj->xmlFoo);
4444
}
4545

4646
public function testSupportsNormalization()
4747
{
48-
$this->assertTrue($this->normalizer->supportsNormalization(new ScalarDummy));
48+
$this->assertTrue($this->normalizer->supportsNormalization(new ScalarDummy()));
4949
$this->assertFalse($this->normalizer->supportsNormalization(new \stdClass));
5050
}
5151

Tests/Normalizer/GetSetMethodNormalizerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ class GetSetMethodNormalizerTest extends \PHPUnit_Framework_TestCase
1717
{
1818
protected function setUp()
1919
{
20-
$this->normalizer = new GetSetMethodNormalizer;
20+
$this->normalizer = new GetSetMethodNormalizer();
2121
$this->normalizer->setSerializer($this->getMock('Symfony\Component\Serializer\Serializer'));
2222
}
2323

2424
public function testNormalize()
2525
{
26-
$obj = new GetSetDummy;
26+
$obj = new GetSetDummy();
2727
$obj->setFoo('foo');
2828
$obj->setBar('bar');
2929
$obj->setCamelCase('camelcase');
@@ -118,7 +118,7 @@ public function testIgnoredAttributes()
118118
{
119119
$this->normalizer->setIgnoredAttributes(array('foo', 'bar', 'camelCase'));
120120

121-
$obj = new GetSetDummy;
121+
$obj = new GetSetDummy();
122122
$obj->setFoo('foo');
123123
$obj->setBar('bar');
124124

Tests/SerializerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ public function testNormalizeNoMatch()
3434
public function testNormalizeTraversable()
3535
{
3636
$this->serializer = new Serializer(array(), array('json' => new JsonEncoder()));
37-
$result = $this->serializer->serialize(new TraversableDummy, 'json');
37+
$result = $this->serializer->serialize(new TraversableDummy(), 'json');
3838
$this->assertEquals('{"foo":"foo","bar":"bar"}', $result);
3939
}
4040

4141
public function testNormalizeGivesPriorityToInterfaceOverTraversable()
4242
{
43-
$this->serializer = new Serializer(array(new CustomNormalizer), array('json' => new JsonEncoder()));
44-
$result = $this->serializer->serialize(new NormalizableTraversableDummy, 'json');
43+
$this->serializer = new Serializer(array(new CustomNormalizer()), array('json' => new JsonEncoder()));
44+
$result = $this->serializer->serialize(new NormalizableTraversableDummy(), 'json');
4545
$this->assertEquals('{"foo":"normalizedFoo","bar":"normalizedBar"}', $result);
4646
}
4747

0 commit comments

Comments
 (0)