= self::MAX_TAGS ) { break; } } return $tags; } /** * Converts a list to the column format. * * @since 0.1.0 * * @param string[] $tags Clean tags. * @return string */ public static function to_storage( array $tags ): string { return array() === $tags ? '' : ',' . implode( ',', $tags ) . ','; } /** * Converts the column value back to a list. * * @since 0.1.0 * * @param string $stored Column value. * @return string[] */ public static function from_storage( string $stored ): array { return array_values( array_filter( explode( ',', $stored ), 'strlen' ) ); } }