Skip to content

Commit

Permalink
v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tiamo committed Jun 27, 2020
2 parents 9ad7571 + c4b95b4 commit 19e42e7
Showing 50 changed files with 6,761 additions and 1,698 deletions.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: tiamo
# patreon: tiamo
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
/vendor
/.idea
/tests/tmp
/tmp
/nbproject/*
*.DS_Store
.idea
.env
coverage.xml
.phpunit.result.cache
.php_cs.cache
*.swp
*.swo
28 changes: 28 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . DIRECTORY_SEPARATOR . 'tests')
->in(__DIR__ . DIRECTORY_SEPARATOR . 'src')
->append(['.php_cs']);

$rules = [
'@Symfony' => true,
'phpdoc_no_empty_return' => false,
'array_syntax' => ['syntax' => 'short'],
'yoda_style' => false,
'binary_operator_spaces' => [
'operators' => [
'=>' => 'align',
'=' => 'align',
],
],
'concat_space' => ['spacing' => 'one'],
'not_operator_with_space' => false,
];

$rules['increment_style'] = ['style' => 'post'];

return PhpCsFixer\Config::create()
->setUsingCache(true)
->setRules($rules)
->setFinder($finder);
29 changes: 0 additions & 29 deletions .php_cs.dist

This file was deleted.

17 changes: 9 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
dist: trusty
language: php

sudo: false

php:
- 5.5
- 5.6
- 7.0
- 7.1

#before_install:
#- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.5" ]]; then composer require --dev --no-update phpunit/phpunit ~4; fi

install:
- composer install --no-interaction --no-suggest
env:
matrix:
- COMPOSER_FLAGS="--prefer-lowest"
- COMPOSER_FLAGS=""

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

script:
- ./vendor/bin/phing all
- composer test
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog

## VERSION 2.1.*
## 2.2.0

2020-06-27

+ Full code refactory
+ Fixed tests

## 2.1.*

2018-10

73 changes: 4 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# SPSS / PSPP

A PHP library for reading and writing SPSS / PSPP .sav data files.

VERSION 2.1.0 ([CHANGELOG](CHANGELOG.md))

[![Latest Version on Packagist](https://img.shields.io/packagist/v/tiamo/spss.svg?style=flat-square)](https://packagist.org/packages/tiamo/spss)
[![Build Status](https://travis-ci.org/tiamo/spss.svg?branch=master)](https://travis-ci.org/tiamo/spss)
[![Total Downloads](https://img.shields.io/packagist/dt/tiamo/spss.svg?style=flat-square)](https://packagist.org/packages/tiamo/spss)

A PHP library for reading and writing SPSS / PSPP .sav data files.

## Requirements

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

## Installation

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
composer require tiamo/spss
```

or add

```
"tiamo/spss": "*"
```

to the require section of your `composer.json` [file](https://packagist.org/packages/tiamo/spss)
or download from [here](https://github.com/tiamo/spss/releases).

## Usage

Reader example:

```php
// Initialize reader
$reader = \SPSS\Reader::fromFile('path/to/file.sav');

// Read header data
$reader->readHeader();
// var_dump($reader->header);

// Read full data
$reader->read();
// var_dump($reader->variables);
// var_dump($reader->valueLabels);
// var_dump($reader->documents);
// var_dump($reader->data);
```
or
```php
$reader = \SPSS\Reader::fromString(file_get_contents('path/to/file.sav'))->read();
```

Writer example:

```php
$writer = new \SPSS\Writer([
'header' => [
'prodName' => '@(#) SPSS DATA FILE test',
'layoutCode' => 2,
'compression' => 1,
'weightIndex' => 0,
'bias' => 100,
'creationDate' => '01 Feb 01',
'creationTime' => '01:01:01',
],
'variables' => [
[
'name' => 'VAR1',
'width' => 0,
'decimals' => 0
'format' => 5,
'columns' => 50,
'align' => 1,
'measure' => 1,
'data' => [
1, 2, 3
],
],
...
]
]);
```
* [Documentation](./docs/index.md)
* [Examples](./examples)

## Changelog

33 changes: 0 additions & 33 deletions build.xml

This file was deleted.

29 changes: 20 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -21,20 +21,21 @@
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=5.5",
"ext-mbstring": "*",
"ext-bcmath": "*",
"ext-json": "*"
},
"require-dev": {
"phing/phing": "^2",
"ergebnis/phpstan-rules": "^0.15.0",
"friendsofphp/php-cs-fixer": "^2.16",
"phpstan/phpstan": "^0.12.31",
"phpstan/phpstan-strict-rules": "^0.12.2",
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0",
"doctrine/instantiator": "1.0.5",
"phpdocumentor/reflection-docblock": "3.0.2",
"squizlabs/php_codesniffer": "^3"
"rector/rector": "^0.7.41",
"squizlabs/php_codesniffer": "^3",
"thecodingmachine/phpstan-strict-rules": "^0.12.0"
},
"autoload": {
"psr-4": {
@@ -46,11 +47,21 @@
"SPSS\\Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true
"sort-packages": true,
"preferred-install": "dist"
},
"scripts": {
"test": "phpunit --verbose",
"codestyle": "php-cs-fixer fix --path-mode=intersection --config=.php_cs.dist"
"lint": "rector process src && php-cs-fixer fix -v",
"test:lint": "php-cs-fixer fix -v --dry-run && rector process src --dry-run",
"test:types": "phpstan analyse --ansi --memory-limit=0",
"test:unit": "phpunit --no-coverage",
"test": [
"@test:lint",
"@test:types",
"@test:unit"
]
}
}
Loading

0 comments on commit 19e42e7

Please sign in to comment.