Skip to content

Commit a136c01

Browse files
authored
Merge pull request #12 from Innmind/update-dependencies
Update dependencies
2 parents b9c48af + 18727eb commit a136c01

File tree

5 files changed

+29
-43
lines changed

5 files changed

+29
-43
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,3 @@ jobs:
1212
uses: innmind/github-workflows/.github/workflows/psalm-matrix.yml@main
1313
cs:
1414
uses: innmind/github-workflows/.github/workflows/cs.yml@main
15-
with:
16-
php-version: '8.2'

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [Unreleased]
4+
5+
### Changed
6+
7+
- Requires PHP `8.4`
8+
- Requires `innmind/foundation:~2.1`
9+
310
## 6.3.0 - 2025-07-31
411

512
### Changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
}
2424
},
2525
"require": {
26-
"php": "~8.2",
27-
"innmind/foundation": "~1.3"
26+
"php": "~8.4",
27+
"innmind/foundation": "~2.1"
2828
},
2929
"require-dev": {
3030
"innmind/black-box": "^6.4.1",
31-
"innmind/static-analysis": "^1.2.1",
31+
"innmind/static-analysis": "~1.3",
3232
"innmind/coding-standard": "~2.0"
3333
}
3434
}

tests/Parser/WalkerTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33

44
namespace Tests\Innmind\RobotsTxt\Parser;
55

6-
use Innmind\RobotsTxt\{
7-
Parser\Walker,
8-
};
6+
use Innmind\RobotsTxt\Parser\Walker;
97
use Innmind\Filesystem\File\Content\Line;
108
use Innmind\Immutable\{
119
Str,
@@ -44,7 +42,7 @@ public function testExecution()
4442
$stream = Walker::of()(Str::of($robots)->split("\n")->map(Line::of(...)));
4543

4644
$this->assertInstanceOf(Sequence::class, $stream);
47-
$this->assertCount(2, $stream);
45+
$this->assertSame(2, $stream->size());
4846
$this->assertSame(
4947
$firstDirectives,
5048
$stream->first()->match(

tests/ParserTest.php

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -48,35 +48,27 @@ public function testExecution()
4848
);
4949
$url = Url::of('http://example.com');
5050
$parse = Parser::of(
51-
new class($url, $response, $this) implements Transport {
52-
public function __construct(
53-
private $url,
54-
private $response,
55-
private $test,
56-
) {
57-
}
58-
59-
public function __invoke(Request $request): Either
60-
{
61-
$this->test->assertSame($this->url, $request->url());
62-
$this->test->assertSame('GET', $request->method()->toString());
63-
$this->test->assertSame('2.0', $request->protocolVersion()->toString());
64-
$this->test->assertCount(1, $request->headers());
65-
$this->test->assertSame(
51+
Transport::via(
52+
function(Request $request) use ($url, $response): Either {
53+
$this->assertSame($url, $request->url());
54+
$this->assertSame('GET', $request->method()->toString());
55+
$this->assertSame('2.0', $request->protocolVersion()->toString());
56+
$this->assertCount(1, $request->headers());
57+
$this->assertSame(
6658
'User-Agent: InnmindCrawler',
6759
$request->headers()->get('user-agent')->match(
6860
static fn($header) => $header->toString(),
6961
static fn() => null,
7062
),
7163
);
72-
$this->test->assertSame('', $request->body()->toString());
64+
$this->assertSame('', $request->body()->toString());
7365

7466
return Either::right(new Success(
7567
$request,
76-
$this->response,
68+
$response,
7769
));
78-
}
79-
},
70+
},
71+
),
8072
'InnmindCrawler',
8173
);
8274
$expected = 'User-agent: Foo'."\n";
@@ -106,21 +98,12 @@ public function testThrowWhenRequestNotFulfilled()
10698
ProtocolVersion::v11,
10799
);
108100
$parse = Parser::of(
109-
new class($url, $response) implements Transport {
110-
public function __construct(
111-
private $url,
112-
private $response,
113-
) {
114-
}
115-
116-
public function __invoke(Request $request): Either
117-
{
118-
return Either::left(new ClientError(
119-
$request,
120-
$this->response,
121-
));
122-
}
123-
},
101+
Transport::via(
102+
static fn(Request $request) => Either::left(new ClientError(
103+
$request,
104+
$response,
105+
)),
106+
),
124107
'InnmindCrawler',
125108
);
126109

0 commit comments

Comments
 (0)