public function __construct($query) { if (!is_string($query)) { throw new InvalidArgumentException('Query filter must be a string.'); } $this->query = $query; }