Skip to content

Commit

Permalink
differentiate $dataPath from $pathForSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Nov 20, 2024
1 parent c598d06 commit e1b9288
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Health.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,18 @@ private static function retrieveSchemaForCategory(string $category, ?string $dat
private function executeValidation(object $validation, ConnectionInterface $to)
{
if ($validation->category === 'sourceDataCheck') {
$dataPath = $validation->validate;
if (property_exists($validation, 'sourceFolder')) {
$dataPath = $validation->sourceFolder;
} else {
$dataPath = $validation->sourceFile;
}
$pathForSchema = $validation->validate;
} else {
$dataPath = $validation->sourceFile;
$pathForSchema = $validation->sourceFile;
$dataPath = $validation->sourceFile;
}

$schema = Health::retrieveSchemaForCategory($validation->category, $dataPath);
$schema = Health::retrieveSchemaForCategory($validation->category, $pathForSchema);

if (property_exists($validation, 'sourceFolder')) {
$files = glob($validation->sourceFolder . '/*.json');
Expand Down

0 comments on commit e1b9288

Please sign in to comment.