Skip to content

Commit 4bd8e6a

Browse files
committed
Fix PHP 7.4 compatibility and method visibility issues
- Replace match() expression with switch statement for PHP 7.4 compatibility - Change private methods to protected for better extensibility - Remove temporary validation files These changes should resolve CI failures related to PHP version compatibility.
1 parent 11c7b14 commit 4bd8e6a

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/QueryDataTable.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -721,18 +721,22 @@ protected function getNormalizeAccentsFunction(string $column): string
721721

722722
$driver = $this->getConnection()->getDriverName();
723723

724-
return match ($driver) {
725-
'mysql' => $this->getMySqlNormalizeFunction($column),
726-
'pgsql' => $this->getPostgreSqlNormalizeFunction($column),
727-
'sqlite' => "LOWER($column)", // SQLite doesn't have built-in accent normalization
728-
default => "LOWER($column)" // Fallback for other databases
729-
};
724+
switch ($driver) {
725+
case 'mysql':
726+
return $this->getMySqlNormalizeFunction($column);
727+
case 'pgsql':
728+
return $this->getPostgreSqlNormalizeFunction($column);
729+
case 'sqlite':
730+
return "LOWER($column)"; // SQLite doesn't have built-in accent normalization
731+
default:
732+
return "LOWER($column)"; // Fallback for other databases
733+
}
730734
}
731735

732736
/**
733737
* Get MySQL-specific accent normalization function.
734738
*/
735-
private function getMySqlNormalizeFunction(string $column): string
739+
protected function getMySqlNormalizeFunction(string $column): string
736740
{
737741
$replacements = [
738742
'ã' => 'a', 'á' => 'a', 'à' => 'a', 'â' => 'a',
@@ -757,7 +761,7 @@ private function getMySqlNormalizeFunction(string $column): string
757761
/**
758762
* Get PostgreSQL-specific accent normalization function.
759763
*/
760-
private function getPostgreSqlNormalizeFunction(string $column): string
764+
protected function getPostgreSqlNormalizeFunction(string $column): string
761765
{
762766
return "LOWER(translate($column, 'ÃãÁáÀàÂâÉéÊêÍíÓóÔôÕõÚúÇç', 'aaaaaaaeeeiioooooucc'))";
763767
}

0 commit comments

Comments
 (0)