diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index 7b7d1be..0000000 --- a/.coveralls.yml +++ /dev/null @@ -1,3 +0,0 @@ -src_dir: . -coverage_clover: build/logs/clover.xml -json_path: build/logs/coveralls-upload.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e600c2..9bd5007 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,15 +9,13 @@ jobs: fail-fast: false matrix: prefer-lowest: [''] - php-version: ['7.2', '7.4', '8.0'] + php-version: ['7.4', '8.0', '8.1'] include: - php-version: '7.2' prefer-lowest: 'prefer-lowest' steps: - - uses: actions/checkout@v1 - with: - fetch-depth: 1 + - uses: actions/checkout@v2 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -44,16 +42,14 @@ jobs: - name: Code Coverage Report if: matrix.php-version == '7.4' - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v2 cs-stan: name: Coding Standard & Static Analysis runs-on: ubuntu-18.04 steps: - - uses: actions/checkout@v1 - with: - fetch-depth: 1 + - uses: actions/checkout@v2 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -61,17 +57,18 @@ jobs: php-version: '7.4' extensions: mbstring, intl coverage: none + tools: vimeo/psalm:4.15, phpstan:1.2 - name: Composer Install - run: composer require --dev cakephp/cakephp-codesniffer:^4.1 psalm/phar:^3.18 phpstan/phpstan:^0.12 + run: composer require --dev cakephp/cakephp-codesniffer:^4.1 - name: Run phpcs run: vendor/bin/phpcs --report=checkstyle --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/ - name: Run psalm if: success() || failure() - run: vendor/bin/psalm.phar --output-format=github + run: psalm --output-format=github - name: Run phpstan if: success() || failure() - run: vendor/bin/phpstan.phar analyse --error-format=github + run: phpstan analyse --error-format=github diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 63e135d..b6916ff 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,8 +1,8 @@ parameters: ignoreErrors: - - message: "#^Access to an undefined property object\\:\\:\\$query\\.$#" - count: 4 + message: "#^Access to an undefined property object\\:\\:\\$element\\.$#" + count: 1 path: src/Listener/ViewListener.php - @@ -11,8 +11,8 @@ parameters: path: src/Listener/ViewListener.php - - message: "#^Access to an undefined property object\\:\\:\\$element\\.$#" - count: 1 + message: "#^Access to an undefined property object\\:\\:\\$query\\.$#" + count: 4 path: src/Listener/ViewListener.php - @@ -21,22 +21,22 @@ parameters: path: src/Listener/ViewListener.php - - message: "#^Parameter \\#2 \\$arr2 of function array_diff_key expects array, array\\|false given\\.$#" - count: 1 + message: "#^Cannot unset offset mixed on array\\{\\}\\.$#" + count: 2 path: src/Listener/ViewListener.php - - message: "#^Result of \\|\\| is always false\\.$#" - count: 1 + message: "#^Offset \\(int\\|string\\) on array\\{\\} in isset\\(\\) does not exist\\.$#" + count: 2 path: src/Listener/ViewListener.php - - message: "#^Cannot unset offset mixed on array\\(\\)\\.$#" - count: 2 + message: "#^Parameter \\#1 \\$field of method CrudView\\\\Listener\\\\ViewListener\\:\\:_deriveFieldFromContext\\(\\) expects string, array\\\\|string\\|null given\\.$#" + count: 1 path: src/Listener/ViewListener.php - - message: "#^Parameter \\#1 \\$field of method CrudView\\\\Listener\\\\ViewListener\\:\\:_deriveFieldFromContext\\(\\) expects string, array\\\\|string\\|null given\\.$#" + message: "#^Result of \\|\\| is always false\\.$#" count: 1 path: src/Listener/ViewListener.php @@ -46,7 +46,12 @@ parameters: path: src/Listener/ViewSearchListener.php - - message: "#^Offset 'data\\-wrap' does not exist on array\\(\\?'data\\-enable\\-seconds' \\=\\> 'true', 'data\\-date\\-format' \\=\\> string, \\?'data\\-enable\\-time' \\=\\> 'true', \\?'data\\-alt\\-format' \\=\\> mixed, \\?'data\\-alt\\-input' \\=\\> 'true', \\?'data\\-no\\-calendar' \\=\\> 'true'\\)\\.$#" + message: "#^Binary operation \"\\+\" between string and array\\{data\\-enable\\-seconds\\?\\: 'true', data\\-date\\-format\\: string, data\\-enable\\-time\\?\\: 'true', data\\-alt\\-format\\?\\: mixed, data\\-alt\\-input\\?\\: 'true', data\\-no\\-calendar\\?\\: 'true', data\\-alt\\-input\\-class\\?\\: string, class\\: array\\{'input\\-group', 'flatpickr'\\}\\} results in an error\\.$#" + count: 1 + path: src/View/Widget/DateTimeWidget.php + + - + message: "#^Binary operation \"\\+\\=\" between array\\\\|string and array\\{data\\-enable\\-seconds\\?\\: 'true', data\\-date\\-format\\: string, data\\-enable\\-time\\?\\: 'true', data\\-alt\\-format\\?\\: mixed, data\\-alt\\-input\\?\\: 'true', data\\-no\\-calendar\\?\\: 'true'\\} results in an error\\.$#" count: 1 path: src/View/Widget/DateTimeWidget.php @@ -61,12 +66,12 @@ parameters: path: src/View/Widget/DateTimeWidget.php - - message: "#^Binary operation \"\\+\" between string and array\\('data\\-date\\-format' \\=\\> string, \\?'data\\-alt\\-format' \\=\\> mixed, \\?'data\\-alt\\-input' \\=\\> 'true', \\?'data\\-no\\-calendar' \\=\\> 'true', \\?'data\\-enable\\-seconds' \\=\\> 'true', \\?'data\\-enable\\-time' \\=\\> 'true', 'data\\-wrap' \\=\\> mixed, \\?'data\\-alt\\-input\\-class' \\=\\> string, \\.\\.\\.\\) results in an error\\.$#" + message: "#^Offset 'data\\-wrap' does not exist on array\\{data\\-enable\\-seconds\\?\\: 'true', data\\-date\\-format\\: string, data\\-enable\\-time\\?\\: 'true', data\\-alt\\-format\\?\\: mixed, data\\-alt\\-input\\?\\: 'true', data\\-no\\-calendar\\?\\: 'true'\\}\\.$#" count: 1 path: src/View/Widget/DateTimeWidget.php - - message: "#^Binary operation \"\\+\\=\" between array\\\\|string and array\\('data\\-date\\-format' \\=\\> string, \\?'data\\-alt\\-format' \\=\\> mixed, \\?'data\\-alt\\-input' \\=\\> 'true', \\?'data\\-no\\-calendar' \\=\\> 'true', \\?'data\\-enable\\-seconds' \\=\\> 'true', \\?'data\\-enable\\-time' \\=\\> 'true', 'data\\-wrap' \\=\\> mixed\\) results in an error\\.$#" + message: "#^Offset 'iconClass' on array\\{data\\-enable\\-seconds\\?\\: 'true', data\\-date\\-format\\: string, data\\-enable\\-time\\?\\: 'true', data\\-alt\\-format\\?\\: mixed, data\\-alt\\-input\\?\\: 'true', data\\-no\\-calendar\\?\\: 'true'\\} in isset\\(\\) does not exist\\.$#" count: 1 path: src/View/Widget/DateTimeWidget.php @@ -81,7 +86,7 @@ parameters: path: src/View/Widget/DateTimeWidget.php - - message: "#^Parameter \\#1 \\$options of method Cake\\\\View\\\\StringTemplate\\:\\:formatAttributes\\(\\) expects array\\|null, array\\\\|string given\\.$#" + message: "#^Parameter \\#1 \\$options of method Cake\\\\View\\\\StringTemplate\\:\\:formatAttributes\\(\\) expects array\\\\|null, array\\\\|string given\\.$#" count: 1 path: src/View/Widget/DateTimeWidget.php diff --git a/src/Listener/ViewSearchListener.php b/src/Listener/ViewSearchListener.php index eac470c..b53270c 100644 --- a/src/Listener/ViewSearchListener.php +++ b/src/Listener/ViewSearchListener.php @@ -36,7 +36,7 @@ class ViewSearchListener extends BaseListener /** * Events this listerner is interested in. * - * @return array + * @return array */ public function implementedEvents(): array { diff --git a/src/View/CrudView.php b/src/View/CrudView.php index a4b827a..f6198db 100644 --- a/src/View/CrudView.php +++ b/src/View/CrudView.php @@ -49,7 +49,7 @@ public function initialize(): void /** * Events this class is interested in. * - * @return array + * @return array */ public function implementedEvents(): array { diff --git a/src/View/Helper/CrudViewHelper.php b/src/View/Helper/CrudViewHelper.php index bc02ed9..62e0142 100644 --- a/src/View/Helper/CrudViewHelper.php +++ b/src/View/Helper/CrudViewHelper.php @@ -35,7 +35,7 @@ class CrudViewHelper extends Helper /** * Default config. * - * @var array + * @var array */ protected $_defaultConfig = [ 'fieldFormatters' => null,