Skip to content

Commit

Permalink
fix: only variables should be passed by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
thorbrink committed Feb 27, 2024
1 parent e54a2b4 commit 244633b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/php/Module/EventForm/EventForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ private function validateFields(array $fields)
if (!file_exists($schemaFilePath)) {
continue;
}
$this->validator->validate(json_decode(json_encode($field)), (object)['$ref' => 'file://' . realpath($schemaFilePath)]);

$fieldAsAssocArray = json_decode(json_encode($field));

$this->validator->validate($fieldAsAssocArray, (object)['$ref' => 'file://' . realpath($schemaFilePath)]);
if (!$this->validator->isValid()) {
echo "JSON does not validate. Violations:\n";
foreach ($this->validator->getErrors() as $error) {
Expand Down

0 comments on commit 244633b

Please sign in to comment.