Skip to content

Commit a385421

Browse files
committed
README, CONTRIBUTING files and Travis config updated (#103)
1 parent 6cf36c3 commit a385421

File tree

5 files changed

+20
-48
lines changed

5 files changed

+20
-48
lines changed

.travis.yml

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
language: php
22
php:
3-
- 7.4
43
- 8.0
5-
before_install:
6-
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.4" ]]; then export PHP74=false; else export PHP74=true; fi
7-
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "8.0" ]]; then export PHP80=false; else export PHP80=true; fi
8-
install:
9-
- ( $PHP74 && $PHP80 ) || ( printf "\n" | pecl install yaml )
10-
- echo "extension=yaml.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
11-
- composer install
4+
- 8.1
5+
- 8.2
6+
- 8.3
127
script:
138
- ./vendor/bin/phpunit tests/
149
- ./vendor/bin/phpcs src/ tests/

CONTRIBUTING.md

+1-1
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

+15-37
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,13 @@ There are various groups of decoders and encoders
1515

1616
### Prerequisities
1717

18-
* PHP 7.4+
19-
* [YAML PHP extension](http://php.net/manual/en/book.yaml.php) 2.2.0+
20-
* [Composer](https://getcomposer.org/) 2.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
27-
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 7
31-
32-
```bash
33-
sudo aptitude install php-pear libyaml-dev
34-
pecl install yaml-beta
35-
```
36-
37-
##### PHP 8
38-
39-
```bash
40-
sudo aptitude install php-pear libyaml-dev
41-
sudo aptitude install php8.0-dev
42-
pecl install yaml
43-
```
44-
45-
Don't forget to add `"extension=yaml.so"` line to your *php.ini* file.
46-
4725
#### cURL, php8.0-cli and Git
4826

4927
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.
@@ -96,16 +74,16 @@ require_once (__DIR__ . '/vendor/autoload.php');
9674

9775
use Exorg\DataCoder\JsonDataEncoder;
9876

99-
$data = array (
77+
$data = [
10078
"firstName" => "John",
10179
"lastName" => "Smith",
102-
"address" => array (
80+
"address" => [
10381
"streetAddress" => "21 2nd Street",
10482
"city" => "New York",
10583
"state" => "NY",
10684
"postalCode" => "10021-3100",
107-
),
108-
);
85+
],
86+
];
10987

11088
$encoder = new JsonDataEncoder();
11189
$result = $encoder->encodeData($data);
@@ -171,16 +149,16 @@ Array
171149
```php
172150
use Exorg\DataCoder\DataEncoder;
173151

174-
$data = array (
152+
$data = [
175153
"firstName" => "John",
176154
"lastName" => "Smith",
177-
"address" => array (
155+
"address" => [
178156
"streetAddress" => "21 2nd Street",
179157
"city" => "New York",
180158
"state" => "NY",
181159
"postalCode" => "10021-3100",
182-
),
183-
);
160+
],
161+
];
184162

185163
$encoder = new DataEncoder();
186164
$encoder->setDataFormat('yaml');
@@ -258,16 +236,16 @@ Datafile coders with configurable data format - **DatafileEncoder** and **Datafi
258236
```php
259237
use Exorg\DataCoder\DatafileEncoder;
260238

261-
$data = array (
239+
$data = [
262240
"firstName" => "John",
263241
"lastName" => "Smith",
264-
"address" => array (
242+
"address" => [
265243
"streetAddress" => "21 2nd Street",
266244
"city" => "New York",
267245
"state" => "NY",
268246
"postalCode" => "10021-3100",
269-
),
270-
);
247+
],
248+
];
271249

272250
$datafilePath = 'data.json';
273251

@@ -373,7 +351,7 @@ composer check
373351
## Built with
374352

375353
* [Linux Mint](https://www.linuxmint.com/)
376-
* [Eclipse](https://eclipse.org/)
354+
* [Visual Studio Code](https://code.visualstudio.com/)
377355
* [Remarkable](https://remarkableapp.github.io/)
378356
* [PHPUnit](https://phpunit.de/)
379357
* [PHPCodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)

phpcs.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414

1515
<rule ref="PSR1"/>
1616
<rule ref="PSR12"/>
17-
</ruleset>
17+
</ruleset>

phpunit.xml

-1
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-

0 commit comments

Comments
 (0)