/** * @param Type $type * @return array */ protected function convertToCsvRow(Type $type) { switch ($type->description()->nativeType()) { case NativeType::COLLECTION: case NativeType::DICTIONARY: return array_map(function (Type $item) { return $item->toString(); }, $type->value()); break; default: return [$type->toString()]; } }
/** * @param Type $other * @return bool */ public function sameAs(Type $other) { if (!$other instanceof DateTime) { return false; } return $this->toString() === $other->toString(); }