public static function withType($type, $allowedTypes) { return new self('The type "' . $type . '" is not within the allowed types "' . implode('", "', $allowedTypes) . '"'); }