Skip to content

Commit 7c2ffb8

Browse files
authored
Minimal PHP version is 7.4 (#1)
1 parent 48a2878 commit 7c2ffb8

File tree

4 files changed

+17
-29
lines changed

4 files changed

+17
-29
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
JBZOO_COMPOSER_UPDATE_FLAGS: ${{ matrix.composer_flags }}
3636
strategy:
3737
matrix:
38-
php-version: [ 7.2, 7.3, 7.4, 8.0 ]
38+
php-version: [ 7.4, 8.0, 8.1 ]
3939
composer_flags: [ "--prefer-lowest", "" ]
4040
steps:
4141
- name: Checkout code
@@ -59,7 +59,7 @@ jobs:
5959
- name: Uploading coverage to coveralls
6060
env:
6161
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62-
run: make report-coveralls --no-print-directory
62+
run: make report-coveralls --no-print-directory || true
6363

6464
- name: Upload Artifacts
6565
uses: actions/upload-artifact@v2
@@ -73,7 +73,7 @@ jobs:
7373
runs-on: ubuntu-latest
7474
strategy:
7575
matrix:
76-
php-version: [ 7.2, 7.3, 7.4, 8.0 ]
76+
php-version: [ 7.4, 8.0, 8.1 ]
7777
steps:
7878
- name: Checkout code
7979
uses: actions/checkout@v2
@@ -86,6 +86,7 @@ jobs:
8686
php-version: ${{ matrix.php-version }}
8787
coverage: xdebug
8888
tools: composer
89+
extentions: ast
8990

9091
- name: Build the Project
9192
run: make update --no-print-directory
@@ -105,7 +106,7 @@ jobs:
105106
runs-on: ubuntu-latest
106107
strategy:
107108
matrix:
108-
php-version: [ 7.2, 7.3, 7.4, 8.0 ]
109+
php-version: [ 7.4, 8.0, 8.1 ]
109110
steps:
110111
- name: Checkout code
111112
uses: actions/checkout@v2

composer.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@
1414
],
1515

1616
"require" : {
17-
"php" : ">=7.2",
18-
19-
"jbzoo/utils" : "^4.4.0"
17+
"php" : ">=7.4",
18+
"jbzoo/utils" : "^4.5|^5.0"
2019
},
2120

2221
"require-dev" : {
23-
"jbzoo/toolbox-dev" : "^3.1.0"
22+
"jbzoo/toolbox-dev" : "^4.0.1"
2423
},
2524

2625
"autoload" : {
@@ -35,8 +34,8 @@
3534

3635
"config" : {
3736
"optimize-autoloader" : true,
38-
"allow-plugins": {
39-
"composer/package-versions-deprecated": true
37+
"allow-plugins" : {
38+
"composer/package-versions-deprecated" : true
4039
}
4140
},
4241

src/Table.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,27 @@ class Table
3030
/**
3131
* @var string[]
3232
*/
33-
private $headers = [];
33+
private array $headers = [];
3434

3535
/**
3636
* @var string[]
3737
*/
38-
private $alignments = [];
38+
private array $alignments = [];
3939

4040
/**
4141
* @var array[]
4242
*/
43-
private $rows = [];
43+
private array $rows = [];
4444

4545
/**
4646
* @var array
4747
*/
48-
private $autoIndexConfig = [];
48+
private array $autoIndexConfig = [];
4949

5050
/**
5151
* @var int
5252
*/
53-
private $minCellLength = 1;
53+
private int $minCellLength = 1;
5454

5555
/**
5656
* @param string $headerName
@@ -180,7 +180,7 @@ protected function calculateWidths(array $actualHeaders, array $actualRows): arr
180180

181181
// all columns must be at least 3 wide for the markdown to work
182182
return \array_map(function (int $width): int {
183-
return $width >= $this->minCellLength ? $width : $this->minCellLength;
183+
return \max($width, $this->minCellLength);
184184
}, $widths);
185185
}
186186

tests/UtilitySuite/MarkdownReadmeTest.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,5 @@
2424
*/
2525
class MarkdownReadmeTest extends AbstractReadmeTest
2626
{
27-
/**
28-
* @var string
29-
*/
30-
protected $packageName = 'Markdown';
31-
32-
/**
33-
* @inheritDoc
34-
*/
35-
protected function setUp(): void
36-
{
37-
parent::setUp();
38-
$this->params['travis'] = false;
39-
}
27+
protected string $packageName = 'Markdown';
4028
}

0 commit comments

Comments
 (0)