Skip to content

Commit 4e49727

Browse files
committed
chore: Run CS Fixer
1 parent bc4d7b2 commit 4e49727

15 files changed

Lines changed: 56 additions & 36 deletions

WebFiori/Json/CaseConverter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* This file is licensed under MIT License.
45
*

WebFiori/Json/Json.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* This file is licensed under MIT License.
45
*
@@ -758,6 +759,7 @@ private static function checkArray($subVal, &$parentArr) {
758759

759760
if ($isIndexed) {
760761
$subArr = [];
762+
761763
// A sub array. Can have sub arrays.
762764
// Sub arrays can have objects.
763765
for ($x = 0 ; $x < count($subVal) ; $x++) {

WebFiori/Json/JsonConverter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* This file is licensed under MIT License.
45
*
@@ -84,7 +85,7 @@ public static function objectToJson($obj) {
8485

8586
$reflection = new \ReflectionClass($obj);
8687
$publicProps = $reflection->getProperties(\ReflectionProperty::IS_PUBLIC);
87-
88+
8889
foreach ($publicProps as $prop) {
8990
$name = $prop->getName();
9091
$value = $prop->getValue($obj);

WebFiori/Json/JsonException.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* This file is licensed under MIT License.
45
*

WebFiori/Json/JsonI.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* This file is licensed under MIT License.
45
*

WebFiori/Json/JsonTypes.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* This file is licensed under MIT License.
45
*

WebFiori/Json/Property.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* This file is licensed under MIT License.
45
*

examples/01-basic-usage.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<?php
2-
require_once __DIR__ . '/../vendor/autoload.php';
2+
3+
require_once __DIR__.'/../vendor/autoload.php';
34

45
use WebFiori\Json\Json;
56

67
// Quick init via constructor
78
$json = new Json([
8-
'name' => 'Ibrahim',
9-
'age' => 30,
9+
'name' => 'Ibrahim',
10+
'age' => 30,
1011
'married' => false,
11-
'score' => 9.5,
12-
'notes' => null,
12+
'score' => 9.5,
13+
'notes' => null,
1314
]);
1415

15-
echo $json . "\n";
16+
echo $json."\n";
1617
// {"name":"Ibrahim","age":30,"married":false,"score":9.5,"notes":null}

examples/02-arrays.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<?php
2-
require_once __DIR__ . '/../vendor/autoload.php';
2+
3+
require_once __DIR__.'/../vendor/autoload.php';
34

45
use WebFiori\Json\Json;
56

67
$json = new Json();
78
$json->addArray('tags', ['php', 'json', 'api']);
89
$json->addArray('address', ['city' => 'Riyadh', 'country' => 'SA'], true); // true = as object
910

10-
echo $json . "\n";
11+
echo $json."\n";
1112
// {"tags":["php","json","api"],"address":{"city":"Riyadh","country":"SA"}}

examples/03-object-with-jsoni.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
2-
require_once __DIR__ . '/../vendor/autoload.php';
2+
3+
require_once __DIR__.'/../vendor/autoload.php';
34

45
use WebFiori\Json\Json;
56
use WebFiori\Json\JsonI;
@@ -8,7 +9,8 @@ class User implements JsonI {
89
public function __construct(
910
private string $username,
1011
private string $email
11-
) {}
12+
) {
13+
}
1214

1315
public function toJSON(): Json {
1416
return new Json(['username' => $this->username, 'email' => $this->email]);
@@ -19,5 +21,5 @@ public function toJSON(): Json {
1921
$user = new User('ibrahim', 'ibrahim@example.com');
2022
$json->addObject('user', $user);
2123

22-
echo $json . "\n";
24+
echo $json."\n";
2325
// {"user":{"username":"ibrahim","email":"ibrahim@example.com"}}

0 commit comments

Comments
 (0)