From b6bf4a910abff516b36bf4df1806b642f159b776 Mon Sep 17 00:00:00 2001 From: Pat Long Date: Wed, 18 May 2016 16:32:44 -0700 Subject: [PATCH] change [] syntax to array() --- src/Jsv4/Validator.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Jsv4/Validator.php b/src/Jsv4/Validator.php index 76bfed9..883b5a6 100644 --- a/src/Jsv4/Validator.php +++ b/src/Jsv4/Validator.php @@ -48,7 +48,7 @@ private function __construct(&$data, $schema, $firstErrorOnly = FALSE, $coerce = $this->firstErrorOnly = $firstErrorOnly; $this->coerce = $coerce; $this->valid = TRUE; - $this->errors = []; + $this->errors = array(); try { $this->checkTypes(); @@ -179,7 +179,7 @@ private function checkTypes() if (isset($this->schema->type)) { $types = $this->schema->type; if (!is_array($types)) { - $types = [$types]; + $types = array($types); } foreach ($types as $type) { if ($type == "object" && is_object($this->data)) { @@ -282,7 +282,7 @@ private function checkObject() } } } - $checkedProperties = []; + $checkedProperties = array(); if (isset($this->schema->properties)) { foreach ($this->schema->properties as $key => $subSchema) { $checkedProperties[$key] = TRUE; @@ -483,7 +483,7 @@ private function checkComposite() } } if (isset($this->schema->anyOf)) { - $failResults = []; + $failResults = array(); foreach ($this->schema->anyOf as $index => $subSchema) { $subResult = $this->subResult($this->data, $subSchema, FALSE); if ($subResult->valid) { @@ -494,7 +494,7 @@ private function checkComposite() $this->fail(self::ANY_OF_MISSING, "", "/anyOf", "Value must satisfy at least one of the options", $failResults); } if (isset($this->schema->oneOf)) { - $failResults = []; + $failResults = array(); $successIndex = NULL; foreach ($this->schema->oneOf as $index => $subSchema) { $subResult = $this->subResult($this->data, $subSchema, FALSE); @@ -555,7 +555,7 @@ private function createValueForProperty($key) } elseif (in_array("object", $types)) { $this->data->$key = new \StdClass; } elseif (in_array("array", $types)) { - $this->data->$key = []; + $this->data->$key = array(); } else { return FALSE; }