Skip to content

Commit

Permalink
drop some PHP 5.* legacy stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyTsalkov committed Nov 27, 2024
1 parent ee8514d commit 3810465
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions db.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -701,10 +701,7 @@ protected function paramsMapOptArrayTypes() {
return array('b', 'c');
}

/**
* @internal has to be public for PHP 5.3 compatability
*/
public function sanitizeTS($ts) {
protected function sanitizeTS($ts) {
if (is_string($ts)) {
return date('Y-m-d H:i:s', strtotime($ts));
}
Expand All @@ -714,10 +711,7 @@ public function sanitizeTS($ts) {
return '';
}

/**
* @internal has to be public for PHP 5.3 compatability
*/
public function sanitize($input) {
protected function sanitize($input) {
if (is_object($input)) {
if ($input instanceof DateTime) {
return new MeekroDBParsedQuery('?', array($input->format('Y-m-d H:i:s')));
Expand All @@ -733,10 +727,7 @@ public function sanitize($input) {
return new MeekroDBParsedQuery('?', array($input));
}

/**
* @internal has to be public for PHP 5.3 compatability
*/
public function formatName($name, $can_join=false) {
protected function formatName($name, $can_join=false) {
if (is_array($name)) {
if ($can_join) return implode('.', array_map(array($this, 'formatName'), $name));
throw new MeekroDBException("Invalid column/table name");
Expand All @@ -745,11 +736,8 @@ public function formatName($name, $can_join=false) {
if ($this->db_type() == 'pgsql') $char = '"';
return $char . str_replace($char, $char . $char, $name) . $char;
}

/**
* @internal has to be public for PHP 5.3 compatability
*/
public function intval($var) {

protected function intval($var) {
if (PHP_INT_SIZE == 8) return intval($var);
return floor(doubleval($var));
}
Expand Down

0 comments on commit 3810465

Please sign in to comment.