Skip to content

Commit

Permalink
Initialize project
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Nöhles <[email protected]>
  • Loading branch information
BolZer committed Jun 7, 2024
1 parent 25e7b84 commit a6bdb53
Show file tree
Hide file tree
Showing 344 changed files with 125,236 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/codestyle.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Code Style (PHP-CS-Fixer)

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
include:
- { operating-system: 'ubuntu-latest', php-version: '8.2', dependencies: '' }

name: PHP ${{ matrix.php-version }}

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
tools: composer:v2

- name: Install dependencies
run: |
composer install --no-interaction --prefer-dist --no-progress ${{ matrix.dependencies }}
- name: Check code style
run: |
php vendor/bin/php-cs-fixer --using-cache=no --diff --dry-run --stop-on-violation --verbose fix
36 changes: 36 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Lint (PHPStan)

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
include:
- { operating-system: 'ubuntu-latest', php-version: '8.2', dependencies: '' }

name: PHP ${{ matrix.php-version }}

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
tools: composer:v2

- name: Install dependencies
run: |
composer install --no-interaction --prefer-dist --no-progress ${{ matrix.dependencies }}
- name: Analyze code for issues
run: |
php vendor/bin/phpstan analyse src --level 9
38 changes: 38 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Tests (Pest)

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
include:
- { operating-system: 'ubuntu-latest', php-version: '8.2', dependencies: '' }
- { operating-system: 'ubuntu-latest', php-version: '8.3', dependencies: '' }


name: PHP ${{ matrix.php-version }}

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
tools: composer:v2

- name: Install dependencies
run: |
composer install --no-interaction --prefer-dist --no-progress ${{ matrix.dependencies }}
- name: Run tests
run: |
php /vendor/bin/pest
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
vendor
.idea
.DS_Store
/zugferd10
/zugferd20
/zugferd211de
.phpunit.result.cache
.php-cs-fixer.cache
.vscode
composer.phar
32 changes: 32 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

$finder = (new PhpCsFixer\Finder())
->in([__DIR__ . '/src', __DIR__ . '/tests']);

return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'@Symfony' => true,
'@PhpCsFixer' => true,
'array_syntax' => ['syntax' => 'short'],
'cast_spaces' => ['space' => 'none'],
'concat_space' => ['spacing' => 'one'],
'yoda_style' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'blank_line_before_statement' => false,
'phpdoc_align' => ['align' => 'left'],
'phpdoc_var_without_name' => false,
'phpdoc_types_order' => false,
'phpdoc_order' => false,
'phpdoc_separation' => false,
'class_definition' => false,
'ternary_to_null_coalescing' => true,
'php_unit_test_class_requires_covers' => false,
'php_unit_internal_class' => false,
'declare_strict_types' => true,
'final_class' => true,
'no_unused_imports' => true,
])
->setFinder($finder);
27 changes: 27 additions & 0 deletions .task/dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: '3'

tasks:
start:
desc: Start the different validators
cmds:
- docker compose up -d
-
stop:
desc: Stop the different validators
cmds:
- docker compose down

tests:
desc: Runs the PHP tests with the PEST runner
cmds:
- ./vendor/bin/pest

lint:
desc: Lints the PHP files with PHPStan
cmds:
- ./vendor/bin/phpstan analyse

fixcs:
desc: Fixes the PHP files with PHP-CS-Fixer
cmds:
- ./vendor/bin/php-cs-fixer fix
Empty file added README.md
Empty file.
4 changes: 4 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: '3'

includes:
dev: ./.task/dev.yaml
58 changes: 58 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "easybill/e-invoicing",
"description": "A package to read and create the formats: factur-x, PEPPOL, XRechnung (CII/UBL)",
"type": "library",
"license": "MIT",
"keywords": [
"XRechnung",
"PEPPOL",
"factur-x",
"ZUGFeRD",
"EN16931",
"e-invoicing",
"einvoice",
"invoicing",
"UBL",
"CII",
"XML"
],
"autoload": {
"psr-4": {
"Easybill\\eInvoicing\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Easybill\\eInvoicingTests\\": "tests/"
}
},
"authors": [
{
"name": "Jan Nöhles",
"email": "[email protected]"
},
{
"name": "Patrick Romowicz",
"email": "[email protected]"
}
],
"minimum-stability": "stable",
"require": {
"php": "^8.2",
"ext-dom": "*",
"jms/serializer": "^3.30",
"ext-libxml": "*"
},
"require-dev": {
"pestphp/pest": "^2.34",
"phpstan/phpstan": "^1.10",
"friendsofphp/php-cs-fixer": "^3.51",
"guzzlehttp/guzzle": "^7.8"
},
"config": {
"platform-check": false,
"allow-plugins": {
"pestphp/pest-plugin": true
}
}
}
Loading

0 comments on commit a6bdb53

Please sign in to comment.