Skip to content

Commit 001dca6

Browse files
committed
Update PHPUnit to PHPUnit10
1 parent 09b8cd6 commit 001dca6

22 files changed

Lines changed: 89 additions & 114 deletions

.github/workflows/tag_meged_pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
tools: composer:v2
2424

2525
- name: Checkout code
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
2727
with:
2828
fetch-depth: 0
2929

.github/workflows/test_pull_request.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
tools: composer:v2
1616

1717
- name: Checkout code
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 0
2121

@@ -63,12 +63,12 @@ jobs:
6363
tools: composer:v2
6464

6565
- name: Set up Node
66-
uses: actions/setup-node@v3
66+
uses: actions/setup-node@v4
6767
with:
6868
node-version: '14.x'
6969

7070
- name: Checkout code
71-
uses: actions/checkout@v3
71+
uses: actions/checkout@v4
7272
with:
7373
fetch-depth: 0
7474

@@ -126,25 +126,25 @@ jobs:
126126
tools: composer:v2
127127

128128
- name: Set up Node
129-
uses: actions/setup-node@v3
129+
uses: actions/setup-node@v4
130130
with:
131131
node-version: '14.x'
132132

133133
- name: Checkout code
134-
uses: actions/checkout@v3
134+
uses: actions/checkout@v4
135135
with:
136136
fetch-depth: 0
137137

138138
- name: Run Composer
139139
run: composer install --no-interaction
140140

141141
- name: Update PHPUnit for Code Coverage
142-
run: composer require phpunit/phpunit:^9.6 phploc/phploc:* sebastian/version:* --with-all-dependencies
142+
run: composer require phpunit/phpunit:^10.5 sebastian/version:* --with-all-dependencies
143143

144144
- name: PHP Lint
145145
run: ./vendor/bin/parallel-lint src tests examples
146146

147147
- name: Unit tests
148148
run: |
149149
mkdir -p build/logs
150-
./vendor/bin/phpunit ./tests/ --coverage-clover build/logs/clover.xml
150+
XDEBUG_MODE=coverage ./vendor/bin/phpunit ./tests/ --coverage-clover build/logs/clover.xml --coverage-filter=./src/

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/vendor/
2+
composer.lock
3+
.php-version

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ composer require macocci7/php-scatterplot
6161

6262
```php
6363
<?php
64-
require('../vendor/autoload.php');
64+
65+
require_once __DIR__ . '/../vendor/autoload.php';
6566

6667
use Macocci7\PhpScatterplot\Scatterplot;
6768

@@ -82,7 +83,7 @@ composer require macocci7/php-scatterplot
8283
<a href="examples/img/BasicUsage.png"><img src="examples/img/BasicUsage.png" width="400" /></a>
8384

8485
- Details:
85-
- Import Autoloader: `require_once('../vendor/autoload.php')`
86+
- Import Autoloader: `require_once __DIR__ . '/../vendor/autoload.php'`
8687
- Declare: `use Macocci7\PhpScatterplot`
8788
- Prepare Data: `$layers = [ $layer ]`
8889
- `$layers`: `array<int|string, array<string, list<int|float>>>`
@@ -100,7 +101,7 @@ composer require macocci7/php-scatterplot
100101
```php
101102
<?php
102103

103-
require('../vendor/autoload.php');
104+
require_once __DIR__ . '/../vendor/autoload.php';
104105

105106
use Macocci7\PhpScatterplot\Scatterplot;
106107

@@ -153,7 +154,7 @@ composer require macocci7/php-scatterplot
153154
```php
154155
<?php
155156

156-
require('../vendor/autoload.php');
157+
require_once __DIR__ . '/../vendor/autoload.php';
157158

158159
use Macocci7\PhpScatterplot\Scatterplot;
159160

@@ -326,7 +327,7 @@ Second, Code PHP like this:
326327
```php
327328
<?php
328329

329-
require('../vendor/autoload.php');
330+
require_once __DIR__ . '/../vendor/autoload.php';
330331

331332
use Macocci7\PhpScatterplot\Scatterplot;
332333

@@ -368,7 +369,7 @@ Then, run the PHP code.
368369
```php
369370
<?php
370371

371-
require('../vendor/autoload.php');
372+
require_once __DIR__ . '/../vendor/autoload.php';
372373

373374
use Macocci7\PhpScatterplot\Scatterplot;
374375

@@ -475,7 +476,7 @@ Then, run the PHP code.
475476
```php
476477
<?php
477478

478-
require('../vendor/autoload.php');
479+
require_once __DIR__ . '/../vendor/autoload.php';
479480

480481
use Macocci7\PhpScatterplot\Scatterplot;
481482

@@ -518,7 +519,8 @@ Then, run the PHP code.
518519

