1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-12 01:09:38 +01:00

old casts

This commit is contained in:
orklah 2021-09-26 23:18:47 +02:00
parent 9170b0af8f
commit c91bdfb689
3 changed files with 10 additions and 10 deletions

View File

@ -978,7 +978,7 @@ class Config
}
if (isset($config_xml['maxStringLength'])) {
$attribute_text = intval($config_xml['maxStringLength']);
$attribute_text = (int)$config_xml['maxStringLength'];
$config->max_string_length = $attribute_text;
}

View File

@ -307,7 +307,7 @@ class Pool
// resource id.
$streams = [];
foreach ($this->read_streams as $stream) {
$streams[intval($stream)] = $stream;
$streams[(int)$stream] = $stream;
}
// Create an array for the content received on each stream,
@ -340,12 +340,12 @@ class Pool
foreach ($needs_read as $file) {
$buffer = fread($file, 1024);
if ($buffer !== false) {
$content[intval($file)] .= $buffer;
$content[(int)$file] .= $buffer;
}
if (strpos($buffer, "\n") !== false) {
$serialized_messages = explode("\n", $content[intval($file)]);
$content[intval($file)] = array_pop($serialized_messages);
$serialized_messages = explode("\n", $content[(int)$file]);
$content[(int)$file] = array_pop($serialized_messages);
foreach ($serialized_messages as $serialized_message) {
$message = unserialize(base64_decode($serialized_message, true));
@ -375,13 +375,13 @@ class Pool
// If the stream has closed, stop trying to select on it.
if (feof($file)) {
if ($content[intval($file)] !== '') {
if ($content[(int)$file] !== '') {
error_log('Child did not send full message before closing the connection');
$this->did_have_error = true;
}
fclose($file);
unset($streams[intval($file)]);
unset($streams[(int)$file]);
}
}
}

View File

@ -336,7 +336,7 @@ class Union implements TypeNode
$printed_int = true;
}
$types[] = strval($type);
$types[] = (string)$type;
}
sort($types);
@ -374,7 +374,7 @@ class Union implements TypeNode
$types[] = 'int';
$printed_int = true;
} else {
$types[] = strval($type->getKey());
$types[] = (string)$type->getKey();
}
}
@ -390,7 +390,7 @@ class Union implements TypeNode
$types = [];
foreach ($this->types as $type) {
$types[] = strval($type->getId());
$types[] = (string)$type->getId();
}
sort($types);