Skip to content

Commit

Permalink
chore: Use self instead of class name
Browse files Browse the repository at this point in the history
  • Loading branch information
hschimpf committed Jan 31, 2025
1 parent 483fe00 commit e342f24
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ResourceFilters.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ final public function handle(Builder $query, Closure $next): Builder | Collectio

if (is_string($operators)) {
// validate that field type exists
if ( !array_key_exists($operators, ResourceFilters::TYPES)) {
if ( !array_key_exists($operators, self::TYPES)) {
throw new RuntimeException(
message: sprintf('Invalid "%s" field type', $operators),
code: Response::HTTP_INTERNAL_SERVER_ERROR,
);
}

// load operators for specified field type
$operators = ResourceFilters::TYPES[ $operators ];
$operators = self::TYPES[ $operators ];
}

foreach ($operators as $operator) {
Expand All @@ -95,7 +95,7 @@ final public function handle(Builder $query, Closure $next): Builder | Collectio
}

// validate that operator is valid
if ( !array_key_exists($operator, ResourceFilters::OPERATORS)) {
if ( !array_key_exists($operator, self::OPERATORS)) {
throw new RuntimeException(
message: sprintf('Invalid "%s" operator', $operator),
code: Response::HTTP_BAD_REQUEST,
Expand Down Expand Up @@ -142,7 +142,7 @@ private function addQueryFilter(Builder $query, string $column, string $operator
} else {
$query->where(
column: $this->column_mappings[ $column ] ?? $column,
operator: ResourceFilters::OPERATORS[ $operator ],
operator: self::OPERATORS[ $operator ],
value: $this->parseValue($operator, $value),
);
}
Expand Down

0 comments on commit e342f24

Please sign in to comment.