allowedValues = $allowedValues; } /** * Returns a string representation of the object. */ public function toString(): string { $allowedValues = []; foreach ($this->allowedValues as $value) { $this->allowedValues[] = VarDumper::dumpAsString($value); } $expectedAsString = implode(', ', $allowedValues); return "is one of $expectedAsString"; } protected function matches($other): bool { return in_array($other, $this->allowedValues, false); } }