Skip to content

Commit c4b7d1f

Browse files
authored
Merge pull request #104 from katheroine/issue-103-update-dependencies
Issue 103 update dependencies
2 parents edb0de1 + 6d62abb commit c4b7d1f

File tree

78 files changed

+344
-313
lines changed

Some content is hidden

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

78 files changed

+344
-313
lines changed

.travis.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
language: php
22
php:
3-
- 5.5
4-
- 5.6
5-
- 7.0
6-
before_install:
7-
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.5" ]]; then export PHP55=false; else export PHP55=true; fi
8-
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.6" ]]; then export PHP56=false; else export PHP56=true; fi
9-
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.0" ]]; then export PHP70=false; else export PHP70=true; fi
10-
install:
11-
- ( $PHP55 && $PHP56 ) || ( printf "\n" | pecl install yaml )
12-
- ( $PHP70 ) || ( printf "\n" | pecl install yaml-beta )
13-
- echo "extension=yaml.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
14-
- composer install
3+
- 8.0
4+
- 8.1
5+
- 8.2
6+
- 8.3
157
script:
16-
- phpunit tests/
8+
- ./vendor/bin/phpunit tests/
179
- ./vendor/bin/phpcs src/ tests/

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ To contribute to the project you need to have an account on [GitHub](https://git
1616

1717
## Standards and conventions
1818

19-
Please follow [PSR-1](http://www.php-fig.org/psr/psr-1/) and [PSR-2](http://www.php-fig.org/psr/psr-2/) coding standards and [PSR-4](http://www.php-fig.org/psr/psr-4/) autoloading standard.
19+
Please follow [PSR-1](http://www.php-fig.org/psr/psr-1/) and [PSR-12](http://www.php-fig.org/psr/psr-12/) coding standards and [PSR-4](http://www.php-fig.org/psr/psr-4/) autoloading standard.
2020

2121
This project uses [PHPCodeSniffer](https://www.squizlabs.com/php-codesniffer) for detecting coding style issues.
2222

README.md

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,16 @@ There are various groups of decoders and encoders
1515

1616
### Prerequisities
1717

18-
* PHP 5.5.9+
19-
* [YAML PHP extension](http://php.net/manual/en/book.yaml.php) 1.2.0
20-
* [Composer](https://getcomposer.org/) 1.0
18+
* PHP 8.0+
19+
* [Composer](https://getcomposer.org/) 2.5.0+
2120

2221
### Installation
2322

2423
The recommended way to install DataCoder into the source code of the project is to handle it as code dependency by [Composer](http://getcomposer.org).
2524

26-
#### YAML PHP extension
25+
#### cURL, php8.0-cli and Git
2726

28-
YAML Coders uses [YAML PHP extension](http://php.net/manual/en/book.yaml.php) so it needs to be installed before any YAML Coder will be run.
29-
30-
##### PHP 5
31-
32-
```bash
33-
sudo apt-get install php-pear libyaml-dev
34-
pecl install yaml
35-
```
36-
37-
##### PHP 7
38-
39-
```bash
40-
sudo apt-get install php-pear libyaml-dev
41-
pecl install yaml-beta
42-
```
43-
44-
Don't forget to add `"extension=yaml.so"` line to your *php.ini* file.
45-
46-
#### cURL, php5-cli and Git
47-
48-
The command line tool cURL will be used to to download *Composer* installer and *php5-cli* for and running it to install Composer. Git is needed by to downloading dependencies by the Composer.
27+
The command line tool cURL will be used to to download *Composer* installer and *php8.0-cli* for and running it to install Composer. Git is needed by to downloading dependencies by the Composer.
4928

5029
#### Composer
5130

@@ -95,16 +74,16 @@ require_once (__DIR__ . '/vendor/autoload.php');
9574

9675
use Exorg\DataCoder\JsonDataEncoder;
9776

98-
$data = array (
77+
$data = [
9978
"firstName" => "John",
10079
"lastName" => "Smith",
101-
"address" => array (
80+
"address" => [
10281
"streetAddress" => "21 2nd Street",
10382
"city" => "New York",
10483
"state" => "NY",
10584
"postalCode" => "10021-3100",
106-
),
107-
);
85+
],
86+
];
10887

10988
$encoder = new JsonDataEncoder();
11089
$result = $encoder->encodeData($data);
@@ -170,16 +149,16 @@ Array
170149
```php
171150
use Exorg\DataCoder\DataEncoder;
172151

173-
$data = array (
152+
$data = [
174153
"firstName" => "John",
175154
"lastName" => "Smith",
176-
"address" => array (
155+
"address" => [
177156
"streetAddress" => "21 2nd Street",
178157
"city" => "New York",
179158
"state" => "NY",
180159
"postalCode" => "10021-3100",
181-
),
182-
);
160+
],
161+
];
183162

184163
$encoder = new DataEncoder();
185164
$encoder->setDataFormat('yaml');
@@ -257,16 +236,16 @@ Datafile coders with configurable data format - **DatafileEncoder** and **Datafi
257236
```php
258237
use Exorg\DataCoder\DatafileEncoder;
259238

260-
$data = array (
239+
$data = [
261240
"firstName" => "John",
262241
"lastName" => "Smith",
263-
"address" => array (
242+
"address" => [
264243
"streetAddress" => "21 2nd Street",
265244
"city" => "New York",
266245
"state" => "NY",
267246
"postalCode" => "10021-3100",
268-
),
269-
);
247+
],
248+
];
270249

271250
$datafilePath = 'data.json';
272251

@@ -341,26 +320,44 @@ To run tests, write the following command in your command line inside the main D
341320
vendor/bin/phpunit tests/
342321
```
343322

323+
or use a Composer script
324+
325+
```bash
326+
composer test
327+
```
328+
344329
### Code style tests
345330

346331
This code follows [PSR-1](http://www.php-fig.org/psr/psr-1/) and [PSR-2](http://www.php-fig.org/psr/psr-2/) standards.
347332

348-
To run tests for code style write the following command in your command line inside the main DataCoder project directory
333+
To run tests for code style write the following command in your command line inside the main DataCoder project directory
349334

350335
```bash
351336
vendor/bin/phpcs tests/ src/
352337
```
353338

339+
or use a Composer script
340+
341+
```bash
342+
composer sniff
343+
```
344+
345+
You can also use a Composer script for running both tests and check code style
346+
347+
```bash
348+
composer check
349+
```
350+
354351
## Built with
355352

356353
* [Linux Mint](https://www.linuxmint.com/)
357-
* [Eclipse](https://eclipse.org/)
354+
* [Visual Studio Code](https://code.visualstudio.com/)
358355
* [Remarkable](https://remarkableapp.github.io/)
359356
* [PHPUnit](https://phpunit.de/)
360-
* [PHPCodeSniffer](https://www.squizlabs.com/php-codesniffer)
357+
* [PHPCodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)
361358
* [Git](https://git-scm.com/)
362359
* [GitHub](https://github.com/)
363-
* [Travis](https://travis-ci.org/)
360+
* [Travis](https://travis-ci.com/)
364361

365362
## Versioning
366363

composer.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
}
2020
],
2121
"require": {
22-
"php": ">=5.5.9",
23-
"garoevans/php-enum": "*"
22+
"php": ">=8.0.0",
23+
"garoevans/php-enum": "*",
24+
"symfony/yaml": "^6.3"
2425
},
2526
"require-dev": {
26-
"phpunit/PHPUnit": "4.4.*",
27+
"phpunit/phpunit": "*",
2728
"squizlabs/php_codesniffer": "*"
2829
},
2930
"autoload": {
@@ -62,5 +63,10 @@
6263
"tests/unit_tests/file/"
6364
]
6465
}
65-
}
66+
},
67+
"scripts": {
68+
"test": "vendor/bin/phpunit ./tests",
69+
"sniff": "vendor/bin/phpcs ./src ./tests",
70+
"check": "composer test; composer sniff"
71+
}
6672
}

phpcs.xml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
<?xml version="1.0"?>
2-
<ruleset name="PHP_CodeSniffer">
3-
<description>The coding standard for PHP_CodeSniffer itself.</description>
2+
<ruleset name="Exorg_PHP_DataCoder">
3+
<description>The coding standard for PHPDataCoder.</description>
44

5-
<exclude-pattern>tests/testing_environment/data/*</exclude-pattern>
6-
<exclude-pattern>tests/testing_environment/files/*</exclude-pattern>
7-
<exclude-pattern>src/data_format/DataFormat.php</exclude-pattern>
5+
<file>./src</file>
6+
<file>./tests</file>
7+
8+
<exclude-pattern>./tests/testing_environment/data/*</exclude-pattern>
9+
<exclude-pattern>./tests/testing_environment/files/*</exclude-pattern>
10+
<exclude-pattern>./src/data_format/DataFormat.php</exclude-pattern>
811

912
<arg name="report" value="full"/>
1013
<arg value="np"/>
1114

1215
<rule ref="PSR1"/>
13-
<rule ref="PSR2"/>
14-
</ruleset>
16+
<rule ref="PSR12"/>
17+
</ruleset>

phpunit.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<phpunit bootstrap="./vendor/autoload.php">
33
</phpunit>
4-

src/coder_builder/CoderBuildingTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
* @package DataCoder
2323
* @author Katarzyna Krasińska <[email protected]>
24-
* @copyright Copyright (c) 2015 Katarzyna Krasińska
24+
* @copyright Copyright (c) 2015-2023 Katarzyna Krasińska
2525
* @license http://opensource.org/licenses/MIT MIT License
2626
* @link https://github.com/ExOrg/php-data-coder
2727
*/

src/coder_builder/CoderClassNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* @package DataCoder
2222
* @author Katarzyna Krasińska <[email protected]>
23-
* @copyright Copyright (c) 2015 Katarzyna Krasińska
23+
* @copyright Copyright (c) 2015-2023 Katarzyna Krasińska
2424
* @license http://opensource.org/licenses/MIT MIT License
2525
* @link https://github.com/ExOrg/php-data-coder
2626
*/

src/coders/data_coders/data_decoders/AbstractDataDecoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
* @package DataCoder
2020
* @author Katarzyna Krasińska <[email protected]>
21-
* @copyright Copyright (c) 2015 Katarzyna Krasińska
21+
* @copyright Copyright (c) 2015-2023 Katarzyna Krasińska
2222
* @license http://opensource.org/licenses/MIT MIT License
2323
* @link https://github.com/ExOrg/php-data-coder
2424
*/

src/coders/data_coders/data_decoders/DataDecoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
* @package DataCoder
2020
* @author Katarzyna Krasińska <[email protected]>
21-
* @copyright Copyright (c) 2015 Katarzyna Krasińska
21+
* @copyright Copyright (c) 2015-2023 Katarzyna Krasińska
2222
* @license http://opensource.org/licenses/MIT MIT License
2323
* @link https://github.com/ExOrg/php-data-coder
2424
*/

0 commit comments

Comments
 (0)