diff --git a/psalm.xml b/psalm.xml
index 6b4a878..fa1d427 100644
--- a/psalm.xml
+++ b/psalm.xml
@@ -14,4 +14,7 @@
+
+
+
diff --git a/src/Hash.php b/src/Hash.php
index e633efc..0c3a30a 100644
--- a/src/Hash.php
+++ b/src/Hash.php
@@ -17,11 +17,13 @@ enum Hash
case sha384;
case sha512;
+ #[\NoDiscard]
public function ofFile(File $file): Value
{
return $this->ofContent($file->content());
}
+ #[\NoDiscard]
public function ofContent(File\Content $content): Value
{
return $this->ofSequence(
@@ -32,6 +34,7 @@ public function ofContent(File\Content $content): Value
/**
* @param Sequence $chunks
*/
+ #[\NoDiscard]
public function ofSequence(Sequence $chunks): Value
{
return $chunks
@@ -45,11 +48,13 @@ public function ofSequence(Sequence $chunks): Value
/**
* @psalm-external-mutation-free
*/
+ #[\NoDiscard]
public function start(): Incremental
{
return Incremental::start($this);
}
+ #[\NoDiscard]
public function toString(): string
{
return $this->name;
diff --git a/src/Incremental.php b/src/Incremental.php
index 09d7891..e09d86c 100644
--- a/src/Incremental.php
+++ b/src/Incremental.php
@@ -14,6 +14,7 @@ private function __construct(\HashContext $context)
$this->context = $context;
}
+ #[\NoDiscard]
public static function start(Hash $hash): self
{
return new self(\hash_init($hash->toString()));
@@ -26,6 +27,7 @@ public static function start(Hash $hash): self
*
* @psalm-external-mutation-free
*/
+ #[\NoDiscard]
public function add(Str $chunk): self
{
/** @psalm-suppress ImpureFunctionCall */
@@ -39,6 +41,7 @@ public function add(Str $chunk): self
*
* @psalm-external-mutation-free
*/
+ #[\NoDiscard]
public function finish(): Value
{
return Value::of(\hash_final($this->context));
diff --git a/src/Value.php b/src/Value.php
index e4e6cc5..f6e9c30 100644
--- a/src/Value.php
+++ b/src/Value.php
@@ -24,6 +24,7 @@ private function __construct(string $hex)
*
* @param non-empty-string $hex
*/
+ #[\NoDiscard]
public static function of(string $hex): self
{
return new self($hex);
@@ -32,11 +33,13 @@ public static function of(string $hex): self
/**
* @return non-empty-string
*/
+ #[\NoDiscard]
public function hex(): string
{
return $this->hex;
}
+ #[\NoDiscard]
public function binary(): string
{
/** @var string */