Skip to content

Commit

Permalink
Merge pull request #1789 from MasterOdin/patch-8
Browse files Browse the repository at this point in the history
Ignore un-testable function/class existence in Config
  • Loading branch information
dereuromark committed May 21, 2020
2 parents 75a974e + b0ab1d1 commit b417acf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Phinx/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ public function __construct(array $configArray, $configFilePath = null)
public static function fromYaml($configFilePath)
{
if (!class_exists('Symfony\\Component\\Yaml\\Yaml', true)) {
// @codeCoverageIgnoreStart
throw new RuntimeException('Missing yaml parser, symfony/yaml package is not installed.');
// @codeCoverageIgnoreEnd
}

$configFile = file_get_contents($configFilePath);
Expand Down Expand Up @@ -94,7 +96,9 @@ public static function fromYaml($configFilePath)
public static function fromJson($configFilePath)
{
if (!function_exists('json_decode')) {
// @codeCoverageIgnoreStart
throw new RuntimeException("Need to install JSON PHP extension to use JSON config");
// @codeCoverageIgnoreEnd
}

$configArray = json_decode(file_get_contents($configFilePath), true);
Expand Down

0 comments on commit b417acf

Please sign in to comment.