Skip to content

Commit 72cda99

Browse files
authored
Update CI (#33)
* Update CI * Remove missing test suite * Replace serialize method * Fix CS * Update readme
1 parent d495de3 commit 72cda99

9 files changed

Lines changed: 28 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,35 @@ on:
77
jobs:
88
test:
99
name: "PHPUnit: MW ${{ matrix.mw }}, PHP ${{ matrix.php }}"
10+
continue-on-error: ${{ matrix.experimental }}
1011

1112
strategy:
1213
matrix:
1314
include:
1415
- mw: 'REL1_36'
1516
php: 8.0
17+
experimental: false
1618
- mw: 'REL1_37'
1719
php: 8.0
20+
experimental: false
1821
- mw: 'REL1_38'
1922
php: 8.0
23+
experimental: false
2024
- mw: 'REL1_39'
2125
php: 8.0
26+
experimental: false
27+
- mw: 'REL1_41'
28+
php: 8.1
29+
experimental: false
30+
- mw: 'REL1_42'
31+
php: 8.2
32+
experimental: false
33+
- mw: 'REL1_43'
34+
php: 8.3
35+
experimental: false
36+
- mw: 'master'
37+
php: 8.4
38+
experimental: true
2239

2340
runs-on: ubuntu-latest
2441

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ Rules are applied in order. In other words, the second Rule can override values
186186

187187
Platform requirements:
188188

189-
* [PHP] 7.4 or later (tested up to 8.0)
190-
* [MediaWiki] 1.35 or later (tested up to 1.37)
191-
* [Wikibase] 1.35 or later (tested up to 1.37)
189+
* [PHP] 7.4 or later (tested up to 8.3)
190+
* [MediaWiki] 1.35 or later (tested up to 1.43)
191+
* [Wikibase] 1.35 or later (tested up to 1.43)
192192

193193
The recommended way to install Automated Values is using [Composer] with
194194
[MediaWiki's built-in support for Composer][Composer install].

phpunit.xml.dist

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
<testsuite name="Integration">
77
<directory>tests/Integration</directory>
88
</testsuite>
9-
<testsuite name="TestExampleRules">
10-
<file>tests/TestExampleRules.php</file>
11-
</testsuite>
129
<testsuite name="MediaWiki">
1310
<directory>tests/MediaWiki</directory>
1411
</testsuite>

src/DataAccess/PageContentFetcher.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ public function __construct( \TitleParser $titleParser, RevisionLookup $revision
1919
public function getPageContent( string $pageTitle ): ?\Content {
2020
try {
2121
$title = $this->titleParser->parseTitle( $pageTitle );
22-
}
23-
catch ( \MalformedTitleException $e ) {
22+
} catch ( \MalformedTitleException $e ) {
2423
return null;
2524
}
2625

src/DataAccess/RulesDeserializer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private function newRules( array $arrayRules ): Rules {
6161
private function newEntityCriteria( array $arrayRule ): EntityCriteria {
6262
return new EntityCriteria(
6363
...array_map(
64-
fn( array $criterion ) => new StatementEqualityCriterion( Compat::newPId( $criterion['statement'] ), new StringValue( $criterion['equalTo'] ) ),
64+
fn ( array $criterion ) => new StatementEqualityCriterion( Compat::newPId( $criterion['statement'] ), new StringValue( $criterion['equalTo'] ) ),
6565
$arrayRule['when'] ?? []
6666
)
6767
);

src/Domain/Template.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function buildValues( StatementList $statements ): array {
4141
public function supportsMultipleValues(): bool {
4242
return count( array_unique(
4343
array_map(
44-
fn( TemplateSegment $s ) => $s->statementPropertyId,
44+
fn ( TemplateSegment $s ) => $s->statementPropertyId,
4545
$this->segments
4646
)
4747
) ) === 1;
@@ -57,7 +57,7 @@ private function buildMultipleValues( StatementList $statements ): array {
5757
$values[] = $this->buildValue( new StatementList( $statement ) );
5858
}
5959

60-
return array_filter( $values, fn( string $s ) => $s !== '' );
60+
return array_filter( $values, fn ( string $s ) => $s !== '' );
6161
}
6262

6363
}

src/Domain/TemplateSegment.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ private function getValuesForSegment( StatementList $statements ): array {
5151
$values[] = $this->getValueFromSegment( $statement );
5252
}
5353

54-
return array_filter( $values, fn( $v ) => $v !== null );
54+
return array_filter( $values, fn ( $v ) => $v !== null );
5555
}
5656

5757
private function getValueFromSegment( Statement $statement ): ?DataValue {

src/Hooks.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ class Hooks {
1818
public static function onMultiContentSave( RenderedRevision $renderedRevision ): void {
1919
try {
2020
$content = $renderedRevision->getRevision()->getSlot( 'main' )->getContent();
21-
}
22-
catch ( RevisionAccessException $ex ) {
21+
} catch ( RevisionAccessException $ex ) {
2322
}
2423

2524
if ( isset( $content ) && $content instanceof EntityContent ) {
2625
try {
2726
$entity = $content->getEntity();
28-
}
29-
catch ( \Exception $ex ) {
27+
} catch ( \Exception $ex ) {
3028
}
3129

3230
if ( isset( $entity ) && $entity instanceof StatementListProvidingEntity ) {

tests/MediaWiki/AutomatedValuesMwTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected function privateSaveAndLoadProperty( Property $property ): Property {
2020

2121
private function saveProperty( Property $property ) {
2222
$this->insertPage(
23-
'Property:' . $property->getId()->serialize(),
23+
'Property:' . $property->getId()->getSerialization(),
2424
json_encode( $this->getPropertySerializer()->serialize( $property ) )
2525
);
2626
}

0 commit comments

Comments
 (0)