Skip to content

Commit bba8cfa

Browse files
committed
update dependencies
1 parent 9fde8bb commit bba8cfa

10 files changed

Lines changed: 37 additions & 27 deletions

File tree

.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
## 5.4.0 - 2025-07-31
411

512
### Changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"issues": "http://github.com/Innmind/LogReader/issues"
1515
},
1616
"require": {
17-
"php": "~8.2",
18-
"innmind/foundation": "~1.3",
17+
"php": "~8.4",
18+
"innmind/foundation": "~2.1",
1919
"psr/log": "^3.0"
2020
},
2121
"autoload": {
@@ -30,7 +30,7 @@
3030
},
3131
"require-dev": {
3232
"innmind/black-box": "^6.4.1",
33-
"innmind/static-analysis": "^1.2.1",
33+
"innmind/static-analysis": "~1.3",
3434
"innmind/coding-standard": "~2.0"
3535
}
3636
}

src/LineParser/ApacheAccess.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
Log,
99
Log\Attribute\Attribute,
1010
};
11-
use Innmind\TimeContinuum\{
11+
use Innmind\Time\{
1212
Clock,
13-
PointInTime,
13+
Point,
1414
Format,
1515
};
1616
use Innmind\Url\{
@@ -63,7 +63,9 @@ public function __invoke(Str $line): Maybe
6363
->get('time')
6464
->map(static fn($time) => $time->toString())
6565
->keep(Is::string()->nonEmpty()->asPredicate())
66-
->flatMap($this->clock->ofFormat(Format::of('d/M/Y:H:i:s O'))->at(...));
66+
->attempt(static fn() => new \Exception)
67+
->flatMap($this->clock->ofFormat(Format::of('d/M/Y:H:i:s O'))->at(...))
68+
->maybe();
6769
$user = $parts
6870
->get('user')
6971
->map(static fn($user) => Attribute::of('user', $user));
@@ -106,7 +108,7 @@ public function __invoke(Str $line): Maybe
106108
$code,
107109
$size,
108110
)
109-
->map(static fn(PointInTime $time, Attribute ...$attributes) => Log::of(
111+
->map(static fn(Point $time, Attribute ...$attributes) => Log::of(
110112
$time,
111113
$line,
112114
Set::of(...$attributes),

src/LineParser/Monolog.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
Log\Attribute\Monolog\Level,
1212
Log\Attribute\Monolog\Message,
1313
};
14-
use Innmind\TimeContinuum\{
14+
use Innmind\Time\{
1515
Clock,
1616
Format,
1717
};
@@ -101,7 +101,9 @@ public function __invoke(Str $line): Maybe
101101
->get('time')
102102
->map(static fn($time) => $time->toString())
103103
->keep(Is::string()->nonEmpty()->asPredicate())
104-
->flatMap($this->clock->ofFormat(Format::of('Y-m-d H:i:s'))->at(...));
104+
->attempt(static fn() => new \Exception)
105+
->flatMap($this->clock->ofFormat(Format::of('Y-m-d H:i:s'))->at(...))
106+
->maybe();
105107

106108
return $time->flatMap(
107109
static fn($time) => $attributes->map(

src/Log.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace Innmind\LogReader;
55

66
use Innmind\LogReader\Log\Attribute;
7-
use Innmind\TimeContinuum\PointInTime;
7+
use Innmind\Time\Point;
88
use Innmind\Immutable\{
99
Str,
1010
Set,
@@ -16,15 +16,15 @@
1616
*/
1717
final class Log
1818
{
19-
private PointInTime $time;
19+
private Point $time;
2020
private Str $raw;
2121
/** @var Set<Attribute> */
2222
private Set $attributes;
2323

2424
/**
2525
* @param Set<Attribute> $attributes
2626
*/
27-
private function __construct(PointInTime $time, Str $raw, Set $attributes)
27+
private function __construct(Point $time, Str $raw, Set $attributes)
2828
{
2929
$this->time = $time;
3030
$this->raw = $raw;
@@ -36,13 +36,13 @@ private function __construct(PointInTime $time, Str $raw, Set $attributes)
3636
*
3737
* @param Set<Attribute> $attributes
3838
*/
39-
public static function of(PointInTime $time, Str $raw, Set $attributes): self
39+
public static function of(Point $time, Str $raw, Set $attributes): self
4040
{
4141
return new self($time, $raw, $attributes);
4242
}
4343

4444
#[\NoDiscard]
45-
public function time(): PointInTime
45+
public function time(): Point
4646
{
4747
return $this->time;
4848
}

tests/LineParser/ApacheAccessTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
LineParser,
99
Log,
1010
};
11-
use Innmind\TimeContinuum\{
11+
use Innmind\Time\{
1212
Clock,
1313
Format,
1414
};
@@ -220,7 +220,7 @@ public static function lines(): array
220220
'-',
221221
'2004-03-08T00:23:12+00:00',
222222
'GET',
223-
'/twiki/bin/oops/TWiki/AppendixFileSystem?template=oopsmore¶m1=1.12¶m2=1.12',
223+
'/twiki/bin/oops/TWiki/AppendixFileSystem?template=oopsmore%C2%B6m1=1.12%C2%B6m2=1.12',
224224
'1.1',
225225
'200',
226226
11382,

tests/LineParser/MonologTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
Log\Attribute\Monolog\Level,
1212
Log\Attribute\Monolog\Message,
1313
};
14-
use Innmind\TimeContinuum\{
14+
use Innmind\Time\{
1515
Clock,
1616
Format,
1717
};

tests/LogTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Log,
88
Log\Attribute,
99
};
10-
use Innmind\TimeContinuum\PointInTime;
10+
use Innmind\Time\Point;
1111
use Innmind\Immutable\{
1212
Set,
1313
Str,
@@ -19,7 +19,7 @@ class LogTest extends TestCase
1919
public function testInterface()
2020
{
2121
$log = Log::of(
22-
$time = PointInTime::now(),
22+
$time = Point::now(),
2323
$raw = Str::of('foo'),
2424
$attributes = Set::of(Attribute\Attribute::of('bar', 42)),
2525
);
@@ -34,12 +34,12 @@ public function testInterface()
3434
public function testEquals()
3535
{
3636
$log = Log::of(
37-
PointInTime::now(),
37+
Point::now(),
3838
Str::of('foo'),
3939
Set::of(),
4040
);
4141
$log2 = Log::of(
42-
PointInTime::now(),
42+
Point::now(),
4343
Str::of('bar'),
4444
Set::of(),
4545
);

tests/ReaderTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
Reader,
88
LineParser\Monolog,
99
};
10-
use Innmind\TimeContinuum\Clock;
10+
use Innmind\Time\Clock;
1111
use Innmind\Filesystem\{
12-
Adapter\Filesystem,
12+
Adapter,
1313
Name,
1414
};
1515
use Innmind\Url\Path;
@@ -21,7 +21,8 @@ class ReaderTest extends TestCase
2121
public function testParse()
2222
{
2323
$read = Reader::of(Monolog::of(Clock::live()));
24-
$file = Filesystem::mount(Path::of('fixtures/'))
24+
$file = Adapter::mount(Path::of('fixtures/'))
25+
->unwrap()
2526
->get(Name::of('symfony.log'))
2627
->match(
2728
static fn($file) => $file->content(),
@@ -31,6 +32,6 @@ public function testParse()
3132
$stream = $read($file);
3233

3334
$this->assertInstanceOf(Sequence::class, $stream);
34-
$this->assertCount(5000, $stream);
35+
$this->assertSame(5000, $stream->size());
3536
}
3637
}

0 commit comments

Comments
 (0)