Skip to content

Commit 8fdf66e

Browse files
committed
docs: release notes for the 2.0.0 release
1 parent 90f6525 commit 8fdf66e

File tree

1 file changed

+77
-2
lines changed

1 file changed

+77
-2
lines changed

CHANGELOG.md

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,78 @@
11
# CHANGELOG
22

3+
## [2.0.0](https://github.com/josantonius/php-json/releases/tag/2.0.0) (2022-06-16)
4+
5+
* The library was completely refactored.
6+
7+
* Static methods are no longer used.
8+
9+
* New methods were added to merge and push content in JSON files.
10+
11+
* The JSON error handling class was removed in preference to a single method.
12+
13+
* To continue using the version with static methods without the new features:
14+
15+
* For older versions of PHP (from **5.6** to **7.4**),
16+
[version 1.1.9](https://github.com/josantonius/php-json/tree/1.1.9) of this library can be used.
17+
18+
* For PHP versions **8.0** and **8.1**,
19+
[version 1.2.0](https://github.com/josantonius/php-json/tree/1.2.0) of this library can be used.
20+
21+
* Deprecated `Josantonius\Json\Json::arrayToFile` method.
22+
* Deprecated `Josantonius\Json\Json::fileToArray` method.
23+
24+
* Deleted `Josantonius\Json\Exception\JsonException` class.
25+
* Deleted `Josantonius\Json\JsonLastError` class.
26+
* Deleted `Josantonius\Json\Tests\JsonLastErrorTest` class.
27+
28+
* Added `Josantonius\Json\Exception\CreateDirectoryException` class.
29+
* Added `Josantonius\Json\Exception\CreateFileException` class.
30+
* Added `Josantonius\Json\Exception\GetFileException` class.
31+
* Added `Josantonius\Json\Exception\JsonErrorException` class.
32+
* Added `Josantonius\Json\Exception\UnavailableMethodException` class.
33+
34+
* Deleted `Josantonius\Json\Json::createDirectory` method.
35+
* Deleted `Josantonius\Json\Json::saveFile` method.
36+
37+
* Added `Josantonius\Json\Json->__construct()` method.
38+
* Added `Josantonius\Json\Json->get()` method.
39+
* Added `Josantonius\Json\Json->set()` method.
40+
* Added `Josantonius\Json\Json->merge()` method.
41+
* Added `Josantonius\Json\Json->push()` method.
42+
* Added `Josantonius\Json\Json->createFileIfNotExists()` private method.
43+
* Added `Josantonius\Json\Json->createDirIfNotExists()` private method.
44+
* Added `Josantonius\Json\Json->getFileContents()` private method.
45+
* Added `Josantonius\Json\Json->saveToJsonFile()` private method.
46+
* Added `Josantonius\Json\Json->checkJsonLastError()` private method.
47+
48+
* Deleted `JsonTest->testGetCollection()` method.
49+
* Deleted `JsonTest->testArrayToFileCreateFileException()` method.
50+
* Deleted `JsonTest->testFileToArray()` method.
51+
* Deleted `JsonTest->testFileToArrayCreateFileException()` method.
52+
* Deleted `JsonTest->testExternalFileToArray()` method.
53+
* Deleted `JsonTest->testExternalFileNonExistentToArray()` method.
54+
55+
* Added `JsonTest->itShouldReturnValidInstance()` method.
56+
* Added `JsonTest->constructorShouldCreateTheFileIfNotExist()` method.
57+
* Added `JsonTest->constructorShouldThrowExceptionIfPathIsWrong()` method.
58+
* Added `JsonTest->constructorShouldThrowExceptionIfFilenameIsWrong()` method.
59+
* Added `JsonTest->itShouldGetFileContents()` method.
60+
* Added `JsonTest->itShouldGetRemoteFileContents()` method.
61+
* Added `JsonTest->itShouldSetArrayOnJsonFile()` method.
62+
* Added `JsonTest->itShouldSetObjectOnJsonFile()` method.
63+
* Added `JsonTest->itShouldThrowExceptionIfSetMethodIsUsedWithRemoteFile()` method.
64+
* Added `JsonTest->itShouldMergeArrayOnJsonFile()` method.
65+
* Added `JsonTest->itShouldMergeObjectOnJsonFile()` method.
66+
* Added `JsonTest->itShouldThrowExceptionIfMergeMethodIsUsedWithRemoteFile()` method.
67+
* Added `JsonTest->itShouldPushArrayOnJsonFile()` method.
68+
* Added `JsonTest->itShouldPushObjectOnJsonFile()` method.
69+
* Added `JsonTest->itShouldThrowExceptionIfPushMethodIsUsedWithRemoteFile()` method.
70+
* Added `JsonTest->itShouldThrowExceptionIfFileCannotBeObtained()` method.
71+
* Added `JsonTest->itShouldThrowExceptionIfRemoteFileCannotBeObtained()` method.
72+
* Added `JsonTest->itShouldThrowExceptionWhenThereAreJsonErrorsInTheFile()` method.
73+
* Added `JsonTest->arrayToFileStaticMethodShouldBehaveLikeTheSetMethod()` method.
74+
* Added `JsonTest->fileToArrayStaticMethodShouldBehaveLikeTheGetMethod()` method.
75+
376
## [1.2.0](https://github.com/josantonius/php-json/releases/tag/1.2.0) (2022-06-13)
477

578
* Support for PHP version **8.0** and higher.
@@ -128,7 +201,8 @@
128201

129202
## [1.1.2](https://github.com/josantonius/php-json/releases/tag/1.1.2) (2017-05-31)
130203

131-
* The file exception not found in the `fileToArray()` method was deleted. Now if it does not exist the file will create it with an empty array.
204+
* The file exception not found in the `fileToArray()` method was deleted.
205+
Now if it does not exist the file will create it with an empty array.
132206

133207
* `JSON_PRETTY_PRINT` was added at time to create the json file.
134208

@@ -142,7 +216,8 @@
142216

143217
## [1.0.0](https://github.com/josantonius/php-json/releases/tag/1.0.0) (2016-12-14)
144218

145-
* Compatible only with PHP 7.0 or higher. In the next versions, the library will be modified to make it compatible with PHP 5.6 or higher.
219+
* Compatible only with PHP 7.0 or higher.
220+
In the next versions, the library will be modified to make it compatible with PHP 5.6 or higher.
146221

147222
* Added `Josantonius\Json\Json` class.
148223
* Added `Josantonius\Json\Json::arrayToFile()` method.

0 commit comments

Comments
 (0)