Skip to content

Commit

Permalink
fix: DataTableBuilder hassers utilizing "isset" instead of "array_key…
Browse files Browse the repository at this point in the history
…_exists"
  • Loading branch information
Kreyu committed Feb 5, 2024
1 parent 1d3539d commit 8dfe3c6
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/DataTableBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,7 @@ public function hasColumn(string $name): bool
throw $this->createBuilderLockedException();
}

return array_key_exists($name, $this->columns)
|| array_key_exists($name, $this->unresolvedColumns);
return isset($this->columns[$name]) || isset($this->unresolvedColumns[$name]);
}

public function removeColumn(string $name): static
Expand Down Expand Up @@ -294,8 +293,7 @@ public function hasFilter(string $name): bool
throw $this->createBuilderLockedException();
}

return array_key_exists($name, $this->filters)
|| array_key_exists($name, $this->unresolvedFilters);
return isset($this->filters[$name]) || isset($this->unresolvedFilters[$name]);
}

public function removeFilter(string $name): static
Expand Down Expand Up @@ -403,8 +401,7 @@ public function hasAction(string $name): bool
throw $this->createBuilderLockedException();
}

return array_key_exists($name, $this->actions)
|| array_key_exists($name, $this->unresolvedActions);
return isset($this->actions[$name]) || isset($this->unresolvedActions[$name]);
}

public function removeAction(string $name): static
Expand Down Expand Up @@ -452,8 +449,7 @@ public function hasBatchAction(string $name): bool
throw $this->createBuilderLockedException();
}

return array_key_exists($name, $this->batchActions)
|| array_key_exists($name, $this->unresolvedBatchActions);
return isset($this->batchActions[$name]) || isset($this->unresolvedBatchActions[$name]);
}

public function addBatchAction(string|ActionBuilderInterface $action, string $type = null, array $options = []): static
Expand Down Expand Up @@ -541,8 +537,7 @@ public function hasRowAction(string $name): bool
throw $this->createBuilderLockedException();
}

return array_key_exists($name, $this->rowActions)
|| array_key_exists($name, $this->unresolvedRowActions);
return isset($this->rowActions[$name]) || isset($this->unresolvedRowActions[$name]);
}

public function addRowAction(string|ActionBuilderInterface $action, string $type = null, array $options = []): static
Expand Down Expand Up @@ -650,8 +645,7 @@ public function hasExporter(string $name): bool
throw $this->createBuilderLockedException();
}

return array_key_exists($name, $this->exporters)
|| array_key_exists($name, $this->unresolvedExporters);
return isset($this->exporters[$name]) || isset($this->unresolvedExporters[$name]);
}

public function removeExporter(string $name): static
Expand Down

0 comments on commit 8dfe3c6

Please sign in to comment.