Skip to content

Commit

Permalink
Update CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Dec 18, 2021
1 parent e132b5e commit 13ffab0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 29 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -44,34 +42,33 @@ 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
with:
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
35 changes: 20 additions & 15 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -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

-
Expand All @@ -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

-
Expand All @@ -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\\>\\|string\\|null given\\.$#"
count: 1
path: src/Listener/ViewListener.php

-
message: "#^Parameter \\#1 \\$field of method CrudView\\\\Listener\\\\ViewListener\\:\\:_deriveFieldFromContext\\(\\) expects string, array\\<string\\>\\|string\\|null given\\.$#"
message: "#^Result of \\|\\| is always false\\.$#"
count: 1
path: src/Listener/ViewListener.php

Expand All @@ -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\\>\\|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

Expand All @@ -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\\>\\|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

Expand All @@ -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\\>\\|string given\\.$#"
message: "#^Parameter \\#1 \\$options of method Cake\\\\View\\\\StringTemplate\\:\\:formatAttributes\\(\\) expects array\\<string, mixed\\>\\|null, array\\<string\\>\\|string given\\.$#"
count: 1
path: src/View/Widget/DateTimeWidget.php

2 changes: 1 addition & 1 deletion src/Listener/ViewSearchListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ViewSearchListener extends BaseListener
/**
* Events this listerner is interested in.
*
* @return array
* @return array<string, mixed>
*/
public function implementedEvents(): array
{
Expand Down
2 changes: 1 addition & 1 deletion src/View/CrudView.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function initialize(): void
/**
* Events this class is interested in.
*
* @return array
* @return array<string, mixed>
*/
public function implementedEvents(): array
{
Expand Down
2 changes: 1 addition & 1 deletion src/View/Helper/CrudViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CrudViewHelper extends Helper
/**
* Default config.
*
* @var array
* @var array<string, mixed>
*/
protected $_defaultConfig = [
'fieldFormatters' => null,
Expand Down

0 comments on commit 13ffab0

Please sign in to comment.