diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 2ce6dc1..6b1ea80 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -6,7 +6,4 @@ categories: labels: - "BC-break" - title: "Other changes" -template: | - ## What’s Changed - - $CHANGES +template: $CHANGES diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 73d79f5..b169aef 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -1,4 +1,4 @@ -name: Build Release +name: Build release on: push: diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index eaf81e8..0f8fbbc 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -37,7 +37,7 @@ jobs: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Setup cache 2/2 - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-smoke-${{ matrix.php }}-${{ matrix.type }}-${{ hashFiles('composer.json') }} @@ -46,15 +46,15 @@ jobs: - 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 }}" != "Phpunit" ] && [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpunit/phpunit ergebnis/phpunit-slow-test-detector --dev; fi + if [ "${{ matrix.type }}" != "CodingStyle" ]; then composer remove --no-interaction --no-update friendsofphp/php-cs-fixer ergebnis/composer-normalize --dev; fi if [ "${{ matrix.type }}" != "StaticAnalysis" ]; then composer remove --no-interaction --no-update phpstan/\* behat/\* --dev; fi composer update --ansi --prefer-dist --no-interaction --no-progress --optimize-autoloader - name: "Run tests: SQLite (only for Phpunit)" if: startsWith(matrix.type, 'Phpunit') run: | - echo "not implemented" || vendor/bin/phpunit --exclude-group none --no-coverage -v + echo "not implemented" || vendor/bin/phpunit --exclude-group none --no-coverage --fail-on-warning --fail-on-risky $(if vendor/bin/phpunit --version | grep -q '^PHPUnit 9\.'; then echo -v; else echo --fail-on-notice --fail-on-deprecation --display-notices --display-deprecations --display-warnings --display-errors --display-incomplete --display-skipped; fi) - name: Check Coding Style (only for CodingStyle) if: matrix.type == 'CodingStyle' @@ -68,4 +68,4 @@ jobs: if: matrix.type == 'StaticAnalysis' run: | echo "memory_limit = 2G" > /usr/local/etc/php/conf.d/custom-memory-limit.ini - vendor/bin/phpstan analyse + vendor/bin/phpstan analyse -v diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 53f76ef..496e452 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,10 +1,15 @@ in([__DIR__]) ->exclude(['vendor']); -return (new PhpCsFixer\Config()) +return (new Config()) ->setRiskyAllowed(true) ->setRules([ '@PhpCsFixer' => true, @@ -33,6 +38,7 @@ 'blank_line_before_statement' => [ 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'exit'], ], + 'final_internal_class' => false, 'combine_consecutive_issets' => false, 'combine_consecutive_unsets' => false, 'multiline_whitespace_before_semicolons' => false, @@ -46,9 +52,6 @@ 'general_phpdoc_annotation_remove' => [ 'annotations' => ['author', 'copyright', 'throws'], ], - 'nullable_type_declaration_for_default_null_value' => [ - 'use_nullable_type_declaration' => false, - ], // fn => without curly brackets is less readable, // also prevent bounding of unwanted variables for GC diff --git a/composer.json b/composer.json index 10e6db7..b83cf9f 100644 --- a/composer.json +++ b/composer.json @@ -28,17 +28,17 @@ }, "require-release": { "php": ">=7.4 <8.4", - "atk4/ui": "~5.0.0" + "atk4/ui": "~5.2.0" }, "require-dev": { "ergebnis/composer-normalize": "^2.13", + "ergebnis/phpunit-slow-test-detector": "^2.9", "friendsofphp/php-cs-fixer": "^3.0", - "johnkary/phpunit-speedtrap": "^3.3", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.0", "phpstan/phpstan-deprecation-rules": "^1.0", "phpstan/phpstan-strict-rules": "^1.3", - "phpunit/phpunit": "^9.5.5" + "phpunit/phpunit": "^9.5.5 || ^10.0" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 30cd1c3..ba5f1a0 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -3,6 +3,7 @@ includes: parameters: level: 6 + checkMissingOverrideMethodAttribute: true paths: - . excludePaths: @@ -10,4 +11,4 @@ parameters: ignoreErrors: # relax strict rules - - '~^Only booleans are allowed in .+, .+ given( on the (left|right) side)?\.~' + - '~^Only booleans are allowed in .+, .+ given( on the (left|right) side)?\.$~' diff --git a/src/Chart.php b/src/Chart.php index 38093de..b24be01 100644 --- a/src/Chart.php +++ b/src/Chart.php @@ -9,6 +9,7 @@ use Atk4\Ui\Js\JsExpression; use Atk4\Ui\Js\JsFunction; use Atk4\Ui\View; +use Atk4\Ui\View\ModelTrait; /** * Chart.js 3.9.1 documentation: https://www.chartjs.org/docs/3.9.1/ @@ -16,6 +17,10 @@ */ class Chart extends View { + use ModelTrait { + setModel as private _setModel; + } + public const TYPE_BAR = 'bar'; public const TYPE_LINE = 'line'; public const TYPE_PIE = 'pie'; @@ -162,7 +167,7 @@ public function setModel(Model $model, array $columns = []): void } $this->columns = $columns; - parent::setModel($model); + $this->_setModel($model); $this->prepareDatasets(); } diff --git a/src/ScatterChart.php b/src/ScatterChart.php index 25cf96c..04b1647 100644 --- a/src/ScatterChart.php +++ b/src/ScatterChart.php @@ -57,7 +57,7 @@ public function prepareDatasets(): void * @param string|null $xTitle X axis title * @param string|null $yTitle Y axis title */ - public function setAxisTitles(string $xTitle = null, string $yTitle = null): void + public function setAxisTitles(?string $xTitle = null, ?string $yTitle = null): void { $options = [ 'scales' => [