Skip to content

Commit 19e42e7

Browse files
committed
v2.2.0
2 parents 9ad7571 + c4b95b4 commit 19e42e7

Some content is hidden

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

50 files changed

+6761
-1698
lines changed

.github/FUNDING.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# These are supported funding model platforms
2+
3+
github: tiamo
4+
# patreon: tiamo

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
/vendor
2-
/.idea
32
/tests/tmp
43
/tmp
54
/nbproject/*
65
*.DS_Store
76
.idea
87
.env
8+
coverage.xml
99
.phpunit.result.cache
10+
.php_cs.cache
11+
*.swp
12+
*.swo

.php_cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__ . DIRECTORY_SEPARATOR . 'tests')
5+
->in(__DIR__ . DIRECTORY_SEPARATOR . 'src')
6+
->append(['.php_cs']);
7+
8+
$rules = [
9+
'@Symfony' => true,
10+
'phpdoc_no_empty_return' => false,
11+
'array_syntax' => ['syntax' => 'short'],
12+
'yoda_style' => false,
13+
'binary_operator_spaces' => [
14+
'operators' => [
15+
'=>' => 'align',
16+
'=' => 'align',
17+
],
18+
],
19+
'concat_space' => ['spacing' => 'one'],
20+
'not_operator_with_space' => false,
21+
];
22+
23+
$rules['increment_style'] = ['style' => 'post'];
24+
25+
return PhpCsFixer\Config::create()
26+
->setUsingCache(true)
27+
->setRules($rules)
28+
->setFinder($finder);

.php_cs.dist

Lines changed: 0 additions & 29 deletions
This file was deleted.

.travis.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
dist: trusty
21
language: php
32

3+
sudo: false
4+
45
php:
56
- 5.5
67
- 5.6
78
- 7.0
89
- 7.1
910

10-
#before_install:
11-
#- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.5" ]]; then composer require --dev --no-update phpunit/phpunit ~4; fi
12-
13-
install:
14-
- composer install --no-interaction --no-suggest
11+
env:
12+
matrix:
13+
- COMPOSER_FLAGS="--prefer-lowest"
14+
- COMPOSER_FLAGS=""
1515

1616
before_script:
17-
- phpenv config-rm xdebug.ini
17+
- travis_retry composer self-update
18+
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source
1819

1920
script:
20-
- ./vendor/bin/phing all
21+
- composer test

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Changelog
22

3-
## VERSION 2.1.*
3+
## 2.2.0
4+
5+
2020-06-27
6+
7+
+ Full code refactory
8+
+ Fixed tests
9+
10+
## 2.1.*
411

512
2018-10
613

README.md

Lines changed: 4 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
# SPSS / PSPP
22

3-
A PHP library for reading and writing SPSS / PSPP .sav data files.
4-
5-
VERSION 2.1.0 ([CHANGELOG](CHANGELOG.md))
6-
73
[![Latest Version on Packagist](https://img.shields.io/packagist/v/tiamo/spss.svg?style=flat-square)](https://packagist.org/packages/tiamo/spss)
84
[![Build Status](https://travis-ci.org/tiamo/spss.svg?branch=master)](https://travis-ci.org/tiamo/spss)
95
[![Total Downloads](https://img.shields.io/packagist/dt/tiamo/spss.svg?style=flat-square)](https://packagist.org/packages/tiamo/spss)
106

7+
A PHP library for reading and writing SPSS / PSPP .sav data files.
8+
119
## Requirements
1210

1311
+ php >= 5.5
@@ -16,77 +14,14 @@ VERSION 2.1.0 ([CHANGELOG](CHANGELOG.md))
1614

1715
## Installation
1816

19-
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
20-
21-
Either run
22-
2317
```
2418
composer require tiamo/spss
2519
```
2620

27-
or add
28-
29-
```
30-
"tiamo/spss": "*"
31-
```
32-
33-
to the require section of your `composer.json` [file](https://packagist.org/packages/tiamo/spss)
34-
or download from [here](https://github.com/tiamo/spss/releases).
35-
3621
## Usage
3722

38-
Reader example:
39-
40-
```php
41-
// Initialize reader
42-
$reader = \SPSS\Reader::fromFile('path/to/file.sav');
43-
44-
// Read header data
45-
$reader->readHeader();
46-
// var_dump($reader->header);
47-
48-
// Read full data
49-
$reader->read();
50-
// var_dump($reader->variables);
51-
// var_dump($reader->valueLabels);
52-
// var_dump($reader->documents);
53-
// var_dump($reader->data);
54-
```
55-
or
56-
```php
57-
$reader = \SPSS\Reader::fromString(file_get_contents('path/to/file.sav'))->read();
58-
```
59-
60-
Writer example:
61-
62-
```php
63-
$writer = new \SPSS\Writer([
64-
'header' => [
65-
'prodName' => '@(#) SPSS DATA FILE test',
66-
'layoutCode' => 2,
67-
'compression' => 1,
68-
'weightIndex' => 0,
69-
'bias' => 100,
70-
'creationDate' => '01 Feb 01',
71-
'creationTime' => '01:01:01',
72-
],
73-
'variables' => [
74-
[
75-
'name' => 'VAR1',
76-
'width' => 0,
77-
'decimals' => 0
78-
'format' => 5,
79-
'columns' => 50,
80-
'align' => 1,
81-
'measure' => 1,
82-
'data' => [
83-
1, 2, 3
84-
],
85-
],
86-
...
87-
]
88-
]);
89-
```
23+
* [Documentation](./docs/index.md)
24+
* [Examples](./examples)
9025

9126
## Changelog
9227

build.xml

Lines changed: 0 additions & 33 deletions
This file was deleted.

composer.json

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,21 @@
2121
"email": "[email protected]"
2222
}
2323
],
24-
"minimum-stability": "dev",
25-
"prefer-stable": true,
2624
"require": {
2725
"php": ">=5.5",
2826
"ext-mbstring": "*",
2927
"ext-bcmath": "*",
3028
"ext-json": "*"
3129
},
3230
"require-dev": {
33-
"phing/phing": "^2",
31+
"ergebnis/phpstan-rules": "^0.15.0",
32+
"friendsofphp/php-cs-fixer": "^2.16",
33+
"phpstan/phpstan": "^0.12.31",
34+
"phpstan/phpstan-strict-rules": "^0.12.2",
3435
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
35-
"doctrine/instantiator": "1.0.5",
36-
"phpdocumentor/reflection-docblock": "3.0.2",
37-
"squizlabs/php_codesniffer": "^3"
36+
"rector/rector": "^0.7.41",
37+
"squizlabs/php_codesniffer": "^3",
38+
"thecodingmachine/phpstan-strict-rules": "^0.12.0"
3839
},
3940
"autoload": {
4041
"psr-4": {
@@ -46,11 +47,21 @@
4647
"SPSS\\Tests\\": "tests/"
4748
}
4849
},
50+
"minimum-stability": "dev",
51+
"prefer-stable": true,
4952
"config": {
50-
"sort-packages": true
53+
"sort-packages": true,
54+
"preferred-install": "dist"
5155
},
5256
"scripts": {
53-
"test": "phpunit --verbose",
54-
"codestyle": "php-cs-fixer fix --path-mode=intersection --config=.php_cs.dist"
57+
"lint": "rector process src && php-cs-fixer fix -v",
58+
"test:lint": "php-cs-fixer fix -v --dry-run && rector process src --dry-run",
59+
"test:types": "phpstan analyse --ansi --memory-limit=0",
60+
"test:unit": "phpunit --no-coverage",
61+
"test": [
62+
"@test:lint",
63+
"@test:types",
64+
"@test:unit"
65+
]
5566
}
5667
}

0 commit comments

Comments
 (0)