Resolve PHPStan level 6 findings

This commit is contained in:
2024-08-30 09:24:25 -04:00
parent 9e0e663811
commit 0a188a80c2
29 changed files with 185 additions and 112 deletions

View File

@@ -13,7 +13,7 @@ use Square\Pjson\JsonDataSerializable;
/**
* A serializable ID wrapper class
*/
class PjsonId implements JsonDataSerializable
final class PjsonId implements JsonDataSerializable
{
public function __construct(protected string $value) { }
@@ -22,6 +22,11 @@ class PjsonId implements JsonDataSerializable
return $this->value;
}
/**
* @param mixed $jd JSON data
* @param mixed[]|string $path path segments
* @return static
*/
public static function fromJsonData($jd, array|string $path = []): static
{
return new static($jd);