Skip to content

Commit

Permalink
Typo fix in IsPresentableService.
Browse files Browse the repository at this point in the history
  • Loading branch information
warrickbayman committed Jan 2, 2022
1 parent 18ddccc commit be1567e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/IsPresentableService.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

class IsPresentableService
{
/**
* @throws InvalidPresentableClass
*/
public function getPresentables(object $object, bool $excludeHidden = false): array
{
$defaults = $this->getDefaults($object, $excludeHidden);
Expand All @@ -30,10 +33,13 @@ public function getPresentables(object $object, bool $excludeHidden = false): ar
}))->toArray();
}

protected function getDefaults(object $object, bool $excluseIfHidden): Collection
/**
* @throws InvalidPresentableClass
*/
protected function getDefaults(object $object, bool $excludeIfHidden): Collection
{
return collect(config('presentable.defaults'))
->mapWithKeys(fn (string $presentableClass, $attribute) => $this->renderClass($object, $presentableClass, $attribute, $excluseIfHidden));
->mapWithKeys(fn (string $presentableClass, $attribute) => $this->renderClass($object, $presentableClass, $attribute, $excludeIfHidden));
}

public function getPresentableMethods(object $class): Collection
Expand All @@ -47,6 +53,9 @@ public function getPresentableMethods(object $class): Collection
);
}

/**
* @throws InvalidPresentableClass
*/
public function renderClass(object $object, string|array $className, string $attribute, bool $excludeIfHidden = false): array
{
$class = $className;
Expand Down

0 comments on commit be1567e

Please sign in to comment.