Skip to content

Commit

Permalink
Fix Styling
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmarney committed May 18, 2024
1 parent 074c169 commit 0acdfb2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
6 changes: 1 addition & 5 deletions src/Hierarchical.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ private function getParentKey(object $item): mixed
*/
public function is(mixed $itemOrId): static
{
$item = $this->toItem($itemOrId);

if (! $item) {
if (! $item = $this->toItem($itemOrId)) {
throw new InvalidArgumentException('Item not found');
}

Expand Down Expand Up @@ -240,7 +238,6 @@ public function depthOf(mixed $itemOrId): ?int

private function depth(mixed $itemOrId, int $depth = 0): int
{

if (! $item = $this->toItem($itemOrId)) {
return $depth;
}
Expand Down Expand Up @@ -268,6 +265,5 @@ public function siblingOf(mixed $itemOrId): bool
}

return $this->getParentKey($this->testItem) === $this->getParentKey($target);

}
}
5 changes: 0 additions & 5 deletions src/LaraHierarchy.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

class LaraHierarchy
{
public function __construct()
{

}

/**
* @deprecated - Use Hierarchical::make($args)->toCollection() instead
* Take a flat collection of objects and transform into a hierarchical collection
Expand Down

0 comments on commit 0acdfb2

Please sign in to comment.