-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* First commit * Add CS-Fixer and format code, tomorrow is another day. * Changes done, clean up, tests still needed * Change visibility validateOutbox private to protected * Add MailResponse on send * Make it working and add unit tests * fix composer * Apply fixes from StyleCI * start ui part * Apply fixes from StyleCI * working on demos * cleanup * cleanup * cleanup * Apply fixes from StyleCI * add appStickyCb = true * Apply fixes from StyleCI * cleanup * Align composer to 2.4 * Add gitActions * Upgrade PHPUnit config * Add php-cs-fixer config * Add phpstan config * Update Tests * Align to 2.4 * Normalize composer.json * Drop unit test on php 7.3 * Fix Dynamic method getOutbox * Removed deprecated php-cs-fixer option --diff-format PHP-CS-Fixer/PHP-CS-Fixer#5766 * Normalize Composer Co-authored-by: Imants Horsts <[email protected]>
- Loading branch information
1 parent
c1553c0
commit 410d2fe
Showing
32 changed files
with
1,225 additions
and
385 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
categories: | ||
- title: "Breaking Changes" | ||
labels: | ||
- "BC-break" | ||
- title: "Major Features" | ||
labels: | ||
- "MAJOR" | ||
- title: "Documentation enhancements" | ||
labels: | ||
- "Documentation :books:" | ||
template: | | ||
## What’s Changed | ||
$CHANGES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Build Docs | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
update_release_draft: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Run Release Drafter | ||
uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Build Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**\.build' | ||
- 'release/*' | ||
- '!**\.gen' | ||
|
||
jobs: | ||
autocommit: | ||
name: Build Release | ||
runs-on: ubuntu-latest | ||
container: | ||
image: atk4/image:latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.ref }} | ||
|
||
- name: Install PHP dependencies | ||
run: composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader | ||
|
||
- name: Composer unset version | ||
run: composer config version --unset | ||
|
||
- name: Update composer.json | ||
run: >- | ||
php -r ' | ||
$f = __DIR__ . "/composer.json"; | ||
$data = json_decode(file_get_contents($f), true); | ||
foreach ($data as $k => $v) { | ||
if (preg_match("~^(.+)-release$~", $k, $matches)) { | ||
$data[$matches[1]] = $data[$k]; unset($data[$k]); | ||
} | ||
} | ||
$str = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . "\n"; | ||
echo $str; | ||
file_put_contents($f, $str); | ||
' | ||
- name: Composer validate config | ||
run: composer validate --strict --no-check-lock && composer normalize --dry-run --no-check-lock | ||
|
||
- name: Commit | ||
run: | | ||
git config --global user.name "$(git show -s --format='%an')" | ||
git config --global user.email "$(git show -s --format='%ae')" | ||
git add -A && git diff --staged && git commit -m "Build Release" | ||
- name: Push | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: ${{ github.ref }}.gen | ||
force: true | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
name: Unit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
schedule: | ||
- cron: '0 0/2 * * *' | ||
|
||
jobs: | ||
smoke-test: | ||
name: Smoke | ||
runs-on: ubuntu-latest | ||
container: | ||
image: atk4/image:${{ matrix.php }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ['latest'] | ||
type: ['Phpunit'] | ||
include: | ||
- php: 'latest' | ||
type: 'CodingStyle' | ||
- php: 'latest' | ||
type: 'StaticAnalysis' | ||
env: | ||
LOG_COVERAGE: "" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure PHP | ||
run: | | ||
if [ -n "$LOG_COVERAGE" ]; then echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; else rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; fi | ||
php --version | ||
- name: Setup cache 1/2 | ||
id: composer-cache | ||
run: | | ||
echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: Setup cache 2/2 | ||
if: ${{ !env.ACT }} | ||
uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-smoke-${{ matrix.php }}-${{ matrix.type }}-${{ hashFiles('composer.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install PHP dependencies | ||
run: | | ||
if [ "${{ matrix.type }}" != "Phpunit" ] && [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpunit/phpunit johnkary/phpunit-speedtrap --dev ; fi | ||
if [ "${{ matrix.type }}" != "CodingStyle" ]; then composer remove --no-interaction --no-update friendsofphp/php-cs-fixer --dev ; fi | ||
if [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpstan/phpstan --dev ; fi | ||
composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader | ||
- name: Init | ||
run: | | ||
mkdir -p build/logs | ||
- name: "Run tests: Phpunit (only for Phpunit)" | ||
if: matrix.type == 'Phpunit' | ||
run: "vendor/bin/phpunit \"$(if [ -n \"$LOG_COVERAGE\" ]; then echo '--coverage-text'; else echo '--no-coverage'; fi)\" -v" | ||
|
||
- name: Check Coding Style (only for CodingStyle) | ||
if: matrix.type == 'CodingStyle' | ||
run: vendor/bin/php-cs-fixer fix --dry-run --using-cache=no --diff --verbose --show-progress=dots | ||
|
||
- name: Run Static Analysis (only for StaticAnalysis) | ||
if: matrix.type == 'StaticAnalysis' | ||
run: | | ||
echo "memory_limit = 1G" > /usr/local/etc/php/conf.d/custom-memory-limit.ini | ||
vendor/bin/phpstan analyse | ||
unit-test: | ||
name: Unit | ||
runs-on: ubuntu-latest | ||
container: | ||
image: atk4/image:${{ matrix.php }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: ['7.4', 'latest'] | ||
type: ['Phpunit'] | ||
include: | ||
- php: 'latest' | ||
type: 'Phpunit Lowest' | ||
- php: 'latest' | ||
type: 'Phpunit Burn' | ||
env: | ||
LOG_COVERAGE: "${{ fromJSON('{true: \"1\", false: \"\"}')[matrix.php == 'latest' && matrix.type == 'Phpunit' && (github.event_name == 'pull_request' || (github.event_name == 'push' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/master')))] }}" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure PHP | ||
run: | | ||
if [ -n "$LOG_COVERAGE" ]; then echo "xdebug.mode=coverage" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; else rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini; fi | ||
php --version | ||
- name: Setup cache 1/2 | ||
id: composer-cache | ||
run: | | ||
echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: Setup cache 2/2 | ||
if: ${{ !env.ACT }} | ||
uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.type }}-${{ hashFiles('composer.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Install PHP dependencies | ||
run: | | ||
if [ "${{ matrix.type }}" != "Phpunit" ] && [ "${{ matrix.type }}" != "Phpunit Lowest" ] && [ "${{ matrix.type }}" != "Phpunit Burn" ]; then composer remove --no-interaction --no-update phpunit/phpunit --no-update phpunit/phpunit johnkary/phpunit-speedtrap --dev ; fi | ||
if [ "${{ matrix.type }}" != "CodingStyle" ]; then composer remove --no-interaction --no-update friendsofphp/php-cs-fixer --dev ; fi | ||
if [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpstan/phpstan --dev ; fi | ||
composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader | ||
if [ "${{ matrix.type }}" == "Phpunit Lowest" ]; then composer update --ansi --prefer-dist --prefer-lowest --prefer-stable --no-interaction --no-progress --optimize-autoloader ; fi | ||
if [ "${{ matrix.type }}" == "Phpunit Burn" ]; then sed -i 's/ *public function runBare(): void/public function runBare(): void { gc_collect_cycles(); $mem0 = memory_get_usage(); for ($i = 0; $i < '"$(if [ \"$GITHUB_EVENT_NAME\" == \"schedule\" ]; then echo 5; else echo 5; fi)"'; ++$i) { $this->_runBare(); if ($i === 0) { gc_collect_cycles(); $mem1 = memory_get_usage(); } } gc_collect_cycles(); $mem2 = memory_get_usage(); if ($mem2 - 4000 * 1024 > $mem0 || $mem2 - 1536 * 1024 > $mem1) { $this->onNotSuccessfulTest(new AssertionFailedError("Memory leak detected! (" . round($mem0 \/ (1024 * 1024), 3) . " + " . round(($mem1 - $mem0) \/ (1024 * 1024), 3) . " + " . round(($mem2 - $mem1) \/ (1024 * 1024), 3) . " MB, " . $i . " iterations)")); } } private function _runBare(): void/' vendor/phpunit/phpunit/src/Framework/TestCase.php && cat vendor/phpunit/phpunit/src/Framework/TestCase.php | grep '_runBare(' ; fi | ||
- name: Init | ||
run: | | ||
mkdir -p build/logs | ||
- name: "Run tests: Phpunit (only for Phpunit)" | ||
if: startsWith(matrix.type, 'Phpunit') | ||
run: "vendor/bin/phpunit \"$(if [ -n \"$LOG_COVERAGE\" ]; then echo '--coverage-text'; else echo '--no-coverage'; fi)\" -v" | ||
|
||
- name: Upload coverage logs (only for "latest" Phpunit) | ||
if: env.LOG_COVERAGE | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
file: build/logs/clover.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
docs/build | ||
/composer.lock | ||
/build | ||
/vendor | ||
.DS_Store | ||
.idea | ||
/demos/db.sqlite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in([__DIR__]) | ||
->exclude([ | ||
'vendor', | ||
]); | ||
|
||
$config = new \PhpCsFixer\Config(); | ||
$config->setRiskyAllowed(true) | ||
->setRules([ | ||
'@PhpCsFixer' => true, | ||
'@PhpCsFixer:risky' =>true, | ||
'@PHP71Migration:risky' => true, | ||
'@PHP73Migration' => true, | ||
|
||
// required by PSR-12 | ||
'concat_space' => [ | ||
'spacing' => 'one', | ||
], | ||
|
||
// disable some too strict rules | ||
'phpdoc_types' => [ | ||
// keep enabled, but without "alias" group to not fix | ||
// "Callback" to "callback" in phpdoc | ||
'groups' => ['simple', 'meta'] | ||
], | ||
'phpdoc_types_order' => [ | ||
'null_adjustment' => 'always_last', | ||
'sort_algorithm' => 'none', | ||
], | ||
'single_line_throw' => false, | ||
'yoda_style' => [ | ||
'equal' => false, | ||
'identical' => false, | ||
], | ||
'native_function_invocation' => false, | ||
'non_printable_character' => [ | ||
'use_escape_sequences_in_strings' => true, | ||
], | ||
'void_return' => false, | ||
'blank_line_before_statement' => [ | ||
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'exit'], | ||
], | ||
'combine_consecutive_issets' => false, | ||
'combine_consecutive_unsets' => false, | ||
'multiline_whitespace_before_semicolons' => false, | ||
'no_superfluous_elseif' => false, | ||
'ordered_class_elements' => false, | ||
'php_unit_internal_class' => false, | ||
'php_unit_test_case_static_method_calls' => [ | ||
'call_type' => 'this', | ||
], | ||
'php_unit_test_class_requires_covers' => false, | ||
'phpdoc_add_missing_param_annotation' => false, | ||
'return_assignment' => false, | ||
'comment_to_phpdoc' => false, | ||
'list_syntax' => ['syntax' => 'short'], | ||
'general_phpdoc_annotation_remove' => [ | ||
'annotations' => ['author', 'copyright', 'throws'], | ||
], | ||
'nullable_type_declaration_for_default_null_value' => [ | ||
'use_nullable_type_declaration' => false, | ||
], | ||
]) | ||
->setFinder($finder) | ||
->setCacheFile(__DIR__ . '/.php_cs.cache'); | ||
|
||
return $config; |
Oops, something went wrong.