/**
  * turn one or more comparison strings into a VersionRangeList object
  *
  * e.g.
  *
  *     >= 1.0.0, <2.0, !1.5.9
  *     ~1.1
  *
  * @param  string $expression
  *         the string to parse
  * @param  VersionParser $parser
  *         the parser to use on the version numbers
  * @return VersionRange
  */
 public static function from($expression, VersionParser $parser)
 {
     // robustness!
     RequireStringy::check($expression, E4xx_UnsupportedType::class);
     // our final list
     $list = [];
     $parts = explode(",", (string) $expression);
     $parts = FilterOutEmptyValues::from($parts);
     foreach ($parts as $part) {
         $list[] = ParseComparisonExpression::from(trim($part), $parser);
     }
     return new VersionRange($list);
 }
 /**
  * @covers ::nothingMatchesTheInputType
  * @dataProvider provideBadData
  *
  * @expectedException GanbaroDigital\TextTools\Exceptions\E4xx_UnsupportedType
  */
 public function testRejectsOtherDataTypes($input)
 {
     // ----------------------------------------------------------------
     // setup your test
     // ----------------------------------------------------------------
     // perform the change
     FilterOutEmptyValues::from($input);
 }