protected function doEncode(array $input, array $keys = []) {
    $output = [];

    foreach ($input as $key => $value) {
      $keys[] = $key;

      if (is_array($value)) {
        if ($this->isAssociative($value)) {
          $output = array_merge($output, $this->doEncode($value, $keys));
        }
        else {
          foreach ($value as $j) {
            $output[] = $this->keysToString($keys) . '[] = ' . $j;
          }
        }
      }
      else {
        $output[] = $this->keysToString($keys) . ' = ' . $value;
      }

      array_pop($keys);
    }

    return $output;
  }
protected function doEncode(array $input, array $keys = []) {
    $output = [];

    foreach ($input as $key => $value) {
      $keys[] = $key;

      if (is_array($value)) {
        if ($this->isAssociative($value)) {
          $output = array_merge($output, $this->doEncode($value, $keys));
        }
        else {
          foreach ($value as $j) {
            $output[] = $this->keysToString($keys) . '[] = ' . $j;
          }
        }
      }
      else {
        $output[] = $this->keysToString($keys) . ' = ' . $value;
      }

      array_pop($keys);
    }

    return $output;
  }
protected function doEncode ( array $ input , array $ keys = [ ] ) { $ output = [ ] ; foreach ( $ input as $ key => $ value ) { $ keys [ ] = $ key ; if ( is_array ( $ value ) ) { if ( $ this -> isAssociative ( $ value ) ) { $ output = array_merge ( $ output , $ this -> doEncode ( $ value , $ keys ) ) ; } else { foreach ( $ value as $ j ) { $ output [ ] = $ this -> keysToString ( $ keys ) . '[] = ' . $ j ; } } } else { $ output [ ] = $ this -> keysToString ( $ keys ) . ' = ' . $ value ; } array_pop ( $ keys ) ; } return $ output ; }
Recursively serializes data to legacy make format.

@param array $input
The data to serialize.
@param array $keys
The current key path.

@return string[]
The serialized data as a flat array of lines.
Recursively serializes data to legacy make format .