Skip to content

Commit d421524

Browse files
committed
Updated to 1.1.4 version
1 parent 891645c commit d421524

File tree

1,366 files changed

+118370
-142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,366 files changed

+118370
-142
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
/tests export-ignore
2+
/src/bootstrap.php export-ignore
3+
/vendor export-ignore
24
.gitattributes export-ignore
35
.gitignore export-ignore
6+
_config.yml export-ignore
7+
.travis.yml export-ignore
48
CHANGELOG.md export-ignore
9+
phpunit.xml.dist export-ignore
510
CONDUCT.md export-ignore
611
contributors.txt export-ignore
712
README.md export-ignore

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ phpunit.xml
22
composer.phar
33
composer.lock
44
composer-test.lock
5-
vendor/
65
build/artifacts/
76
artifacts/
87
docs/_build

.travis.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
language: php
2+
3+
sudo: false
4+
5+
dist: trusty
6+
7+
git:
8+
depth: 5
9+
10+
php:
11+
- 5.6
12+
- 7.0
13+
- 7.1
14+
- hhvm
15+
- nightly
16+
17+
matrix:
18+
fast_finish: true
19+
allow_failures:
20+
- php: nightly
21+
22+
before_script:
23+
- composer self-update
24+
- composer install
25+
26+
script:
27+
- composer test

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
# CHANGELOG
22

3+
## 1.1.4 - 2017-09-10
4+
5+
* Unit tests supported by `PHPUnit` were added.
6+
7+
* The repository was synchronized with Travis CI to implement continuous integration.
8+
9+
* Added `Json/src/bootstrap.php` file
10+
11+
* Added `Json/tests/bootstrap.php` file.
12+
13+
* Added `Json/phpunit.xml.dist` file.
14+
* Added `Json/_config.yml` file.
15+
* Added `Json/.travis.yml` file.
16+
17+
* Deleted `Josantonius\Json\Tests\JsonTest` class.
18+
* Deleted `Josantonius\Json\Tests\JsonTest::testArrayToFile()` method.
19+
* Deleted `Josantonius\Json\Tests\JsonTest::testArrayToFileError()` method.
20+
* Deleted `Josantonius\Json\Tests\JsonTest::testFileToArray()` method.
21+
* Deleted `Josantonius\Json\Tests\JsonTest::testFileToArrayError()` method.
22+
23+
* Added `Josantonius\Json\Test\JsonTest` class.
24+
* Added `Josantonius\Json\Test\JsonTest::testArrayToFile()` method.
25+
* Added `Josantonius\Json\Test\JsonTest::testArrayToFileCreateFileException()` method.
26+
* Added `Josantonius\Json\Test\JsonTest::testFileToArray()` method.
27+
* Added `Josantonius\Json\Test\JsonTest::testFileToArrayCreateFileException()` method.
28+
* Added `Josantonius\Json\Test\JsonTest::testExternalFileToArray()` method.
29+
* Added `Josantonius\Json\Test\JsonTest::testExternalFileNonExistentToArray()` method.
30+
331
## 1.1.3 - 2017-08-20
432

533
* Added `Josantonius\Json\Json::_jsonLastError()` method.
@@ -21,26 +49,32 @@
2149
* `JSON_PRETTY_PRINT` was added at time to create the json file.
2250

2351
## 1.1.1 - 2017-03-18
52+
2453
* Some files were excluded from download and comments and readme files were updated.
2554

2655
## 1.1.0 - 2017-01-30
56+
2757
* Compatible with PHP 5.6 or higher.
2858

2959
## 1.0.0 - 2017-01-30
60+
3061
* 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.
3162

3263
## 1.0.0 - 2016-12-14
64+
3365
* Added `Josantonius\Json\Json` class.
3466
* Added `Josantonius\Json\Json::arrayToFile()` method.
3567
* Added `Josantonius\Json\Json::fileToArray()` method.
3668
* Added `Josantonius\Json\Json::jsonLastError()` method.
3769

3870
## 1.0.0 - 2016-12-14
71+
3972
* Added `Josantonius\Json\Exception\JsonException` class.
4073
* Added `Josantonius\Json\Exception\Exceptions` abstract class.
4174
* Added `Josantonius\Json\Exception\JsonException->__construct()` method.
4275

