Skip to content

Commit 1d2d85d

Browse files
committed
Initial
0 parents  commit 1d2d85d

31 files changed

+1236
-0
lines changed

.github/workflows/test_master.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
test:
13+
name: Test
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
18+
19+
steps:
20+
- name: Set up PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php }}
24+
coverage: xdebug
25+
tools: composer:v2
26+
27+
- name: Checkout code
28+
uses: actions/checkout@v3
29+
with:
30+
fetch-depth: 0
31+
32+
- name: PHP Version Check
33+
run: php -v
34+
35+
- name: Validate Composer JSON
36+
run: composer validate
37+
38+
- name: Run Composer
39+
run: composer install --no-interaction
40+
41+
- name: Unit tests
42+
run: |
43+
composer test-init
44+
composer test
45+
46+
- name: PHP Code Sniffer
47+
run: composer codesniffer
48+
49+
- name: PHPStan analysis
50+
run: composer stan
51+
52+
code-coverage:
53+
name: Code coverage
54+
runs-on: ubuntu-latest
55+
strategy:
56+
matrix:
57+
php: ['7.4']
58+
59+
steps:
60+
- name: Set up PHP
61+
uses: shivammathur/setup-php@v2
62+
with:
63+
php-version: ${{ matrix.php }}
64+
coverage: xdebug
65+
tools: composer:v2
66+
67+
- name: Checkout code
68+
uses: actions/checkout@v3
69+
with:
70+
fetch-depth: 0
71+
72+
- name: Run Composer
73+
run: composer install --no-interaction
74+
75+
- name: Unit tests
76+
run: |
77+
composer test-init
78+
composer test-coverage-xml
79+
mkdir -p ./build/logs
80+
cp ./tests/_output/coverage.xml ./build/logs/clover.xml
81+
- name: Code Coverage (Coveralls)
82+
env:
83+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
run: php vendor/bin/php-coveralls -v

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
vendor
2+
.idea
3+
tests/_output
4+
tests/_support/_generated
5+
composer.lock
6+
composer.phar
7+
build

.travis.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Required to run your project under the correct environment
2+
language: php
3+
4+
# Versions of PHP you want your project run with
5+
php:
6+
- 7.4
7+
- 8.0
8+
- 8.1
9+
10+
# fast_finish: If your build fails do not continue trying to build, just stop.
11+
matrix:
12+
fast_finish: true
13+
include:
14+
- php: 7.4
15+
- php: 8.0
16+
- php: 8.1
17+
18+
# Update composer
19+
before-install:
20+
- composer self-update
21+
22+
# Install composer dependencies, init codeception
23+
install:
24+
- composer install --no-interaction --dev
25+
- composer test-init
26+
27+
# Run script
28+
script:
29+
- composer test
30+
- composer codesniffer

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2022 Smoren
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Schematic data mapper
2+
![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/smoren/array-view)
3+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Smoren/array-view-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Smoren/array-view-php/?branch=master)
4+
[![Coverage Status](https://coveralls.io/repos/github/Smoren/array-view-php/badge.svg?branch=master)](https://coveralls.io/github/Smoren/array-view-php?branch=master)
5+
![Build and test](https://github.com/Smoren/array-view-php/actions/workflows/test_master.yml/badge.svg)
6+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7+
8+
TODO
9+
10+
## How to install to your project
11+
```
12+
composer require smoren/array-view
13+
```
14+
15+
## Usage
16+
TODO
17+
18+
## Unit testing
19+
```
20+
composer install
21+
composer test-init
22+
composer test
23+
```
24+
25+
## Standards
26+
ArrayView conforms to the following standards:
27+
28+
* PSR-1 — [Basic coding standard](https://www.php-fig.org/psr/psr-1/)
29+
* PSR-4 — [Autoloader](https://www.php-fig.org/psr/psr-4/)
30+
* PSR-12 — [Extended coding style guide](https://www.php-fig.org/psr/psr-12/)
31+
32+
## License
33+
ArrayView is licensed under the MIT License.

codeception.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
actor: Tester
2+
bootstrap: _bootstrap.php
3+
paths:
4+
tests: tests
5+
log: tests/_output
6+
output: tests/_output
7+
data: tests/_data
8+
helpers: tests/_support
9+
settings:
10+
memory_limit: 1024M
11+
colors: true
12+
coverage:
13+
#c3_url: http://localhost:8080/index-test.php/
14+
enabled: true
15+
show_uncovered: false
16+
include:
17+
- src/*
18+
exclude:
19+
- vendor/*
20+
- tests/*

composer.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "smoren/array-view",
3+
"description": "Schematic data converter",
4+
"keywords": ["converter", "schema"],
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Smoren",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"require": {
13+
"php": ">=7.4"
14+
},
15+
"require-dev": {
16+
"codeception/codeception": "^4.2.1",
17+
"codeception/module-asserts": "^2.0",
18+
"php-coveralls/php-coveralls": "^2.0",
19+
"squizlabs/php_codesniffer": "3.*",
20+
"phpstan/phpstan": "^1.8"
21+
},
22+
"autoload": {
23+
"psr-4": {
24+
"Smoren\\ArrayView\\": "src",
25+
"Smoren\\ArrayView\\Tests\\Unit\\": "tests/unit"
26+
}
27+
},
28+
"config": {
29+
"fxp-asset": {
30+
"enabled": false
31+
}
32+
},
33+
"repositories": [
34+
{
35+
"type": "composer",
36+
"url": "https://asset-packagist.org"
37+
}
38+
],
39+
"scripts": {
40+
"test-init": ["./vendor/bin/codecept build"],
41+
"test-all": ["composer test-coverage", "composer codesniffer", "composer stan"],
42+
"test": ["./vendor/bin/codecept run unit tests/unit"],
43+
"test-coverage": ["./vendor/bin/codecept run unit tests/unit --coverage"],
44+
"test-coverage-html": ["./vendor/bin/codecept run unit tests/unit --coverage-html"],
45+
"test-coverage-xml": ["./vendor/bin/codecept run unit tests/unit --coverage-xml"],
46+
"codesniffer": ["./vendor/bin/phpcs --ignore=vendor,tests --standard=tests/coding_standard.xml -s ."],
47+
"stan": ["./vendor/bin/phpstan analyse -l 9 src"]
48+
}
49+
}

docs/images/schemator-logo.png

315 KB
Loading

src/Exceptions/IndexError.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Smoren\ArrayView\Exceptions;
4+
5+
class IndexError extends \RuntimeException
6+
{
7+
}

src/Exceptions/KeyError.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Smoren\ArrayView\Exceptions;
4+
5+
class KeyError extends \RuntimeException
6+
{
7+
}

0 commit comments

Comments
 (0)