Skip to content

Commit 65b3df7

Browse files
release: fixes
- Updated dependencies - Fixed issue with the number format not being applied properly to the last value of the Google chart
2 parents 0b8179d + e7935ac commit 65b3df7

File tree

8 files changed

+5681
-26
lines changed

8 files changed

+5681
-26
lines changed

.distignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ cypress.json
2929
docker-compose.ci.yml
3030
CONTRIBUTING.md
3131
artifacts
32+
phpstan.neon
33+
phpstan-baseline.neon

.github/workflows/test-php.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,20 @@ jobs:
5151
composer install --prefer-dist --no-progress --no-dev
5252
- name: Run phpunit
5353
run: phpunit
54+
55+
phpstan:
56+
name: PHPStan
57+
runs-on: ubuntu-latest
58+
steps:
59+
- name: Setup PHP version
60+
uses: shivammathur/setup-php@v2
61+
with:
62+
php-version: "7.4"
63+
extensions: simplexml
64+
- name: Checkout source code
65+
uses: actions/checkout@v4
66+
- name: Install composer
67+
run: |
68+
composer install --prefer-dist --no-progress
69+
- name: Run phpstan
70+
run: composer run phpstan

composer.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
},
3333
"scripts": {
3434
"format": "phpcbf --standard=phpcs.xml --report-summary --report-source",
35-
"lint": "phpcs --standard=phpcs.xml"
35+
"lint": "phpcs --standard=phpcs.xml",
36+
"phpstan": "phpstan",
37+
"phpstan:generate:baseline": "phpstan --generate-baseline"
3638
},
3739
"minimum-stability": "dev",
3840
"prefer-stable": true,
@@ -48,6 +50,8 @@
4850
"require-dev": {
4951
"wp-coding-standards/wpcs": "^2.3",
5052
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
51-
"phpcompatibility/phpcompatibility-wp": "*"
53+
"phpcompatibility/phpcompatibility-wp": "*",
54+
"phpstan/phpstan": "^2.1",
55+
"szepeviktor/phpstan-wordpress": "^2.0"
5256
}
5357
}

composer.lock

Lines changed: 182 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/render-google.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -352,19 +352,14 @@ var isResizeRequest = false;
352352
}
353353
break;
354354
default:
355-
for (i = 0; i < settings.series.length; i++) {
356-
if (!series[i + 1] || typeof settings.series[i] === 'undefined') {
357-
continue;
358-
}
359-
var seriesIndexToUse = i + 1;
360-
361-
// if an annotation "swallowed" a series, use the following one.
362-
if(series_annotations.includes(i)){
363-
seriesIndexToUse++;
364-
}
365-
if ( series[seriesIndexToUse] ) {
366-
format_data(id, table, series[seriesIndexToUse].type, settings.series[i].format, seriesIndexToUse);
367-
}
355+
// Single-pass: walk columns, skip annotation/helper roles, apply formats in order.
356+
var k = 0; // index into settings.series (visible series)
357+
for (var c = 1; c < series.length && k < settings.series.length; c++) { // skip label at 0
358+
if (table.getColumnProperty(c, 'role')) continue; // helper/annotation column
359+
var s = settings.series[k++];
360+
if (!s || !s.format) continue;
361+
if (!series[c]) continue;
362+
format_data(id, table, series[c].type, s.format, c);
368363
}
369364
break;
370365
}

0 commit comments

Comments
 (0)