Skip to content

Commit 90856a6

Browse files
committed
refactor: Updated Namespace
1 parent 0f9feb7 commit 90856a6

9 files changed

Lines changed: 13 additions & 16 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ The following code shows a very simple usage example.
7474
```php
7575
//load the class "Json"
7676
require_once 'Json.php';
77-
use webfiori\json\Json;
77+
use WebFiori\Json\Json;
7878

7979
//initialize an object of the class Json
8080
$j = new Json();
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* https://github.com/WebFiori/.github/blob/main/LICENSE
99
*
1010
*/
11-
namespace webfiori\json;
11+
namespace WebFiori\Json;
1212

1313
/**
1414
* A class which is used to convert string case from one to another (e.g. camel to snake).
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* https://github.com/WebFiori/.github/blob/main/LICENSE
99
*
1010
*/
11-
namespace webfiori\json;
11+
namespace WebFiori\Json;
1212

1313
use Exception;
1414
use InvalidArgumentException;
@@ -73,7 +73,6 @@ class Json {
7373
private $formatted;
7474
private $propsArr;
7575

76-
7776
/**
7877
* Creates new instance of the class.
7978
*
@@ -425,7 +424,6 @@ public function addString(string $key, $val) {
425424

426425
return true;
427426
}
428-
429427
/**
430428
* Converts a JSON-like string to JSON object.
431429
*
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* https://github.com/WebFiori/.github/blob/main/LICENSE
99
*
1010
*/
11-
namespace webfiori\json;
11+
namespace WebFiori\Json;
1212

1313
/**
1414
* A class to convert Json instance to it's JSON string representation.
@@ -37,7 +37,7 @@ class JsonConverter {
3737
* @return Json
3838
*/
3939
public static function objectToJson($obj) {
40-
if (is_subclass_of($obj, 'webfiori\\json\\JsonI')) {
40+
if (is_subclass_of($obj, 'WebFiori\\Json\\JsonI')) {
4141
return $obj->toJSON();
4242
} else {
4343
if ($obj instanceof Json) {
@@ -342,7 +342,7 @@ private static function getNumberVal($val) {
342342
*/
343343
private static function objToJson($probVal, string $style, string $lettersCase) {
344344
if (!($probVal instanceof Json)) {
345-
if (!is_subclass_of($probVal, 'webfiori\\json\\JsonI')) {
345+
if (!is_subclass_of($probVal, 'WebFiori\\Json\\JsonI')) {
346346
$probVal = self::objectToJson($probVal);
347347
} else {
348348
$probVal = $probVal->toJSON();
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* https://github.com/WebFiori/.github/blob/main/LICENSE
99
*
1010
*/
11-
namespace webfiori\json;
11+
namespace WebFiori\Json;
1212

1313
use Exception;
1414
/**
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* https://github.com/WebFiori/.github/blob/main/LICENSE
99
*
1010
*/
11-
namespace webfiori\json;
11+
namespace WebFiori\Json;
1212

1313
/**
1414
* An interface for the objects that can be added to an instance of JsonX.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* https://github.com/WebFiori/.github/blob/main/LICENSE
99
*
1010
*/
11-
namespace webfiori\json;
11+
namespace WebFiori\Json;
1212

1313
/**
1414
* A class that contains constants which represents supported JSON data types.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* https://github.com/WebFiori/.github/blob/main/LICENSE
99
*
1010
*/
11-
namespace webfiori\json;
11+
namespace WebFiori\Json;
1212

1313
use InvalidArgumentException;
1414
/**
@@ -302,7 +302,7 @@ public function setStyle(string $style, string $lettersCase = 'same') {
302302
public function setValue($val) {
303303
$this->datatype = gettype($val);
304304

305-
if ($this->getType() == 'object' && is_subclass_of($val, 'webfiori\\json\\JsonI')) {
305+
if ($this->getType() == 'object' && is_subclass_of($val, 'WebFiori\\Json\\JsonI')) {
306306
$this->value = $val->toJSON();
307307
} else {
308308
$this->value = $val;

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "webfiori/jsonx",
33
"type": "library",
44
"description": "PHP library for creating well-formatted JSON strings.",
5-
"type":"library",
65
"version":"3.3.0",
76
"keywords": [
87
"JSON", "PHP", "JSONx"
@@ -13,9 +12,9 @@
1312
},
1413
"autoload" :{
1514
"psr-4":{
16-
"webfiori\\json\\":"webfiori\\json"
15+
"WebFiori\\Json\\":"src/WebFiori/Json"
1716
}
1817
},
1918
"require-dev": {
2019
}
21-
}
20+
}

0 commit comments

Comments
 (0)