Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
usox committed Dec 18, 2023
1 parent 68ab772 commit 21cbf6a
Show file tree
Hide file tree
Showing 14 changed files with 4,073 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Unittests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest']
php: ['8.1', '8.2', '8.3']
continue-on-error: ${{ matrix.php == '8.3' }}
steps:
- uses: actions/checkout@v2

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

- name: Validate composer.json and composer.lock
run: composer validate

- name: Install dependencies
if: ${{ matrix.php != '8.3' }}
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 3
command: composer update --no-interaction --no-progress

- name: Install Dependencies (ignore platform)
if: ${{ matrix.php == '8.3' }}
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 3
command: composer update --no-interaction --no-progress --ignore-platform-req=php

- name: Run test suite
run: composer run-script qa
env:
PHP_CS_FIXER_IGNORE_ENV: 1
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vendor
build
22 changes: 22 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(['src', 'tests'])
;
$config = new PhpCsFixer\Config();
$config->setCacheFile('build/.php-cs-fixer.cache.php');
$config->setRules(
[
'@PSR12' => true,
'@PHP81Migration' => true,
'array_syntax' => ['syntax' => 'short'],
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline', 'keep_multiple_spaces_after_comma' => false],
'no_unused_imports' => true,
'ordered_imports' => [
'sort_algorithm' => 'alpha',
'imports_order' => ['const', 'class', 'function'],
],
]
)->setFinder($finder);

return $config;
55 changes: 55 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "usox/tal-i18n-extract",
"description": "Extractor for tal i18n translation attributes",
"type": "library",
"license": "MIT",
"autoload": {
"psr-4": {
"Usox\\TalI18nExtract\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Usox\\TalI18nExtract\\": "tests/"
}
},
"authors": [
{
"name": "Daniel Jakob",
"email": "[email protected]"
}
],
"require": {
"php": "~8.1.0||~8.2.0||~8.3.0",
"ext-dom": "*"
},
"require-dev": {
"phpunit/phpunit": "^10.5",
"phpstan/phpstan": "^1.10",
"friendsofphp/php-cs-fixer": "^3.41",
"phpstan/extension-installer": "^1.2",
"phpstan/phpstan-strict-rules": "^1",
"rector/rector": "^0.18"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"phpstan/extension-installer": true
}
},
"scripts": {
"qa": [
"@test",
"@stan",
"@cs:dry",
"@rector:dry"
],
"test": "phpunit",
"stan": "phpstan",
"cs:fix": "php-cs-fixer fix",
"cs:dry": "php-cs-fixer fix --dry-run --diff",
"coverage": "XDEBUG_MODE=coverage phpunit --coverage-html build/coverage tests",
"rector:dry": "rector process -n",
"rector:fix": "rector process"
}
}
Loading

0 comments on commit 21cbf6a

Please sign in to comment.