4376
## 1.0.0 - 2016-12-14
77+
4478
* Added `Josantonius\Json\Tests\JsonTest` class.
4579
* Added `Josantonius\Json\Tests\JsonTest::testArrayToFile()` method.
4680
* Added `Josantonius\Json\Tests\JsonTest::testArrayToFileError()` method.

README-ES.md

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PHP Json library
22

3-
[![Latest Stable Version](https://poser.pugx.org/josantonius/json/v/stable)](https://packagist.org/packages/josantonius/json) [![Total Downloads](https://poser.pugx.org/josantonius/json/downloads)](https://packagist.org/packages/josantonius/json) [![Latest Unstable Version](https://poser.pugx.org/josantonius/json/v/unstable)](https://packagist.org/packages/josantonius/json) [![License](https://poser.pugx.org/josantonius/json/license)](https://packagist.org/packages/josantonius/json)
3+
[![Latest Stable Version](https://poser.pugx.org/josantonius/json/v/stable)](https://packagist.org/packages/josantonius/json) [![Total Downloads](https://poser.pugx.org/josantonius/json/downloads)](https://packagist.org/packages/josantonius/json) [![Latest Unstable Version](https://poser.pugx.org/josantonius/json/v/unstable)](https://packagist.org/packages/josantonius/json) [![License](https://poser.pugx.org/josantonius/json/license)](https://packagist.org/packages/josantonius/json) [![Travis](https://travis-ci.org/Josantonius/PHP-Json.svg)](https://travis-ci.org/Josantonius/PHP-Json)
44

55
[English version](README.md)
66

@@ -22,16 +22,6 @@ Biblioteca PHP para la gestión de archivos JSON.
2222

2323
---
2424

25-
<p align="center"><strong>Echa un vistazo al código</strong></p>
26-
27-
<p align="center">
28-
<a href="https://youtu.be/5Tpx-iZ8ktA" title="Echa un vistazo al código">
29-
<img src="https://raw.githubusercontent.com/Josantonius/PHP-Algorithm/master/resources/youtube-thumbnail.jpg">
30-
</a>
31-
</p>
32-
33-
---
34-
3525
### Instalación
3626

3727
La mejor forma de instalar esta extensión es a través de [composer](http://getcomposer.org/download/).
@@ -94,24 +84,13 @@ var_dump(Json::arrayToFile($array, $pathfile)); //bool(true)
9484

9585
### Tests
9686

97-
Para utilizar la clase de [pruebas](tests), simplemente:
87+
Para ejecutar las [pruebas](tests/Json/test) simplemente:
9888

99-
```php
100-
<?php
101-
$loader = require __DIR__ . '/vendor/autoload.php';
89+
$ git clone https://github.com/Josantonius/PHP-Json.git
90+
91+
$ cd PHP-Json
10292

103-
$loader->addPsr4('Josantonius\\Json\\Tests\\', __DIR__ . '/vendor/josantonius/json/tests');
104-
105-
use Josantonius\Json\Tests\JsonTest;
106-
```
107-
Métodos de prueba disponibles en esta biblioteca:
108-
109-
```php
110-
JsonTest::testArrayToFile();
111-
JsonTest::testArrayToFileError();
112-
JsonTest::testFileToArray();
113-
JsonTest::testFileToArrayError();
114-
```
93+
$ phpunit
11594

11695
### Manejador de excepciones
11796

README.md

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PHP Json library
22

3-
[![Latest Stable Version](https://poser.pugx.org/josantonius/json/v/stable)](https://packagist.org/packages/josantonius/json) [![Total Downloads](https://poser.pugx.org/josantonius/json/downloads)](https://packagist.org/packages/josantonius/json) [![Latest Unstable Version](https://poser.pugx.org/josantonius/json/v/unstable)](https://packagist.org/packages/josantonius/json) [![License](https://poser.pugx.org/josantonius/json/license)](https://packagist.org/packages/josantonius/json)
3+
[![Latest Stable Version](https://poser.pugx.org/josantonius/json/v/stable)](https://packagist.org/packages/josantonius/json) [![Total Downloads](https://poser.pugx.org/josantonius/json/downloads)](https://packagist.org/packages/josantonius/json) [![Latest Unstable Version](https://poser.pugx.org/josantonius/json/v/unstable)](https://packagist.org/packages/josantonius/json) [![License](https://poser.pugx.org/josantonius/json/license)](https://packagist.org/packages/josantonius/json) [![Travis](https://travis-ci.org/Josantonius/PHP-Json.svg)](https://travis-ci.org/Josantonius/PHP-Json)
44

55
[Versión en español](README-ES.md)
66

@@ -22,16 +22,6 @@ PHP simple library for managing Json files.
2222

2323
---
2424

25-
<p align="center"><strong>Take a look at the code</strong></p>
26-
27-
<p align="center">
28-
<a href="https://youtu.be/5Tpx-iZ8ktA" title="Take a look at the code">
29-
<img src="https://raw.githubusercontent.com/Josantonius/PHP-Algorithm/master/resources/youtube-thumbnail.jpg">
30-
</a>
31-
</p>
32-
33-
---
34-
3525
### Installation
3626

3727
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
@@ -94,25 +84,13 @@ var_dump(Json::arrayToFile($array, $pathfile)); //bool(true)
9484

9585
### Tests
9686

97-
To use the [test](tests) class, simply:
98-
99-
```php
100-
<?php
101-
$loader = require __DIR__ . '/vendor/autoload.php';
102-
103-
$loader->addPsr4('Josantonius\\Json\\Tests\\', __DIR__ . '/vendor/josantonius/json/tests');
104-
105-
use Josantonius\Json\Tests\JsonTest;
87+
To run [tests](tests/Json/test) simply:
10688

107-
```
108-
Available test methods in this library:
89+
$ git clone https://github.com/Josantonius/PHP-Json.git
90+
91+
$ cd PHP-Json
10992

110-
```php
111-
JsonTest::testArrayToFile();
112-
JsonTest::testArrayToFileError();
113-
JsonTest::testFileToArray();
114-
JsonTest::testFileToArrayError();
115-
```
93+
$ phpunit
11694

11795
### Exception Handler
11896

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-cayman

composer.json

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "josantonius/json",
3-
"version": "1.1.2",
3+
"version": "1.1.4",
44
"type": "library",
55
"description": "PHP simple library for managing Json files.",
66
"keywords": [
@@ -23,7 +23,9 @@
2323
}
2424
],
2525
"support": {
26-
"source": "https://github.com/josantonius/php-json"
26+
"issues": "https://github.com/josantonius/php-asset/issues",
27+
"forum": "http://stackoverflow.com/tags/josantonius/php-asset",
28+
"source": "https://github.com/josantonius/php-asset"
2729
},
2830
"config": {
2931
"preferred-install": "dist"
@@ -32,19 +34,20 @@
3234
"require": {
3335
"php": "^5.6 || ^7.0"
3436
},
35-
"autoload": {
36-
"psr-4": {
37-
"Josantonius\\Json\\": "src/"
38-
}
37+
"require-dev": {
38+
"phpunit/phpunit": "5.7.*"
3939
},
40-
"autoload-dev": {
40+
"autoload": {
4141
"psr-4": {
42-
"Josantonius\\Json\\Tests\\": "tests/"
42+
"Josantonius\\Json\\": "src/Json/"
4343
}
4444
},
4545
"extra": {
4646
"branch-alias": {
4747
"dev-master": "1.0-dev"
4848
}
49+
},
50+
"scripts": {
51+
"test": "phpunit"
4952
}
5053
}

phpunit.xml.dist

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<phpunit backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
convertErrorsToExceptions="true"
7+
convertNoticesToExceptions="true"
8+
convertWarningsToExceptions="true"
9+
processIsolation="false"
10+
stopOnFailure="false"
11+
syntaxCheck="false"
12+
bootstrap="tests/bootstrap.php"
13+
>
14+
<testsuites>
15+
<testsuite name="Json Test Suite">
16+
<directory>tests/Json</directory>
17+
</testsuite>
18+
</testsuites>
19+
20+
<filter>
21+
<whitelist>
22+
<directory>src/Json</directory>
23+
</whitelist>
24+
</filter>
25+
</phpunit>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class JsonException extends \Exception {
3030
* @param string $msg → message error (Optional)
3131
* @param int $error → error code (Optional)
3232
* @param int $status → HTTP response status code (Optional)
33+
*
34+
* @return void
3335
*/
3436
public function __construct($msg = '', $error = 0, $status = 0) {
3537

0 commit comments

Comments
 (0)