]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeCheck/StrictTypeCheck.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / vendor / justinrainbow / json-schema / src / JsonSchema / Constraints / TypeCheck / StrictTypeCheck.php
diff --git a/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeCheck/StrictTypeCheck.php b/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeCheck/StrictTypeCheck.php
new file mode 100644 (file)
index 0000000..a6303a7
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+
+namespace JsonSchema\Constraints\TypeCheck;
+
+class StrictTypeCheck implements TypeCheckInterface
+{
+    public static function isObject($value)
+    {
+        return is_object($value);
+    }
+
+    public static function isArray($value)
+    {
+        return is_array($value);
+    }
+
+    public static function propertyGet($value, $property)
+    {
+        return $value->{$property};
+    }
+
+    public static function propertySet(&$value, $property, $data)
+    {
+        $value->{$property} = $data;
+    }
+
+    public static function propertyExists($value, $property)
+    {
+        return property_exists($value, $property);
+    }
+
+    public static function propertyCount($value)
+    {
+        return count(get_object_vars($value));
+    }
+}