Fix possible bug: allow only arrays

This commit is contained in:
Anton Medvedev 2017-02-24 23:36:32 +07:00
parent 76743d22b9
commit a7c37fcd10

View File

@ -31,7 +31,7 @@ class BootstrapByConfigFile
public $configFile = null;
/**
* @var array|string|\stdClass|null $configFileContent
* @var array $configFileContent
*/
public $configFileContent = null;
@ -109,9 +109,9 @@ class BootstrapByConfigFile
*/
public function parseConfig()
{
try {
$this->configFileContent = Yaml::parse(file_get_contents($this->configFile));
} catch (\RuntimeException $e) {
if (!is_array($this->configFileContent)) {
throw new \RuntimeException("Error in parsing " . $this->configFile . " file.");
}