You are here

public static function LdapAuthenticationConfiguration::linesToArray in Lightweight Directory Access Protocol (LDAP) 8.3

Helper function to convert array to serialized lines.

Parameters

string $lines: Serialized lines.

Return value

array Deserialized content.

File

ldap_authentication/src/Helper/LdapAuthenticationConfiguration.php, line 106

Class

LdapAuthenticationConfiguration
Configuration helper class for LDAP authentication.

Namespace

Drupal\ldap_authentication\Helper

Code

public static function linesToArray($lines) {
  $lines = trim($lines);
  if ($lines) {
    $array = preg_split('/[\\n\\r]+/', $lines);
    foreach ($array as $i => $value) {
      $array[$i] = trim($value);
    }
  }
  else {
    $array = [];
  }
  return $array;
}