Skip to content

Commit 77d46ed

Browse files
authored
Add () when instantiating the class to follow PER standard (#34)
1 parent 44448cb commit 77d46ed

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use HJSON\HJSONStringifier;
4343
$parser = new HJSONParser();
4444
$obj = $parser->parse(hjsonText);
4545
46-
$stringifier = new HJSONStringifier;
46+
$stringifier = new HJSONStringifier();
4747
$text = $stringifier->stringify($obj);
4848
```
4949

@@ -79,8 +79,8 @@ This method produces Hjson text from a value.
7979
You can modify a Hjson file and keep the whitespace & comments intact. This is useful if an app updates its config file.
8080

8181
```
82-
$parser = new HJSONParser;
83-
$stringifier = new HJSONStringifier;
82+
$parser = new HJSONParser();
83+
$stringifier = new HJSONStringifier();
8484
8585
$text = "{
8686
# specify rate in requests/second (because comments are helpful!)

src/HJSON/HJSONParser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,12 @@ private function object($withoutBraces = false)
211211
{
212212
// Parse an object value.
213213
$key = null;
214-
$object = new \stdClass;
214+
$object = new \stdClass();
215215
$kw = null;
216216
$wat = null;
217217
if ($this->keepWsc) {
218-
$kw = new \stdClass;
219-
$kw->c = new \stdClass;
218+
$kw = new \stdClass();
219+
$kw->c = new \stdClass();
220220
$kw->o = [];
221221
$object->__WSC__ = $kw;
222222
if ($withoutBraces) {

tests/HJSONParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,6 @@ public function testAll()
155155
}
156156
}
157157

158-
$tester = new HJSONParserTest;
158+
$tester = new HJSONParserTest();
159159
$tester->setUp();
160160
$tester->testAll();

0 commit comments

Comments
 (0)