strval -> cast

This commit is contained in:
flash 2023-01-01 19:53:27 +00:00
parent d166428729
commit a0b3a08d7f
6 changed files with 9 additions and 9 deletions

View File

@ -1 +1 @@
0.2301.11859
0.2301.11953

View File

@ -1,7 +1,7 @@
<?php
// AString.php
// Created: 2021-04-26
// Updated: 2022-02-27
// Updated: 2023-01-01
namespace Index;
@ -269,6 +269,6 @@ final class AString implements IString {
return $value;
if($value instanceof WString)
return $value->toAString();
return new AString(strval($value));
return new AString((string)$value);
}
}

View File

@ -70,7 +70,7 @@ abstract class MariaDBResult implements IDbResult {
}
public function getString(int|string $index): string {
return strval($this->getValue($index));
return (string)$this->getValue($index);
}
public function getAString(int|string $index): AString {

View File

@ -1,7 +1,7 @@
<?php
// MariaDBStatement.php
// Created: 2021-05-02
// Updated: 2022-02-27
// Updated: 2023-01-01
namespace Index\Data\MariaDB;
@ -130,7 +130,7 @@ class MariaDBStatement implements IDbStatement {
while($data = fread($value, 8192))
$this->statement->send_long_data($key, $data);
} else
$this->statement->send_long_data($key, strval($value));
$this->statement->send_long_data($key, (string)$value);
$value = null;
}

View File

@ -56,7 +56,7 @@ class SQLiteResult implements IDbResult {
}
public function getString(int|string $index): string {
return strval($this->getValue($index));
return (string)$this->getValue($index);
}
public function getAString(int|string $index): AString {

View File

@ -53,7 +53,7 @@ class BencodeSerialiser extends Serialiser {
} else {
$output = 'd';
foreach($input as $key => $value) {
$output .= self::encode(strval($key), $depth - 1);
$output .= self::encode((string)$key, $depth - 1);
$output .= self::encode($value, $depth - 1);
}
}
@ -68,7 +68,7 @@ class BencodeSerialiser extends Serialiser {
$output = 'd';
foreach($input as $key => $value) {
$output .= self::encode(strval($key), $depth - 1);
$output .= self::encode((string)$key, $depth - 1);
$output .= self::encode($value, $depth - 1);
}