Skip to content

Commit d15b1c3

Browse files
committed
fix: phpstan
1 parent 4e32834 commit d15b1c3

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Support/Values.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ public static function isMissing(mixed $resource): bool
8989

9090
/**
9191
* @param array<array-key, mixed>|object $object
92-
* @param string $attribute
92+
* @param int|string $attribute
9393
* @return bool
9494
*/
95-
public static function hasAttribute(array|object $object, string $attribute): bool
95+
public static function hasAttribute(array|object $object, int|string $attribute): bool
9696
{
9797
if ($object instanceof Model) {
9898
return array_key_exists($attribute, $object->getAttributes());
@@ -103,7 +103,12 @@ public static function hasAttribute(array|object $object, string $attribute): bo
103103
return property_exists($object, $attribute);
104104
}
105105

106-
public static function getAttribute(array|object $object, string $attribute): mixed
106+
/**
107+
* @param array<array-key, mixed>|object $object
108+
* @param int|string $attribute
109+
* @return mixed
110+
*/
111+
public static function getAttribute(array|object $object, int|string $attribute): mixed
107112
{
108113
if ($object instanceof Model) {
109114
return $object->getAttribute($attribute);

0 commit comments

Comments
 (0)