Releases: josantonius/php-json
v2.0.8
What's Changed
- Release/v2.0.8 by @josantonius in #24
PHP 8.0 is no longer supported.
Added
-
Josantonius\Json\Json->pop()method. -
Josantonius\Json\Json->shift()method. -
Josantonius\Json\Json->unshift()method. -
Josantonius\Json\Json->unset()method. -
Josantonius\Json\Tests\PopMethodTestclass. -
Josantonius\Json\Tests\ShiftMethodTestclass. -
Josantonius\Json\Tests\UnsetMethodTestclass. -
Josantonius\Json\Tests\UnshiftMethodTestclass. -
Josantonius\Json\Exceptions\NoIterableElementExceptionclass. -
Josantonius\Json\Exceptions\NoIterableFileExceptionclass. -
.markdownlint.jsonfile.
Removed
-
The
filepathmethod. Use thefilepathproperty instead. -
The option to handle remote files via their URL.
-
Spanish documentation.
-
Josantonius\Json\Tests\FilepathMethodTestclass. -
Josantonius\Json\Exceptions\UnavailableMethodExceptionclass.
Refactored
- The
getmethod now supports the$associativeparameter. - The
getmethod now returns a mixed value. - The
setmethod now supports the$dotparameter to indicate the array level using dot notation. - The
setmethod now returns the resulting content of the JSON file after performing the action. - The
mergemethod now supports the$dotparameter to indicate the array level using dot notation. - The
pushmethod now supports the$dotparameter to indicate the array level using dot notation.
Full Changelog: v2.0.7...v2.0.8
v2.0.7
What's Changed
-
Release/v2.0.7 by @josantonius in #23
-
Tests for Windows have been added.
-
Tests for PHP 8.2 have been added.
Full Changelog: v2.0.6...v2.0.7
v2.0.6
What's Changed
Added
Josantonius\Json\Json->filepath()method.Josantonius\Json\Json->exists()method.
Changed
- The file is no longer created if it does not exist when the instance is created.
- The
$contentparameter of thesetmethod is now optional and contains an empty array by default.
Deleted
Josantonius\Json\Exceptions\CreateDirectoryExceptionclass.Josantonius\Json\Tests\ExistsMethodTestclass.Josantonius\Json\Tests\GetFilepathMethodTestclass.Josantonius\Json\Json->createFileIfNotExists()method.
Refactor
- The notation type in the test function names has been changed from camel to snake case for readability.
- Functions were added to document the methods and avoid confusion.
- Disabled the ´CamelCaseMethodName´ rule in ´phpmd.xml´ to avoid warnings about function names in tests.
- The alignment of the asterisks in the comments has been fixed.
Updated
- Tests.
Full Changelog: v2.0.5...v2.0.6
v2.0.5
What's Changed
-
release/v2.0.5 in #20
-
The exceptions directory was renamed from
exceptiontoexceptions. -
Improved documentation.
-
Improved doc comments in
Josantonius\Json\Json.
Full Changelog: v2.0.4...v2.0.5
v2.0.4
What's Changed
-
Fix exceptions comment.
-
The namespaces in the test classes were sorted.
-
Changed the PHPUnit version from
9.0to9.5. -
Fixed blank line at the beginning of the file in
FUNDING.yml. -
release/v2.0.4 in #19
Full Changelog: v2.0.3...v2.0.4
v2.0.3
v2.0.2
v2.0.1
What's Changed
- Full Changelog: 2.0.0...v2.0.1
Changes
-
Exceptions were refactored.
-
Changes in documentation.
-
New code style rules have been added.
-
Implemented
PSR12 coding standardfrom all library PHP files. -
DELETED:
Josantonius\Json\Json::arrayToFilemethod.Josantonius\Json\Json::fileToArraymethod.Josantonius\Json\Tests\JsonTestclass. -
ADDED:
Josantonius\Json\Tests\ConstructMethodTestclass.Josantonius\Json\Tests\GetMethodTestclass.Josantonius\Json\Tests\MergeMethodTestclass.Josantonius\Json\Tests\PushMethodTestclass.Josantonius\Json\Tests\SetMethodTestclass.
2.0.0
-
The library was completely refactored.
-
Static methods are no longer used.
-
New methods were added to merge and push content in JSON files.
-
The JSON error handling class was removed in preference to a single method.
-
To continue using the version with static methods without the new features:
-
For older versions of PHP (from 5.6 to 7.4), version 1.1.9 of this library can be used.
-
For PHP versions 8.0 and 8.1, version 1.2.0 of this library can be used.
-
-
Deprecated
Josantonius\Json\Json::arrayToFilemethod. -
Deprecated
Josantonius\Json\Json::fileToArraymethod. -
Deleted
Josantonius\Json\Exception\JsonExceptionclass. -
Deleted
Josantonius\Json\JsonLastErrorclass. -
Deleted
Josantonius\Json\Tests\JsonLastErrorTestclass. -
Added
Josantonius\Json\Exception\CreateDirectoryExceptionclass. -
Added
Josantonius\Json\Exception\CreateFileExceptionclass. -
Added
Josantonius\Json\Exception\GetFileExceptionclass. -
Added
Josantonius\Json\Exception\JsonErrorExceptionclass. -
Added
Josantonius\Json\Exception\UnavailableMethodExceptionclass. -
Deleted
Josantonius\Json\Json::createDirectorymethod. -
Deleted
Josantonius\Json\Json::saveFilemethod. -
Added
Josantonius\Json\Json->__construct()method. -
Added
Josantonius\Json\Json->get()method. -
Added
Josantonius\Json\Json->set()method. -
Added
Josantonius\Json\Json->merge()method. -
Added
Josantonius\Json\Json->push()method. -
Added
Josantonius\Json\Json->createFileIfNotExists()private method. -
Added
Josantonius\Json\Json->createDirIfNotExists()private method. -
Added
Josantonius\Json\Json->getFileContents()private method. -
Added
Josantonius\Json\Json->saveToJsonFile()private method. -
Added
Josantonius\Json\Json->checkJsonLastError()private method. -
Deleted
JsonTest->testGetCollection()method. -
Deleted
JsonTest->testArrayToFileCreateFileException()method. -
Deleted
JsonTest->testFileToArray()method. -
Deleted
JsonTest->testFileToArrayCreateFileException()method. -
Deleted
JsonTest->testExternalFileToArray()method. -
Deleted
JsonTest->testExternalFileNonExistentToArray()method. -
Added
JsonTest->itShouldReturnValidInstance()method. -
Added
JsonTest->constructorShouldCreateTheFileIfNotExist()method. -
Added
JsonTest->constructorShouldThrowExceptionIfPathIsWrong()method. -
Added
JsonTest->constructorShouldThrowExceptionIfFilenameIsWrong()method. -
Added
JsonTest->itShouldGetFileContents()method. -
Added
JsonTest->itShouldGetRemoteFileContents()method. -
Added
JsonTest->itShouldSetArrayOnJsonFile()method. -
Added
JsonTest->itShouldSetObjectOnJsonFile()method. -
Added
JsonTest->itShouldThrowExceptionIfSetMethodIsUsedWithRemoteFile()method. -
Added
JsonTest->itShouldMergeArrayOnJsonFile()method. -
Added
JsonTest->itShouldMergeObjectOnJsonFile()method. -
Added
JsonTest->itShouldThrowExceptionIfMergeMethodIsUsedWithRemoteFile()method. -
Added
JsonTest->itShouldPushArrayOnJsonFile()method. -
Added
JsonTest->itShouldPushObjectOnJsonFile()method. -
Added
JsonTest->itShouldThrowExceptionIfPushMethodIsUsedWithRemoteFile()method. -
Added
JsonTest->itShouldThrowExceptionIfFileCannotBeObtained()method. -
Added
JsonTest->itShouldThrowExceptionIfRemoteFileCannotBeObtained()method. -
Added
JsonTest->itShouldThrowExceptionWhenThereAreJsonErrorsInTheFile()method. -
Added
JsonTest->arrayToFileStaticMethodShouldBehaveLikeTheSetMethod()method. -
Added
JsonTest->fileToArrayStaticMethodShouldBehaveLikeTheGetMethod()method.
1.2.0
-
Support for PHP version 8.0 and higher.
-
Support for earlier versions of PHP 8.0 is discontinued.
-
For older versions of PHP (from 5.6 to 7.4) version 1.1.9 of this library can be used.