519520
```php
520521
<?php
521-
require('../vendor/autoload.php');
522+
523+
require_once __DIR__ . '/../vendor/autoload.php';
522524

523525
use Macocci7\PhpScatterplot\Analyzer;
524526

@@ -657,6 +659,6 @@ Then, run the PHP code.
657659

658660
*Document written: 2023/06/06*
659661

660-
*Document updated: 2024/03/10*
662+
*Document updated: 2024/04/18*
661663

662664
Copyright 2023 - 2024 macocci7.

bin/TestAndLint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ test_and_lint() {
5555
echo "-----------------------------------------------------------"
5656
echo "[PHP $1][phpunit]"
5757
./vendor/bin/phpunit ./tests/ \
58-
--color auto
58+
--color=auto
5959
echo "-----------------------------------------------------------"
6060
}
6161

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "macocci7/php-scatterplot",
33
"description": "it's easy to use for creating scatter plots.",
4-
"version": "1.1.1",
4+
"version": "1.2.0",
55
"type": "library",
66
"license": "MIT",
77
"autoload": {
@@ -17,18 +17,18 @@
1717
],
1818
"minimum-stability": "stable",
1919
"require": {
20-
"intervention/image": "^3.4",
21-
"macocci7/php-frequency-table": "^1.2",
20+
"php": ">=8.1",
21+
"intervention/image": "^3.5",
22+
"macocci7/php-frequency-table": "^1.3",
2223
"macocci7/php-csv": "^1.0",
2324
"macocci7/php-combination": "^1.0",
2425
"nette/neon": "^3.4"
2526
},
2627
"require-dev": {
2728
"squizlabs/php_codesniffer": "^3.7",
2829
"phpmd/phpmd": "^2.15",
29-
"phpunit/phpunit": "^9.6",
30+
"phpunit/phpunit": "^10.5",
3031
"phpstan/phpstan": "^1.10",
31-
"phploc/phploc": "^7.0",
3232
"php-parallel-lint/php-parallel-lint": "^1.3"
3333
}
3434
}

examples/AdjustDisplayByArray.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require('../vendor/autoload.php');
3+
require_once __DIR__ . '/../vendor/autoload.php';
44

55
use Macocci7\PhpScatterplot\Scatterplot;
66

examples/AdjustDisplayByMethods.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,36 @@
4343
|fontPath|fonts/ipaexg.ttf|
4444
|fontSize|16|
4545
|fontColor|#333333|
46-
|outlierDiameter|2|
47-
|outlierColor|#ff0000|
48-
|mean|`false`|
49-
|meanColor|#0000ff|
50-
|labels|[x, y]|
46+
|regressionLine|`true`|
47+
|regressionLineWidth|3|
5148
|labelX|DATA X|
5249
|labelY|DATA Y|
5350
|caption|SCATTER PLOT|
5451
|legend|`true`|
5552
|legendCount|4|
5653
|legends|[John, Jake, Hugo, Alex]|
54+
|referenceLineX|`true`|
55+
|referenceLineXValue|1.5|
56+
|referenceLineXWidth|1|
57+
|referenceLineXColor|#00ccff|
58+
|referenceLineY|`true`|
59+
|referenceLineYValue|1.5|
60+
|referenceLineYWidth|1|
61+
|referenceLineYColor|#00ccff|
62+
|specificationLimitX|`true`|
63+
|specificationLimitXLower|0.5|
64+
|specificationLimitXUpper|11.5|
65+
|specificationLimitXWidth|1|
66+
|specificationLimitXColor|#ff00ff|
67+
|specificationLimitY|`true`|
68+
|specificationLimitYLower|0.5|
69+
|specificationLimitYUpper|11.5|
70+
|specificationLimitYWidth|1|
71+
|specificationLimitYColor|#ff00ff|
5772
|legendWidth|100|
5873
|legendFontSize|10|
5974
|colors|[#ffffff, #cc3333, #339933, #33cccc, #cc3333, #ffcc33, #cccc33, #cc33cc]|
75+
|regressionLineColors|[#666666, #cc2222, #2222cc, #22cc22]|
6076
</details>
6177

6278
<details><summary>Regression Line Formula</summary>
@@ -67,4 +83,4 @@
6783
- Alex: y = 0.24545454545455 x + 4.9818181818182
6884
</details>
6985

70-
![ChangingProperties.png](img/ChangingProperties.png)
86+
![AdjustDisplayByMethods.png](img/AdjustDisplayByMethods.png)

examples/AdjustDisplayByMethods.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require('../vendor/autoload.php');
3+
require_once __DIR__ . '/../vendor/autoload.php';
44

55
use Macocci7\PhpScatterplot\Scatterplot;
66

@@ -100,4 +100,4 @@
100100
echo "</details>\n\n";
101101

102102
// Scatter plot
103-
echo "![ChangingProperties.png](img/ChangingProperties.png)\n";
103+
echo "![AdjustDisplayByMethods.png](img/AdjustDisplayByMethods.png)\n";

examples/AdjustDisplayByNeon.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require('../vendor/autoload.php');
3+
require_once __DIR__ . '/../vendor/autoload.php';
44

55
use Macocci7\PhpScatterplot\Scatterplot;
66

0 commit comments

Comments
 (0)