From 8e092e04045e5a831130c390a95cc895e4f8877d Mon Sep 17 00:00:00 2001 From: Julien Turbide Date: Sat, 24 Feb 2024 02:50:44 -0500 Subject: [PATCH] adding types --- src/Support/Exposer/Builder.php | 11 +++++------ src/Support/Exposer/Exposer.php | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Support/Exposer/Builder.php b/src/Support/Exposer/Builder.php index 58a0c90f..af644295 100644 --- a/src/Support/Exposer/Builder.php +++ b/src/Support/Exposer/Builder.php @@ -13,9 +13,9 @@ class Builder implements BuilderInterface { - private $value; + private mixed $value; - private $parent; + private mixed $parent; private ?array $columns = null; @@ -29,23 +29,22 @@ class Builder implements BuilderInterface private bool $protected = false; - public function getValue() { return $this->value; } - public function setValue($value = null): void + public function setValue(mixed $value = null): void { $this->value = $value; } - public function getParent() + public function getParent(): mixed { return $this->parent; } - public function setParent($parent = null): void + public function setParent(mixed $parent = null): void { $this->parent = $parent; } diff --git a/src/Support/Exposer/Exposer.php b/src/Support/Exposer/Exposer.php index 2839fa46..59428ce1 100644 --- a/src/Support/Exposer/Exposer.php +++ b/src/Support/Exposer/Exposer.php @@ -39,7 +39,7 @@ */ class Exposer { - public static function createBuilder($object, ?array $columns = null, ?bool $expose = null, ?bool $protected = null): Builder + public static function createBuilder(mixed $object, ?array $columns = null, ?bool $expose = null, ?bool $protected = null): Builder { $expose ??= true; $protected ??= false; @@ -52,7 +52,7 @@ public static function createBuilder($object, ?array $columns = null, ?bool $exp return $builder; } - private static function getValue(string $string, $value): string + private static function getValue(string $string, mixed $value): string { return (is_array($value) || is_object($value)) ? sprintfn($string, $value)