diff --git a/src/Psalm/Config.php b/src/Psalm/Config.php index 3438aa5a9..bf2686819 100644 --- a/src/Psalm/Config.php +++ b/src/Psalm/Config.php @@ -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; } diff --git a/src/Psalm/Internal/Fork/Pool.php b/src/Psalm/Internal/Fork/Pool.php index 21ef1e432..2facc1111 100644 --- a/src/Psalm/Internal/Fork/Pool.php +++ b/src/Psalm/Internal/Fork/Pool.php @@ -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]); } } } diff --git a/src/Psalm/Type/Union.php b/src/Psalm/Type/Union.php index 50564eaec..9c4bfb74b 100644 --- a/src/Psalm/Type/Union.php +++ b/src/Psalm/Type/Union.php @@ -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);