Skip to content
Merged

Release #1229

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ cypress.json
docker-compose.ci.yml
CONTRIBUTING.md
artifacts
phpstan.neon
phpstan-baseline.neon
17 changes: 17 additions & 0 deletions .github/workflows/test-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,20 @@ jobs:
composer install --prefer-dist --no-progress --no-dev
- name: Run phpunit
run: phpunit

phpstan:
name: PHPStan
runs-on: ubuntu-latest
steps:
- name: Setup PHP version
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
extensions: simplexml
- name: Checkout source code
uses: actions/checkout@v4
- name: Install composer
run: |
composer install --prefer-dist --no-progress
- name: Run phpstan
run: composer run phpstan
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
},
"scripts": {
"format": "phpcbf --standard=phpcs.xml --report-summary --report-source",
"lint": "phpcs --standard=phpcs.xml"
"lint": "phpcs --standard=phpcs.xml",
"phpstan": "phpstan",
"phpstan:generate:baseline": "phpstan --generate-baseline"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand All @@ -48,6 +50,8 @@
"require-dev": {
"wp-coding-standards/wpcs": "^2.3",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
"phpcompatibility/phpcompatibility-wp": "*"
"phpcompatibility/phpcompatibility-wp": "*",
"phpstan/phpstan": "^2.1",
"szepeviktor/phpstan-wordpress": "^2.0"
}
}
193 changes: 182 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 8 additions & 13 deletions js/render-google.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,19 +352,14 @@ var isResizeRequest = false;
}
break;
default:
for (i = 0; i < settings.series.length; i++) {
if (!series[i + 1] || typeof settings.series[i] === 'undefined') {
continue;
}
var seriesIndexToUse = i + 1;

// if an annotation "swallowed" a series, use the following one.
if(series_annotations.includes(i)){
seriesIndexToUse++;
}
if ( series[seriesIndexToUse] ) {
format_data(id, table, series[seriesIndexToUse].type, settings.series[i].format, seriesIndexToUse);
}
// Single-pass: walk columns, skip annotation/helper roles, apply formats in order.
var k = 0; // index into settings.series (visible series)
for (var c = 1; c < series.length && k < settings.series.length; c++) { // skip label at 0
if (table.getColumnProperty(c, 'role')) continue; // helper/annotation column
var s = settings.series[k++];
if (!s || !s.format) continue;
if (!series[c]) continue;
format_data(id, table, series[c].type, s.format, c);
}
break;
}
Expand Down
Loading
Loading