Skip to content

Conversation

@sukhwinder33445
Copy link
Contributor

No description provided.

Copy link

@BastianLedererIcinga BastianLedererIcinga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return type of BaseFilter::setBaseFilter can be changed to static.

src/Filter.php Outdated
* @return Condition
*/
public static function equal($column, $value)
public static function equal(string $column, array|bool|float|int|string|DateTime|null $value): Condition
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the param types for $value. The phpDoc is fine.

Please remove this from other methods where DateTime can be specified as a parameter.

src/Filter.php Outdated
Comment on lines 172 to 179
if (! $rule instanceof Equal && ! $rule instanceof Unequal) {
throw new InvalidArgumentException(sprintf(
'Rule must be of type %s or %s, got %s instead',
Equal::class,
Unequal::class,
get_php_type($rule)
));
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed now.

src/Filter.php Outdated
Comment on lines 223 to 230
if (! $rule instanceof Like && ! $rule instanceof Unlike) {
throw new InvalidArgumentException(sprintf(
'Rule must be of type %s or %s, got %s instead',
Like::class,
Unlike::class,
get_php_type($rule)
));
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is superfluous and can be removed now.

src/Filter.php Outdated
Comment on lines 499 to 501
switch (true) {
case $rule instanceof All:
return $this->matchAll($rule, $row);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use match() instead of switch() and then remove the default case.

@sukhwinder33445 sukhwinder33445 force-pushed the support-php-85 branch 2 times, most recently from 6408fa8 to d67ed2a Compare December 12, 2025 07:44
Base automatically changed from support-php-85 to main January 7, 2026 14:54
@lippserd lippserd dismissed BastianLedererIcinga’s stale review January 7, 2026 14:54

The base branch was changed.

@sukhwinder33445
Copy link
Contributor Author

Please rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants