Convert to array if JSON isn't one already.
This commit is contained in:
@ -17,8 +17,11 @@ class FieldDefinition
|
|||||||
throw new \Exception('File ' . $definitionFile . ' not found!');
|
throw new \Exception('File ' . $definitionFile . ' not found!');
|
||||||
}
|
}
|
||||||
$fieldDataJson = file_get_contents($definitionFile);
|
$fieldDataJson = file_get_contents($definitionFile);
|
||||||
/** @var array */
|
$fieldData = json_decode($fieldDataJson, true);
|
||||||
$this->fieldData = json_decode($fieldDataJson, true);
|
if (!is_array($fieldData)) {
|
||||||
|
$fieldData = array($fieldData);
|
||||||
|
}
|
||||||
|
$this->fieldData = $fieldData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFieldData()
|
public function getFieldData()
|
||||||
|
Reference in New Issue
Block a user