/** * our constructor * * @param array<ComparisonExpression> $rangeExpressions * the list of comparison expressions that make up this version range */ public function __construct($rangeExpressions) { // robustness RequireTraversable::check($rangeExpressions, E4xx_UnsupportedType::class); $this->rangeExpressions = []; foreach ($rangeExpressions as $rangeExpression) { RequireObjectOfType::check($rangeExpression, ComparisonExpression::class, E4xx_UnsupportedType::class); $this->rangeExpressions[] = $rangeExpression; } }
/** * @covers ::check * @dataProvider provideScalars * @expectedException GanbaroDigital\Reflection\Exceptions\E4xx_UnsupportedType */ public function testRejectsEverythingElseWhenCalledStatically($item, $type) { // ---------------------------------------------------------------- // setup your test // ---------------------------------------------------------------- // perform the change RequireObjectOfType::check($item, $type); }