wip: age based filtering of options
This commit is contained in:
@@ -42,4 +42,4 @@ interface AgeConstraintParserInterface
|
||||
* @return string The constraint type identifier (e.g., 'birth_year', 'grade_level')
|
||||
*/
|
||||
public function getConstraintType(): string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,4 +112,4 @@ class AgeConstraintParserRegistry
|
||||
|
||||
return min($current, $new); // Most restrictive maximum
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class BirthYearConstraintParser implements AgeConstraintParserInterface
|
||||
public function parse(string $constraintData): AgeConstraintResult
|
||||
{
|
||||
if (false === $this->canParse($constraintData)) {
|
||||
throw new \InvalidArgumentException('Cannot parse constraint data: ' . $constraintData);
|
||||
throw new \InvalidArgumentException('Cannot parse constraint data: '.$constraintData);
|
||||
}
|
||||
|
||||
$yearData = substr($constraintData, strlen(self::BIRTH_YEAR_PREFIX));
|
||||
@@ -64,4 +64,4 @@ class BirthYearConstraintParser implements AgeConstraintParserInterface
|
||||
{
|
||||
return 'birth_year';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ class TravelParser extends AbstractParser
|
||||
{
|
||||
$this->ageConstraintRegistry = new AgeConstraintParserRegistry();
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse XML node into a Travel object.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user