summaryrefslogtreecommitdiff
path: root/vendor/thecodingmachine/safe/generated/var.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/thecodingmachine/safe/generated/var.php')
-rw-r--r--vendor/thecodingmachine/safe/generated/var.php60
1 files changed, 60 insertions, 0 deletions
diff --git a/vendor/thecodingmachine/safe/generated/var.php b/vendor/thecodingmachine/safe/generated/var.php
new file mode 100644
index 000000000..14609f22d
--- /dev/null
+++ b/vendor/thecodingmachine/safe/generated/var.php
@@ -0,0 +1,60 @@
+<?php
+
+namespace Safe;
+
+use Safe\Exceptions\VarException;
+
+/**
+ * Set the type of variable var to
+ * type.
+ *
+ * @param mixed $var The variable being converted.
+ * @param string $type Possibles values of type are:
+ *
+ *
+ *
+ * "boolean" or "bool"
+ *
+ *
+ *
+ *
+ * "integer" or "int"
+ *
+ *
+ *
+ *
+ * "float" or "double"
+ *
+ *
+ *
+ *
+ * "string"
+ *
+ *
+ *
+ *
+ * "array"
+ *
+ *
+ *
+ *
+ * "object"
+ *
+ *
+ *
+ *
+ * "null"
+ *
+ *
+ *
+ * @throws VarException
+ *
+ */
+function settype(&$var, string $type): void
+{
+ error_clear_last();
+ $result = \settype($var, $type);
+ if ($result === false) {
+ throw VarException::createFromPhpError();
+ }
+}