Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<issueHandlers>
<UndefinedAttributeClass errorLevel="suppress" />
</issueHandlers>
</psalm>
1 change: 1 addition & 0 deletions src/LineParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ interface LineParser
/**
* @return Maybe<Log>
*/
#[\NoDiscard]
public function __invoke(Str $line): Maybe;
}
6 changes: 6 additions & 0 deletions src/Log.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ public static function of(PointInTime $time, Str $raw, Set $attributes): self
return new self($time, $raw, $attributes);
}

#[\NoDiscard]
public function time(): PointInTime
{
return $this->time;
}

#[\NoDiscard]
public function raw(): Str
{
return $this->raw;
Expand All @@ -54,6 +56,7 @@ public function raw(): Str
/**
* @return Set<Attribute>
*/
#[\NoDiscard]
public function attributes(): Set
{
return $this->attributes;
Expand All @@ -62,16 +65,19 @@ public function attributes(): Set
/**
* @return Maybe<Attribute>
*/
#[\NoDiscard]
public function attribute(string $key): Maybe
{
return $this->attributes->find(static fn($attribute) => $attribute->key() === $key);
}

#[\NoDiscard]
public function equals(self $log): bool
{
return $this->raw->equals($log->raw());
}

#[\NoDiscard]
public function toString(): string
{
return $this->raw->toString();
Expand Down
2 changes: 2 additions & 0 deletions src/Log/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*/
interface Attribute
{
#[\NoDiscard]
public function key(): string;
#[\NoDiscard]
public function value(): mixed;
}
1 change: 1 addition & 0 deletions src/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ private function __construct(LineParser $parser)
$this->parse = $parser;
}

#[\NoDiscard]
public function __invoke(Content $file): Sequence
{
/**
Expand Down
Loading