Skip to content

Commit

Permalink
feat: allow un/serialize for currency
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris8934 committed Jan 26, 2024
1 parent 18993f4 commit baafdd2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function __serialize(): array
return ['code' => $this->code];
}

# TODO Correct PSALM?
// TODO Correct PSALM?
public function __unserialize(array $data): void
{
$this->code = (string) $data['code'];

Check failure on line 73 in src/Currency.php

View workflow job for this annotation

GitHub Actions / Build lowest version

PropertyTypeCoercion

src/Currency.php:73:23: PropertyTypeCoercion: $this->code expects 'non-empty-string', parent type 'string' provided (see https://psalm.dev/198)

Check failure on line 73 in src/Currency.php

View workflow job for this annotation

GitHub Actions / Psalm

PropertyTypeCoercion

src/Currency.php:73:23: PropertyTypeCoercion: $this->code expects 'non-empty-string', parent type 'string' provided (see https://psalm.dev/198)

Check failure on line 73 in src/Currency.php

View workflow job for this annotation

GitHub Actions / Build (8.1)

PropertyTypeCoercion

src/Currency.php:73:23: PropertyTypeCoercion: $this->code expects 'non-empty-string', parent type 'string' provided (see https://psalm.dev/198)

Check failure on line 73 in src/Currency.php

View workflow job for this annotation

GitHub Actions / Build (8.2)

PropertyTypeCoercion

src/Currency.php:73:23: PropertyTypeCoercion: $this->code expects 'non-empty-string', parent type 'string' provided (see https://psalm.dev/198)

Check failure on line 73 in src/Currency.php

View workflow job for this annotation

GitHub Actions / Build (8.3)

PropertyTypeCoercion

src/Currency.php:73:23: PropertyTypeCoercion: $this->code expects 'non-empty-string', parent type 'string' provided (see https://psalm.dev/198)
Expand All @@ -81,9 +81,10 @@ public function serialize(): array
return $this->__serialize();
}

# TODO Correct PSALM?
public function unserialize(string $data)
// TODO Correct PSALM?
// Correct CODE?
public function unserialize(string $data): void
{
return $this->__unserialize($data);
$this->__unserialize((array) $data);

Check failure on line 88 in src/Currency.php

View workflow job for this annotation

GitHub Actions / Build lowest version

UnusedMethodCall

src/Currency.php:88:16: UnusedMethodCall: The call to Money\Currency::__unserialize is not used (see https://psalm.dev/209)

Check failure on line 88 in src/Currency.php

View workflow job for this annotation

GitHub Actions / Psalm

UnusedMethodCall

src/Currency.php:88:16: UnusedMethodCall: The call to Money\Currency::__unserialize is not used (see https://psalm.dev/209)

Check failure on line 88 in src/Currency.php

View workflow job for this annotation

GitHub Actions / Build (8.1)

UnusedMethodCall

src/Currency.php:88:16: UnusedMethodCall: The call to Money\Currency::__unserialize is not used (see https://psalm.dev/209)

Check failure on line 88 in src/Currency.php

View workflow job for this annotation

GitHub Actions / Build (8.2)

UnusedMethodCall

src/Currency.php:88:16: UnusedMethodCall: The call to Money\Currency::__unserialize is not used (see https://psalm.dev/209)

Check failure on line 88 in src/Currency.php

View workflow job for this annotation

GitHub Actions / Build (8.3)

UnusedMethodCall

src/Currency.php:88:16: UnusedMethodCall: The call to Money\Currency::__unserialize is not used (see https://psalm.dev/209)
}
}

0 comments on commit baafdd2

Please sign in to comment.