Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
* develop:
  add support for immutable 5
  use blackbox 5
  test against php 8.2 and 8.3
  • Loading branch information
Baptouuuu committed Sep 16, 2023
2 parents 51c4da3 + d99b657 commit 5f0ce44
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
php-version: ['8.1']
php-version: ['8.2', '8.3']
name: 'PHPUnit'
steps:
- name: Checkout
Expand All @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['8.1']
php-version: ['8.2', '8.3']
name: 'Psalm'
steps:
- name: Checkout
Expand All @@ -48,7 +48,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['8.1']
php-version: ['8.2']
name: 'CS'
steps:
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
composer.lock
vendor
.phpunit.result.cache
.phpunit.cache
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog

## 3.1.0 - 2023-09-16

### Added

- Support for `innmind/immutable` `5`

### Removed

- Support for PHP `8.1`
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"issues": "http://github.com/Innmind/UrlTemplate/issues"
},
"require": {
"php": "~8.1",
"php": "~8.2",
"innmind/url": "~4.1",
"innmind/immutable": "~4.3"
"innmind/immutable": "~4.3|~5.0"
},
"autoload": {
"psr-4": {
Expand All @@ -30,9 +30,9 @@
}
},
"require-dev": {
"phpunit/phpunit": "~9.0",
"vimeo/psalm": "~4.4",
"innmind/black-box": "^4.16",
"phpunit/phpunit": "~10.2",
"vimeo/psalm": "~5.12",
"innmind/black-box": "~5.5",
"innmind/coding-standard": "~2.0"
}
}
21 changes: 13 additions & 8 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" printerClass="Innmind\BlackBox\PHPUnit\ResultPrinterV9" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" colors="true" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" cacheDirectory=".phpunit.cache">
<extensions>
<bootstrap class="Innmind\BlackBox\PHPUnit\Extension">
</bootstrap>
</extensions>
<coverage/>
<testsuites>
<testsuite name="Test suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>.</directory>
</include>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="Test suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
</source>
</phpunit>
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<psalm
errorLevel="1"
resolveFromConfigFile="true"
findUnusedCode="false"
findUnusedBaselineEntry="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
Expand Down
5 changes: 4 additions & 1 deletion src/Expression/Name.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ public static function limit(
Str $value,
Expansion $expansion,
): Maybe {
/** @psalm-suppress ArgumentTypeCoercion Because of the non-empty-string */
/**
* @psalm-suppress ArgumentTypeCoercion Because of the non-empty-string
* @var Maybe<array{self, positive-int}>
*/
return Maybe::just($value)
->filter($expansion->matchesLimit(...))
->map($expansion->clean(...))
Expand Down
2 changes: 1 addition & 1 deletion tests/Expression/Level4/CompositeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function testRegex()
);
}

public function cases(): array
public static function cases(): array
{
return [
['{var,hello}', 'value,Hello%20World%21'],
Expand Down
2 changes: 1 addition & 1 deletion tests/ExpressionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function testReturnNothingWhenInvalidPattern()
));
}

public function cases(): array
public static function cases(): array
{
return [
['{foo}', Level4::class],
Expand Down
2 changes: 1 addition & 1 deletion tests/TemplateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ public function testNoNeedToEscapeSpecialRegexCharactersInTheUrl()
$this->assertFalse($template->matches(Url::of('/f')));
}

public function cases(): array
public static function cases(): array
{
return [
['http://example.com{/list*}{?keys*}', 'http://example.com/red/green/blue?semi=%3B&dot=.&comma=%2C'],
Expand Down

0 comments on commit 5f0ce44

Please sign in to comment.