Parsed: 131891

  private static function update_separator_declarations( $declarations ) {
    $background_color     = '';
    $border_color_matches = false;
    $text_color_matches   = false;

    foreach ( $declarations as $declaration ) {
      if ( 'background-color' === $declaration['name'] && ! $background_color && isset( $declaration['value'] ) ) {
        $background_color = $declaration['value'];
      } elseif ( 'border-color' === $declaration['name'] ) {
        $border_color_matches = true;
      } elseif ( 'color' === $declaration['name'] ) {
        $text_color_matches = true;
      }

      if ( $background_color && $border_color_matches && $text_color_matches ) {
        break;
      }
    }

    if ( $background_color && ! $border_color_matches && ! $text_color_matches ) {
      $declarations[] = array(
        'name'  => 'color',
        'value' => $background_color,
      );
    }

    return $declarations;
  }